1 ; RUN: llc -march=x86 < %s | FileCheck %s
3 @array = weak global [4 x i32] zeroinitializer
5 define i32 @test_lshr_and(i32 %x) {
6 ; CHECK-LABEL: test_lshr_and:
9 ; CHECK: movl {{.*}}array{{.*}},
13 %tmp2 = lshr i32 %x, 2
14 %tmp3 = and i32 %tmp2, 3
15 %tmp4 = getelementptr [4 x i32], [4 x i32]* @array, i32 0, i32 %tmp3
16 %tmp5 = load i32, i32* %tmp4, align 4
20 define i32* @test_exact1(i32 %a, i32 %b, i32* %x) {
21 ; CHECK-LABEL: test_exact1:
25 %shr = ashr exact i32 %sub, 3
26 %gep = getelementptr inbounds i32, i32* %x, i32 %shr
30 define i32* @test_exact2(i32 %a, i32 %b, i32* %x) {
31 ; CHECK-LABEL: test_exact2:
35 %shr = ashr exact i32 %sub, 3
36 %gep = getelementptr inbounds i32, i32* %x, i32 %shr
40 define i32* @test_exact3(i32 %a, i32 %b, i32* %x) {
41 ; CHECK-LABEL: test_exact3:
45 %shr = ashr exact i32 %sub, 2
46 %gep = getelementptr inbounds i32, i32* %x, i32 %shr
50 define i32* @test_exact4(i32 %a, i32 %b, i32* %x) {
51 ; CHECK-LABEL: test_exact4:
55 %shr = lshr exact i32 %sub, 3
56 %gep = getelementptr inbounds i32, i32* %x, i32 %shr
60 define i32* @test_exact5(i32 %a, i32 %b, i32* %x) {
61 ; CHECK-LABEL: test_exact5:
65 %shr = lshr exact i32 %sub, 3
66 %gep = getelementptr inbounds i32, i32* %x, i32 %shr
70 define i32* @test_exact6(i32 %a, i32 %b, i32* %x) {
71 ; CHECK-LABEL: test_exact6:
75 %shr = lshr exact i32 %sub, 2
76 %gep = getelementptr inbounds i32, i32* %x, i32 %shr