[llvm] AArch64: Use LibcallLoweringInfo in MachineSMEABI pass (PR #176777)
Benjamin Maxwell via llvm-commits
llvm-commits at lists.llvm.org
Mon Jan 19 11:10:00 PST 2026
================
@@ -1046,14 +1066,17 @@ void MachineSMEABI::emitFullZASaveRestore(EmitContext &Context,
BuildMI(MBB, MBBI, DL, TII->get(TargetOpcode::COPY), BufferPtr)
.addReg(Context.getAgnosticZABufferPtr(*MF));
+ RTLIB::LibcallImpl LibcallImpl = getLibcallImpl(
+ IsSave ? RTLIB::SMEABI_SME_SAVE : RTLIB::SMEABI_SME_RESTORE);
+ StringRef FuncName =
+ RTLIB::RuntimeLibcallsInfo::getLibcallImplName(LibcallImpl);
+ CallingConv::ID CC = Libcalls->getLibcallImplCallingConv(LibcallImpl);
+
// Call __arm_sme_save/__arm_sme_restore.
BuildMI(MBB, MBBI, DL, TII->get(AArch64::BL))
.addReg(BufferPtr, RegState::Implicit)
- .addExternalSymbol(TLI->getLibcallName(
- IsSave ? RTLIB::SMEABI_SME_SAVE : RTLIB::SMEABI_SME_RESTORE))
- .addRegMask(TRI->getCallPreservedMask(
- *MF,
- CallingConv::AArch64_SME_ABI_Support_Routines_PreserveMost_From_X1));
----------------
MacDue wrote:
The calling conventions were deliberately hard-coded in this pass as it the pass assumes these calling conventions (using anything else would break the SME ABI). The `RTLIB::SMEABI_` usage was only to avoid redefining some strings.
https://github.com/llvm/llvm-project/pull/176777
More information about the llvm-commits
mailing list