Skip to content

Commit 0eaa69e

Browse files
committed
[VPlan] Handle VPExpandSCEVRecipe in isUniformAfterVectorization.
VPExpandSCEVRecipes must be placed in the entry and are alway uniform. This fixes a crash by always identifying them as uniform, even if the main vector loop region has been removed. Fixes #121897.
1 parent 3b19e78 commit 0eaa69e

File tree

2 files changed

+541
-1
lines changed

2 files changed

+541
-1
lines changed

llvm/lib/Transforms/Vectorize/VPlanUtils.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@ inline bool isUniformAfterVectorization(const VPValue *VPV) {
4949
return all_of(GEP->operands(), isUniformAfterVectorization);
5050
if (auto *VPI = dyn_cast<VPInstruction>(Def))
5151
return VPI->isSingleScalar() || VPI->isVectorToScalar();
52-
return false;
52+
// VPExpandSCEVRecipes must be placed in the entry and are alway uniform.
53+
return isa<VPExpandSCEVRecipe>(Def);
5354
}
5455

5556
/// Return true if \p V is a header mask in \p Plan.

0 commit comments

Comments
 (0)