For PR950:
[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-upgrade < %s | llvm-as | opt -loop-reduce | llvm-dis | %prcontext 'br bool' 1 | grep icmp
6
7 void %foo(float* %D, uint %E) {
8 entry:
9         br label %no_exit
10
11 no_exit:
12         %indvar = phi uint [ 0, %entry ], [ %indvar.next, %no_exit ]
13         volatile store float 0.0, float* %D
14         %indvar.next = add uint %indvar, 1              ; <uint> [#uses=2]
15         %exitcond = seteq uint %indvar.next, %E         ; <bool> [#uses=1]
16         br bool %exitcond, label %loopexit, label %no_exit
17
18 loopexit:
19         ret void
20 }