[llvm] RuntimeLibcalls: Remove __muloti4 from default libcall set (PR #148562)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Sun Jul 13 20:24:55 PDT 2025


https://github.com/arsenm created https://github.com/llvm/llvm-project/pull/148562

The current logic says it's only available on wasm, so only
explicitly add it there. Also fix a misnomer in the compiler-rt
call list.

>From 4b710451faa438fbcd32d45a2fe31dcf89140765 Mon Sep 17 00:00:00 2001
From: Matt Arsenault <Matthew.Arsenault at amd.com>
Date: Mon, 14 Jul 2025 12:06:18 +0900
Subject: [PATCH] RuntimeLibcalls: Remove __muloti4 from default libcall set

The current logic says it's only available on wasm, so only
explicitly add it there. Also fix a misnomer in the compiler-rt
call list.
---
 llvm/include/llvm/IR/RuntimeLibcalls.td | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/llvm/include/llvm/IR/RuntimeLibcalls.td b/llvm/include/llvm/IR/RuntimeLibcalls.td
index 9781bef8e37b6..53eea97bf1ea9 100644
--- a/llvm/include/llvm/IR/RuntimeLibcalls.td
+++ b/llvm/include/llvm/IR/RuntimeLibcalls.td
@@ -459,7 +459,6 @@ def __multi3 : RuntimeLibcallImpl<MUL_I128>;
 
 def __mulosi4 : RuntimeLibcallImpl<MULO_I32>;
 def __mulodi4 : RuntimeLibcallImpl<MULO_I64>;
-def __muloti4 : RuntimeLibcallImpl<MULO_I128>;
 
 def __divqi3 : RuntimeLibcallImpl<SDIV_I8>;
 def __divhi3 : RuntimeLibcallImpl<SDIV_I16>;
@@ -935,6 +934,12 @@ def calloc : RuntimeLibcallImpl<CALLOC>;
 
 } // End let IsDefault = true
 
+//--------------------------------------------------------------------
+// compiler-rt, not available for most architectures
+//--------------------------------------------------------------------
+
+def __muloti4 : RuntimeLibcallImpl<MULO_I128>;
+
 //--------------------------------------------------------------------
 // Define implementation other libcalls
 //--------------------------------------------------------------------
@@ -1036,7 +1041,7 @@ defvar Int128RTLibcalls = [
 ];
 
 // Only available in compiler-rt
-defvar CompilerRTOnlyInt128Libcalls = [
+defvar CompilerRTOnlyInt64Libcalls = [
   __mulodi4
 ];
 
@@ -1057,7 +1062,7 @@ defvar DefaultRuntimeLibcallImpls =
   !listremove(
     !listremove(
         !listremove(AllDefaultRuntimeLibcallImpls, Int128RTLibcalls),
-                    CompilerRTOnlyInt128Libcalls),
+                    CompilerRTOnlyInt64Libcalls),
                     DefaultRuntimeLibcallImpls_f80),
                     DefaultRuntimeLibcallImpls_ppcf128);
 
@@ -2130,5 +2135,5 @@ def isWasm : RuntimeLibcallPredicate<"TT.isWasm()">;
 def WasmSystemLibrary
     : SystemRuntimeLibrary<isWasm,
       (add DefaultRuntimeLibcallImpls, Int128RTLibcalls,
-           CompilerRTOnlyInt128Libcalls,
+           CompilerRTOnlyInt64Libcalls, __muloti4,
            emscripten_return_address)>;



More information about the llvm-commits mailing list