Use the llvm-upgrade program to upgrade llvm assembly.
[oota-llvm.git] / test / Transforms / LoopStrengthReduce / share_ivs.ll
1 ; RUN: llvm-upgrade < %s | llvm-as | opt -loop-reduce | llvm-dis | grep phi | wc -l | grep 1
2
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
7 declare bool %cond(uint)
8
9 void %test(uint %B) {
10         br label %Loop
11 Loop:
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
22 Out:
23         ret void
24 }