[llvm] AArch64: Use LibcallLoweringInfo in MachineSMEABI pass (PR #176777)

Benjamin Maxwell via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 19 09:21:28 PST 2026


================
@@ -1000,14 +1016,20 @@ void MachineSMEABI::emitSMEPrologue(MachineBasicBlock &MBB,
     BuildMI(MBB, MBBI, DL, TII->get(AArch64::MRS))
         .addReg(TPIDR2EL0, RegState::Define)
         .addImm(AArch64SysReg::TPIDR2_EL0);
+
+    RTLIB::LibcallImpl TPIDR2SaveImpl =
+        getLibcallImpl(RTLIB::SMEABI_TPIDR2_SAVE);
+    StringRef FuncName =
+        RTLIB::RuntimeLibcallsInfo::getLibcallImplName(TPIDR2SaveImpl);
+
     // If TPIDR2_EL0 is non-zero, commit the lazy save.
     // NOTE: Functions that only use ZT0 don't need to zero ZA.
     auto CommitZASave =
         BuildMI(MBB, MBBI, DL, TII->get(AArch64::CommitZASavePseudo))
             .addReg(TPIDR2EL0)
             .addImm(ZeroZA)
             .addImm(ZeroZT0)
-            .addExternalSymbol(TLI->getLibcallName(RTLIB::SMEABI_TPIDR2_SAVE))
+            .addExternalSymbol(FuncName.data())
----------------
MacDue wrote:

Then with the above suggestion the users can be mostly unchanged: 
```suggestion
            .addExternalSymbol(getLibcallName(RTLIB::SMEABI_TPIDR2_SAVE))
```

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


More information about the llvm-commits mailing list