Index: lib/Target/ARM/ARMISelLowering.cpp =================================================================== --- lib/Target/ARM/ARMISelLowering.cpp +++ lib/Target/ARM/ARMISelLowering.cpp @@ -3257,9 +3257,9 @@ ARMTargetLowering::LowerEH_SJLJ_SETJMP(SDValue Op, SelectionDAG &DAG) const { SDLoc dl(Op); SDValue Val = DAG.getConstant(0, dl, MVT::i32); - return DAG.getNode(ARMISD::EH_SJLJ_SETJMP, dl, - DAG.getVTList(MVT::i32, MVT::Other), Op.getOperand(0), - Op.getOperand(1), Val); + SDValue Chain = DAG.getNode(ARMISD::EH_SJLJ_SETJMP, dl, MVT::Other, + Op.getOperand(0), Op.getOperand(1), Val); + return DAG.getCopyFromReg(Chain, dl, ARM::R0, MVT::i32); } SDValue Index: lib/Target/ARM/ARMInstrInfo.td =================================================================== --- lib/Target/ARM/ARMInstrInfo.td +++ lib/Target/ARM/ARMInstrInfo.td @@ -58,9 +58,7 @@ SDTCisPtrTy<1>, SDTCisVT<2, i32>]>; def SDT_ARMThreadPointer : SDTypeProfile<1, 0, [SDTCisPtrTy<0>]>; -def SDT_ARMEH_SJLJ_Setjmp : SDTypeProfile<1, 2, [SDTCisInt<0>, SDTCisPtrTy<1>, - SDTCisInt<2>]>; -def SDT_ARMEH_SJLJ_Longjmp: SDTypeProfile<0, 2, [SDTCisPtrTy<0>, SDTCisInt<1>]>; +def SDT_ARMEH_SJLJ_jmp: SDTypeProfile<0, 2, [SDTCisPtrTy<0>, SDTCisInt<1>]>; def SDT_ARMEH_SJLJ_SetupDispatch: SDTypeProfile<0, 0, []>; def SDT_ARMMEMBARRIER : SDTypeProfile<0, 1, [SDTCisInt<0>]>; @@ -167,10 +165,10 @@ def ARMthread_pointer: SDNode<"ARMISD::THREAD_POINTER", SDT_ARMThreadPointer>; def ARMeh_sjlj_setjmp: SDNode<"ARMISD::EH_SJLJ_SETJMP", - SDT_ARMEH_SJLJ_Setjmp, + SDT_ARMEH_SJLJ_jmp, [SDNPHasChain, SDNPSideEffect]>; def ARMeh_sjlj_longjmp: SDNode<"ARMISD::EH_SJLJ_LONGJMP", - SDT_ARMEH_SJLJ_Longjmp, + SDT_ARMEH_SJLJ_jmp, [SDNPHasChain, SDNPSideEffect]>; def ARMeh_sjlj_setup_dispatch: SDNode<"ARMISD::EH_SJLJ_SETUP_DISPATCH", SDT_ARMEH_SJLJ_SetupDispatch, @@ -5474,7 +5472,7 @@ hasSideEffects = 1, isBarrier = 1, usesCustomInserter = 1 in { def Int_eh_sjlj_setjmp : PseudoInst<(outs), (ins GPR:$src, GPR:$val), NoItinerary, - [(set R0, (ARMeh_sjlj_setjmp GPR:$src, GPR:$val))]>, + [(ARMeh_sjlj_setjmp GPR:$src, GPR:$val)]>, Requires<[IsARM, HasVFP2]>; } @@ -5483,7 +5481,7 @@ hasSideEffects = 1, isBarrier = 1, usesCustomInserter = 1 in { def Int_eh_sjlj_setjmp_nofp : PseudoInst<(outs), (ins GPR:$src, GPR:$val), NoItinerary, - [(set R0, (ARMeh_sjlj_setjmp GPR:$src, GPR:$val))]>, + [(ARMeh_sjlj_setjmp GPR:$src, GPR:$val)]>, Requires<[IsARM, NoVFP]>; } Index: lib/Target/ARM/ARMInstrThumb.td =================================================================== --- lib/Target/ARM/ARMInstrThumb.td +++ lib/Target/ARM/ARMInstrThumb.td @@ -1453,7 +1453,7 @@ usesCustomInserter = 1 in def tInt_eh_sjlj_setjmp : ThumbXI<(outs),(ins tGPR:$src, tGPR:$val), AddrModeNone, 0, NoItinerary, "","", - [(set R0, (ARMeh_sjlj_setjmp tGPR:$src, tGPR:$val))]>; + [(ARMeh_sjlj_setjmp tGPR:$src, tGPR:$val)]>; // FIXME: Non-IOS version(s) let isBarrier = 1, hasSideEffects = 1, isTerminator = 1, isCodeGenOnly = 1, Index: lib/Target/ARM/ARMInstrThumb2.td =================================================================== --- lib/Target/ARM/ARMInstrThumb2.td +++ lib/Target/ARM/ARMInstrThumb2.td @@ -3379,7 +3379,7 @@ usesCustomInserter = 1 in { def t2Int_eh_sjlj_setjmp : Thumb2XI<(outs), (ins tGPR:$src, tGPR:$val), AddrModeNone, 0, NoItinerary, "", "", - [(set R0, (ARMeh_sjlj_setjmp tGPR:$src, tGPR:$val))]>, + [(ARMeh_sjlj_setjmp tGPR:$src, tGPR:$val)]>, Requires<[IsThumb2, HasVFP2]>; } @@ -3389,7 +3389,7 @@ usesCustomInserter = 1 in { def t2Int_eh_sjlj_setjmp_nofp : Thumb2XI<(outs), (ins tGPR:$src, tGPR:$val), AddrModeNone, 0, NoItinerary, "", "", - [(set R0, (ARMeh_sjlj_setjmp tGPR:$src, tGPR:$val))]>, + [(ARMeh_sjlj_setjmp tGPR:$src, tGPR:$val)]>, Requires<[IsThumb2, NoVFP]>; }