[llvm] [AArch64][SME] Use LibcallLoweringInfo in the MachineSMEABIPass (PR #177762)

Benjamin Maxwell via llvm-commits llvm-commits at lists.llvm.org
Sat Jan 24 05:52:35 PST 2026


================
@@ -876,11 +881,22 @@ void MachineSMEABI::restorePhyRegSave(const PhysRegSave &RegSave,
         .addReg(RegSave.X0Save);
 }
 
+void MachineSMEABI::addSMELibCall(MachineInstrBuilder &MIB, RTLIB::Libcall LC,
+                                  CallingConv::ID ExpectedCC) {
+  RTLIB::LibcallImpl LCImpl = LLI->getLibcallImpl(LC);
+  assert(LCImpl != RTLIB::Unsupported && "Expected SME routines to exist.");
+  CallingConv::ID CC = LLI->getLibcallImplCallingConv(LCImpl);
+  assert(CC == ExpectedCC && "Unexpected calling convention for SME rountine");
+  StringRef SymbolName = RTLIB::RuntimeLibcallsInfo::getLibcallImplName(LCImpl);
+  // FIXME: This assumes the SymbolName StringRef is null-terminated.
----------------
MacDue wrote:

I think this FIXME holds until external symbols as enums are supported. I understand `RuntimeLibcallsInfo` guarantees this, but the StringRef API does not, so it's generally unsafe and should be fixed (hence the FIXME). 



https://github.com/llvm/llvm-project/pull/177762


More information about the llvm-commits mailing list