1 ; This test makes sure that these instructions are properly eliminated.
4 ; RUN: llvm-as < %s | opt -instcombine -die | llvm-dis | not grep phi
8 int %test1(int %A, bool %b) {
9 BB0: br bool %b, label %BB1, label %BB2
11 %B = phi int [%A, %BB0] ; Combine away one argument PHI nodes
17 int %test2(int %A, bool %b) {
18 BB0: br bool %b, label %BB1, label %BB2
22 %B = phi int [%A, %BB0], [%A, %BB1] ; Combine away PHI nodes with same values
26 int %test3(int %A, bool %b) {
30 %B = phi int [%A, %BB0], [%B, %Loop] ; PHI has same value always.
31 br bool %b, label %Loop, label %Exit
37 BB0: ret int 7 ; Loop is unreachable
40 %B = phi int [%B, %L2], [%B, %Loop] ; PHI has same value always.
41 br bool %b, label %L2, label %Loop