[PATCH] D77538: [Alignment][NFC] Assume AlignmentFromAssumptions::getNewAlignment is always set.
Eli Friedman via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Apr 6 19:06:33 PDT 2020
efriedma added inline comments.
================
Comment at: llvm/lib/Transforms/Scalar/AlignmentFromAssumptions.cpp:329
- if (NewAlignment > LI->getAlignment()) {
- LI->setAlignment(MaybeAlign(NewAlignment));
+ if (NewAlignment > *LI->getAlign()) {
+ LI->setAlignment(NewAlignment);
----------------
Until D77454 lands, you have to use something like "DL.getValueOrABITypeAlignment(LI->getAlign(), LI->getType())", not "*LI->getAlign()". Similar for stores. Yes, it's sort of messy.
Not sure what MemIntrinsic does at the moment. I briefly tried to trace it, I think it crashes if the MemIntrinsic doesn't have an align attribute (which must be non-zero). So I guess that's fine, but we should probably fix the API.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D77538/new/
https://reviews.llvm.org/D77538
More information about the llvm-commits
mailing list