mirror of
https://github.com/RPCS3/llvm.git
synced 2025-02-04 09:37:20 +00:00
Adjust eh.sjlj.setjmp to properly have a chain and to have an opcode entry in
ISD::. No functional change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@104734 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
394427b014
commit
23ff7cff52
@ -95,6 +95,11 @@ namespace ISD {
|
||||
// execution to HANDLER. Many platform-related details also :)
|
||||
EH_RETURN,
|
||||
|
||||
// OUTCHAIN = EH_SJLJ_SETJMP(INCHAIN, buffer)
|
||||
// This corresponds to the eh.sjlj.setjmp intrinsic.
|
||||
// It takes an input chain and a pointer to the jump buffer as inputs
|
||||
// and returns an outchain.
|
||||
EH_SJLJ_SETJMP,
|
||||
|
||||
// OUTCHAIN = EH_SJLJ_LONGJMP(INCHAIN, buffer)
|
||||
// This corresponds to the eh.sjlj.longjmp intrinsic.
|
||||
|
@ -306,12 +306,12 @@ def int_eh_unwind_init: Intrinsic<[]>,
|
||||
def int_eh_dwarf_cfa : Intrinsic<[llvm_ptr_ty], [llvm_i32_ty]>;
|
||||
|
||||
let Properties = [IntrNoMem] in {
|
||||
def int_eh_sjlj_setjmp : Intrinsic<[llvm_i32_ty], [llvm_ptr_ty]>,
|
||||
GCCBuiltin<"__builtin_setjmp">;
|
||||
def int_eh_sjlj_lsda : Intrinsic<[llvm_ptr_ty]>;
|
||||
def int_eh_sjlj_callsite: Intrinsic<[], [llvm_i32_ty]>;
|
||||
}
|
||||
def int_eh_sjlj_longjmp : Intrinsic<[], [llvm_ptr_ty], [IntrWriteArgMem]>,
|
||||
def int_eh_sjlj_setjmp : Intrinsic<[llvm_i32_ty], [llvm_ptr_ty]>,
|
||||
GCCBuiltin<"__builtin_setjmp">;
|
||||
def int_eh_sjlj_longjmp : Intrinsic<[], [llvm_ptr_ty]>,
|
||||
GCCBuiltin<"__builtin_longjmp">;
|
||||
|
||||
//===---------------- Generic Variable Attribute Intrinsics----------------===//
|
||||
|
@ -5627,6 +5627,8 @@ std::string SDNode::getOperationName(const SelectionDAG *G) const {
|
||||
case ISD::LSDAADDR: return "LSDAADDR";
|
||||
case ISD::EHSELECTION: return "EHSELECTION";
|
||||
case ISD::EH_RETURN: return "EH_RETURN";
|
||||
case ISD::EH_SJLJ_SETJMP: return "EH_SJLJ_SETJMP";
|
||||
case ISD::EH_SJLJ_LONGJMP: return "EH_SJLJ_LONGJMP";
|
||||
case ISD::ConstantPool: return "ConstantPool";
|
||||
case ISD::ExternalSymbol: return "ExternalSymbol";
|
||||
case ISD::BlockAddress: return "BlockAddress";
|
||||
|
@ -4038,8 +4038,14 @@ SelectionDAGBuilder::visitIntrinsicCall(const CallInst &I, unsigned Intrinsic) {
|
||||
MMI.setCurrentCallSite(CI->getZExtValue());
|
||||
return 0;
|
||||
}
|
||||
case Intrinsic::eh_sjlj_setjmp: {
|
||||
setValue(&I, DAG.getNode(ISD::EH_SJLJ_SETJMP, dl, MVT::i32, getRoot(),
|
||||
getValue(I.getOperand(1))));
|
||||
return 0;
|
||||
}
|
||||
case Intrinsic::eh_sjlj_longjmp: {
|
||||
DAG.setRoot(DAG.getNode(ISD::EH_SJLJ_LONGJMP, dl, MVT::Other, getRoot(),
|
||||
DAG.setRoot(DAG.getNode(ISD::EH_SJLJ_LONGJMP, dl, MVT::Other,
|
||||
getRoot(),
|
||||
getValue(I.getOperand(1))));
|
||||
return 0;
|
||||
}
|
||||
|
@ -412,6 +412,7 @@ ARMTargetLowering::ARMTargetLowering(TargetMachine &TM)
|
||||
|
||||
// We want to custom lower some of our intrinsics.
|
||||
setOperationAction(ISD::INTRINSIC_WO_CHAIN, MVT::Other, Custom);
|
||||
setOperationAction(ISD::EH_SJLJ_SETJMP, MVT::i32, Custom);
|
||||
setOperationAction(ISD::EH_SJLJ_LONGJMP, MVT::Other, Custom);
|
||||
|
||||
setOperationAction(ISD::SETCC, MVT::i32, Expand);
|
||||
@ -1548,6 +1549,16 @@ SDValue ARMTargetLowering::LowerGLOBAL_OFFSET_TABLE(SDValue Op,
|
||||
return DAG.getNode(ARMISD::PIC_ADD, dl, PtrVT, Result, PICLabel);
|
||||
}
|
||||
|
||||
SDValue
|
||||
ARMTargetLowering::LowerEH_SJLJ_SETJMP(SDValue Op, SelectionDAG &DAG) const {
|
||||
DebugLoc dl = Op.getDebugLoc();
|
||||
SDValue Val = Subtarget->isThumb() ?
|
||||
DAG.getCopyFromReg(DAG.getEntryNode(), dl, ARM::SP, MVT::i32) :
|
||||
DAG.getConstant(0, MVT::i32);
|
||||
return DAG.getNode(ARMISD::EH_SJLJ_SETJMP, dl, MVT::i32, Op.getOperand(0),
|
||||
Op.getOperand(1), Val);
|
||||
}
|
||||
|
||||
SDValue
|
||||
ARMTargetLowering::LowerEH_SJLJ_LONGJMP(SDValue Op, SelectionDAG &DAG) const {
|
||||
DebugLoc dl = Op.getDebugLoc();
|
||||
@ -1594,12 +1605,6 @@ ARMTargetLowering::LowerINTRINSIC_WO_CHAIN(SDValue Op, SelectionDAG &DAG,
|
||||
}
|
||||
return Result;
|
||||
}
|
||||
case Intrinsic::eh_sjlj_setjmp:
|
||||
SDValue Val = Subtarget->isThumb() ?
|
||||
DAG.getCopyFromReg(DAG.getEntryNode(), dl, ARM::SP, MVT::i32) :
|
||||
DAG.getConstant(0, MVT::i32);
|
||||
return DAG.getNode(ARMISD::EH_SJLJ_SETJMP, dl, MVT::i32, Op.getOperand(1),
|
||||
Val);
|
||||
}
|
||||
}
|
||||
|
||||
@ -3183,6 +3188,7 @@ SDValue ARMTargetLowering::LowerOperation(SDValue Op, SelectionDAG &DAG) const {
|
||||
case ISD::RETURNADDR: return LowerRETURNADDR(Op, DAG);
|
||||
case ISD::FRAMEADDR: return LowerFRAMEADDR(Op, DAG);
|
||||
case ISD::GLOBAL_OFFSET_TABLE: return LowerGLOBAL_OFFSET_TABLE(Op, DAG);
|
||||
case ISD::EH_SJLJ_SETJMP: return LowerEH_SJLJ_SETJMP(Op, DAG);
|
||||
case ISD::EH_SJLJ_LONGJMP: return LowerEH_SJLJ_LONGJMP(Op, DAG);
|
||||
case ISD::INTRINSIC_WO_CHAIN: return LowerINTRINSIC_WO_CHAIN(Op, DAG,
|
||||
Subtarget);
|
||||
|
@ -287,6 +287,7 @@ namespace llvm {
|
||||
DebugLoc dl, SelectionDAG &DAG,
|
||||
const CCValAssign &VA,
|
||||
ISD::ArgFlagsTy Flags) const;
|
||||
SDValue LowerEH_SJLJ_SETJMP(SDValue Op, SelectionDAG &DAG) const;
|
||||
SDValue LowerEH_SJLJ_LONGJMP(SDValue Op, SelectionDAG &DAG) const;
|
||||
SDValue LowerINTRINSIC_WO_CHAIN(SDValue Op, SelectionDAG &DAG,
|
||||
const ARMSubtarget *Subtarget) const;
|
||||
|
@ -101,7 +101,8 @@ def ARMsra_flag : SDNode<"ARMISD::SRA_FLAG", SDTIntUnaryOp, [SDNPOutFlag]>;
|
||||
def ARMrrx : SDNode<"ARMISD::RRX" , SDTIntUnaryOp, [SDNPInFlag ]>;
|
||||
|
||||
def ARMthread_pointer: SDNode<"ARMISD::THREAD_POINTER", SDT_ARMThreadPointer>;
|
||||
def ARMeh_sjlj_setjmp: SDNode<"ARMISD::EH_SJLJ_SETJMP", SDT_ARMEH_SJLJ_Setjmp>;
|
||||
def ARMeh_sjlj_setjmp: SDNode<"ARMISD::EH_SJLJ_SETJMP",
|
||||
SDT_ARMEH_SJLJ_Setjmp, [SDNPHasChain]>;
|
||||
def ARMeh_sjlj_longjmp: SDNode<"ARMISD::EH_SJLJ_LONGJMP",
|
||||
SDT_ARMEH_SJLJ_Longjmp, [SDNPHasChain]>;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user