-
Notifications
You must be signed in to change notification settings - Fork 14.3k
SystemZ: Move runtime libcall setting out of TargetLowering #142622
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
SystemZ: Move runtime libcall setting out of TargetLowering #142622
Conversation
RuntimeLibcallInfo needs to be correct outside of codegen contexts.
@llvm/pr-subscribers-llvm-ir @llvm/pr-subscribers-backend-systemz Author: Matt Arsenault (arsenm) ChangesRuntimeLibcallInfo needs to be correct outside of codegen contexts. Full diff: https://github.com/llvm/llvm-project/pull/142622.diff 3 Files Affected:
diff --git a/llvm/lib/IR/RuntimeLibcalls.cpp b/llvm/lib/IR/RuntimeLibcalls.cpp
index db0373055160c..d8451b818e8e3 100644
--- a/llvm/lib/IR/RuntimeLibcalls.cpp
+++ b/llvm/lib/IR/RuntimeLibcalls.cpp
@@ -278,4 +278,17 @@ void RuntimeLibcallsInfo::initLibcalls(const Triple &TT) {
}
setLibcallName(RTLIB::MULO_I128, nullptr);
}
+
+ if (TT.isSystemZ() && TT.isOSzOS()) {
+ struct RTLibCallMapping {
+ RTLIB::Libcall Code;
+ const char *Name;
+ };
+ static RTLibCallMapping RTLibCallCommon[] = {
+#define HANDLE_LIBCALL(code, name) {RTLIB::code, name},
+#include "ZOSLibcallNames.def"
+ };
+ for (auto &E : RTLibCallCommon)
+ setLibcallName(E.Code, E.Name);
+ }
}
diff --git a/llvm/lib/Target/SystemZ/ZOSLibcallNames.def b/llvm/lib/IR/ZOSLibcallNames.def
similarity index 100%
rename from llvm/lib/Target/SystemZ/ZOSLibcallNames.def
rename to llvm/lib/IR/ZOSLibcallNames.def
diff --git a/llvm/lib/Target/SystemZ/SystemZISelLowering.cpp b/llvm/lib/Target/SystemZ/SystemZISelLowering.cpp
index 3b86a9bc58790..f06246706aaa9 100644
--- a/llvm/lib/Target/SystemZ/SystemZISelLowering.cpp
+++ b/llvm/lib/Target/SystemZ/SystemZISelLowering.cpp
@@ -828,19 +828,6 @@ SystemZTargetLowering::SystemZTargetLowering(const TargetMachine &TM,
// Default to having -disable-strictnode-mutation on
IsStrictFPEnabled = true;
-
- if (Subtarget.isTargetzOS()) {
- struct RTLibCallMapping {
- RTLIB::Libcall Code;
- const char *Name;
- };
- static RTLibCallMapping RTLibCallCommon[] = {
-#define HANDLE_LIBCALL(code, name) {RTLIB::code, name},
-#include "ZOSLibcallNames.def"
- };
- for (auto &E : RTLibCallCommon)
- setLibcallName(E.Code, E.Name);
- }
}
bool SystemZTargetLowering::useSoftFloat() const {
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM as well, thanks!
RuntimeLibcallInfo needs to be correct outside of codegen contexts.