Skip to content

Commit

Permalink
[VPlan] Handle invariant GEPs in isUniformAfterVectorization.
Browse files Browse the repository at this point in the history
This fixes a crash caused by legal treating a scalable GEP as invariant,
but isUniformAfterVectorization does not handle GEPs.

Partially fixes #60831.

Reviewed By: Ayal

Differential Revision: https://reviews.llvm.org/D144434
  • Loading branch information
fhahn committed May 30, 2023
1 parent 8a6dada commit 1a28b9b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions llvm/lib/Transforms/Vectorize/VPlan.h
Expand Up @@ -2979,6 +2979,8 @@ inline bool isUniformAfterVectorization(VPValue *VPV) {
assert(Def && "Must have definition for value defined inside vector region");
if (auto Rep = dyn_cast<VPReplicateRecipe>(Def))
return Rep->isUniform();
if (auto *GEP = dyn_cast<VPWidenGEPRecipe>(Def))
return all_of(GEP->operands(), isUniformAfterVectorization);
return false;
}
} // end namespace vputils
Expand Down

0 comments on commit 1a28b9b

Please sign in to comment.