[llvm] [InstCombine] Handle scalable geps in EmitGEPOffset (PR #71565)
Philip Reames via llvm-commits
llvm-commits at lists.llvm.org
Wed Nov 8 16:36:12 PST 2023
================
@@ -45,7 +45,8 @@ Value *llvm::emitGEPOffset(IRBuilderBase *Builder, const DataLayout &DL,
for (User::op_iterator i = GEP->op_begin() + 1, e = GEP->op_end(); i != e;
++i, ++GTI) {
Value *Op = *i;
- uint64_t Size = DL.getTypeAllocSize(GTI.getIndexedType()) & PtrSizeMask;
+ TypeSize TSize = DL.getTypeAllocSize(GTI.getIndexedType());
+ uint64_t Size = TSize.getKnownMinValue() & PtrSizeMask;
----------------
preames wrote:
I'm not entirely clear on the role of PtrSizeMask, but it seems odd to be applying this to the known min value for a scalable vector and not the full dynamic type size. Doesn't seem to match the fixed vector semantics.
https://github.com/llvm/llvm-project/pull/71565
More information about the llvm-commits
mailing list