1 ; This test makes sure that these instructions are properly eliminated.
4 ; RUN: if as < %s | opt -instcombine -die | dis | grep phi
11 int %test1(int %A, bool %b) {
12 BB0: br bool %b, label %BB1, label %BB2
14 %B = phi int [%A, %BB0] ; Combine away one argument PHI nodes
20 int %test2(int %A, bool %b) {
21 BB0: br bool %b, label %BB1, label %BB2
25 %B = phi int [%A, %BB0], [%A, %BB1] ; Combine away PHI nodes with same values
29 int %test3(int %A, bool %b) {
33 %B = phi int [%A, %BB0], [%B, %Loop] ; PHI has same value always.
34 br bool %b, label %Loop, label %Exit
40 BB0: ret int 7 ; Loop is unreachable
43 %B = phi int [%B, %L2], [%B, %Loop] ; PHI has same value always.
44 br bool %b, label %L2, label %Loop