Skip to content

Commit

Permalink
[NVPTX] Disable all RTLib libcalls (#98672)
Browse files Browse the repository at this point in the history
Summary:
This patch explicitly disables runtime calls to be emitted from the
NVPTX backend. This allows other utilities to know that we do not need
to worry about emitting these.
  • Loading branch information
jhuber6 committed Jul 12, 2024
1 parent afb584a commit 1ccd875
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions llvm/lib/CodeGen/TargetLoweringBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,13 @@ void TargetLoweringBase::InitLibcalls(const Triple &TT) {
}
}

// Disable most libcalls on NVPTX.
if (TT.isNVPTX()) {
for (int I = 0; I < RTLIB::UNKNOWN_LIBCALL; ++I)
if (I < RTLIB::ATOMIC_LOAD || I > RTLIB::ATOMIC_FETCH_NAND_16)
setLibcallName(static_cast<RTLIB::Libcall>(I), nullptr);
}

if (TT.isARM() || TT.isThumb()) {
// These libcalls are not available in 32-bit.
setLibcallName(RTLIB::SHL_I128, nullptr);
Expand Down

0 comments on commit 1ccd875

Please sign in to comment.