1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-22 04:22:57 +02:00
llvm-mirror/test/Transforms/InstCombine/phi-merge.ll
Dan Gohman 205b641954 Change tests from "opt %s" to "opt < %s" so that opt doesn't see the
input filename so that opt doesn't print the input filename in the
output so that grep lines in the tests don't unintentionally match
strings in the input filename.

llvm-svn: 81537
2009-09-11 18:01:28 +00:00

32 lines
644 B
LLVM

; RUN: opt < %s -instcombine -S | not grep {phi i32}
; PR1777
declare i1 @rrr()
define i1 @zxcv() {
entry:
%a = alloca i32
%i = ptrtoint i32* %a to i32
%b = call i1 @rrr()
br i1 %b, label %one, label %two
one:
%x = phi i32 [%i, %entry], [%y, %two]
%c = call i1 @rrr()
br i1 %c, label %two, label %end
two:
%y = phi i32 [%i, %entry], [%x, %one]
%d = call i1 @rrr()
br i1 %d, label %one, label %end
end:
%f = phi i32 [ %x, %one], [%y, %two]
; Change the %f to %i, and the optimizer suddenly becomes a lot smarter
; even though %f must equal %i at this point
%g = inttoptr i32 %f to i32*
store i32 10, i32* %g
%z = call i1 @rrr()
ret i1 %z
}