[PATCH] D140229: [SeparateConstOffsetFromGEP] Remove TypeSize error when collecting constant indices.

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 16 14:12:34 PST 2022


arsenm added inline comments.


================
Comment at: llvm/lib/Transforms/Scalar/SeparateConstOffsetFromGEP.cpp:1015
+      // Constant offsets of scalable types are not really constant.
+      if (DL->getTypeAllocSize(GTI.getIndexedType()).isScalable())
+        continue;
----------------
paulwalker-arm wrote:
> arsenm wrote:
> > arsenm wrote:
> > > Is there not a way to directly check isScalable on the type without going through getTypeAllocSize?
> > Looks like we're missing isScalableVectorTy, it should be there
> I guess I was trying to be future proof.  However, currently scalable vectors cannot be in arrays and struct support is purely in register and thus cannot be indexed via getelementptr.
> 
> If this changes then the same TypeSize error will be triggered as was the case for the scenario this patch fixes.
I don't see how that could change. Even then there should be a predicate for that. I'd prefer to stick to a direct type check


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D140229/new/

https://reviews.llvm.org/D140229



More information about the llvm-commits mailing list