[PATCH] D133567: [AA] Improve the BasicAA analysis capability
Nikita Popov via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sun Sep 11 07:01:11 PDT 2022
nikic 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;
----------------
Please store the getTypeAllocSize() result in a variable and reuse it below. Also, the num operands checks is no longer needed.
================
Comment at: llvm/lib/Analysis/BasicAliasAnalysis.cpp:626
+ if (isa<ScalableVectorType>(GEPOp->getSourceElementType())) {
+ Decomposed.Base = V;
----------------
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.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D133567/new/
https://reviews.llvm.org/D133567
More information about the llvm-commits
mailing list