1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s | FileCheck %s
4 ; Check that the isel does not fold the shld, which already folds a load
5 ; and has two uses, into a store.
7 target triple = "i686-unknown-unknown"
9 @A = external dso_local global i32
11 define i32 @test5(i32 %B, i8 %C) {
13 ; CHECK: # %bb.0: # %entry
14 ; CHECK-NEXT: movzbl {{[0-9]+}}(%esp), %ecx
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
21 %tmp.1 = load i32, ptr @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, ptr @A