Conversation
Contributor
Author
This stack of pull requests is managed by Graphite. Learn more about stacking. |
Member
|
@llvm/pr-subscribers-llvm-ir @llvm/pr-subscribers-backend-aarch64 Author: Matt Arsenault (arsenm) ChangesMove the parts that aren't dependent on the subtarget into Full diff: https://github.com/llvm/llvm-project/pull/142985.diff 2 Files Affected:
diff --git a/llvm/lib/IR/RuntimeLibcalls.cpp b/llvm/lib/IR/RuntimeLibcalls.cpp
index ca45cd4b7b13c..6ffe535242edd 100644
--- a/llvm/lib/IR/RuntimeLibcalls.cpp
+++ b/llvm/lib/IR/RuntimeLibcalls.cpp
@@ -11,6 +11,25 @@
using namespace llvm;
using namespace RTLIB;
+static cl::opt<bool>
+ HexagonEnableFastMathRuntimeCalls("hexagon-fast-math", cl::Hidden,
+ cl::desc("Enable Fast Math processing"));
+
+static void setAArch64LibcallNames(RuntimeLibcallsInfo &Info,
+ const Triple &TT) {
+ if (TT.isWindowsArm64EC()) {
+ // FIXME: are there calls we need to exclude from this?
+#define HANDLE_LIBCALL(code, name) \
+ { \
+ const char *libcallName = Info.getLibcallName(RTLIB::code); \
+ if (libcallName && libcallName[0] != '#') \
+ Info.setLibcallName(RTLIB::code, "#" #name); \
+ }
+#include "llvm/IR/RuntimeLibcalls.def"
+#undef HANDLE_LIBCALL
+ }
+}
+
/// Set default libcall names. If a target wants to opt-out of a libcall it
/// should be placed here.
void RuntimeLibcallsInfo::initLibcalls(const Triple &TT) {
@@ -249,6 +268,9 @@ void RuntimeLibcallsInfo::initLibcalls(const Triple &TT) {
}
}
+ if (TT.getArch() == Triple::ArchType::aarch64)
+ setAArch64LibcallNames(*this, TT);
+
if (TT.getArch() == Triple::ArchType::avr) {
// Division rtlib functions (not supported), use divmod functions instead
setLibcallName(RTLIB::SDIV_I8, nullptr);
diff --git a/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp b/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
index 9f51caef6d228..2019c9df0f271 100644
--- a/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
+++ b/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
@@ -1982,18 +1982,6 @@ AArch64TargetLowering::AArch64TargetLowering(const TargetMachine &TM,
for (ISD::NodeType Op : {ISD::FLDEXP, ISD::STRICT_FLDEXP, ISD::FFREXP})
if (isOperationExpand(Op, MVT::f16))
setOperationAction(Op, MVT::f16, Promote);
-
- if (Subtarget->isWindowsArm64EC()) {
- // 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
- }
}
void AArch64TargetLowering::addTypeForNEON(MVT VT) {
|
dpaoliello
requested changes
Jun 5, 2025
Contributor
dpaoliello
left a comment
There was a problem hiding this comment.
Please clean up the hexagon option (unless it is actually needed), otherwise the rest looks good.
08249e3 to
4ef459c
Compare
Move the parts that aren't dependent on the subtarget into RuntimeLibcallInfo, which should contain the superset of all possible runtime calls and be accurate outside of codegen.
4ef459c to
262364d
Compare
dpaoliello
approved these changes
Jun 6, 2025
tomtor
pushed a commit
to tomtor/llvm-project
that referenced
this pull request
Jun 14, 2025
llvm#142985) Move the parts that aren't dependent on the subtarget into RuntimeLibcallInfo, which should contain the superset of all possible runtime calls and be accurate outside of codegen.
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
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.

Move the parts that aren't dependent on the subtarget into
RuntimeLibcallInfo, which should contain the superset of all possible
runtime calls and be accurate outside of codegen.