Remove a manual renaming of a variable that was introduced before
[oota-llvm.git] / test / Transforms / SimplifyCFG / branch-phi-thread.ll
1 ; RUN: llvm-upgrade < %s | llvm-as | opt -simplifycfg -adce | llvm-dis | not grep 'call void %f1' &&
2 ; RUN: llvm-upgrade < %s | llvm-as | opt -simplifycfg -adce -disable-output
3 declare void %f1()
4 declare void %f2()
5 declare void %f3()
6 declare void %f4()
7
8 implementation
9
10 int %test1(int %X, bool %D) {
11 E:
12         %C = seteq int %X, 0
13         br bool %C, label %T, label %F
14 T:
15         br bool %C, label %B, label %A
16 A:
17         call void %f1()
18         br bool %D, label %T, label %F
19 B:
20         call void %f2()
21         ret int 345
22 F:
23         call void %f3()
24         ret int 123
25 }
26
27 int %test2(int %X, bool %D) {
28 E:
29         %C = seteq int %X, 0
30         br bool %C, label %T, label %F
31 T:
32         %P = phi bool [true, %E], [%C, %A]
33         br bool %P, label %B, label %A
34 A:
35         call void %f1()
36         br bool %D, label %T, label %F
37 B:
38         call void %f2()
39         ret int 345
40 F:
41         call void %f3()
42         ret int 123
43 }
44
45 int %test3(int %X, bool %D, int* %AP, int* %BP) {
46 E:
47         %C = seteq int %X, 0
48         br bool %C, label %T, label %F
49 T:
50         call void %f3()  ;; Inst in block.
51         %XX = load int* %AP
52         store int %XX, int* %BP
53         br bool %C, label %B, label %A
54 A:
55         call void %f1()
56         br bool %D, label %T, label %F
57 B:
58         call void %f2()
59         ret int 345
60 F:
61         call void %f3()
62         ret int 123
63 }