summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms/SimplifyCFG/2008-09-17-SpeculativeHoist.ll
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
commit7f9671ba37a0a75a85f8c869e7f487e380dc5950 (patch)
tree32bed71d04db4cffd00a141d58c14bb8018963aa /llvm/test/Transforms/SimplifyCFG/2008-09-17-SpeculativeHoist.ll
parent6ff95305e691737af1f764b68e234d95967eb38c (diff)
downloadbcm5719-llvm-7f9671ba37a0a75a85f8c869e7f487e380dc5950.tar.gz
bcm5719-llvm-7f9671ba37a0a75a85f8c869e7f487e380dc5950.zip
Do not hoist instruction above branch condition. The instruction may use branch condition.
llvm-svn: 56286
Diffstat (limited to 'llvm/test/Transforms/SimplifyCFG/2008-09-17-SpeculativeHoist.ll')
-rw-r--r--llvm/test/Transforms/SimplifyCFG/2008-09-17-SpeculativeHoist.ll18
1 files changed, 18 insertions, 0 deletions
diff --git a/llvm/test/Transforms/SimplifyCFG/2008-09-17-SpeculativeHoist.ll b/llvm/test/Transforms/SimplifyCFG/2008-09-17-SpeculativeHoist.ll
new file mode 100644
index 00000000000..b2d671da67f
--- /dev/null
+++ b/llvm/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()
OpenPOWER on IntegriCloud