blob: a99a9c95a4cc9cf7446a0d0b567b78868bf4a73c [file] [log] [blame]
Dan Gohman0a063102009-09-08 23:54:48 +00001; RUN: llc < %s -march=x86 | not grep lea
2; RUN: llc < %s -march=x86-64 | not grep lea
Dan Gohman5766ac72007-10-22 20:40:42 +00003
4@B = external global [1000 x float], align 32
5@A = external global [1000 x float], align 32
6@P = external global [1000 x i32], align 32
7
8define void @foo(i32 %m) {
9entry:
10 %tmp1 = icmp sgt i32 %m, 0
11 br i1 %tmp1, label %bb, label %return
12
13bb:
14 %i.019.0 = phi i32 [ %indvar.next, %bb ], [ 0, %entry ]
15 %tmp2 = getelementptr [1000 x float]* @B, i32 0, i32 %i.019.0
16 %tmp3 = load float* %tmp2, align 4
Dan Gohman7ce405e2009-06-04 22:49:04 +000017 %tmp4 = fmul float %tmp3, 2.000000e+00
Dan Gohman5766ac72007-10-22 20:40:42 +000018 %tmp5 = getelementptr [1000 x float]* @A, i32 0, i32 %i.019.0
19 store float %tmp4, float* %tmp5, align 4
20 %tmp8 = shl i32 %i.019.0, 1
21 %tmp9 = add i32 %tmp8, 64
22 %tmp10 = getelementptr [1000 x i32]* @P, i32 0, i32 %i.019.0
23 store i32 %tmp9, i32* %tmp10, align 4
24 %indvar.next = add i32 %i.019.0, 1
25 %exitcond = icmp eq i32 %indvar.next, %m
26 br i1 %exitcond, label %return, label %bb
27
28return:
29 ret void
30}