Skip to content

Commit 1ccd875

Browse files
authored
[NVPTX] Disable all RTLib libcalls (#98672)
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.
1 parent afb584a commit 1ccd875

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

llvm/lib/CodeGen/TargetLoweringBase.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,13 @@ void TargetLoweringBase::InitLibcalls(const Triple &TT) {
312312
}
313313
}
314314

315+
// Disable most libcalls on NVPTX.
316+
if (TT.isNVPTX()) {
317+
for (int I = 0; I < RTLIB::UNKNOWN_LIBCALL; ++I)
318+
if (I < RTLIB::ATOMIC_LOAD || I > RTLIB::ATOMIC_FETCH_NAND_16)
319+
setLibcallName(static_cast<RTLIB::Libcall>(I), nullptr);
320+
}
321+
315322
if (TT.isARM() || TT.isThumb()) {
316323
// These libcalls are not available in 32-bit.
317324
setLibcallName(RTLIB::SHL_I128, nullptr);

0 commit comments

Comments
 (0)