two simple testcases loopreduce should handle but does not yet currently
[oota-llvm.git] / test / Transforms / LoopStrengthReduce / exit_compare_live_range.ll
1 ; Make sure that the compare instruction occurs after the increment to avoid
2 ; having overlapping live ranges that result in copies.  We want the setcc instruction
3 ; immediately before the conditional branch.
4 ;
5 ; RUN: llvm-as < %s | opt -loop-reduce | llvm-dis | %prcontext 'br bool' 1 | grep set
6 ; XFAIL: *
7
8 void %foo(float* %D, uint %E) {
9 entry:
10         br label %no_exit
11
12 no_exit:
13         %indvar = phi uint [ 0, %entry ], [ %indvar.next, %no_exit ]
14         volatile store float 0.0, float* %D
15         %indvar.next = add uint %indvar, 1              ; <uint> [#uses=2]
16         %exitcond = seteq uint %indvar.next, %E         ; <bool> [#uses=1]
17         br bool %exitcond, label %loopexit, label %no_exit
18
19 loopexit:
20         ret void
21 }