AArch64: Stop using StringSaver for runtime libcall names (#142544)
This redoes 43ba568daac098b286e1c1207deadd1f59d56cd7 to avoid
the statefulness.
diff --git a/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp b/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
index c6f9c9a..9f51cae 100644
--- a/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
+++ b/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
@@ -1984,14 +1984,15 @@
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 450e2ef..b217448 100644
--- a/llvm/lib/Target/AArch64/AArch64ISelLowering.h
+++ b/llvm/lib/Target/AArch64/AArch64ISelLowering.h
@@ -540,9 +540,6 @@
/// make the right decision when generating code for different targets.
const AArch64Subtarget *Subtarget;
- llvm::BumpPtrAllocator BumpAlloc;
- llvm::StringSaver Saver{BumpAlloc};
-
bool isExtFreeImpl(const Instruction *Ext) const override;
void addTypeForNEON(MVT VT);