1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-25 12:12:47 +01:00
llvm-mirror/test/Transforms/SimplifyCFG/duplicate-phis.ll
2009-12-30 05:54:51 +00:00

22 lines
478 B
LLVM

; RUN: opt < %s -instcombine -simplifycfg -S | grep { = phi } | count 1
; instcombine should sort the PHI operands so that simplifycfg can see the
; duplicate and remove it.
define i32 @foo(i1 %t) {
entry:
call void @bar()
br i1 %t, label %true, label %false
true:
call void @bar()
br label %false
false:
%a = phi i32 [ 2, %true ], [ 5, %entry ]
%b = phi i32 [ 5, %entry ], [ 2, %true ]
call void @bar()
%c = add i32 %a, %b
ret i32 %c
}
declare void @bar()