[PATCH] D150515: [ConstantFold] use StoreSize for VectorType byte checking
Kohei Asano via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sun May 14 22:29:34 PDT 2023
khei4 added inline comments.
================
Comment at: llvm/lib/Analysis/ConstantFolding.cpp:513
EltTy = cast<FixedVectorType>(C->getType())->getElementType();
+ EltSize = DL.getTypeStoreSize(EltTy);
}
----------------
nikic wrote:
> This fix is correct, but incomplete: We should also add a `if (!DL.typeSizeEqualsStoreSize(EltTy)) return false;` here. For non-byte-sized vectors the memory layout is packed, while this code will assume that there is padding to the next byte boundary between elements.
Thank you for the review! I added bailout and TODO comment and test for that!
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D150515/new/
https://reviews.llvm.org/D150515
More information about the llvm-commits
mailing list