[PATCH] D141836: [AArch64] Disable __muloti4 libcalls for AArch64
Eli Friedman via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Jan 25 14:55:49 PST 2023
efriedma added a comment.
I think there just isn't any good way forward that imposes demands on the "system" libgcc/compiler-rt. Adding or modifying APIs to libgcc/compiler-rt simply isn't practical given that programs are linked using implementations distributed independent from the compiler. Even if we convince the gcc developers to add __muloti4, it'll be years before it actually ships in Linux distributions. There are bunch of APIs we'd want if it were straightforward to add new ones; not just mul-with-overflow, but also saturating float-to-int, clz with zero defined, memory functions optimized for small sizes, outlined prologue/epilogue sequences, existing functions with optimized ABI, math functions that don't mess with errno, etc.
Long-term, I think the only practical way forward is to teach LLVM to embed the definitions of helper functions such as "mul-with-overflow" as weak symbols into the files that use them, so we can just assume they're always available.
I don't have a strong opinion on whether the current patch is the right way forward short-term. Maybe restrict the change to glibc/musl targets, though, since we generally use compiler-rt on other aarch64 targets (and it's included __muloti4 for ages).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D141836/new/
https://reviews.llvm.org/D141836
More information about the llvm-commits
mailing list