[PATCH] D89321: [MemLoc] Support memchr/memccpy in MemoryLocation::getForArgument
Florian Hahn via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Oct 21 02:35:53 PDT 2020
fhahn added inline comments.
================
Comment at: llvm/lib/Analysis/MemoryLocation.cpp:262
+ dyn_cast<ConstantInt>(Call->getArgOperand(3)))
+ return MemoryLocation(Arg, LocationSize::precise(LenCI->getZExtValue()),
+ AATags);
----------------
Thinking about this again, I am not sure if this is a good idea to do for the destination argument, because it gives the impression that exactly `LenCI` bytes are written, when this is not the case.
I think for reads the larger size is the conservative option and fine, but for writing it could mis-lead clients into thinking the call writes more bytes than it actually does, leading to potentially invalid optimizations.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D89321/new/
https://reviews.llvm.org/D89321
More information about the llvm-commits
mailing list