Relax unsafe use check. If there is one unconditional use inside the loop then it...
[oota-llvm.git] / test / Transforms / CondProp / phisimplify.ll
1 ; RUN: llvm-upgrade < %s | llvm-as | opt -condprop | llvm-dis | not grep phi
2
3 int %test(uint %C, bool %Val) {
4         switch uint %C, label %T1 [
5                  uint 4, label %T2
6                  uint 17, label %T3
7         ]
8 T1:
9         call void %a()
10         br label %Cont
11 T2:
12         call void %b()
13         br label %Cont
14 T3:
15         call void %c()
16         br label %Cont
17
18 Cont:
19         ;; PHI becomes dead after threading T2
20         %C2 = phi bool [%Val, %T1], [true, %T2], [%Val, %T3]
21         br bool %C2, label %L2, label %F2
22 L2:
23         call void %d()
24         ret int 17
25 F2:
26         call void %e()
27         ret int 1
28 }
29 declare void %a()
30 declare void %b()
31 declare void %c()
32 declare void %d()
33 declare void %e()