-
Notifications
You must be signed in to change notification settings - Fork 14.3k
AArch64: Stop using StringSaver for runtime libcall names #142544
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
arsenm
merged 1 commit into
main
from
users/arsenm/aarch64/stop-using-stringsaver-windows-arm64-ec-libcall-names
Jun 3, 2025
Merged
AArch64: Stop using StringSaver for runtime libcall names #142544
arsenm
merged 1 commit into
main
from
users/arsenm/aarch64/stop-using-stringsaver-windows-arm64-ec-libcall-names
Jun 3, 2025
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This redoes 43ba568 to avoid the statefulness.
@llvm/pr-subscribers-platform-windows @llvm/pr-subscribers-backend-aarch64 Author: Matt Arsenault (arsenm) ChangesThis redoes 43ba568 to avoid Full diff: https://github.com/llvm/llvm-project/pull/142544.diff 2 Files Affected:
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<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 different targets.
const AArch64Subtarget *Subtarget;
- llvm::BumpPtrAllocator BumpAlloc;
- llvm::StringSaver Saver{BumpAlloc};
-
bool isExtFreeImpl(const Instruction *Ext) const override;
void addTypeForNEON(MVT VT);
|
dpaoliello
approved these changes
Jun 3, 2025
rorth
pushed a commit
to rorth/llvm-project
that referenced
this pull request
Jun 11, 2025
This redoes 43ba568 to avoid the statefulness.
DhruvSrivastavaX
pushed a commit
to DhruvSrivastavaX/lldb-for-aix
that referenced
this pull request
Jun 12, 2025
This redoes 43ba568 to avoid the statefulness.
cjacek
added a commit
to cjacek/llvm-project
that referenced
this pull request
Jun 13, 2025
Fixes llvm#142544, which incorrectly used #name in the `HANDLE_LIBCALL` macro. Since name is already a string, this led to extra quotes in the symbol name, resulting in calls like `b "#\"memcpy\""`. Some libcalls do not have an associated name and use nullptr instead. To handle these cases cleanly, introduce a new `HANDLE_NAMELESS_LIBCALL` macro that allows skipping them in the logic.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This redoes 43ba568 to avoid
the statefulness.