@@ -1265,8 +1265,8 @@ class VPWidenRecipe : public VPRecipeWithIRFlags, public VPIRMetadata {
1265
1265
Opcode (I.getOpcode()) {}
1266
1266
1267
1267
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)
1270
1270
: VPRecipeWithIRFlags(VPDefOpcode, Operands, WrapFlagsTy(NUW, NSW), DL),
1271
1271
Opcode(Opcode) {}
1272
1272
@@ -1275,8 +1275,8 @@ class VPWidenRecipe : public VPRecipeWithIRFlags, public VPIRMetadata {
1275
1275
: VPWidenRecipe(VPDef::VPWidenSC, I, Operands) {}
1276
1276
1277
1277
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)
1280
1280
: VPWidenRecipe(VPDef::VPWidenSC, Opcode, Operands, NUW, NSW, DL) {}
1281
1281
1282
1282
~VPWidenRecipe () override = default ;
@@ -2558,9 +2558,10 @@ class VPReductionEVLRecipe : public VPReductionRecipe {
2558
2558
// / concrete recipes before codegen. The operands are {ChainOp, VecOp,
2559
2559
// / [Condition]}.
2560
2560
class VPExtendedReductionRecipe : public VPReductionRecipe {
2561
- // / Opcode of the extend recipe will be lowered to .
2561
+ // / Opcode of the extend for VecOp .
2562
2562
Instruction::CastOps ExtOp;
2563
2563
2564
+ // / The scalar type after extending.
2564
2565
Type *ResultTy;
2565
2566
2566
2567
// / For cloning VPExtendedReductionRecipe.
@@ -2581,7 +2582,7 @@ class VPExtendedReductionRecipe : public VPReductionRecipe {
2581
2582
ExtOp(Ext->getOpcode ()), ResultTy(Ext->getResultType ()) {
2582
2583
assert ((ExtOp == Instruction::CastOps::ZExt ||
2583
2584
ExtOp == Instruction::CastOps::SExt) &&
2584
- " VPExtendedReductionRecipe only support zext and sext." );
2585
+ " VPExtendedReductionRecipe only supports zext and sext." );
2585
2586
2586
2587
// Not all WidenCastRecipes contain nneg flag. Need to transfer flags from
2587
2588
// the original recipe to prevent setting wrong flags.
@@ -2614,7 +2615,7 @@ class VPExtendedReductionRecipe : public VPReductionRecipe {
2614
2615
// / Is the extend ZExt?
2615
2616
bool isZExt () const { return getExtOpcode () == Instruction::ZExt; }
2616
2617
2617
- // / The opcode of extend recipe .
2618
+ // / Get the opcode of the extend for VecOp .
2618
2619
Instruction::CastOps getExtOpcode () const { return ExtOp; }
2619
2620
};
2620
2621
@@ -2624,12 +2625,13 @@ class VPExtendedReductionRecipe : public VPReductionRecipe {
2624
2625
// / recipe is abstract and needs to be lowered to concrete recipes before
2625
2626
// / codegen. The operands are {ChainOp, VecOp1, VecOp2, [Condition]}.
2626
2627
class VPMulAccumulateReductionRecipe : public VPReductionRecipe {
2627
- // / Opcode of the extend recipe .
2628
+ // / Opcode of the extend for VecOp1 and VecOp2 .
2628
2629
Instruction::CastOps ExtOp;
2629
2630
2630
2631
// / Non-neg flag of the extend recipe.
2631
2632
bool IsNonNeg = false ;
2632
2633
2634
+ // / The scalar type after extending.
2633
2635
Type *ResultTy;
2634
2636
2635
2637
// / For cloning VPMulAccumulateReductionRecipe.
@@ -2660,7 +2662,7 @@ class VPMulAccumulateReductionRecipe : public VPReductionRecipe {
2660
2662
" be Add" );
2661
2663
assert ((ExtOp == Instruction::CastOps::ZExt ||
2662
2664
ExtOp == Instruction::CastOps::SExt) &&
2663
- " VPMulAccumulateReductionRecipe only support zext and sext." );
2665
+ " VPMulAccumulateReductionRecipe only supports zext and sext." );
2664
2666
setUnderlyingValue (R->getUnderlyingValue ());
2665
2667
// Only set the non-negative flag if the original recipe contains.
2666
2668
if (Ext0->hasNonNegFlag ())
@@ -2706,24 +2708,26 @@ class VPMulAccumulateReductionRecipe : public VPReductionRecipe {
2706
2708
2707
2709
Type *getResultType () const {
2708
2710
assert (isExtended () && " Only support getResultType when this recipe "
2709
- " contains implicit extend." );
2711
+ " is implicitly extend." );
2710
2712
return ResultTy;
2711
2713
}
2712
2714
2713
- // / The VPValue of the vector value to be extended and reduced.
2715
+ // / The first vector value to be extended and reduced.
2714
2716
VPValue *getVecOp0 () const { return getOperand (1 ); }
2717
+
2718
+ // / The second vector value to be extended and reduced.
2715
2719
VPValue *getVecOp1 () const { return getOperand (2 ); }
2716
2720
2717
- // / Return if this MulAcc recipe contains extended operands.
2721
+ // / Return true if this recipe contains extended operands.
2718
2722
bool isExtended () const { return ExtOp != Instruction::CastOps::CastOpsEnd; }
2719
2723
2720
2724
// / Return the opcode of the extends for the operands.
2721
2725
Instruction::CastOps getExtOpcode () const { return ExtOp; }
2722
2726
2723
- // / Return if the operands are zero extended.
2727
+ // / Return if the operands are zero- extended.
2724
2728
bool isZExt () const { return ExtOp == Instruction::CastOps::ZExt; }
2725
2729
2726
- // / Return the non negative flag of the ext recipe .
2730
+ // / Return true if the operand extends have the non-negative flag .
2727
2731
bool isNonNeg () const { return IsNonNeg; }
2728
2732
};
2729
2733
0 commit comments