[llvm] 1ccd875 - [NVPTX] Disable all RTLib libcalls (#98672)

via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 12 13:46:54 PDT 2024


Author: Joseph Huber
Date: 2024-07-12T15:46:51-05:00
New Revision: 1ccd8756f1284e497fe921b955b8e06c8ccfbcdc

URL: https://github.com/llvm/llvm-project/commit/1ccd8756f1284e497fe921b955b8e06c8ccfbcdc
DIFF: https://github.com/llvm/llvm-project/commit/1ccd8756f1284e497fe921b955b8e06c8ccfbcdc.diff

LOG: [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.

Added: 
    

Modified: 
    llvm/lib/CodeGen/TargetLoweringBase.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/CodeGen/TargetLoweringBase.cpp b/llvm/lib/CodeGen/TargetLoweringBase.cpp
index f36743a569739..eccac0e218c58 100644
--- a/llvm/lib/CodeGen/TargetLoweringBase.cpp
+++ b/llvm/lib/CodeGen/TargetLoweringBase.cpp
@@ -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);


        


More information about the llvm-commits mailing list