Skip to content

RuntimeLibcalls: Remove __muloti4 from default libcall set #148562

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 15 additions & 5 deletions llvm/include/llvm/IR/RuntimeLibcalls.td
Original file line number Diff line number Diff line change
Expand Up @@ -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>;
Expand Down Expand Up @@ -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
//--------------------------------------------------------------------
Expand Down Expand Up @@ -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 = [
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why the rename? This libcall works on 128 bit integers.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's for MULO_I64

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, duh. Shouldn't it get dropped from the Int128RTLibcalls list directly above?

__mulodi4
];

defvar CompilerRTOnlyInt128Libcalls = [
__muloti4
];

defvar DefaultRuntimeLibcallImpls_f80 =
!filter(entry, AllDefaultRuntimeLibcallImpls,
!match(!cast<string>(entry.Provides), "F80"));
Expand All @@ -1057,7 +1066,8 @@ defvar DefaultRuntimeLibcallImpls =
!listremove(
!listremove(
!listremove(AllDefaultRuntimeLibcallImpls, Int128RTLibcalls),
CompilerRTOnlyInt128Libcalls),
!listconcat(CompilerRTOnlyInt64Libcalls,
CompilerRTOnlyInt128Libcalls)),
DefaultRuntimeLibcallImpls_f80),
DefaultRuntimeLibcallImpls_ppcf128);

Expand Down Expand Up @@ -2143,5 +2153,5 @@ def isWasm : RuntimeLibcallPredicate<"TT.isWasm()">;
def WasmSystemLibrary
: SystemRuntimeLibrary<isWasm,
(add DefaultRuntimeLibcallImpls, Int128RTLibcalls,
CompilerRTOnlyInt128Libcalls,
CompilerRTOnlyInt64Libcalls, CompilerRTOnlyInt128Libcalls,
emscripten_return_address)>;
2 changes: 0 additions & 2 deletions llvm/lib/IR/RuntimeLibcalls.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
Loading