mirror of
https://github.com/RPCS3/llvm.git
synced 2024-12-13 23:18:58 +00:00
b46bb541f5
SimplifyCFG allows tail merging with code which terminates in unreachable which, in turn, makes it possible for an invoke to end up in a funclet which it was not originally part of. Using operand bundles on invokes allows us to determine whether or not an invoke was part of a funclet in the source program. Furthermore, it allows us to unambiguously answer questions about the legality of inlining into call sites which the personality may have trouble with. Differential Revision: http://reviews.llvm.org/D15517 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255674 91177308-0d34-0410-b5e6-96231b3b80d8
28 lines
669 B
LLVM
28 lines
669 B
LLVM
; RUN: llc -mtriple=x86_64-pc-windows-msvc -code-model=large -o - < %s | FileCheck %s
|
|
|
|
declare i32 @__CxxFrameHandler3(...)
|
|
|
|
declare void @bar()
|
|
|
|
define void @foo() personality i32 (...)* @__CxxFrameHandler3 {
|
|
entry:
|
|
invoke void @bar()
|
|
to label %exit unwind label %cleanup
|
|
cleanup:
|
|
%c = cleanuppad within none []
|
|
call void @bar() [ "funclet"(token %c) ]
|
|
cleanupret from %c unwind to caller
|
|
exit:
|
|
ret void
|
|
}
|
|
|
|
; CHECK: foo: # @foo
|
|
; CHECK: movabsq $bar, %[[reg:[^ ]*]]
|
|
; CHECK: callq *%[[reg]]
|
|
; CHECK: retq
|
|
|
|
; CHECK: "?dtor$2@?0?foo@4HA":
|
|
; CHECK: movabsq $bar, %[[reg:[^ ]*]]
|
|
; CHECK: callq *%[[reg]]
|
|
; CHECK: retq # CLEANUPRET
|