[PATCH] D131521: [SDAG] avoid generating libcall in function with nobuiltin
Nick Desaulniers via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Aug 10 15:07:09 PDT 2022
nickdesaulniers added a comment.
In D131521#3714285 <https://reviews.llvm.org/D131521#3714285>, @nickdesaulniers wrote:
> I don't think we have an equivalent fn attr or mdnode for `--rtlib=none` in IR. If we did, and it was explicitly set, then we can't assume functions like `__muloti4` will be available to link against.
Further, a libc like musl might compile with `-ffreestanding` to avoid the compiler creating inf loops in the implementations of these runtime-provided function definitions, just like the test case in this bug. They would mis out on other potential libcall optimizations the compiler could find that don't result in inf loops, but I think musl also wants individual definitions to not have cross TU dependencies, which makes picking and choosing a subset of the runtime to ship more feasible.
So if someone defined `__muloti4` (as this test case does, as we do in compiler-rt) I'd imagine they'd run into a similar problem (as demonstrated by this test case) and would require a similar solution. I wonder how we build compiler-rt to avoid this dilemma?
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D131521/new/
https://reviews.llvm.org/D131521
More information about the llvm-commits
mailing list