Index: llvm/lib/Target/ARM/ARMInstrInfo.td =================================================================== --- llvm/lib/Target/ARM/ARMInstrInfo.td +++ llvm/lib/Target/ARM/ARMInstrInfo.td @@ -5909,10 +5909,10 @@ // FIXME: Non-IOS version(s) let isBarrier = 1, hasSideEffects = 1, isTerminator = 1, - Defs = [ R7, LR, SP ] in { -def Int_eh_sjlj_longjmp : PseudoInst<(outs), (ins GPR:$src, GPR:$scratch), + Defs = [ R7, R11, LR, SP ] in { +def Int_eh_sjlj_longjmp : PseudoInst<(outs), (ins GPRnofp:$src, GPRnofp:$scratch), NoItinerary, - [(ARMeh_sjlj_longjmp GPR:$src, GPR:$scratch)]>, + [(ARMeh_sjlj_longjmp GPRnofp:$src, GPRnofp:$scratch)]>, Requires<[IsARM]>; } Index: llvm/lib/Target/ARM/ARMRegisterInfo.td =================================================================== --- llvm/lib/Target/ARM/ARMRegisterInfo.td +++ llvm/lib/Target/ARM/ARMRegisterInfo.td @@ -254,6 +254,16 @@ let DiagnosticString = "operand must be a register in range [r0, r14]"; } +// GPRs without potential FPs. Used by eh_sjlj_longjmp(). +def GPRnofp : RegisterClass<"ARM", [i32], 32, (sub GPR, R7, R11)> { + let AltOrders = [(add LR, GPRnofp), (trunc GPRnofp, 7), + (add (trunc GPRnofp, 7), R12, LR, (shl GPRnofp, 7))]; + let AltOrderSelect = [{ + return MF.getSubtarget().getGPRAllocationOrder(MF); + }]; + let DiagnosticString = "operand must be a register in range [r0, r15]"; +} + // GPRs without the PC. Some ARM instructions do not allow the PC in // certain operand slots, particularly as the destination. Primarily // useful for disassembly. Index: llvm/test/CodeGen/Thumb/high-reg-clobber.mir =================================================================== --- llvm/test/CodeGen/Thumb/high-reg-clobber.mir +++ llvm/test/CodeGen/Thumb/high-reg-clobber.mir @@ -31,14 +31,14 @@ ; CHECK: tSTRspi [[COPY]], %stack.0, 0, 14 /* CC::al */, $noreg ; CHECK: [[tLDRspi:%[0-9]+]]:tgpr = tLDRspi %stack.0, 0, 14 /* CC::al */, $noreg ; CHECK: [[COPY1:%[0-9]+]]:hgpr = COPY [[tLDRspi]] - ; CHECK: INLINEASM &"mov r12, $0", 1 /* sideeffect attdialect */, 1048585 /* reguse:GPRnoip_and_GPRwithAPSR_NZCVnosp */, [[COPY1]], 12 /* clobber */, implicit-def early-clobber $r12 + ; CHECK: INLINEASM &"mov r12, $0", 1 /* sideeffect attdialect */, 1048585 /* reguse:GPRnofp_and_GPRnopc */, [[COPY1]], 12 /* clobber */, implicit-def early-clobber $r12 ; CHECK: tBX_RET 14 /* CC::al */, $noreg ; FAST-LABEL: name: constraint_h ; FAST: liveins: $r0 ; FAST: tSTRspi killed renamable $r0, %stack.0, 0, 14 /* CC::al */, $noreg ; FAST: renamable $r0 = tLDRspi %stack.0, 0, 14 /* CC::al */, $noreg ; FAST: renamable $r8 = COPY killed renamable $r0 - ; FAST: INLINEASM &"mov r12, $0", 1 /* sideeffect attdialect */, 1048585 /* reguse:GPRnoip_and_GPRwithAPSR_NZCVnosp */, killed renamable $r8, 12 /* clobber */, implicit-def dead early-clobber $r12 + ; FAST: INLINEASM &"mov r12, $0", 1 /* sideeffect attdialect */, 1048585 /* reguse:GPRnofp_and_GPRnopc */, killed renamable $r8, 12 /* clobber */, implicit-def dead early-clobber $r12 ; FAST: tBX_RET 14 /* CC::al */, $noreg %0:tgpr = COPY $r0 tSTRspi %0, %stack.0, 0, 14 /* CC::al */, $noreg