[PATCH] D129224: [InstCombine] Fold strtoul and strtoull and avoid PR #56293
Nikita Popov via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Jul 8 05:22:20 PDT 2022
nikic added inline comments.
================
Comment at: llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp:2591
Value *LibCallSimplifier::optimizeAtoi(CallInst *CI, IRBuilderBase &B) {
+ CI->addParamAttr(0, Attribute::NoCapture);
+
----------------
msebor wrote:
> xbolva00 wrote:
> > This should go to BuildLibcalls as it is added unconditionally
> Where in `BuildCalls` would you suggest to add it?
>
> For what it's worth, `llvm::inferNonMandatoryLibFuncAttrs` already handles `LibFunc_atoi` but it's not invoked for calls to the function already in the source. (I was under the impression is that `BuildCalls` is used when library call is being synthesized by the middle end, but I have very little experience in this area.)
inferNonMandatoryLibFuncAttrs() is called for existing function declarations. The attribute is placed on the called function, not on the call.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D129224/new/
https://reviews.llvm.org/D129224
More information about the llvm-commits
mailing list