@@ -1265,8 +1265,8 @@ class VPWidenRecipe : public VPRecipeWithIRFlags, public VPIRMetadata {
12651265 Opcode (I.getOpcode()) {}
12661266
12671267 template <typename IterT>
1268- VPWidenRecipe (unsigned VPDefOpcode, unsigned Opcode,
1269- iterator_range<IterT> Operands, bool NUW, bool NSW, DebugLoc DL)
1268+ VPWidenRecipe (unsigned VPDefOpcode, unsigned Opcode, ArrayRef<IterT> Operands,
1269+ bool NUW, bool NSW, DebugLoc DL)
12701270 : VPRecipeWithIRFlags(VPDefOpcode, Operands, WrapFlagsTy(NUW, NSW), DL),
12711271 Opcode(Opcode) {}
12721272
@@ -1275,8 +1275,8 @@ class VPWidenRecipe : public VPRecipeWithIRFlags, public VPIRMetadata {
12751275 : VPWidenRecipe(VPDef::VPWidenSC, I, Operands) {}
12761276
12771277 template <typename IterT>
1278- VPWidenRecipe (unsigned Opcode, iterator_range <IterT> Operands, bool NUW,
1279- bool NSW, DebugLoc DL)
1278+ VPWidenRecipe (unsigned Opcode, ArrayRef <IterT> Operands, bool NUW, bool NSW ,
1279+ DebugLoc DL)
12801280 : VPWidenRecipe(VPDef::VPWidenSC, Opcode, Operands, NUW, NSW, DL) {}
12811281
12821282 ~VPWidenRecipe () override = default ;
@@ -2558,9 +2558,10 @@ class VPReductionEVLRecipe : public VPReductionRecipe {
25582558// / concrete recipes before codegen. The operands are {ChainOp, VecOp,
25592559// / [Condition]}.
25602560class VPExtendedReductionRecipe : public VPReductionRecipe {
2561- // / Opcode of the extend recipe will be lowered to .
2561+ // / Opcode of the extend for VecOp .
25622562 Instruction::CastOps ExtOp;
25632563
2564+ // / The scalar type after extending.
25642565 Type *ResultTy;
25652566
25662567 // / For cloning VPExtendedReductionRecipe.
@@ -2581,10 +2582,8 @@ class VPExtendedReductionRecipe : public VPReductionRecipe {
25812582 ExtOp(Ext->getOpcode ()), ResultTy(Ext->getResultType ()) {
25822583 assert ((ExtOp == Instruction::CastOps::ZExt ||
25832584 ExtOp == Instruction::CastOps::SExt) &&
2584- " VPExtendedReductionRecipe only support zext and sext." );
2585+ " VPExtendedReductionRecipe only supports zext and sext." );
25852586
2586- // Not all WidenCastRecipes contain nneg flag. Need to transfer flags from
2587- // the original recipe to prevent setting wrong flags.
25882587 transferFlags (*Ext);
25892588 setUnderlyingValue (R->getUnderlyingValue ());
25902589 }
@@ -2614,7 +2613,7 @@ class VPExtendedReductionRecipe : public VPReductionRecipe {
26142613 // / Is the extend ZExt?
26152614 bool isZExt () const { return getExtOpcode () == Instruction::ZExt; }
26162615
2617- // / The opcode of extend recipe .
2616+ // / Get the opcode of the extend for VecOp .
26182617 Instruction::CastOps getExtOpcode () const { return ExtOp; }
26192618};
26202619
@@ -2624,12 +2623,13 @@ class VPExtendedReductionRecipe : public VPReductionRecipe {
26242623// / recipe is abstract and needs to be lowered to concrete recipes before
26252624// / codegen. The operands are {ChainOp, VecOp1, VecOp2, [Condition]}.
26262625class VPMulAccumulateReductionRecipe : public VPReductionRecipe {
2627- // / Opcode of the extend recipe .
2626+ // / Opcode of the extend for VecOp1 and VecOp2 .
26282627 Instruction::CastOps ExtOp;
26292628
26302629 // / Non-neg flag of the extend recipe.
26312630 bool IsNonNeg = false ;
26322631
2632+ // / The scalar type after extending.
26332633 Type *ResultTy;
26342634
26352635 // / For cloning VPMulAccumulateReductionRecipe.
@@ -2660,7 +2660,7 @@ class VPMulAccumulateReductionRecipe : public VPReductionRecipe {
26602660 " be Add" );
26612661 assert ((ExtOp == Instruction::CastOps::ZExt ||
26622662 ExtOp == Instruction::CastOps::SExt) &&
2663- " VPMulAccumulateReductionRecipe only support zext and sext." );
2663+ " VPMulAccumulateReductionRecipe only supports zext and sext." );
26642664 setUnderlyingValue (R->getUnderlyingValue ());
26652665 // Only set the non-negative flag if the original recipe contains.
26662666 if (Ext0->hasNonNegFlag ())
@@ -2706,24 +2706,26 @@ class VPMulAccumulateReductionRecipe : public VPReductionRecipe {
27062706
27072707 Type *getResultType () const {
27082708 assert (isExtended () && " Only support getResultType when this recipe "
2709- " contains implicit extend." );
2709+ " is implicitly extend." );
27102710 return ResultTy;
27112711 }
27122712
2713- // / The VPValue of the vector value to be extended and reduced.
2713+ // / The first vector value to be extended and reduced.
27142714 VPValue *getVecOp0 () const { return getOperand (1 ); }
2715+
2716+ // / The second vector value to be extended and reduced.
27152717 VPValue *getVecOp1 () const { return getOperand (2 ); }
27162718
2717- // / Return if this MulAcc recipe contains extended operands.
2719+ // / Return true if this recipe contains extended operands.
27182720 bool isExtended () const { return ExtOp != Instruction::CastOps::CastOpsEnd; }
27192721
27202722 // / Return the opcode of the extends for the operands.
27212723 Instruction::CastOps getExtOpcode () const { return ExtOp; }
27222724
2723- // / Return if the operands are zero extended.
2725+ // / Return if the operands are zero- extended.
27242726 bool isZExt () const { return ExtOp == Instruction::CastOps::ZExt; }
27252727
2726- // / Return the non negative flag of the ext recipe .
2728+ // / Return true if the operand extends have the non-negative flag .
27272729 bool isNonNeg () const { return IsNonNeg; }
27282730};
27292731
0 commit comments