Skip to content

Commit 71c7401

Browse files
committed
!fixup, address comments.
1 parent fd539f8 commit 71c7401

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

llvm/lib/Transforms/Vectorize/VPlan.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2512,7 +2512,7 @@ class VPReductionEVLRecipe : public VPReductionRecipe {
25122512
/// A recipe to represent inloop extended reduction operations, performing a
25132513
/// reduction on a extended vector operand into a scalar value, and adding the
25142514
/// result to a chain. This recipe is abstract and needs to be lowered to
2515-
/// concrete recipes before codegen. The Operands are {ChainOp, VecOp,
2515+
/// concrete recipes before codegen. The operands are {ChainOp, VecOp,
25162516
/// [Condition]}.
25172517
class VPExtendedReductionRecipe : public VPReductionRecipe {
25182518
/// Opcode of the extend recipe will be lowered to.

llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2642,7 +2642,7 @@ tryToMatchAndCreateExtendedReduction(VPReductionRecipe *Red, VPCostContext &Ctx,
26422642
Type *RedTy = Ctx.Types.inferScalarType(Red);
26432643
VPValue *VecOp = Red->getVecOp();
26442644

2645-
// Test if using extended-reduction is profitable and clamp the range.
2645+
// Clamp the range if using extended-reduction is profitable.
26462646
auto IsExtendedRedValidAndClampRange = [&](unsigned Opcode, bool isZExt,
26472647
Type *SrcTy) -> bool {
26482648
return LoopVectorizationPlanner::getDecisionAndClampRange(
@@ -2687,8 +2687,7 @@ tryToMatchAndCreateMulAccumulateReduction(VPReductionRecipe *Red,
26872687

26882688
Type *RedTy = Ctx.Types.inferScalarType(Red);
26892689

2690-
// Test if using mulutiply-accumulate-reduction is beneficial and clamp the
2691-
// range.
2690+
// Clamp the range if using multiply-accumulate-reduction is profitable.
26922691
auto IsMulAccValidAndClampRange =
26932692
[&](bool isZExt, VPWidenRecipe *Mul, VPWidenCastRecipe *Ext0,
26942693
VPWidenCastRecipe *Ext1, VPWidenCastRecipe *OuterExt) -> bool {
@@ -2766,7 +2765,7 @@ tryToMatchAndCreateMulAccumulateReduction(VPReductionRecipe *Red,
27662765
return nullptr;
27672766
}
27682767

2769-
/// This function try to create abstract recipes from reduction recipe for
2768+
/// This function tries to create abstract recipes from the reduction recipe for
27702769
/// following optimizations and cost estimation.
27712770
static void tryToCreateAbstractReductionRecipe(VPReductionRecipe *Red,
27722771
VPCostContext &Ctx,
@@ -2789,7 +2788,7 @@ void VPlanTransforms::convertToAbstractRecipes(VPlan &Plan, VPCostContext &Ctx,
27892788
VFRange &Range) {
27902789
for (VPBasicBlock *VPBB : VPBlockUtils::blocksOnly<VPBasicBlock>(
27912790
vp_depth_first_deep(Plan.getVectorLoopRegion()))) {
2792-
for (VPRecipeBase &R : make_early_inc_range(*VPBB)) {
2791+
for (VPRecipeBase &R : *VPBB) {
27932792
if (auto *Red = dyn_cast<VPReductionRecipe>(&R))
27942793
tryToCreateAbstractReductionRecipe(Red, Ctx, Range);
27952794
}

llvm/lib/Transforms/Vectorize/VPlanTransforms.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ struct VPlanTransforms {
185185
/// This function converts initial recipes to the abstract recipes and clamps
186186
/// \p Range based on cost model for following optimizations and cost
187187
/// estimations. The converted abstract recipes will lower to concrete
188-
/// recipies before codegen.
188+
/// recipes before codegen.
189189
static void convertToAbstractRecipes(VPlan &Plan, VPCostContext &Ctx,
190190
VFRange &Range);
191191

0 commit comments

Comments
 (0)