@@ -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,10 +2582,8 @@ 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
- // Not all WidenCastRecipes contain nneg flag. Need to transfer flags from
2587
- // the original recipe to prevent setting wrong flags.
2588
2587
transferFlags (*Ext);
2589
2588
setUnderlyingValue (R->getUnderlyingValue ());
2590
2589
}
@@ -2614,7 +2613,7 @@ class VPExtendedReductionRecipe : public VPReductionRecipe {
2614
2613
// / Is the extend ZExt?
2615
2614
bool isZExt () const { return getExtOpcode () == Instruction::ZExt; }
2616
2615
2617
- // / The opcode of extend recipe .
2616
+ // / Get the opcode of the extend for VecOp .
2618
2617
Instruction::CastOps getExtOpcode () const { return ExtOp; }
2619
2618
};
2620
2619
@@ -2624,12 +2623,13 @@ class VPExtendedReductionRecipe : public VPReductionRecipe {
2624
2623
// / recipe is abstract and needs to be lowered to concrete recipes before
2625
2624
// / codegen. The operands are {ChainOp, VecOp1, VecOp2, [Condition]}.
2626
2625
class VPMulAccumulateReductionRecipe : public VPReductionRecipe {
2627
- // / Opcode of the extend recipe .
2626
+ // / Opcode of the extend for VecOp1 and VecOp2 .
2628
2627
Instruction::CastOps ExtOp;
2629
2628
2630
2629
// / Non-neg flag of the extend recipe.
2631
2630
bool IsNonNeg = false ;
2632
2631
2632
+ // / The scalar type after extending.
2633
2633
Type *ResultTy;
2634
2634
2635
2635
// / For cloning VPMulAccumulateReductionRecipe.
@@ -2660,7 +2660,7 @@ class VPMulAccumulateReductionRecipe : public VPReductionRecipe {
2660
2660
" be Add" );
2661
2661
assert ((ExtOp == Instruction::CastOps::ZExt ||
2662
2662
ExtOp == Instruction::CastOps::SExt) &&
2663
- " VPMulAccumulateReductionRecipe only support zext and sext." );
2663
+ " VPMulAccumulateReductionRecipe only supports zext and sext." );
2664
2664
setUnderlyingValue (R->getUnderlyingValue ());
2665
2665
// Only set the non-negative flag if the original recipe contains.
2666
2666
if (Ext0->hasNonNegFlag ())
@@ -2706,24 +2706,26 @@ class VPMulAccumulateReductionRecipe : public VPReductionRecipe {
2706
2706
2707
2707
Type *getResultType () const {
2708
2708
assert (isExtended () && " Only support getResultType when this recipe "
2709
- " contains implicit extend." );
2709
+ " is implicitly extend." );
2710
2710
return ResultTy;
2711
2711
}
2712
2712
2713
- // / The VPValue of the vector value to be extended and reduced.
2713
+ // / The first vector value to be extended and reduced.
2714
2714
VPValue *getVecOp0 () const { return getOperand (1 ); }
2715
+
2716
+ // / The second vector value to be extended and reduced.
2715
2717
VPValue *getVecOp1 () const { return getOperand (2 ); }
2716
2718
2717
- // / Return if this MulAcc recipe contains extended operands.
2719
+ // / Return true if this recipe contains extended operands.
2718
2720
bool isExtended () const { return ExtOp != Instruction::CastOps::CastOpsEnd; }
2719
2721
2720
2722
// / Return the opcode of the extends for the operands.
2721
2723
Instruction::CastOps getExtOpcode () const { return ExtOp; }
2722
2724
2723
- // / Return if the operands are zero extended.
2725
+ // / Return if the operands are zero- extended.
2724
2726
bool isZExt () const { return ExtOp == Instruction::CastOps::ZExt; }
2725
2727
2726
- // / Return the non negative flag of the ext recipe .
2728
+ // / Return true if the operand extends have the non-negative flag .
2727
2729
bool isNonNeg () const { return IsNonNeg; }
2728
2730
};
2729
2731
0 commit comments