@@ -888,6 +888,8 @@ class VPSingleDefRecipe : public VPRecipeBase, public VPValue {
888
888
return R && classof (R);
889
889
}
890
890
891
+ virtual VPSingleDefRecipe *clone () override = 0;
892
+
891
893
// / Returns the underlying instruction.
892
894
Instruction *getUnderlyingInstr () {
893
895
return cast<Instruction>(getUnderlyingValue ());
@@ -1248,7 +1250,7 @@ class VPInstruction : public VPRecipeWithIRFlags {
1248
1250
1249
1251
VP_CLASSOF_IMPL (VPDef::VPInstructionSC)
1250
1252
1251
- VPRecipeBase *clone() override {
1253
+ VPInstruction *clone() override {
1252
1254
SmallVector<VPValue *, 2 > Operands (operands ());
1253
1255
auto *New = new VPInstruction (Opcode, Operands, getDebugLoc (), Name);
1254
1256
New->transferFlags (*this );
@@ -1335,7 +1337,7 @@ class VPWidenRecipe : public VPRecipeWithIRFlags {
1335
1337
1336
1338
~VPWidenRecipe () override = default ;
1337
1339
1338
- VPRecipeBase *clone () override {
1340
+ VPWidenRecipe *clone () override {
1339
1341
auto *R = new VPWidenRecipe (*getUnderlyingInstr (), operands ());
1340
1342
R->transferFlags (*this );
1341
1343
return R;
@@ -1380,7 +1382,7 @@ class VPWidenCastRecipe : public VPRecipeWithIRFlags {
1380
1382
1381
1383
~VPWidenCastRecipe () override = default ;
1382
1384
1383
- VPRecipeBase *clone () override {
1385
+ VPWidenCastRecipe *clone () override {
1384
1386
if (auto *UV = getUnderlyingValue ())
1385
1387
return new VPWidenCastRecipe (Opcode, getOperand (0 ), ResultTy,
1386
1388
*cast<CastInst>(UV));
@@ -1420,7 +1422,7 @@ class VPScalarCastRecipe : public VPSingleDefRecipe {
1420
1422
1421
1423
~VPScalarCastRecipe () override = default ;
1422
1424
1423
- VPRecipeBase *clone () override {
1425
+ VPScalarCastRecipe *clone () override {
1424
1426
return new VPScalarCastRecipe (Opcode, getOperand (0 ), ResultTy);
1425
1427
}
1426
1428
@@ -1465,7 +1467,7 @@ class VPWidenCallRecipe : public VPSingleDefRecipe {
1465
1467
1466
1468
~VPWidenCallRecipe () override = default ;
1467
1469
1468
- VPRecipeBase *clone () override {
1470
+ VPWidenCallRecipe *clone () override {
1469
1471
return new VPWidenCallRecipe (*cast<CallInst>(getUnderlyingInstr ()),
1470
1472
operands (), VectorIntrinsicID, getDebugLoc (),
1471
1473
Variant);
@@ -1492,7 +1494,7 @@ struct VPWidenSelectRecipe : public VPSingleDefRecipe {
1492
1494
1493
1495
~VPWidenSelectRecipe () override = default ;
1494
1496
1495
- VPRecipeBase *clone () override {
1497
+ VPWidenSelectRecipe *clone () override {
1496
1498
return new VPWidenSelectRecipe (*cast<SelectInst>(getUnderlyingInstr ()),
1497
1499
operands ());
1498
1500
}
@@ -1540,7 +1542,7 @@ class VPWidenGEPRecipe : public VPRecipeWithIRFlags {
1540
1542
1541
1543
~VPWidenGEPRecipe () override = default ;
1542
1544
1543
- VPRecipeBase *clone () override {
1545
+ VPWidenGEPRecipe *clone () override {
1544
1546
return new VPWidenGEPRecipe (cast<GetElementPtrInst>(getUnderlyingInstr ()),
1545
1547
operands ());
1546
1548
}
@@ -1581,7 +1583,7 @@ class VPVectorPointerRecipe : public VPRecipeWithIRFlags {
1581
1583
return true ;
1582
1584
}
1583
1585
1584
- VPRecipeBase *clone () override {
1586
+ VPVectorPointerRecipe *clone () override {
1585
1587
return new VPVectorPointerRecipe (getOperand (0 ), IndexedTy, IsReverse,
1586
1588
isInBounds (), getDebugLoc ());
1587
1589
}
@@ -1696,7 +1698,7 @@ class VPWidenIntOrFpInductionRecipe : public VPHeaderPHIRecipe {
1696
1698
1697
1699
~VPWidenIntOrFpInductionRecipe () override = default ;
1698
1700
1699
- VPRecipeBase *clone () override {
1701
+ VPWidenIntOrFpInductionRecipe *clone () override {
1700
1702
return new VPWidenIntOrFpInductionRecipe (IV, getStartValue (),
1701
1703
getStepValue (), IndDesc, Trunc);
1702
1704
}
@@ -1771,7 +1773,7 @@ class VPWidenPointerInductionRecipe : public VPHeaderPHIRecipe {
1771
1773
1772
1774
~VPWidenPointerInductionRecipe () override = default ;
1773
1775
1774
- VPRecipeBase *clone () override {
1776
+ VPWidenPointerInductionRecipe *clone () override {
1775
1777
return new VPWidenPointerInductionRecipe (
1776
1778
cast<PHINode>(getUnderlyingInstr ()), getOperand (0 ), getOperand (1 ),
1777
1779
IndDesc, IsScalarAfterVectorization);
@@ -1810,7 +1812,7 @@ class VPWidenPHIRecipe : public VPSingleDefRecipe {
1810
1812
addOperand (Start);
1811
1813
}
1812
1814
1813
- VPRecipeBase *clone () override {
1815
+ VPWidenPHIRecipe *clone () override {
1814
1816
llvm_unreachable (" cloning not implemented yet" );
1815
1817
}
1816
1818
@@ -1853,7 +1855,7 @@ struct VPFirstOrderRecurrencePHIRecipe : public VPHeaderPHIRecipe {
1853
1855
return R->getVPDefID () == VPDef::VPFirstOrderRecurrencePHISC;
1854
1856
}
1855
1857
1856
- VPRecipeBase *clone () override {
1858
+ VPFirstOrderRecurrencePHIRecipe *clone () override {
1857
1859
return new VPFirstOrderRecurrencePHIRecipe (
1858
1860
cast<PHINode>(getUnderlyingInstr ()), *getOperand (0 ));
1859
1861
}
@@ -1893,7 +1895,7 @@ class VPReductionPHIRecipe : public VPHeaderPHIRecipe {
1893
1895
1894
1896
~VPReductionPHIRecipe () override = default ;
1895
1897
1896
- VPRecipeBase *clone () override {
1898
+ VPReductionPHIRecipe *clone () override {
1897
1899
auto *R =
1898
1900
new VPReductionPHIRecipe (cast<PHINode>(getUnderlyingInstr ()), RdxDesc,
1899
1901
*getOperand (0 ), IsInLoop, IsOrdered);
@@ -1940,7 +1942,7 @@ class VPBlendRecipe : public VPSingleDefRecipe {
1940
1942
" Expected an odd number of operands" );
1941
1943
}
1942
1944
1943
- VPRecipeBase *clone () override {
1945
+ VPBlendRecipe *clone () override {
1944
1946
SmallVector<VPValue *> Ops (operands ());
1945
1947
return new VPBlendRecipe (cast<PHINode>(getUnderlyingValue ()), Ops);
1946
1948
}
@@ -2019,7 +2021,7 @@ class VPInterleaveRecipe : public VPRecipeBase {
2019
2021
}
2020
2022
~VPInterleaveRecipe () override = default ;
2021
2023
2022
- VPRecipeBase *clone () override {
2024
+ VPInterleaveRecipe *clone () override {
2023
2025
return new VPInterleaveRecipe (IG, getAddr (), getStoredValues (), getMask (),
2024
2026
NeedsMaskForGaps);
2025
2027
}
@@ -2093,7 +2095,7 @@ class VPReductionRecipe : public VPSingleDefRecipe {
2093
2095
2094
2096
~VPReductionRecipe () override = default ;
2095
2097
2096
- VPRecipeBase *clone () override {
2098
+ VPReductionRecipe *clone () override {
2097
2099
return new VPReductionRecipe (RdxDesc, getUnderlyingInstr (), getChainOp (),
2098
2100
getVecOp (), getCondOp (), IsOrdered);
2099
2101
}
@@ -2142,7 +2144,7 @@ class VPReplicateRecipe : public VPRecipeWithIRFlags {
2142
2144
2143
2145
~VPReplicateRecipe () override = default ;
2144
2146
2145
- VPRecipeBase *clone () override {
2147
+ VPReplicateRecipe *clone () override {
2146
2148
auto *Copy =
2147
2149
new VPReplicateRecipe (getUnderlyingInstr (), operands (), IsUniform,
2148
2150
isPredicated () ? getMask () : nullptr );
@@ -2204,7 +2206,7 @@ class VPBranchOnMaskRecipe : public VPRecipeBase {
2204
2206
addOperand (BlockInMask);
2205
2207
}
2206
2208
2207
- VPRecipeBase *clone () override {
2209
+ VPBranchOnMaskRecipe *clone () override {
2208
2210
return new VPBranchOnMaskRecipe (getOperand (0 ));
2209
2211
}
2210
2212
@@ -2255,7 +2257,7 @@ class VPPredInstPHIRecipe : public VPSingleDefRecipe {
2255
2257
: VPSingleDefRecipe(VPDef::VPPredInstPHISC, PredV) {}
2256
2258
~VPPredInstPHIRecipe () override = default ;
2257
2259
2258
- VPRecipeBase *clone () override {
2260
+ VPPredInstPHIRecipe *clone () override {
2259
2261
return new VPPredInstPHIRecipe (getOperand (0 ));
2260
2262
}
2261
2263
@@ -2323,7 +2325,7 @@ class VPWidenMemoryInstructionRecipe : public VPRecipeBase {
2323
2325
setMask (Mask);
2324
2326
}
2325
2327
2326
- VPRecipeBase *clone () override {
2328
+ VPWidenMemoryInstructionRecipe *clone () override {
2327
2329
if (isStore ())
2328
2330
return new VPWidenMemoryInstructionRecipe (
2329
2331
cast<StoreInst>(Ingredient), getAddr (), getStoredValue (), getMask (),
@@ -2399,7 +2401,9 @@ class VPExpandSCEVRecipe : public VPSingleDefRecipe {
2399
2401
2400
2402
~VPExpandSCEVRecipe () override = default ;
2401
2403
2402
- VPRecipeBase *clone () override { return new VPExpandSCEVRecipe (Expr, SE); }
2404
+ VPExpandSCEVRecipe *clone () override {
2405
+ return new VPExpandSCEVRecipe (Expr, SE);
2406
+ }
2403
2407
2404
2408
VP_CLASSOF_IMPL (VPDef::VPExpandSCEVSC)
2405
2409
@@ -2426,7 +2430,7 @@ class VPCanonicalIVPHIRecipe : public VPHeaderPHIRecipe {
2426
2430
2427
2431
~VPCanonicalIVPHIRecipe () override = default ;
2428
2432
2429
- VPRecipeBase *clone () override {
2433
+ VPCanonicalIVPHIRecipe *clone () override {
2430
2434
auto *R = new VPCanonicalIVPHIRecipe (getOperand (0 ), getDebugLoc ());
2431
2435
R->addOperand (getBackedgeValue ());
2432
2436
return R;
@@ -2484,7 +2488,7 @@ class VPActiveLaneMaskPHIRecipe : public VPHeaderPHIRecipe {
2484
2488
2485
2489
~VPActiveLaneMaskPHIRecipe () override = default ;
2486
2490
2487
- VPRecipeBase *clone () override {
2491
+ VPActiveLaneMaskPHIRecipe *clone () override {
2488
2492
return new VPActiveLaneMaskPHIRecipe (getOperand (0 ), getDebugLoc ());
2489
2493
}
2490
2494
@@ -2551,7 +2555,7 @@ class VPWidenCanonicalIVRecipe : public VPSingleDefRecipe {
2551
2555
2552
2556
~VPWidenCanonicalIVRecipe () override = default ;
2553
2557
2554
- VPRecipeBase *clone () override {
2558
+ VPWidenCanonicalIVRecipe *clone () override {
2555
2559
return new VPWidenCanonicalIVRecipe (
2556
2560
cast<VPCanonicalIVPHIRecipe>(getOperand (0 )));
2557
2561
}
@@ -2602,7 +2606,7 @@ class VPDerivedIVRecipe : public VPSingleDefRecipe {
2602
2606
2603
2607
~VPDerivedIVRecipe () override = default ;
2604
2608
2605
- VPRecipeBase *clone () override {
2609
+ VPDerivedIVRecipe *clone () override {
2606
2610
return new VPDerivedIVRecipe (Kind, FPBinOp, getStartValue (), getOperand (1 ),
2607
2611
getStepValue ());
2608
2612
}
@@ -2656,7 +2660,7 @@ class VPScalarIVStepsRecipe : public VPRecipeWithIRFlags {
2656
2660
2657
2661
~VPScalarIVStepsRecipe () override = default ;
2658
2662
2659
- VPRecipeBase *clone () override {
2663
+ VPScalarIVStepsRecipe *clone () override {
2660
2664
return new VPScalarIVStepsRecipe (
2661
2665
getOperand (0 ), getOperand (1 ), InductionOpcode,
2662
2666
hasFastMathFlags () ? getFastMathFlags () : FastMathFlags ());
0 commit comments