summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen/X86/funclet-layout.ll
diff options
context:
space:
mode:
authorDavid Majnemer <david.majnemer@gmail.com>2015-10-04 02:22:52 +0000
committerDavid Majnemer <david.majnemer@gmail.com>2015-10-04 02:22:52 +0000
commit161935520d5a9cd1fcaddee39bb8438bcfec5552 (patch)
tree63b25b0718d66c622eb27efa8213105ef4e984fc /llvm/test/CodeGen/X86/funclet-layout.ll
parent65b9056f3dbba45ffd16d780b058a3d044115a59 (diff)
downloadbcm5719-llvm-161935520d5a9cd1fcaddee39bb8438bcfec5552.tar.gz
bcm5719-llvm-161935520d5a9cd1fcaddee39bb8438bcfec5552.zip
[WinEH] Permit branch folding in the face of funclets
Track which basic blocks belong to which funclets. Permit branch folding to fire but only if it can prove that doing so will not cause code in one funclet to be reused in another. llvm-svn: 249257
Diffstat (limited to 'llvm/test/CodeGen/X86/funclet-layout.ll')
-rw-r--r--llvm/test/CodeGen/X86/funclet-layout.ll19
1 files changed, 16 insertions, 3 deletions
diff --git a/llvm/test/CodeGen/X86/funclet-layout.ll b/llvm/test/CodeGen/X86/funclet-layout.ll
index d31ae2312c2..ffd4b49b688 100644
--- a/llvm/test/CodeGen/X86/funclet-layout.ll
+++ b/llvm/test/CodeGen/X86/funclet-layout.ll
@@ -103,7 +103,7 @@ unreachable: ; preds = %catch, %entry
; CHECK: retq
-define void @test3() #0 personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) {
+define void @test3(i1 %V) #0 personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) {
entry:
invoke void @g()
to label %try.cont unwind label %catch.dispatch
@@ -128,7 +128,15 @@ catchendblock: ; preds = %catch.dispatch.1
catchendpad unwind to caller
try.cont: ; preds = %entry
- ret void
+ br i1 %V, label %exit_one, label %exit_two
+
+exit_one:
+ tail call void @exit(i32 0)
+ unreachable
+
+exit_two:
+ tail call void @exit(i32 0)
+ unreachable
}
; CHECK-LABEL: test3:
@@ -136,15 +144,20 @@ try.cont: ; preds = %entry
; The entry funclet contains %entry and %try.cont
; CHECK: # %entry
; CHECK: # %try.cont
-; CHECK: retq
+; CHECK: callq exit
+; CHECK-NOT: # exit_one
+; CHECK-NOT: # exit_two
+; CHECK: ud2
; The catch(int) funclet contains %catch.2
; CHECK: # %catch.2
; CHECK: callq exit
+; CHECK: ud2
; The catch(...) funclet contains %catch
; CHECK: # %catch{{$}}
; CHECK: callq exit
+; CHECK: ud2
declare void @exit(i32) noreturn nounwind
declare void @_CxxThrowException(i8*, %eh.ThrowInfo*)
OpenPOWER on IntegriCloud