Skip to content

Commit c8f157e

Browse files
committed
[VPlan based] Patch comments, nfc
1 parent 5dea667 commit c8f157e

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
@@ -9200,17 +9200,18 @@ LoopVectorizationPlanner::tryToBuildVPlanWithVPRecipes(VFRange &Range,
92009200
// Adjust the recipes for any inloop reductions.
92019201
adjustRecipesForReductions(Plan, RecipeBuilder, Range.Start);
92029202

9203+
VPCostContext CostCtx(CM.TTI, *CM.TLI, Legal->getWidestInductionType(), CM,
9204+
CM.CostKind);
92039205
// Transform recipes to abstract recipes if it is legal and beneficial and
92049206
// clamp the range for better cost estimation.
92059207
// TODO: Enable following transform when the EVL-version of extended-reduction
92069208
// and mulacc-reduction are implemented.
9207-
VPCostContext CostCtx(CM.TTI, *CM.TLI, Legal->getWidestInductionType(), CM,
9208-
CM.CostKind);
92099209
if (!CM.foldTailWithEVL())
92109210
VPlanTransforms::runPass(VPlanTransforms::convertToAbstractRecipes, *Plan,
92119211
CostCtx, Range);
92129212

9213-
// !!! NEED COMMENT
9213+
// Convert reverse memory recipes to strided access recipes if the strided
9214+
// access is legal and profitable.
92149215
VPlanTransforms::runPass(VPlanTransforms::convertToStridedAccesses, *Plan,
92159216
CostCtx, Range);
92169217

llvm/lib/Transforms/Vectorize/VPlanTransforms.h

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

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

0 commit comments

Comments
 (0)