[PATCH] D133567: [AA] Improve the BasicAA analysis capability

Allen zhong via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Sep 11 19:02:14 PDT 2022


Allen marked 3 inline comments as done.
Allen added inline comments.


================
Comment at: llvm/lib/Analysis/BasicAliasAnalysis.cpp:615
+        if (DL.getTypeAllocSize(GTI.getIndexedType()).isScalable() &&
+            (I - GEPOp->op_begin() != GEPOp->getNumOperands() - 1)) {
+          Decomposed.Base = V;
----------------
nikic wrote:
> Please store the getTypeAllocSize() result in a variable and reuse it below. Also, the num operands checks is no longer needed.
Thanks for detail


================
Comment at: llvm/lib/Analysis/BasicAliasAnalysis.cpp:626
 
+      if (isa<ScalableVectorType>(GEPOp->getSourceElementType())) {
+        Decomposed.Base = V;
----------------
nikic wrote:
> Here again we should be checking the alloc size, not the source element type. It should be possible to support something like `getelementptr <vscale x 4 x i32>, ptr %p, i64 0, i64 %i`, where the variable is on a non-scalable index.
Yes, good catch, thanks very much


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

https://reviews.llvm.org/D133567



More information about the llvm-commits mailing list