[llvm] r264078 - Allow lowering call sites with both funclets and deopt state
Sanjoy Das via llvm-commits
llvm-commits at lists.llvm.org
Tue Mar 22 11:10:39 PDT 2016
Author: sanjoy
Date: Tue Mar 22 13:10:39 2016
New Revision: 264078
URL: http://llvm.org/viewvc/llvm-project?rev=264078&view=rev
Log:
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.
Modified:
llvm/trunk/lib/CodeGen/SelectionDAG/StatepointLowering.cpp
llvm/trunk/test/CodeGen/X86/deopt-bundles.ll
Modified: llvm/trunk/lib/CodeGen/SelectionDAG/StatepointLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/StatepointLowering.cpp?rev=264078&r1=264077&r2=264078&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/StatepointLowering.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/StatepointLowering.cpp Tue Mar 22 13:10:39 2016
@@ -837,16 +837,12 @@ SelectionDAGBuilder::LowerStatepoint(Imm
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;
Modified: llvm/trunk/test/CodeGen/X86/deopt-bundles.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/deopt-bundles.ll?rev=264078&r1=264077&r2=264078&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/X86/deopt-bundles.ll (original)
+++ llvm/trunk/test/CodeGen/X86/deopt-bundles.ll Tue Mar 22 13:10:39 2016
@@ -35,6 +35,13 @@ target triple = "x86_64-apple-macosx10.1
; 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(...)
More information about the llvm-commits
mailing list