summaryrefslogtreecommitdiffstats
path: root/llvm/test
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2011-06-30 20:14:24 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2011-06-30 20:14:24 +0000
commitb10a0f223afbb01df04ef736372e899e8f5edbfe (patch)
treeadb6f0b518c61335733766b3ac6d62c08d975468 /llvm/test
parentde68cc91cf0d6f228e4ab0aecc1d0317cbc5a361 (diff)
downloadbcm5719-llvm-b10a0f223afbb01df04ef736372e899e8f5edbfe.tar.gz
bcm5719-llvm-b10a0f223afbb01df04ef736372e899e8f5edbfe.zip
Add r134057 back, but splice the predecessor after the successors phi
nodes. Original message: Let simplify cfg simplify bb with only debug and lifetime intrinsics. llvm-svn: 134182
Diffstat (limited to 'llvm/test')
-rw-r--r--llvm/test/Transforms/SimplifyCFG/lifetime.ll29
1 files changed, 29 insertions, 0 deletions
diff --git a/llvm/test/Transforms/SimplifyCFG/lifetime.ll b/llvm/test/Transforms/SimplifyCFG/lifetime.ll
new file mode 100644
index 00000000000..b7942217253
--- /dev/null
+++ b/llvm/test/Transforms/SimplifyCFG/lifetime.ll
@@ -0,0 +1,29 @@
+; RUN: opt < %s -simplifycfg -S | FileCheck %s
+
+; Test that a lifetime intrinsic doesn't prevent us from simplifying this.
+
+; CHECK: foo
+; CHECK: entry:
+; CHECK-NOT: bb0:
+; CHECK-NOT: bb1:
+; CHECK: ret
+define void @foo(i1 %x) {
+entry:
+ %a = alloca i8
+ call void @llvm.lifetime.start(i64 -1, i8* %a) nounwind
+ br i1 %x, label %bb0, label %bb1
+
+bb0:
+ call void @llvm.lifetime.end(i64 -1, i8* %a) nounwind
+ br label %bb1
+
+bb1:
+ call void @f()
+ ret void
+}
+
+declare void @f()
+
+declare void @llvm.lifetime.start(i64, i8* nocapture) nounwind
+
+declare void @llvm.lifetime.end(i64, i8* nocapture) nounwind
OpenPOWER on IntegriCloud