Relax unsafe use check. If there is one unconditional use inside the loop then it...
[oota-llvm.git] / test / Transforms / LICM / sink_only_some_exits.ll
1 ; This testcase checks to make sure we can sink values which are only live on
2 ; some exits out of the loop, and that we can do so without breaking dominator
3 ; info.
4 ;
5 ; RUN: llvm-upgrade < %s | llvm-as | opt -licm | llvm-dis | \
6 ; RUN:   %prcontext add 1 | grep exit2:
7
8 implementation   ; Functions:
9
10 int %test(bool %C1, bool %C2, int *%P, int* %Q) {
11 Entry:
12         br label %Loop
13
14 Loop:
15         br bool %C1, label %Cont, label %exit1
16 Cont:
17         %X = load int* %P
18         store int %X, int* %Q
19         %V = add int %X, 1
20         br bool %C2, label %Loop, label %exit2
21
22 exit1:
23         ret int 0
24 exit2:
25         ret int %V
26 }