[llvm-branch-commits] [llvm] RuntimeLibcalls: Remove the dead IsDefault emitter machinery (PR #219947)

Matt Arsenault via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Tue Sep 8 04:33:23 PDT 2026


https://github.com/arsenm updated https://github.com/llvm/llvm-project/pull/219947

>From b752892e180611c1e1b46b5d8cea12a4b0e5facc Mon Sep 17 00:00:00 2001
From: Matt Arsenault <Matthew.Arsenault at amd.com>
Date: Thu, 13 Aug 2026 16:11:20 +0200
Subject: [PATCH] RuntimeLibcalls: Remove the dead IsDefault emitter machinery

The IsDefault bit on RuntimeLibcallImpl fed a LibCallToDefaultImpl map in the
TableGen backend that was populated but never read.

Co-authored-by: Claude (Claude-Opus-4.8) <noreply at anthropic.com>
---
 llvm/test/TableGen/RuntimeLibcallEmitter.td   | 13 +++++--------
 llvm/utils/TableGen/Basic/RuntimeLibcalls.cpp |  8 --------
 llvm/utils/TableGen/Basic/RuntimeLibcalls.h   |  5 -----
 3 files changed, 5 insertions(+), 21 deletions(-)

diff --git a/llvm/test/TableGen/RuntimeLibcallEmitter.td b/llvm/test/TableGen/RuntimeLibcallEmitter.td
index 51c3e02885f4b..35e0068304e5e 100644
--- a/llvm/test/TableGen/RuntimeLibcallEmitter.td
+++ b/llvm/test/TableGen/RuntimeLibcallEmitter.td
@@ -13,14 +13,11 @@ def MEMCPY : RuntimeLibcall;
 def MEMSET : RuntimeLibcall;
 def CALLOC : RuntimeLibcall;
 
-// Test default names.
-let IsDefault = true in {
-  def __ashlsi3 : RuntimeLibcallImpl<SHL_I32>;
-  def __lshrdi3 : RuntimeLibcallImpl<SRL_I64>;
-
-  def sqrtl_f128 : RuntimeLibcallImpl<SQRT_F128, "sqrtl">;
-  def sqrtl_f80 : RuntimeLibcallImpl<SQRT_F80, "sqrtl">;
-}
+def __ashlsi3 : RuntimeLibcallImpl<SHL_I32>;
+def __lshrdi3 : RuntimeLibcallImpl<SRL_I64>;
+
+def sqrtl_f128 : RuntimeLibcallImpl<SQRT_F128, "sqrtl">;
+def sqrtl_f80 : RuntimeLibcallImpl<SQRT_F80, "sqrtl">;
 
 // Ignore non-default in initDefaultLibCallNames.
 def bzero : RuntimeLibcallImpl<BZERO>;
diff --git a/llvm/utils/TableGen/Basic/RuntimeLibcalls.cpp b/llvm/utils/TableGen/Basic/RuntimeLibcalls.cpp
index 9c4a9107a6849..dfccfca5dbb4d 100644
--- a/llvm/utils/TableGen/Basic/RuntimeLibcalls.cpp
+++ b/llvm/utils/TableGen/Basic/RuntimeLibcalls.cpp
@@ -69,14 +69,6 @@ RuntimeLibcalls::RuntimeLibcalls(const RecordKeeper &Records) {
 
     const RuntimeLibcallImpl &LibCallImpl = RuntimeLibcallImplDefList.back();
     Def2RuntimeLibcallImpl[LibCallImplDef] = &LibCallImpl;
-
-    if (LibCallImpl.isDefault()) {
-      const RuntimeLibcall *Provides = LibCallImpl.getProvides();
-      if (!Provides)
-        PrintFatalError(LibCallImplDef->getLoc(),
-                        "default implementations must provide a libcall");
-      LibCallToDefaultImpl[Provides] = &LibCallImpl;
-    }
   }
 }
 
diff --git a/llvm/utils/TableGen/Basic/RuntimeLibcalls.h b/llvm/utils/TableGen/Basic/RuntimeLibcalls.h
index 787c6b0d6a360..b296c86ffd111 100644
--- a/llvm/utils/TableGen/Basic/RuntimeLibcalls.h
+++ b/llvm/utils/TableGen/Basic/RuntimeLibcalls.h
@@ -135,8 +135,6 @@ class RuntimeLibcallImpl {
     OS << '\"' << getLibcallFuncName() << '\"';
   }
 
-  bool isDefault() const { return TheDef->getValueAsBit("IsDefault"); }
-
   void emitEnumEntry(raw_ostream &OS) const {
     OS << "RTLIB::impl_" << this->getName();
   }
@@ -173,9 +171,6 @@ class RuntimeLibcalls {
   std::vector<RuntimeLibcall> RuntimeLibcallDefList;
   std::vector<RuntimeLibcallImpl> RuntimeLibcallImplDefList;
 
-  DenseMap<const RuntimeLibcall *, const RuntimeLibcallImpl *>
-      LibCallToDefaultImpl;
-
 public:
   RuntimeLibcalls(const RecordKeeper &Records);
 



More information about the llvm-branch-commits mailing list