diff options
| author | Sanjoy Das <sanjoy@playingwithpointers.com> | 2016-03-22 18:10:39 +0000 |
|---|---|---|
| committer | Sanjoy Das <sanjoy@playingwithpointers.com> | 2016-03-22 18:10:39 +0000 |
| commit | eb5037cadcb78d1453e5000174f3d6378b821512 (patch) | |
| tree | 71de5fa9991483ae68914a91875f99d3d6ac9c9c | |
| parent | 1edff82f820513eda5741d29532e5cf69a51e44d (diff) | |
| download | bcm5719-llvm-eb5037cadcb78d1453e5000174f3d6378b821512.tar.gz bcm5719-llvm-eb5037cadcb78d1453e5000174f3d6378b821512.zip | |
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.
llvm-svn: 264078
| -rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/StatepointLowering.cpp | 6 | ||||
| -rw-r--r-- | llvm/test/CodeGen/X86/deopt-bundles.ll | 29 |
2 files changed, 30 insertions, 5 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/StatepointLowering.cpp b/llvm/lib/CodeGen/SelectionDAG/StatepointLowering.cpp index fb0cba196ba..ad339064b14 100644 --- a/llvm/lib/CodeGen/SelectionDAG/StatepointLowering.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/StatepointLowering.cpp @@ -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; diff --git a/llvm/test/CodeGen/X86/deopt-bundles.ll b/llvm/test/CodeGen/X86/deopt-bundles.ll index 4b575853270..3a135c38f14 100644 --- a/llvm/test/CodeGen/X86/deopt-bundles.ll +++ b/llvm/test/CodeGen/X86/deopt-bundles.ll @@ -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(...) |

