1 ; RUN: llc -mcpu=generic -mtriple=i686-unknown-unknown < %s | FileCheck %s
2 define i64 @test1(i32 %xx, i32 %test) nounwind {
3 %conv = zext i32 %xx to i64
4 %and = and i32 %test, 7
5 %sh_prom = zext i32 %and to i64
6 %shl = shl i64 %conv, %sh_prom
9 ; CHECK: shll %cl, %eax
12 ; CHECK: shrl %cl, %edx
15 define i64 @test2(i64 %xx, i32 %test) nounwind {
16 %and = and i32 %test, 7
17 %sh_prom = zext i32 %and to i64
18 %shl = shl i64 %xx, %sh_prom
21 ; CHECK: shll %cl, %esi
24 ; CHECK: shrl %cl, %edx
25 ; CHECK: orl %esi, %edx
26 ; CHECK: shll %cl, %eax
29 define i64 @test3(i64 %xx, i32 %test) nounwind {
30 %and = and i32 %test, 7
31 %sh_prom = zext i32 %and to i64
32 %shr = lshr i64 %xx, %sh_prom
35 ; CHECK: shrl %cl, %esi
36 ; CHECK: leal (%edx,%edx), %eax
37 ; CHECK: xorb $31, %cl
38 ; CHECK: shll %cl, %eax
39 ; CHECK: orl %esi, %eax
40 ; CHECK: shrl %cl, %edx
43 define i64 @test4(i64 %xx, i32 %test) nounwind {
44 %and = and i32 %test, 7
45 %sh_prom = zext i32 %and to i64
46 %shr = ashr i64 %xx, %sh_prom
49 ; CHECK: shrl %cl, %esi
50 ; CHECK: leal (%edx,%edx), %eax
51 ; CHECK: xorb $31, %cl
52 ; CHECK: shll %cl, %eax
53 ; CHECK: orl %esi, %eax
54 ; CHECK: sarl %cl, %edx
58 define <2 x i64> @test5(<2 x i64> %A, <2 x i64> %B) {
59 %shl = shl <2 x i64> %A, %B
70 %x = alloca i32, align 4
71 %t = alloca i64, align 8
72 store i32 1, i32* %x, align 4
73 store i64 1, i64* %t, align 8 ;; DEAD
74 %load = load i32* %x, align 4
75 %shl = shl i32 %load, 8
76 %add = add i32 %shl, -224
77 %sh_prom = zext i32 %add to i64
78 %shl1 = shl i64 1, %sh_prom
79 %cmp = icmp ne i64 %shl1, 4294967296
80 br i1 %cmp, label %if.then, label %if.end
82 if.then: ; preds = %entry
85 if.end: ; preds = %entry