Skip to content

Commit 4d0301a

Browse files
committed
[VPlan based] Patch comments, nfc
1 parent 95a890b commit 4d0301a

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

llvm/lib/Transforms/Vectorize/LoopVectorize.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9406,17 +9406,18 @@ LoopVectorizationPlanner::tryToBuildVPlanWithVPRecipes(VFRange &Range,
94069406
// Adjust the recipes for any inloop reductions.
94079407
adjustRecipesForReductions(Plan, RecipeBuilder, Range.Start);
94089408

9409+
VPCostContext CostCtx(CM.TTI, *CM.TLI, Legal->getWidestInductionType(), CM,
9410+
CM.CostKind);
94099411
// Transform recipes to abstract recipes if it is legal and beneficial and
94109412
// clamp the range for better cost estimation.
94119413
// TODO: Enable following transform when the EVL-version of extended-reduction
94129414
// and mulacc-reduction are implemented.
9413-
VPCostContext CostCtx(CM.TTI, *CM.TLI, Legal->getWidestInductionType(), CM,
9414-
CM.CostKind);
94159415
if (!CM.foldTailWithEVL())
94169416
VPlanTransforms::runPass(VPlanTransforms::convertToAbstractRecipes, *Plan,
94179417
CostCtx, Range);
94189418

9419-
// !!! NEED COMMENT
9419+
// Convert reverse memory recipes to strided access recipes if the strided
9420+
// access is legal and profitable.
94209421
VPlanTransforms::runPass(VPlanTransforms::convertToStridedAccesses, *Plan,
94219422
CostCtx, Range);
94229423

llvm/lib/Transforms/Vectorize/VPlanTransforms.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,9 @@ struct VPlanTransforms {
171171
&InterleaveGroups,
172172
VPRecipeBuilder &RecipeBuilder, const bool &ScalarEpilogueAllowed);
173173

174-
// !!! NEED COMMENT
174+
/// Transform reverse memory recipes into strided access recipes when legal
175+
/// and profitable. Clamps \p Range to maintain consistency with widen
176+
/// decisions of \p Plan, and uses \p Ctx to evaluate the cost.
175177
static void convertToStridedAccesses(VPlan &Plan, VPCostContext &Ctx,
176178
VFRange &Range);
177179

0 commit comments

Comments
 (0)