@@ -2291,7 +2291,7 @@ class VPReductionRecipe : public VPRecipeWithIRFlags {
2291
2291
}
2292
2292
2293
2293
// / For VPExtendedReductionRecipe.
2294
- // / Note that IsNonNeg flag and the debug location are for extend instruction .
2294
+ // / Note that IsNonNeg flag and the debug location are from the extend .
2295
2295
VPReductionRecipe (const unsigned char SC, const RecurKind RdxKind,
2296
2296
ArrayRef<VPValue *> Operands, VPValue *CondOp,
2297
2297
bool IsOrdered, NonNegFlagsTy NonNeg, DebugLoc DL)
@@ -2302,7 +2302,7 @@ class VPReductionRecipe : public VPRecipeWithIRFlags {
2302
2302
}
2303
2303
2304
2304
// / For VPMulAccumulateReductionRecipe.
2305
- // / Note that the NUW/NSW and DL are for mul instruction .
2305
+ // / Note that the NUW/NSW and DL are from the Mul .
2306
2306
VPReductionRecipe (const unsigned char SC, const RecurKind RdxKind,
2307
2307
ArrayRef<VPValue *> Operands, VPValue *CondOp,
2308
2308
bool IsOrdered, WrapFlagsTy WrapFlags, DebugLoc DL)
@@ -2320,9 +2320,9 @@ class VPReductionRecipe : public VPRecipeWithIRFlags {
2320
2320
ArrayRef<VPValue *>({ChainOp, VecOp}), CondOp,
2321
2321
IsOrdered, DL) {}
2322
2322
2323
- VPReductionRecipe (const RecurKind RdxKind, FastMathFlags FMFs, VPValue *ChainOp,
2324
- VPValue *VecOp , VPValue *CondOp, bool IsOrdered ,
2325
- DebugLoc DL = {})
2323
+ VPReductionRecipe (const RecurKind RdxKind, FastMathFlags FMFs,
2324
+ VPValue *ChainOp , VPValue *VecOp, VPValue *CondOp ,
2325
+ bool IsOrdered, DebugLoc DL = {})
2326
2326
: VPReductionRecipe(VPDef::VPReductionSC, RdxKind, FMFs, nullptr ,
2327
2327
ArrayRef<VPValue *>({ChainOp, VecOp}), CondOp,
2328
2328
IsOrdered, DL) {}
@@ -2434,16 +2434,17 @@ class VPExtendedReductionRecipe : public VPReductionRecipe {
2434
2434
VPExtendedReductionRecipe (VPExtendedReductionRecipe *ExtRed)
2435
2435
: VPReductionRecipe(
2436
2436
VPDef::VPExtendedReductionSC, ExtRed->getRecurrenceKind (),
2437
- {ExtRed->getChainOp (), ExtRed->getVecOp ()},
2438
- ExtRed->getCondOp (), ExtRed->isOrdered(), NonNegFlagsTy(ExtRed->isNonNeg ()), ExtRed->getDebugLoc()),
2437
+ {ExtRed->getChainOp (), ExtRed->getVecOp ()}, ExtRed->getCondOp (),
2438
+ ExtRed->isOrdered(), NonNegFlagsTy(ExtRed->isNonNeg ()),
2439
+ ExtRed->getDebugLoc()),
2439
2440
ExtOp(ExtRed->getExtOpcode ()), ResultTy(ExtRed->getResultType ()) {}
2440
2441
2441
2442
public:
2442
2443
VPExtendedReductionRecipe (VPReductionRecipe *R, VPWidenCastRecipe *Ext)
2443
- : VPReductionRecipe(
2444
- VPDef::VPExtendedReductionSC, R->getRecurrenceKind (),
2445
- { R->getChainOp (), Ext->getOperand ( 0 )}, R-> getCondOp ( ),
2446
- R->isOrdered(), NonNegFlagsTy(Ext-> isNonNeg ()), Ext->getDebugLoc()),
2444
+ : VPReductionRecipe(VPDef::VPExtendedReductionSC, R-> getRecurrenceKind (),
2445
+ {R-> getChainOp (), Ext-> getOperand ( 0 )}, R->getCondOp (),
2446
+ R->isOrdered (), NonNegFlagsTy( Ext->isNonNeg () ),
2447
+ Ext->getDebugLoc()),
2447
2448
ExtOp(Ext->getOpcode ()), ResultTy(Ext->getResultType ()) {}
2448
2449
2449
2450
~VPExtendedReductionRecipe () override = default ;
@@ -2472,9 +2473,7 @@ class VPExtendedReductionRecipe : public VPReductionRecipe {
2472
2473
#endif
2473
2474
2474
2475
// / The scalar type after extended.
2475
- Type *getResultType () const {
2476
- return ResultTy;
2477
- }
2476
+ Type *getResultType () const { return ResultTy; }
2478
2477
2479
2478
// / Is the extend ZExt?
2480
2479
bool isZExt () const { return getExtOpcode () == Instruction::ZExt; }
@@ -2500,11 +2499,13 @@ class VPMulAccumulateReductionRecipe : public VPReductionRecipe {
2500
2499
// / For cloning VPMulAccumulateReductionRecipe.
2501
2500
VPMulAccumulateReductionRecipe (VPMulAccumulateReductionRecipe *MulAcc)
2502
2501
: VPReductionRecipe(
2503
- VPDef::VPMulAccumulateReductionSC,
2504
- MulAcc->getRecurrenceKind (),
2502
+ VPDef::VPMulAccumulateReductionSC, MulAcc->getRecurrenceKind (),
2505
2503
{MulAcc->getChainOp (), MulAcc->getVecOp0 (), MulAcc->getVecOp1 ()},
2506
- MulAcc->getCondOp (), MulAcc->isOrdered(), WrapFlagsTy(MulAcc->hasNoUnsignedWrap (), MulAcc->hasNoSignedWrap()), MulAcc->getDebugLoc()),
2507
- ExtOp(MulAcc->getExtOpcode ()), IsNonNeg(MulAcc->isNonNeg ()), ResultTy(MulAcc->getResultType ()) {}
2504
+ MulAcc->getCondOp (), MulAcc->isOrdered(),
2505
+ WrapFlagsTy(MulAcc->hasNoUnsignedWrap (), MulAcc->hasNoSignedWrap()),
2506
+ MulAcc->getDebugLoc()),
2507
+ ExtOp(MulAcc->getExtOpcode ()), IsNonNeg(MulAcc->isNonNeg ()),
2508
+ ResultTy(MulAcc->getResultType ()) {}
2508
2509
2509
2510
public:
2510
2511
VPMulAccumulateReductionRecipe (VPReductionRecipe *R, VPWidenRecipe *Mul,
@@ -2516,8 +2517,10 @@ class VPMulAccumulateReductionRecipe : public VPReductionRecipe {
2516
2517
R->getCondOp (), R->isOrdered(),
2517
2518
WrapFlagsTy(Mul->hasNoUnsignedWrap (), Mul->hasNoSignedWrap()),
2518
2519
R->getDebugLoc()),
2519
- ExtOp(Ext0->getOpcode ()), IsNonNeg(Ext0->isNonNeg ()), ResultTy(ResultTy) {
2520
- assert (RecurrenceDescriptor::getOpcode (getRecurrenceKind ())== Instruction::Add &&
2520
+ ExtOp(Ext0->getOpcode ()), IsNonNeg(Ext0->isNonNeg ()),
2521
+ ResultTy(ResultTy) {
2522
+ assert (RecurrenceDescriptor::getOpcode (getRecurrenceKind ()) ==
2523
+ Instruction::Add &&
2521
2524
" The reduction instruction in MulAccumulateteReductionRecipe must "
2522
2525
" be Add" );
2523
2526
}
@@ -2530,7 +2533,8 @@ class VPMulAccumulateReductionRecipe : public VPReductionRecipe {
2530
2533
WrapFlagsTy(Mul->hasNoUnsignedWrap (), Mul->hasNoSignedWrap()),
2531
2534
R->getDebugLoc()),
2532
2535
ExtOp(Instruction::CastOps::CastOpsEnd) {
2533
- assert (RecurrenceDescriptor::getOpcode (getRecurrenceKind ()) == Instruction::Add &&
2536
+ assert (RecurrenceDescriptor::getOpcode (getRecurrenceKind ()) ==
2537
+ Instruction::Add &&
2534
2538
" The reduction instruction in MulAccumulateReductionRecipe must be "
2535
2539
" Add" );
2536
2540
}
@@ -2562,7 +2566,8 @@ class VPMulAccumulateReductionRecipe : public VPReductionRecipe {
2562
2566
#endif
2563
2567
2564
2568
Type *getResultType () const {
2565
- assert (isExtended () && " Only support getResultType when this recipe contains implicit extend." );
2569
+ assert (isExtended () && " Only support getResultType when this recipe "
2570
+ " contains implicit extend." );
2566
2571
return ResultTy;
2567
2572
}
2568
2573
@@ -3792,6 +3797,8 @@ class VPlan {
3792
3797
VFs.insert (VF);
3793
3798
}
3794
3799
3800
+ void clearVF () { VFs.clear (); }
3801
+
3795
3802
bool hasVF (ElementCount VF) const { return VFs.count (VF); }
3796
3803
bool hasScalableVF () const {
3797
3804
return any_of (VFs, [](ElementCount VF) { return VF.isScalable (); });
0 commit comments