[PATCH] D91677: Avoid simplification of library functions when callee has an implementation
Siddhesh Poyarekar via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Nov 18 09:21:34 PST 2020
siddhesh added inline comments.
================
Comment at: llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp:3023-3027
// TODO: Split out the code below that operates on FP calls so that
// we can all non-FP calls with the StrictFP attribute to be
// optimized.
if (CI->isNoBuiltin())
return nullptr;
----------------
lebedev.ri wrote:
> Isn't the problem that you need to mark your `@bcopy` with `nobuiltin` attribute?
`nobuiltin` is clang-specific and to make this effective, all inline versions of bcopy would have to be marked `nobuiltin`. There's no precedence for that in glibc, I'm not sure about other libraries.
================
Comment at: llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp:3076-3079
+ // Simplification is for external library calls, so bail out if the callee
+ // has an implementation.
+ if (!Callee->empty())
+ return nullptr;
----------------
lebedev.ri wrote:
> And if it happens to be in another TU?
It does the simplification; it is not relevant for fortify-source since those implementations are always inline.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D91677/new/
https://reviews.llvm.org/D91677
More information about the llvm-commits
mailing list