@@ -599,11 +599,6 @@ class VPRecipeWithIRFlags : public VPSingleDefRecipe {
599
599
DisjointFlagsTy (bool IsDisjoint) : IsDisjoint(IsDisjoint) {}
600
600
};
601
601
602
- struct GEPFlagsTy {
603
- char IsInBounds : 1 ;
604
- GEPFlagsTy (bool IsInBounds) : IsInBounds(IsInBounds) {}
605
- };
606
-
607
602
struct NonNegFlagsTy {
608
603
char NonNeg : 1 ;
609
604
NonNegFlagsTy (bool IsNonNeg) : NonNeg(IsNonNeg) {}
@@ -2303,9 +2298,9 @@ class VPReductionRecipe : public VPRecipeWithIRFlags {
2303
2298
// / Note that IsNonNeg flag and the debug location are for extend instruction.
2304
2299
VPReductionRecipe (const unsigned char SC, const RecurrenceDescriptor &R,
2305
2300
ArrayRef<VPValue *> Operands, VPValue *CondOp,
2306
- bool IsOrdered, bool IsNonNeg , DebugLoc DL)
2307
- : VPRecipeWithIRFlags(SC, Operands, NonNegFlagsTy(IsNonNeg) , DL),
2308
- RdxDesc(R), IsOrdered(IsOrdered), IsConditional(CondOp) {
2301
+ bool IsOrdered, NonNegFlagsTy NonNeg , DebugLoc DL)
2302
+ : VPRecipeWithIRFlags(SC, Operands, NonNeg , DL), RdxDesc(R ),
2303
+ IsOrdered(IsOrdered), IsConditional(CondOp) {
2309
2304
if (CondOp)
2310
2305
addOperand (CondOp);
2311
2306
}
@@ -2314,9 +2309,9 @@ class VPReductionRecipe : public VPRecipeWithIRFlags {
2314
2309
// / Note that the NUW/NSW and DL are for mul instruction.
2315
2310
VPReductionRecipe (const unsigned char SC, const RecurrenceDescriptor &R,
2316
2311
ArrayRef<VPValue *> Operands, VPValue *CondOp,
2317
- bool IsOrdered, bool NUW, bool NSW , DebugLoc DL)
2318
- : VPRecipeWithIRFlags(SC, Operands, WrapFlagsTy(NUW, NSW ), DL ),
2319
- RdxDesc(R), IsOrdered(IsOrdered), IsConditional(CondOp) {
2312
+ bool IsOrdered, WrapFlagsTy WrapFlags , DebugLoc DL)
2313
+ : VPRecipeWithIRFlags(SC, Operands, WrapFlags, DL ), RdxDesc(R ),
2314
+ IsOrdered(IsOrdered), IsConditional(CondOp) {
2320
2315
if (CondOp)
2321
2316
addOperand (CondOp);
2322
2317
}
@@ -2441,22 +2436,24 @@ class VPExtendedReductionRecipe : public VPReductionRecipe {
2441
2436
VPExtendedReductionRecipe (VPExtendedReductionRecipe *ExtRed)
2442
2437
: VPReductionRecipe(
2443
2438
VPDef::VPExtendedReductionSC, ExtRed->getRecurrenceDescriptor (),
2444
- {ExtRed->getChainOp (), ExtRed->getVecOp ()}, ExtRed-> getCondOp () ,
2445
- ExtRed->isOrdered (), ExtRed->isNonNeg (), ExtRed->getDebugLoc()),
2439
+ nullptr, {ExtRed->getChainOp (), ExtRed->getVecOp ()},
2440
+ ExtRed->getCondOp (), ExtRed->isOrdered (), ExtRed->getDebugLoc()),
2446
2441
ExtOp(ExtRed->getExtOpcode ()) {}
2447
2442
2448
2443
public:
2449
2444
VPExtendedReductionRecipe (VPReductionRecipe *R, VPWidenCastRecipe *Ext)
2450
- : VPReductionRecipe(VPDef::VPExtendedReductionSC,
2451
- R->getRecurrenceDescriptor (),
2452
- {R->getChainOp (), Ext->getOperand (0 )}, R->getCondOp (),
2453
- R->isOrdered(), Ext->isNonNeg(), Ext->getDebugLoc()),
2445
+ : VPReductionRecipe(
2446
+ VPDef::VPExtendedReductionSC, R->getRecurrenceDescriptor (),
2447
+ {R->getChainOp (), Ext->getOperand (0 )}, R->getCondOp (),
2448
+ R->isOrdered(), NonNegFlagsTy( Ext->isNonNeg () ), Ext->getDebugLoc()),
2454
2449
ExtOp(Ext->getOpcode ()) {}
2455
2450
2456
2451
~VPExtendedReductionRecipe () override = default ;
2457
2452
2458
2453
VPExtendedReductionRecipe *clone () override {
2459
- return new VPExtendedReductionRecipe (this );
2454
+ auto *Copy = new VPExtendedReductionRecipe (this );
2455
+ Copy->transferFlags (*this );
2456
+ return Copy;
2460
2457
}
2461
2458
2462
2459
VP_CLASSOF_IMPL (VPDef::VPExtendedReductionSC);
@@ -2504,11 +2501,9 @@ class VPMulAccumulateReductionRecipe : public VPReductionRecipe {
2504
2501
VPMulAccumulateReductionRecipe (VPMulAccumulateReductionRecipe *MulAcc)
2505
2502
: VPReductionRecipe(
2506
2503
VPDef::VPMulAccumulateReductionSC,
2507
- MulAcc->getRecurrenceDescriptor (),
2504
+ MulAcc->getRecurrenceDescriptor (), nullptr,
2508
2505
{MulAcc->getChainOp (), MulAcc->getVecOp0 (), MulAcc->getVecOp1 ()},
2509
- MulAcc->getCondOp (), MulAcc->isOrdered(),
2510
- MulAcc->hasNoUnsignedWrap(), MulAcc->hasNoSignedWrap(),
2511
- MulAcc->getDebugLoc()),
2506
+ MulAcc->getCondOp (), MulAcc->isOrdered(), MulAcc->getDebugLoc()),
2512
2507
ExtOp(MulAcc->getExtOpcode ()), IsNonNeg(MulAcc->isNonNeg ()) {}
2513
2508
2514
2509
public:
@@ -2518,8 +2513,9 @@ class VPMulAccumulateReductionRecipe : public VPReductionRecipe {
2518
2513
: VPReductionRecipe(
2519
2514
VPDef::VPMulAccumulateReductionSC, R->getRecurrenceDescriptor (),
2520
2515
{R->getChainOp (), Ext0->getOperand (0 ), Ext1->getOperand (0 )},
2521
- R->getCondOp (), R->isOrdered(), Mul->hasNoUnsignedWrap(),
2522
- Mul->hasNoSignedWrap(), R->getDebugLoc()),
2516
+ R->getCondOp (), R->isOrdered(),
2517
+ WrapFlagsTy(Mul->hasNoUnsignedWrap (), Mul->hasNoSignedWrap()),
2518
+ R->getDebugLoc()),
2523
2519
ExtOp(Ext0->getOpcode ()), IsNonNeg(Ext0->isNonNeg ()) {
2524
2520
assert (getRecurrenceDescriptor ().getOpcode () == Instruction::Add &&
2525
2521
" The reduction instruction in MulAccumulateteReductionRecipe must "
@@ -2530,8 +2526,9 @@ class VPMulAccumulateReductionRecipe : public VPReductionRecipe {
2530
2526
: VPReductionRecipe(
2531
2527
VPDef::VPMulAccumulateReductionSC, R->getRecurrenceDescriptor (),
2532
2528
{R->getChainOp (), Mul->getOperand (0 ), Mul->getOperand (1 )},
2533
- R->getCondOp (), R->isOrdered(), Mul->hasNoUnsignedWrap(),
2534
- Mul->hasNoSignedWrap(), R->getDebugLoc()),
2529
+ R->getCondOp (), R->isOrdered(),
2530
+ WrapFlagsTy(Mul->hasNoUnsignedWrap (), Mul->hasNoSignedWrap()),
2531
+ R->getDebugLoc()),
2535
2532
ExtOp(Instruction::CastOps::CastOpsEnd) {
2536
2533
assert (getRecurrenceDescriptor ().getOpcode () == Instruction::Add &&
2537
2534
" The reduction instruction in MulAccumulateReductionRecipe must be "
@@ -2541,7 +2538,9 @@ class VPMulAccumulateReductionRecipe : public VPReductionRecipe {
2541
2538
~VPMulAccumulateReductionRecipe () override = default ;
2542
2539
2543
2540
VPMulAccumulateReductionRecipe *clone () override {
2544
- return new VPMulAccumulateReductionRecipe (this );
2541
+ auto *Copy = new VPMulAccumulateReductionRecipe (this );
2542
+ Copy->transferFlags (*this );
2543
+ return Copy;
2545
2544
}
2546
2545
2547
2546
VP_CLASSOF_IMPL (VPDef::VPMulAccumulateReductionSC);
0 commit comments