Allow lowering call sites with both funclets and deopt state

Lowering funclets is a no-op, so we can just go ahead and lower the
deopt state.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264078 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Sanjoy Das 2016-03-22 18:10:39 +00:00
parent 35d7235fd8
commit 340dafa6bd
2 changed files with 30 additions and 5 deletions

View File

@ -837,16 +837,12 @@ SelectionDAGBuilder::LowerStatepoint(ImmutableStatepoint ISP,
void SelectionDAGBuilder::LowerCallSiteWithDeoptBundle(
ImmutableCallSite CS, SDValue Callee, const BasicBlock *EHPadBB) {
assert(CS.getNumOperandBundles() == 1 &&
"Only deopt operand bundles can be lowered!");
StatepointLoweringInfo SI(DAG);
unsigned ArgBeginIndex = CS.arg_begin() - CS.getInstruction()->op_begin();
populateCallLoweringInfo(SI.CLI, CS, ArgBeginIndex, CS.getNumArgOperands(),
Callee, CS.getType(), false);
auto DeoptBundle = CS.getOperandBundleAt(0);
assert(DeoptBundle.getTagID() == LLVMContext::OB_deopt && "Should be!");
auto DeoptBundle = *CS.getOperandBundle(LLVMContext::OB_deopt);
unsigned DefaultID = StatepointDirectives::DeoptBundleStatepointID;

View File

@ -35,6 +35,13 @@ target triple = "x86_64-apple-macosx10.11.0"
; STACKMAPS-NEXT: Stack Maps: Loc 2: Constant 1 [encoding: .byte 4, .byte 8, .short 0, .int 1]
; STACKMAPS-NEXT: Stack Maps: Loc 3: Constant 3 [encoding: .byte 4, .byte 8, .short 0, .int 3]
; STACKMAPS-NEXT: Stack Maps: has 0 live-out registers
; STACKMAPS-NEXT: Stack Maps: callsite 4243
; STACKMAPS-NEXT: Stack Maps: has 4 locations
; STACKMAPS-NEXT: Stack Maps: Loc 0: Constant 0 [encoding: .byte 4, .byte 8, .short 0, .int 0]
; STACKMAPS-NEXT: Stack Maps: Loc 1: Constant 0 [encoding: .byte 4, .byte 8, .short 0, .int 0]
; STACKMAPS-NEXT: Stack Maps: Loc 2: Constant 1 [encoding: .byte 4, .byte 8, .short 0, .int 1]
; STACKMAPS-NEXT: Stack Maps: Loc 3: Constant 55 [encoding: .byte 4, .byte 8, .short 0, .int 55]
; STACKMAPS-NEXT: Stack Maps: has 0 live-out registers
declare i32 @callee_0()
@ -103,3 +110,25 @@ uw:
; CHECK: popq %rcx
; CHECK: retq
}
define i32 @invoker_2() personality i32 (...)* @__CxxFrameHandler3 {
entry:
%val = invoke i32 @callee_1(i32 1)
to label %try.cont unwind label %catch.dispatch
catch.dispatch:
%cs1 = catchswitch within none [label %catch] unwind to caller
catch:
%cp1 = catchpad within %cs1 [i8* null, i32 64, i8* null]
br label %loop
loop:
%val2 = call i32 @callee_1(i32 100) "statepoint-id"="4243" [ "funclet"(token %cp1), "deopt"(i32 55) ]
catchret from %cp1 to label %try.cont
try.cont:
ret i32 0
}
declare i32 @__CxxFrameHandler3(...)