[PATCH] D76464: [ValueTracking][SVE] Fix getOffsetFromIndex for scalable vector.

Huihui Zhang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 20 10:17:18 PDT 2020


huihuiz added inline comments.


================
Comment at: llvm/lib/Analysis/ValueTracking.cpp:6157
     // the index by the ElementSize.
-    uint64_t Size = DL.getTypeAllocSize(GTI.getIndexedType());
+    uint64_t Size = DL.getTypeAllocSize(GTI.getIndexedType()).getFixedSize();
     Offset += Size * OpC->getSExtValue();
----------------
efriedma wrote:
> If we're calling getTypeAllocSize anyway, can we just check whether it returns a scalable TypeSize?
Thanks Eli for the feedback! Yes, that sounds better.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D76464





More information about the llvm-commits mailing list