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

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Sat Jan 24 05:47:59 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.
----------------
arsenm wrote:

```suggestion
```

The RuntimeLibcallsInfo strings are guaranteed to be null terminated. I have half of a patch allowing encoding external symbols as the enum value which will avoid spreading this assumption around

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


More information about the llvm-commits mailing list