[PATCH] D89872: [SVE][AArch64] Fix TypeSize warning in GEP cost analysis

Francesco Petrogalli via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 22 00:53:51 PDT 2020


fpetrogalli accepted this revision.
fpetrogalli added inline comments.
This revision is now accepted and ready to land.


================
Comment at: llvm/include/llvm/Analysis/TargetTransformInfoImpl.h:785
     bool HasBaseReg = (BaseGV == nullptr);
 
     auto PtrSizeBits = DL.getPointerTypeSizeInBits(Ptr->getType());
----------------
sdesmalen wrote:
> If any of the indices is a scalable vector, then the result type will also be a scalable vector. So you can bail out at the start of the function.
My suggestion was to bail out in the place where the different types where handled, and where computation of the offset was done (the `else` after `if (StructType)`), so that we would have known where to start modifying the code for making `BaseOffset`  able to support scalable vectors. I have accepted the patch, but feel free to follow Sander's suggestion if you prefer this early exit (which was your original code too IIRC!).




================
Comment at: llvm/include/llvm/Analysis/TargetTransformInfoImpl.h:813
+        // If this operand is a scalable type, bail out early.
+        // TODO: handle scalable vectors
+        if (isa<ScalableVectorType>(TargetType))
----------------
Nit: `... scalable vectors.`


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D89872



More information about the llvm-commits mailing list