diff --git a/llvm/include/llvm/IR/RuntimeLibcalls.td b/llvm/include/llvm/IR/RuntimeLibcalls.td index cb81949d1324f..39cff4d32346f 100644 --- a/llvm/include/llvm/IR/RuntimeLibcalls.td +++ b/llvm/include/llvm/IR/RuntimeLibcalls.td @@ -459,7 +459,6 @@ def __multi3 : RuntimeLibcallImpl; def __mulosi4 : RuntimeLibcallImpl; def __mulodi4 : RuntimeLibcallImpl; -def __muloti4 : RuntimeLibcallImpl; def __divqi3 : RuntimeLibcallImpl; def __divhi3 : RuntimeLibcallImpl; @@ -935,6 +934,12 @@ def calloc : RuntimeLibcallImpl; } // End let IsDefault = true +//-------------------------------------------------------------------- +// compiler-rt, not available for most architectures +//-------------------------------------------------------------------- + +def __muloti4 : RuntimeLibcallImpl; + //-------------------------------------------------------------------- // Define implementation other libcalls //-------------------------------------------------------------------- @@ -1032,14 +1037,18 @@ defvar AllDefaultRuntimeLibcallImpls // Exist in libgcc and compiler-rt for 64-bit targets, or if // COMPILER_RT_ENABLE_SOFTWARE_INT128. defvar Int128RTLibcalls = [ - __ashlti3, __lshrti3, __ashrti3, __multi3, __mulodi4 + __ashlti3, __lshrti3, __ashrti3, __multi3 ]; // Only available in compiler-rt -defvar CompilerRTOnlyInt128Libcalls = [ +defvar CompilerRTOnlyInt64Libcalls = [ __mulodi4 ]; +defvar CompilerRTOnlyInt128Libcalls = [ + __muloti4 +]; + defvar DefaultRuntimeLibcallImpls_f80 = !filter(entry, AllDefaultRuntimeLibcallImpls, !match(!cast(entry.Provides), "F80")); @@ -1057,7 +1066,8 @@ defvar DefaultRuntimeLibcallImpls = !listremove( !listremove( !listremove(AllDefaultRuntimeLibcallImpls, Int128RTLibcalls), - CompilerRTOnlyInt128Libcalls), + !listconcat(CompilerRTOnlyInt64Libcalls, + CompilerRTOnlyInt128Libcalls)), DefaultRuntimeLibcallImpls_f80), DefaultRuntimeLibcallImpls_ppcf128); @@ -2143,5 +2153,5 @@ def isWasm : RuntimeLibcallPredicate<"TT.isWasm()">; def WasmSystemLibrary : SystemRuntimeLibrary; diff --git a/llvm/lib/IR/RuntimeLibcalls.cpp b/llvm/lib/IR/RuntimeLibcalls.cpp index 45c4bd12658a6..3dd894ad6c50e 100644 --- a/llvm/lib/IR/RuntimeLibcalls.cpp +++ b/llvm/lib/IR/RuntimeLibcalls.cpp @@ -250,8 +250,6 @@ void RuntimeLibcallsInfo::initLibcalls(const Triple &TT, setLibcallImpl(RTLIB::MUL_I128, RTLIB::Unsupported); setLibcallImpl(RTLIB::MULO_I64, RTLIB::Unsupported); } - - setLibcallImpl(RTLIB::MULO_I128, RTLIB::Unsupported); } if (TT.getArch() == Triple::ArchType::msp430) {