[llvm] 4bdcf5b - AArch64: Stop using StringSaver for runtime libcall names (#142544)

via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 3 13:58:27 PDT 2025


Author: Matt Arsenault
Date: 2025-06-04T05:58:24+09:00
New Revision: 4bdcf5b51f9ea0fa30cfa2279d0943faf5446ecf

URL: https://github.com/llvm/llvm-project/commit/4bdcf5b51f9ea0fa30cfa2279d0943faf5446ecf
DIFF: https://github.com/llvm/llvm-project/commit/4bdcf5b51f9ea0fa30cfa2279d0943faf5446ecf.diff

LOG: AArch64: Stop using StringSaver for runtime libcall names (#142544)

This redoes 43ba568daac098b286e1c1207deadd1f59d56cd7 to avoid
the statefulness.

Added: 
    

Modified: 
    llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
    llvm/lib/Target/AArch64/AArch64ISelLowering.h

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp b/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
index c6f9c9a86ff0d..9f51caef6d228 100644
--- a/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
+++ b/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
@@ -1984,14 +1984,15 @@ AArch64TargetLowering::AArch64TargetLowering(const TargetMachine &TM,
       setOperationAction(Op, MVT::f16, Promote);
 
   if (Subtarget->isWindowsArm64EC()) {
-    // FIXME: are there intrinsics we need to exclude from this?
-    for (int i = 0; i < RTLIB::UNKNOWN_LIBCALL; ++i) {
-      auto code = static_cast<RTLIB::Libcall>(i);
-      auto libcallName = getLibcallName(code);
-      if ((libcallName != nullptr) && (libcallName[0] != '#')) {
-        setLibcallName(code, Saver.save(Twine("#") + libcallName).data());
-      }
-    }
+    // FIXME: are there calls we need to exclude from this?
+#define HANDLE_LIBCALL(code, name)                                             \
+  {                                                                            \
+    const char *libcallName = getLibcallName(RTLIB::code);                     \
+    if (libcallName && libcallName[0] != '#')                                  \
+      setLibcallName(RTLIB::code, "#" #name);                                  \
+  }
+#include "llvm/IR/RuntimeLibcalls.def"
+#undef HANDLE_LIBCALL
   }
 }
 

diff  --git a/llvm/lib/Target/AArch64/AArch64ISelLowering.h b/llvm/lib/Target/AArch64/AArch64ISelLowering.h
index 450e2efd7d430..b2174487c2fe8 100644
--- a/llvm/lib/Target/AArch64/AArch64ISelLowering.h
+++ b/llvm/lib/Target/AArch64/AArch64ISelLowering.h
@@ -540,9 +540,6 @@ class AArch64TargetLowering : public TargetLowering {
   /// make the right decision when generating code for 
diff erent targets.
   const AArch64Subtarget *Subtarget;
 
-  llvm::BumpPtrAllocator BumpAlloc;
-  llvm::StringSaver Saver{BumpAlloc};
-
   bool isExtFreeImpl(const Instruction *Ext) const override;
 
   void addTypeForNEON(MVT VT);


        


More information about the llvm-commits mailing list