llvm.org GIT mirror llvm / 2733b30
new testcase that condprop should handle. The PHI node becomes useless after threading the branch, because both operands are the same value. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22668 91177308-0d34-0410-b5e6-96231b3b80d8 Chris Lattner 14 years ago
1 changed file(s) with 36 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
0 ; RUN: llvm-as < %s | opt -condprop | llvm-dis | not grep phi
1
2 declare bool %foo()
3
4 int %test(uint %C) {
5 %Val = call bool %foo()
6 switch uint %C, label %T1 [
7 uint 4, label %T2
8 uint 17, label %T3
9 ]
10 T1:
11 call void %a()
12 br label %Cont
13 T2:
14 call void %b()
15 br label %Cont
16 T3:
17 call void %c()
18 br label %Cont
19
20 Cont:
21 ;; PHI becomes dead after threading T2
22 %C2 = phi bool [%Val, %T1], [true, %T2], [%Val, %T3]
23 br bool %C2, label %L2, label %F2
24 L2:
25 call void %d()
26 ret int 17
27 F2:
28 call void %e()
29 ret int 1
30 }
31 declare void %a()
32 declare void %b()
33 declare void %c()
34 declare void %d()
35 declare void %e()