From ddbdd5879b0bf7a5a49b2ecd54f8b29773c61e26 Mon Sep 17 00:00:00 2001 From: Matt Arsenault Date: Tue, 3 Jun 2025 02:37:32 +0200 Subject: [PATCH] AArch64: Stop using StringSaver for runtime libcall names This redoes 43ba568daac098b286e1c1207deadd1f59d56cd7 to avoid the statefulness. --- llvm/lib/Target/AArch64/AArch64ISelLowering.cpp | 17 +++++++++-------- llvm/lib/Target/AArch64/AArch64ISelLowering.h | 3 --- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp b/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp index ae34e6b7dcc3c..06f24a3332416 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(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 different targets. const AArch64Subtarget *Subtarget; - llvm::BumpPtrAllocator BumpAlloc; - llvm::StringSaver Saver{BumpAlloc}; - bool isExtFreeImpl(const Instruction *Ext) const override; void addTypeForNEON(MVT VT);