make jump threading on a phi with undef inputs happen.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83754 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner
2009-10-11 04:18:15 +00:00
parent 1bd8d0a00b
commit e33583b7c2
2 changed files with 86 additions and 30 deletions
+32 -2
View File
@@ -1,6 +1,4 @@
; RUN: opt < %s -jump-threading -S | FileCheck %s
; There should be no uncond branches left.
; RUN: opt < %s -jump-threading -S | not grep {br label}
declare i32 @f1()
declare i32 @f2()
@@ -75,3 +73,35 @@ T1:
F1:
ret i32 17
}
define i32 @test4(i1 %cond, i1 %cond2) {
; CHECK: @test4
br i1 %cond, label %T1, label %F1
T1:
; CHECK: %v1 = call i32 @f1()
; CHECK-NEXT: br label %T
%v1 = call i32 @f1()
br label %Merge
F1:
%v2 = call i32 @f2()
; CHECK: %v2 = call i32 @f2()
; CHECK-NEXT: br i1 %cond2,
br label %Merge
Merge:
%A = phi i1 [undef, %T1], [%cond2, %F1]
%B = phi i32 [%v1, %T1], [%v2, %F1]
br i1 %A, label %T2, label %F2
T2:
call void @f3()
ret i32 %B
F2:
ret i32 %B
}