@@ -1311,8 +1311,8 @@ class VPWidenRecipe : public VPRecipeWithIRFlags, public VPIRMetadata {
13111311 Opcode (I.getOpcode()) {}
13121312
13131313 template <typename IterT>
1314- VPWidenRecipe (unsigned VPDefOpcode, unsigned Opcode,
1315- iterator_range<IterT> Operands, bool NUW, bool NSW, DebugLoc DL)
1314+ VPWidenRecipe (unsigned VPDefOpcode, unsigned Opcode, ArrayRef<IterT> Operands,
1315+ bool NUW, bool NSW, DebugLoc DL)
13161316 : VPRecipeWithIRFlags(VPDefOpcode, Operands, WrapFlagsTy(NUW, NSW), DL),
13171317 Opcode(Opcode) {}
13181318
@@ -1321,8 +1321,8 @@ class VPWidenRecipe : public VPRecipeWithIRFlags, public VPIRMetadata {
13211321 : VPWidenRecipe(VPDef::VPWidenSC, I, Operands) {}
13221322
13231323 template <typename IterT>
1324- VPWidenRecipe (unsigned Opcode, iterator_range <IterT> Operands, bool NUW,
1325- bool NSW, DebugLoc DL)
1324+ VPWidenRecipe (unsigned Opcode, ArrayRef <IterT> Operands, bool NUW, bool NSW ,
1325+ DebugLoc DL)
13261326 : VPWidenRecipe(VPDef::VPWidenSC, Opcode, Operands, NUW, NSW, DL) {}
13271327
13281328 ~VPWidenRecipe () override = default ;
@@ -2614,9 +2614,10 @@ class VPReductionEVLRecipe : public VPReductionRecipe {
26142614// / concrete recipes before codegen. The operands are {ChainOp, VecOp,
26152615// / [Condition]}.
26162616class VPExtendedReductionRecipe : public VPReductionRecipe {
2617- // / Opcode of the extend recipe will be lowered to .
2617+ // / Opcode of the extend for VecOp .
26182618 Instruction::CastOps ExtOp;
26192619
2620+ // / The scalar type after extending.
26202621 Type *ResultTy;
26212622
26222623 // / For cloning VPExtendedReductionRecipe.
@@ -2637,10 +2638,8 @@ class VPExtendedReductionRecipe : public VPReductionRecipe {
26372638 ExtOp(Ext->getOpcode ()), ResultTy(Ext->getResultType ()) {
26382639 assert ((ExtOp == Instruction::CastOps::ZExt ||
26392640 ExtOp == Instruction::CastOps::SExt) &&
2640- " VPExtendedReductionRecipe only support zext and sext." );
2641+ " VPExtendedReductionRecipe only supports zext and sext." );
26412642
2642- // Not all WidenCastRecipes contain nneg flag. Need to transfer flags from
2643- // the original recipe to prevent setting wrong flags.
26442643 transferFlags (*Ext);
26452644 setUnderlyingValue (R->getUnderlyingValue ());
26462645 }
@@ -2670,7 +2669,7 @@ class VPExtendedReductionRecipe : public VPReductionRecipe {
26702669 // / Is the extend ZExt?
26712670 bool isZExt () const { return getExtOpcode () == Instruction::ZExt; }
26722671
2673- // / The opcode of extend recipe .
2672+ // / Get the opcode of the extend for VecOp .
26742673 Instruction::CastOps getExtOpcode () const { return ExtOp; }
26752674};
26762675
@@ -2680,12 +2679,13 @@ class VPExtendedReductionRecipe : public VPReductionRecipe {
26802679// / recipe is abstract and needs to be lowered to concrete recipes before
26812680// / codegen. The operands are {ChainOp, VecOp1, VecOp2, [Condition]}.
26822681class VPMulAccumulateReductionRecipe : public VPReductionRecipe {
2683- // / Opcode of the extend recipe .
2682+ // / Opcode of the extend for VecOp1 and VecOp2 .
26842683 Instruction::CastOps ExtOp;
26852684
26862685 // / Non-neg flag of the extend recipe.
26872686 bool IsNonNeg = false ;
26882687
2688+ // / The scalar type after extending.
26892689 Type *ResultTy;
26902690
26912691 // / For cloning VPMulAccumulateReductionRecipe.
@@ -2716,7 +2716,7 @@ class VPMulAccumulateReductionRecipe : public VPReductionRecipe {
27162716 " be Add" );
27172717 assert ((ExtOp == Instruction::CastOps::ZExt ||
27182718 ExtOp == Instruction::CastOps::SExt) &&
2719- " VPMulAccumulateReductionRecipe only support zext and sext." );
2719+ " VPMulAccumulateReductionRecipe only supports zext and sext." );
27202720 setUnderlyingValue (R->getUnderlyingValue ());
27212721 // Only set the non-negative flag if the original recipe contains.
27222722 if (Ext0->hasNonNegFlag ())
@@ -2762,24 +2762,26 @@ class VPMulAccumulateReductionRecipe : public VPReductionRecipe {
27622762
27632763 Type *getResultType () const {
27642764 assert (isExtended () && " Only support getResultType when this recipe "
2765- " contains implicit extend." );
2765+ " is implicitly extend." );
27662766 return ResultTy;
27672767 }
27682768
2769- // / The VPValue of the vector value to be extended and reduced.
2769+ // / The first vector value to be extended and reduced.
27702770 VPValue *getVecOp0 () const { return getOperand (1 ); }
2771+
2772+ // / The second vector value to be extended and reduced.
27712773 VPValue *getVecOp1 () const { return getOperand (2 ); }
27722774
2773- // / Return if this MulAcc recipe contains extended operands.
2775+ // / Return true if this recipe contains extended operands.
27742776 bool isExtended () const { return ExtOp != Instruction::CastOps::CastOpsEnd; }
27752777
27762778 // / Return the opcode of the extends for the operands.
27772779 Instruction::CastOps getExtOpcode () const { return ExtOp; }
27782780
2779- // / Return if the operands are zero extended.
2781+ // / Return if the operands are zero- extended.
27802782 bool isZExt () const { return ExtOp == Instruction::CastOps::ZExt; }
27812783
2782- // / Return the non negative flag of the ext recipe .
2784+ // / Return true if the operand extends have the non-negative flag .
27832785 bool isNonNeg () const { return IsNonNeg; }
27842786};
27852787
0 commit comments