[PATCH] D71213: [Alignment][NFC] CreateMemSet use MaybeAlign
Guillaume Chatelet via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Dec 10 04:50:46 PST 2019
gchatelet marked 2 inline comments as done.
gchatelet added inline comments.
================
Comment at: llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp:2910
+ const Align Alignment =
+ assumeAligned(cast<ConstantInt>(I.getArgOperand(2))->getZExtValue());
Value *Mask = I.getArgOperand(3);
----------------
courbet wrote:
> how did you infer this ? I'm not sure I can prove that this is nonzero.
The argument can be `0` and in that case `assumeAligned` will turn it into `1`.
It's not a problem for `getShadowOriginPtr` which treats `0` as `1`.
It does change the generated IR for `CreateMaskedStore` which will have an alignment of `1` instead of `0`. But I believe this is treated the same way down the road by the CodeGen.
All tests are still passing.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D71213/new/
https://reviews.llvm.org/D71213
More information about the cfe-commits
mailing list