diff options
author | Evan Cheng <evan.cheng@apple.com> | 2011-01-29 04:46:23 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2011-01-29 04:46:23 +0000 |
commit | c3f507f98a0747bd256e1c13536060b6fc5c4b62 (patch) | |
tree | 21d6d7ccd66a19999f470068386986b338c7cbef /test/Transforms/JumpThreading/thread-loads.ll | |
parent | b0a42fdb36b575a8ad939ca9624105908aeedf51 (diff) | |
download | llvm-c3f507f98a0747bd256e1c13536060b6fc5c4b62.tar.gz llvm-c3f507f98a0747bd256e1c13536060b6fc5c4b62.tar.bz2 llvm-c3f507f98a0747bd256e1c13536060b6fc5c4b62.tar.xz |
Re-apply r124518 with fix. Watch out for invalidated iterator.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124526 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms/JumpThreading/thread-loads.ll')
-rw-r--r-- | test/Transforms/JumpThreading/thread-loads.ll | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/test/Transforms/JumpThreading/thread-loads.ll b/test/Transforms/JumpThreading/thread-loads.ll index 96ba701046..cce23ea319 100644 --- a/test/Transforms/JumpThreading/thread-loads.ll +++ b/test/Transforms/JumpThreading/thread-loads.ll @@ -1,4 +1,4 @@ -; RUN: opt < %s -jump-threading -simplifycfg -S | grep {ret i32 1} +; RUN: opt < %s -jump-threading -S | FileCheck %s ; rdar://6402033 ; Test that we can thread through the block with the partially redundant load (%2). @@ -6,12 +6,16 @@ target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f3 target triple = "i386-apple-darwin7" define i32 @foo(i32* %P) nounwind { +; CHECK: foo entry: %0 = tail call i32 (...)* @f1() nounwind ; <i32> [#uses=1] %1 = icmp eq i32 %0, 0 ; <i1> [#uses=1] br i1 %1, label %bb1, label %bb bb: ; preds = %entry +; CHECK: bb1.thread: +; CHECK: store +; CHECK: br label %bb3 store i32 42, i32* %P, align 4 br label %bb1 @@ -26,6 +30,9 @@ bb2: ; preds = %bb1 ret i32 %res.0 bb3: ; preds = %bb1 +; CHECK: bb3: +; CHECK: %res.01 = phi i32 [ 1, %bb1.thread ], [ 0, %bb1 ] +; CHECK: ret i32 %res.01 ret i32 %res.0 } |