summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2008-09-17 18:21:49 +0000
committerDevang Patel <dpatel@apple.com>2008-09-17 18:21:49 +0000
commit48fbc2d39b6efbd8d2d02e830cc91ab6e49b8dde (patch)
tree9991042d24398da2803793872bc2ea61fd2d97c8 /test
parent00622952ce10e762a48f281f970cbfe73cf55ea8 (diff)
downloadllvm-48fbc2d39b6efbd8d2d02e830cc91ab6e49b8dde.tar.gz
llvm-48fbc2d39b6efbd8d2d02e830cc91ab6e49b8dde.tar.bz2
llvm-48fbc2d39b6efbd8d2d02e830cc91ab6e49b8dde.tar.xz
Do not hoist instruction above branch condition. The instruction may use branch condition.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56286 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r--test/Transforms/SimplifyCFG/2008-09-17-SpeculativeHoist.ll18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/Transforms/SimplifyCFG/2008-09-17-SpeculativeHoist.ll b/test/Transforms/SimplifyCFG/2008-09-17-SpeculativeHoist.ll
new file mode 100644
index 0000000000..b2d671da67
--- /dev/null
+++ b/test/Transforms/SimplifyCFG/2008-09-17-SpeculativeHoist.ll
@@ -0,0 +1,18 @@
+; RUN: llvm-as < %s | opt -simplifycfg -disable-output
+; PR 2800
+
+define void @foo() {
+start:
+ %tmp = call i1 @bar( ) ; <i1> [#uses=4]
+ br i1 %tmp, label %brtrue, label %brfalse
+
+brtrue: ; preds = %start
+ %tmpnew = and i1 %tmp, %tmp ; <i1> [#uses=1]
+ br label %brfalse
+
+brfalse: ; preds = %brtrue, %start
+ %andandtmp.0 = phi i1 [ %tmp, %start ], [ %tmpnew, %brtrue ] ; <i1> [#uses=0]
+ ret void
+}
+
+declare i1 @bar()