• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2; RUN: llc < %s | FileCheck %s
3;
4; Check that the isel does not fold the shld, which already folds a load
5; and has two uses, into a store.
6
7target triple = "i686-unknown-unknown"
8
9@A = external dso_local global i32
10
11define i32 @test5(i32 %B, i8 %C) {
12; CHECK-LABEL: test5:
13; CHECK:       # %bb.0:
14; CHECK-NEXT:    movb {{[0-9]+}}(%esp), %cl
15; CHECK-NEXT:    movl {{[0-9]+}}(%esp), %edx
16; CHECK-NEXT:    movl A, %eax
17; CHECK-NEXT:    shldl %cl, %edx, %eax
18; CHECK-NEXT:    movl %eax, A
19; CHECK-NEXT:    retl
20entry:
21  %tmp.1 = load i32, i32* @A
22  %shift.upgrd.1 = zext i8 %C to i32
23  %tmp.2 = shl i32 %tmp.1, %shift.upgrd.1
24  %tmp.3 = sub i8 32, %C
25  %shift.upgrd.2 = zext i8 %tmp.3 to i32
26  %tmp.4 = lshr i32 %B, %shift.upgrd.2
27  %tmp.5 = or i32 %tmp.4, %tmp.2
28  store i32 %tmp.5, i32* @A
29  ret i32 %tmp.5
30}
31
32