diff options
author | Chris Lattner <sabre@nondot.org> | 2009-10-11 04:18:15 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-10-11 04:18:15 +0000 |
commit | e33583b7c2b4d715a24e4d668bf446af9c836e54 (patch) | |
tree | 2ca5b702eb4dd642aa662e99faea1d47761e18e3 /test/Transforms/JumpThreading/basic.ll | |
parent | 1bd8d0a00b430723c85a9498e1253a2ae6eb9c3b (diff) | |
download | external_llvm-e33583b7c2b4d715a24e4d668bf446af9c836e54.zip external_llvm-e33583b7c2b4d715a24e4d668bf446af9c836e54.tar.gz external_llvm-e33583b7c2b4d715a24e4d668bf446af9c836e54.tar.bz2 |
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
Diffstat (limited to 'test/Transforms/JumpThreading/basic.ll')
-rw-r--r-- | test/Transforms/JumpThreading/basic.ll | 34 |
1 files changed, 32 insertions, 2 deletions
diff --git a/test/Transforms/JumpThreading/basic.ll b/test/Transforms/JumpThreading/basic.ll index 1a602a6..cab7712 100644 --- a/test/Transforms/JumpThreading/basic.ll +++ b/test/Transforms/JumpThreading/basic.ll @@ -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 +} + |