Skip to content

Commit ecb2dcf

Browse files
committed
Rebase: Use RuntimeLibcalls for EmitEntryPStateSM
1 parent 55a3072 commit ecb2dcf

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

llvm/lib/Target/AArch64/AArch64ISelLowering.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3108,13 +3108,12 @@ AArch64TargetLowering::EmitEntryPStateSM(MachineInstr &MI,
31083108
const TargetInstrInfo *TII = Subtarget->getInstrInfo();
31093109
Register ResultReg = MI.getOperand(0).getReg();
31103110
if (FuncInfo->isPStateSMRegUsed()) {
3111+
RTLIB::Libcall LC = RTLIB::SMEABI_SME_STATE;
31113112
const AArch64RegisterInfo *TRI = Subtarget->getRegisterInfo();
31123113
BuildMI(*BB, MI, MI.getDebugLoc(), TII->get(AArch64::BL))
3113-
.addExternalSymbol("__arm_sme_state")
3114+
.addExternalSymbol(getLibcallName(LC))
31143115
.addReg(AArch64::X0, RegState::ImplicitDefine)
3115-
.addRegMask(TRI->getCallPreservedMask(
3116-
*MF, CallingConv::
3117-
AArch64_SME_ABI_Support_Routines_PreserveMost_From_X2));
3116+
.addRegMask(TRI->getCallPreservedMask(*MF, getLibcallCallingConv(LC)));
31183117
BuildMI(*BB, MI, MI.getDebugLoc(), TII->get(TargetOpcode::COPY), ResultReg)
31193118
.addReg(AArch64::X0);
31203119
} else {

llvm/lib/Target/AArch64/Utils/AArch64SMEAttributes.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ void SMEAttrs::addKnownFunctionAttrs(StringRef FuncName,
9393
case RTLIB::SMEABI_SME_STATE_SIZE:
9494
case RTLIB::SMEABI_SME_SAVE:
9595
case RTLIB::SMEABI_SME_RESTORE:
96-
KnownAttrs |= (SMEAttrs::SM_Compatible | SMEAttrs::SME_ABI_Routine);
96+
KnownAttrs |= SMEAttrs::SM_Compatible | SMEAttrs::SME_ABI_Routine;
9797
break;
9898
case RTLIB::SMEABI_ZA_DISABLE:
9999
case RTLIB::SMEABI_TPIDR2_RESTORE:

0 commit comments

Comments
 (0)