[PATCH] D100875: [SimplifyLibCalls] Don't change alignment when creating memset
Stefan Stipanovic via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Apr 21 11:02:09 PDT 2021
sstefan1 added a comment.
In D100875#2705331 <https://reviews.llvm.org/D100875#2705331>, @xbolva00 wrote:
> Looks ok as a fix. I am just wondering if some other places should be checked as well.
Good question. I've just checked and this is the only place to call `addParamAttributes()` which has the assertion. Other places just set attributes.
================
Comment at: llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp:604
// strncpy(x, s, c) -> memcpy(align 1 x, align 1 s, c) [s and c are constant]
CallInst *NewCI = B.CreateMemCpy(Dst, Align(1), Src, Align(1),
ConstantInt::get(DL.getIntPtrType(PT), Len));
----------------
xbolva00 wrote:
> Could we expect same problem here in the future?
No, as long as `addParamAttributes()` is not called bellow.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D100875/new/
https://reviews.llvm.org/D100875
More information about the llvm-commits
mailing list