blob: edc29b744229c0aee58e2acfadc814aa1d98181b [file] [log] [blame]
Dan Gohmanf9dd1702007-08-15 13:36:28 +00001; RUN: llvm-upgrade < %s | llvm-as | opt -loop-reduce | llvm-dis | grep phi | count 1
Chris Lattnerac86efb2005-08-08 06:23:47 +00002
3; This testcase should have ONE stride 18 indvar, the other use should have a
4; loop invariant value (B) added to it inside of the loop, instead of having
5; a whole indvar based on B for it.
6
Chris Lattnerac86efb2005-08-08 06:23:47 +00007declare bool %cond(uint)
8
9void %test(uint %B) {
10 br label %Loop
11Loop:
12 %IV = phi uint [0, %0], [%IVn, %Loop]
13
14 %C = mul uint %IV, 18
15 %D = mul uint %IV, 18
16 %E = add uint %D, %B
17
18 %cnd = call bool %cond(uint %E)
19 call bool %cond(uint %C)
20 %IVn = add uint %IV, 1
21 br bool %cnd, label %Loop, label %Out
22Out:
23 ret void
24}