Skip to content

Commit 0a3e9aa

Browse files
authored
SystemZ: Move runtime libcall setting out of TargetLowering (#142622)
RuntimeLibcallInfo needs to be correct outside of codegen contexts.
1 parent f2adae5 commit 0a3e9aa

File tree

3 files changed

+13
-13
lines changed

3 files changed

+13
-13
lines changed

llvm/lib/IR/RuntimeLibcalls.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,4 +278,17 @@ void RuntimeLibcallsInfo::initLibcalls(const Triple &TT) {
278278
}
279279
setLibcallName(RTLIB::MULO_I128, nullptr);
280280
}
281+
282+
if (TT.isSystemZ() && TT.isOSzOS()) {
283+
struct RTLibCallMapping {
284+
RTLIB::Libcall Code;
285+
const char *Name;
286+
};
287+
static RTLibCallMapping RTLibCallCommon[] = {
288+
#define HANDLE_LIBCALL(code, name) {RTLIB::code, name},
289+
#include "ZOSLibcallNames.def"
290+
};
291+
for (auto &E : RTLibCallCommon)
292+
setLibcallName(E.Code, E.Name);
293+
}
281294
}

llvm/lib/Target/SystemZ/SystemZISelLowering.cpp

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -828,19 +828,6 @@ SystemZTargetLowering::SystemZTargetLowering(const TargetMachine &TM,
828828

829829
// Default to having -disable-strictnode-mutation on
830830
IsStrictFPEnabled = true;
831-
832-
if (Subtarget.isTargetzOS()) {
833-
struct RTLibCallMapping {
834-
RTLIB::Libcall Code;
835-
const char *Name;
836-
};
837-
static RTLibCallMapping RTLibCallCommon[] = {
838-
#define HANDLE_LIBCALL(code, name) {RTLIB::code, name},
839-
#include "ZOSLibcallNames.def"
840-
};
841-
for (auto &E : RTLibCallCommon)
842-
setLibcallName(E.Code, E.Name);
843-
}
844831
}
845832

846833
bool SystemZTargetLowering::useSoftFloat() const {

0 commit comments

Comments
 (0)