Skip to content

Commit 18ca551

Browse files
committed
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.
1 parent e088334 commit 18ca551

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

llvm/include/llvm/IR/RuntimeLibcalls.td

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -459,7 +459,6 @@ def __multi3 : RuntimeLibcallImpl<MUL_I128>;
459459

460460
def __mulosi4 : RuntimeLibcallImpl<MULO_I32>;
461461
def __mulodi4 : RuntimeLibcallImpl<MULO_I64>;
462-
def __muloti4 : RuntimeLibcallImpl<MULO_I128>;
463462

464463
def __divqi3 : RuntimeLibcallImpl<SDIV_I8>;
465464
def __divhi3 : RuntimeLibcallImpl<SDIV_I16>;
@@ -935,6 +934,12 @@ def calloc : RuntimeLibcallImpl<CALLOC>;
935934

936935
} // End let IsDefault = true
937936

937+
//--------------------------------------------------------------------
938+
// compiler-rt, not available for most architectures
939+
//--------------------------------------------------------------------
940+
941+
def __muloti4 : RuntimeLibcallImpl<MULO_I128>;
942+
938943
//--------------------------------------------------------------------
939944
// Define implementation other libcalls
940945
//--------------------------------------------------------------------
@@ -1036,7 +1041,7 @@ defvar Int128RTLibcalls = [
10361041
];
10371042

10381043
// Only available in compiler-rt
1039-
defvar CompilerRTOnlyInt128Libcalls = [
1044+
defvar CompilerRTOnlyInt64Libcalls = [
10401045
__mulodi4
10411046
];
10421047

@@ -1057,7 +1062,7 @@ defvar DefaultRuntimeLibcallImpls =
10571062
!listremove(
10581063
!listremove(
10591064
!listremove(AllDefaultRuntimeLibcallImpls, Int128RTLibcalls),
1060-
CompilerRTOnlyInt128Libcalls),
1065+
CompilerRTOnlyInt64Libcalls),
10611066
DefaultRuntimeLibcallImpls_f80),
10621067
DefaultRuntimeLibcallImpls_ppcf128);
10631068

@@ -2130,5 +2135,5 @@ def isWasm : RuntimeLibcallPredicate<"TT.isWasm()">;
21302135
def WasmSystemLibrary
21312136
: SystemRuntimeLibrary<isWasm,
21322137
(add DefaultRuntimeLibcallImpls, Int128RTLibcalls,
2133-
CompilerRTOnlyInt128Libcalls,
2138+
CompilerRTOnlyInt64Libcalls, __muloti4,
21342139
emscripten_return_address)>;

llvm/lib/IR/RuntimeLibcalls.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -250,8 +250,6 @@ void RuntimeLibcallsInfo::initLibcalls(const Triple &TT,
250250
setLibcallImpl(RTLIB::MUL_I128, RTLIB::Unsupported);
251251
setLibcallImpl(RTLIB::MULO_I64, RTLIB::Unsupported);
252252
}
253-
254-
setLibcallImpl(RTLIB::MULO_I128, RTLIB::Unsupported);
255253
}
256254

257255
if (TT.getArch() == Triple::ArchType::msp430) {

0 commit comments

Comments
 (0)