Skip to content

Commit 96da92e

Browse files
committed
[VPlan based] Patch comments, nfc
1 parent 32ebb11 commit 96da92e

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
@@ -8914,17 +8914,18 @@ VPlanPtr LoopVectorizationPlanner::tryToBuildVPlanWithVPRecipes(
89148914
// Adjust the recipes for any inloop reductions.
89158915
adjustRecipesForReductions(Plan, RecipeBuilder, Range.Start);
89168916

8917+
VPCostContext CostCtx(CM.TTI, *CM.TLI, Legal->getWidestInductionType(), CM,
8918+
CM.CostKind);
89178919
// Transform recipes to abstract recipes if it is legal and beneficial and
89188920
// clamp the range for better cost estimation.
89198921
// TODO: Enable following transform when the EVL-version of extended-reduction
89208922
// and mulacc-reduction are implemented.
8921-
VPCostContext CostCtx(CM.TTI, *CM.TLI, Legal->getWidestInductionType(), CM,
8922-
CM.CostKind);
89238923
if (!CM.foldTailWithEVL())
89248924
VPlanTransforms::runPass(VPlanTransforms::convertToAbstractRecipes, *Plan,
89258925
CostCtx, Range);
89268926

8927-
// !!! NEED COMMENT
8927+
// Convert reverse memory recipes to strided access recipes if the strided
8928+
// access is legal and profitable.
89288929
VPlanTransforms::runPass(VPlanTransforms::convertToStridedAccesses, *Plan,
89298930
CostCtx, Range);
89308931

llvm/lib/Transforms/Vectorize/VPlanTransforms.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,9 @@ struct VPlanTransforms {
175175
&InterleaveGroups,
176176
VPRecipeBuilder &RecipeBuilder, const bool &ScalarEpilogueAllowed);
177177

178-
// !!! NEED COMMENT
178+
/// Transform reverse memory recipes into strided access recipes when legal
179+
/// and profitable. Clamps \p Range to maintain consistency with widen
180+
/// decisions of \p Plan, and uses \p Ctx to evaluate the cost.
179181
static void convertToStridedAccesses(VPlan &Plan, VPCostContext &Ctx,
180182
VFRange &Range);
181183

0 commit comments

Comments
 (0)