@@ -1311,8 +1311,8 @@ class VPWidenRecipe : public VPRecipeWithIRFlags, public VPIRMetadata {
1311
1311
Opcode (I.getOpcode()) {}
1312
1312
1313
1313
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)
1316
1316
: VPRecipeWithIRFlags(VPDefOpcode, Operands, WrapFlagsTy(NUW, NSW), DL),
1317
1317
Opcode(Opcode) {}
1318
1318
@@ -1321,8 +1321,8 @@ class VPWidenRecipe : public VPRecipeWithIRFlags, public VPIRMetadata {
1321
1321
: VPWidenRecipe(VPDef::VPWidenSC, I, Operands) {}
1322
1322
1323
1323
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)
1326
1326
: VPWidenRecipe(VPDef::VPWidenSC, Opcode, Operands, NUW, NSW, DL) {}
1327
1327
1328
1328
~VPWidenRecipe () override = default ;
@@ -2614,9 +2614,10 @@ class VPReductionEVLRecipe : public VPReductionRecipe {
2614
2614
// / concrete recipes before codegen. The operands are {ChainOp, VecOp,
2615
2615
// / [Condition]}.
2616
2616
class VPExtendedReductionRecipe : public VPReductionRecipe {
2617
- // / Opcode of the extend recipe will be lowered to .
2617
+ // / Opcode of the extend for VecOp .
2618
2618
Instruction::CastOps ExtOp;
2619
2619
2620
+ // / The scalar type after extending.
2620
2621
Type *ResultTy;
2621
2622
2622
2623
// / For cloning VPExtendedReductionRecipe.
@@ -2637,10 +2638,8 @@ class VPExtendedReductionRecipe : public VPReductionRecipe {
2637
2638
ExtOp(Ext->getOpcode ()), ResultTy(Ext->getResultType ()) {
2638
2639
assert ((ExtOp == Instruction::CastOps::ZExt ||
2639
2640
ExtOp == Instruction::CastOps::SExt) &&
2640
- " VPExtendedReductionRecipe only support zext and sext." );
2641
+ " VPExtendedReductionRecipe only supports zext and sext." );
2641
2642
2642
- // Not all WidenCastRecipes contain nneg flag. Need to transfer flags from
2643
- // the original recipe to prevent setting wrong flags.
2644
2643
transferFlags (*Ext);
2645
2644
setUnderlyingValue (R->getUnderlyingValue ());
2646
2645
}
@@ -2670,7 +2669,7 @@ class VPExtendedReductionRecipe : public VPReductionRecipe {
2670
2669
// / Is the extend ZExt?
2671
2670
bool isZExt () const { return getExtOpcode () == Instruction::ZExt; }
2672
2671
2673
- // / The opcode of extend recipe .
2672
+ // / Get the opcode of the extend for VecOp .
2674
2673
Instruction::CastOps getExtOpcode () const { return ExtOp; }
2675
2674
};
2676
2675
@@ -2680,12 +2679,13 @@ class VPExtendedReductionRecipe : public VPReductionRecipe {
2680
2679
// / recipe is abstract and needs to be lowered to concrete recipes before
2681
2680
// / codegen. The operands are {ChainOp, VecOp1, VecOp2, [Condition]}.
2682
2681
class VPMulAccumulateReductionRecipe : public VPReductionRecipe {
2683
- // / Opcode of the extend recipe .
2682
+ // / Opcode of the extend for VecOp1 and VecOp2 .
2684
2683
Instruction::CastOps ExtOp;
2685
2684
2686
2685
// / Non-neg flag of the extend recipe.
2687
2686
bool IsNonNeg = false ;
2688
2687
2688
+ // / The scalar type after extending.
2689
2689
Type *ResultTy;
2690
2690
2691
2691
// / For cloning VPMulAccumulateReductionRecipe.
@@ -2716,7 +2716,7 @@ class VPMulAccumulateReductionRecipe : public VPReductionRecipe {
2716
2716
" be Add" );
2717
2717
assert ((ExtOp == Instruction::CastOps::ZExt ||
2718
2718
ExtOp == Instruction::CastOps::SExt) &&
2719
- " VPMulAccumulateReductionRecipe only support zext and sext." );
2719
+ " VPMulAccumulateReductionRecipe only supports zext and sext." );
2720
2720
setUnderlyingValue (R->getUnderlyingValue ());
2721
2721
// Only set the non-negative flag if the original recipe contains.
2722
2722
if (Ext0->hasNonNegFlag ())
@@ -2762,24 +2762,26 @@ class VPMulAccumulateReductionRecipe : public VPReductionRecipe {
2762
2762
2763
2763
Type *getResultType () const {
2764
2764
assert (isExtended () && " Only support getResultType when this recipe "
2765
- " contains implicit extend." );
2765
+ " is implicitly extend." );
2766
2766
return ResultTy;
2767
2767
}
2768
2768
2769
- // / The VPValue of the vector value to be extended and reduced.
2769
+ // / The first vector value to be extended and reduced.
2770
2770
VPValue *getVecOp0 () const { return getOperand (1 ); }
2771
+
2772
+ // / The second vector value to be extended and reduced.
2771
2773
VPValue *getVecOp1 () const { return getOperand (2 ); }
2772
2774
2773
- // / Return if this MulAcc recipe contains extended operands.
2775
+ // / Return true if this recipe contains extended operands.
2774
2776
bool isExtended () const { return ExtOp != Instruction::CastOps::CastOpsEnd; }
2775
2777
2776
2778
// / Return the opcode of the extends for the operands.
2777
2779
Instruction::CastOps getExtOpcode () const { return ExtOp; }
2778
2780
2779
- // / Return if the operands are zero extended.
2781
+ // / Return if the operands are zero- extended.
2780
2782
bool isZExt () const { return ExtOp == Instruction::CastOps::ZExt; }
2781
2783
2782
- // / Return the non negative flag of the ext recipe .
2784
+ // / Return true if the operand extends have the non-negative flag .
2783
2785
bool isNonNeg () const { return IsNonNeg; }
2784
2786
};
2785
2787
0 commit comments