summaryrefslogtreecommitdiffstats
path: root/llvm/test
diff options
context:
space:
mode:
authorDavid Majnemer <david.majnemer@gmail.com>2016-01-04 17:42:19 +0000
committerDavid Majnemer <david.majnemer@gmail.com>2016-01-04 17:42:19 +0000
commit219055f9df43fbb69083084aef1750317eafe87e (patch)
treee45e1076b1d45d8972153d4a6323d38e955da51b /llvm/test
parent9d6940ba096ac9ce964c4996a1c26562d2d5893e (diff)
downloadbcm5719-llvm-219055f9df43fbb69083084aef1750317eafe87e.tar.gz
bcm5719-llvm-219055f9df43fbb69083084aef1750317eafe87e.zip
[LICM] Don't insert instructions after a catchswitch when performing loop promotion
Inserting after a catchswitch results in verifier errors, bail out on promotion if a catchswitch is a loop exit. llvm-svn: 256763
Diffstat (limited to 'llvm/test')
-rw-r--r--llvm/test/Transforms/LICM/funclet.ll36
1 files changed, 36 insertions, 0 deletions
diff --git a/llvm/test/Transforms/LICM/funclet.ll b/llvm/test/Transforms/LICM/funclet.ll
index 4052ef7c4d7..10001526ffc 100644
--- a/llvm/test/Transforms/LICM/funclet.ll
+++ b/llvm/test/Transforms/LICM/funclet.ll
@@ -60,6 +60,42 @@ try.cont: ; preds = %catch, %while.cond
; CHECK-NEXT: store i32 %[[CALL]], i32* %s
; CHECK-NEXT: cleanupret from %[[CP]] unwind to caller
+define void @test3(i1 %a, i1 %b, i1 %c) personality i32 (...)* @__CxxFrameHandler3 {
+entry:
+ %.frame = alloca i8, align 4
+ %bc = bitcast i8* %.frame to i32*
+ br i1 %a, label %try.success.or.caught, label %forbody
+
+catch.object.Throwable: ; preds = %catch.dispatch
+ %cp = catchpad within %cs [i8* null, i32 64, i8* null]
+ unreachable
+
+try.success.or.caught: ; preds = %forcond.backedge, %0
+ ret void
+
+postinvoke: ; preds = %forbody
+ br i1 %b, label %else, label %forcond.backedge
+
+forcond.backedge: ; preds = %else, %postinvoke
+ br i1 %c, label %try.success.or.caught, label %forbody
+
+catch.dispatch: ; preds = %else, %forbody
+ %cs = catchswitch within none [label %catch.object.Throwable] unwind to caller
+
+forbody: ; preds = %forcond.backedge, %0
+ store i32 1, i32* %bc, align 4
+ invoke void @may_throw()
+ to label %postinvoke unwind label %catch.dispatch
+
+else: ; preds = %postinvoke
+ invoke void @may_throw()
+ to label %forcond.backedge unwind label %catch.dispatch
+}
+
+; CHECK-LABEL: define void @test3(
+; CHECK: catchswitch within none
+; CHECK: store i32 1, i32* %bc, align 4
+
declare void @may_throw()
declare i32 @pure_computation() nounwind argmemonly readonly
OpenPOWER on IntegriCloud