1 ; Test a bunch of cases where the cfg simplification code should
2 ; be able to fold PHI nodes into computation in common cases. Folding the PHI
3 ; nodes away allows the branches to be eliminated, performing a simple form of
6 ; RUN: llvm-as < %s | opt -simplifycfg | llvm-dis > %t.xform
7 ; RUN: not grep phi %t.xform && grep ret %t.xform
9 declare void %use(bool)
10 declare void %use(int)
12 void %test(bool %c, int %V, int %V2) {
13 br bool %c, label %T, label %F
17 %B1 = phi bool [true, %0], [false, %T]
18 %B2 = phi bool [true, %T], [false, %0]
19 %I1 = phi int [1, %T], [0, %0]
20 %I2 = phi int [1, %0], [0, %T]
21 %I3 = phi int [17, %T], [0, %0]
22 %I4 = phi int [17, %T], [5, %0]
23 %I5 = phi int [%V, %T], [0, %0]
24 %I6 = phi int [%V, %0], [0, %T]
25 %I7 = phi int [%V, %0], [%V2, %T]
26 call void %use(bool %B1)
27 call void %use(bool %B2)
28 call void %use(int %I1)
29 call void %use(int %I2)
30 call void %use(int %I3)
31 call void %use(int %I4)
32 call void %use(int %I5)
33 call void %use(int %I6)
34 call void %use(int %I7)