Skip to content

Commit cf41972

Browse files
committed
Break up into two separate asserts, update comment
1 parent 4613265 commit cf41972

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2177,19 +2177,21 @@ static void transformRecipestoEVLRecipes(VPlan &Plan, VPValue &EVL) {
21772177
assert(all_of(Plan.getVF().users(),
21782178
IsaPred<VPVectorEndPointerRecipe, VPScalarIVStepsRecipe,
21792179
VPWidenIntOrFpInductionRecipe>) &&
2180-
all_of(Plan.getVFxUF().users(),
2180+
"User of VF that we can't transform to EVL.");
2181+
Plan.getVF().replaceAllUsesWith(&EVL);
2182+
2183+
assert(all_of(Plan.getVFxUF().users(),
21812184
[&Plan](VPUser *U) {
2182-
// VFxUF users must either be VPWidenPointerInductionRecipe or
2183-
// canonical IV increment.
21842185
return match(U, m_c_Binary<Instruction::Add>(
21852186
m_Specific(Plan.getCanonicalIV()),
21862187
m_Specific(&Plan.getVFxUF()))) ||
21872188
isa<VPWidenPointerInductionRecipe>(U);
21882189
}) &&
2189-
"User of VF that we can't transform to EVL.");
2190-
Plan.getVF().replaceAllUsesWith(&EVL);
2190+
"Only users of VFxUF should be VPWidenPointerInductionRecipe and the "
2191+
"increment of the canonical induction.");
21912192
Plan.getVFxUF().replaceUsesWithIf(&EVL, [](VPUser &U, unsigned Idx) {
2192-
// Don't replace the canonical IV increment.
2193+
// Only replace uses in VPWidenPointerInductionRecipe; The increment of the
2194+
// canonical induction must not be updated.
21932195
return isa<VPWidenPointerInductionRecipe>(U);
21942196
});
21952197

0 commit comments

Comments
 (0)