@@ -386,10 +386,6 @@ class VPRecipeBase : public ilist_node_with_parent<VPRecipeBase, VPBasicBlock>,
386
386
DebugLoc DL = {})
387
387
: VPDef(SC), VPUser(Operands), DL(DL) {}
388
388
389
- template <typename IterT>
390
- VPRecipeBase (const unsigned char SC, iterator_range<IterT> Operands,
391
- DebugLoc DL = {})
392
- : VPDef(SC), VPUser(Operands), DL(DL) {}
393
389
virtual ~VPRecipeBase () = default ;
394
390
395
391
// / Clone the current recipe.
@@ -504,17 +500,12 @@ class VPRecipeBase : public ilist_node_with_parent<VPRecipeBase, VPBasicBlock>,
504
500
// / Note that VPRecipeBase must be inherited from before VPValue.
505
501
class VPSingleDefRecipe : public VPRecipeBase , public VPValue {
506
502
public:
507
- template <typename IterT>
508
- VPSingleDefRecipe (const unsigned char SC, IterT Operands, DebugLoc DL = {})
509
- : VPRecipeBase(SC, Operands, DL), VPValue(this ) {}
510
-
511
503
VPSingleDefRecipe (const unsigned char SC, ArrayRef<VPValue *> Operands,
512
504
DebugLoc DL = {})
513
505
: VPRecipeBase(SC, Operands, DL), VPValue(this ) {}
514
506
515
- template <typename IterT>
516
- VPSingleDefRecipe (const unsigned char SC, IterT Operands, Value *UV,
517
- DebugLoc DL = {})
507
+ VPSingleDefRecipe (const unsigned char SC, ArrayRef<VPValue *> Operands,
508
+ Value *UV, DebugLoc DL = {})
518
509
: VPRecipeBase(SC, Operands, DL), VPValue(this , UV) {}
519
510
520
511
static inline bool classof (const VPRecipeBase *R) {
@@ -648,15 +639,15 @@ class VPRecipeWithIRFlags : public VPSingleDefRecipe {
648
639
}
649
640
650
641
public:
651
- template < typename IterT>
652
- VPRecipeWithIRFlags ( const unsigned char SC, IterT Operands, DebugLoc DL = {})
642
+ VPRecipeWithIRFlags ( const unsigned char SC, ArrayRef<VPValue *> Operands,
643
+ DebugLoc DL = {})
653
644
: VPSingleDefRecipe(SC, Operands, DL) {
654
645
OpType = OperationType::Other;
655
646
AllFlags = 0 ;
656
647
}
657
648
658
- template < typename IterT>
659
- VPRecipeWithIRFlags ( const unsigned char SC, IterT Operands, Instruction &I)
649
+ VPRecipeWithIRFlags ( const unsigned char SC, ArrayRef<VPValue *> Operands,
650
+ Instruction &I)
660
651
: VPSingleDefRecipe(SC, Operands, &I, I.getDebugLoc()) {
661
652
if (auto *Op = dyn_cast<CmpInst>(&I)) {
662
653
OpType = OperationType::Cmp;
@@ -685,33 +676,28 @@ class VPRecipeWithIRFlags : public VPSingleDefRecipe {
685
676
}
686
677
}
687
678
688
- template <typename IterT>
689
- VPRecipeWithIRFlags (const unsigned char SC, IterT Operands,
679
+ VPRecipeWithIRFlags (const unsigned char SC, ArrayRef<VPValue *> Operands,
690
680
CmpInst::Predicate Pred, DebugLoc DL = {})
691
681
: VPSingleDefRecipe(SC, Operands, DL), OpType(OperationType::Cmp),
692
682
CmpPredicate (Pred) {}
693
683
694
- template <typename IterT>
695
- VPRecipeWithIRFlags (const unsigned char SC, IterT Operands,
684
+ VPRecipeWithIRFlags (const unsigned char SC, ArrayRef<VPValue *> Operands,
696
685
WrapFlagsTy WrapFlags, DebugLoc DL = {})
697
686
: VPSingleDefRecipe(SC, Operands, DL),
698
687
OpType(OperationType::OverflowingBinOp), WrapFlags(WrapFlags) {}
699
688
700
- template <typename IterT>
701
- VPRecipeWithIRFlags (const unsigned char SC, IterT Operands,
689
+ VPRecipeWithIRFlags (const unsigned char SC, ArrayRef<VPValue *> Operands,
702
690
FastMathFlags FMFs, DebugLoc DL = {})
703
691
: VPSingleDefRecipe(SC, Operands, DL), OpType(OperationType::FPMathOp),
704
692
FMFs(FMFs) {}
705
693
706
- template <typename IterT>
707
- VPRecipeWithIRFlags (const unsigned char SC, IterT Operands,
694
+ VPRecipeWithIRFlags (const unsigned char SC, ArrayRef<VPValue *> Operands,
708
695
DisjointFlagsTy DisjointFlags, DebugLoc DL = {})
709
696
: VPSingleDefRecipe(SC, Operands, DL), OpType(OperationType::DisjointOp),
710
697
DisjointFlags(DisjointFlags) {}
711
698
712
699
protected:
713
- template <typename IterT>
714
- VPRecipeWithIRFlags (const unsigned char SC, IterT Operands,
700
+ VPRecipeWithIRFlags (const unsigned char SC, ArrayRef<VPValue *> Operands,
715
701
GEPNoWrapFlags GEPFlags, DebugLoc DL = {})
716
702
: VPSingleDefRecipe(SC, Operands, DL), OpType(OperationType::GEPOp),
717
703
GEPFlags(GEPFlags) {}
@@ -1225,15 +1211,13 @@ class VPWidenRecipe : public VPRecipeWithIRFlags, public VPIRMetadata {
1225
1211
unsigned Opcode;
1226
1212
1227
1213
protected:
1228
- template <typename IterT>
1229
1214
VPWidenRecipe (unsigned VPDefOpcode, Instruction &I,
1230
- iterator_range<IterT > Operands)
1215
+ ArrayRef<VPValue * > Operands)
1231
1216
: VPRecipeWithIRFlags(VPDefOpcode, Operands, I), VPIRMetadata(I),
1232
1217
Opcode (I.getOpcode()) {}
1233
1218
1234
1219
public:
1235
- template <typename IterT>
1236
- VPWidenRecipe (Instruction &I, iterator_range<IterT> Operands)
1220
+ VPWidenRecipe (Instruction &I, ArrayRef<VPValue *> Operands)
1237
1221
: VPWidenRecipe(VPDef::VPWidenSC, I, Operands) {}
1238
1222
1239
1223
~VPWidenRecipe () override = default ;
@@ -1466,8 +1450,7 @@ class VPHistogramRecipe : public VPRecipeBase {
1466
1450
unsigned Opcode;
1467
1451
1468
1452
public:
1469
- template <typename IterT>
1470
- VPHistogramRecipe (unsigned Opcode, iterator_range<IterT> Operands,
1453
+ VPHistogramRecipe (unsigned Opcode, ArrayRef<VPValue *> Operands,
1471
1454
DebugLoc DL = {})
1472
1455
: VPRecipeBase(VPDef::VPHistogramSC, Operands, DL), Opcode(Opcode) {}
1473
1456
@@ -1503,8 +1486,7 @@ class VPHistogramRecipe : public VPRecipeBase {
1503
1486
1504
1487
// / A recipe for widening select instructions.
1505
1488
struct VPWidenSelectRecipe : public VPRecipeWithIRFlags , public VPIRMetadata {
1506
- template <typename IterT>
1507
- VPWidenSelectRecipe (SelectInst &I, iterator_range<IterT> Operands)
1489
+ VPWidenSelectRecipe (SelectInst &I, ArrayRef<VPValue *> Operands)
1508
1490
: VPRecipeWithIRFlags(VPDef::VPWidenSelectSC, Operands, I),
1509
1491
VPIRMetadata (I) {}
1510
1492
@@ -1563,8 +1545,7 @@ class VPWidenGEPRecipe : public VPRecipeWithIRFlags {
1563
1545
}
1564
1546
1565
1547
public:
1566
- template <typename IterT>
1567
- VPWidenGEPRecipe (GetElementPtrInst *GEP, iterator_range<IterT> Operands)
1548
+ VPWidenGEPRecipe (GetElementPtrInst *GEP, ArrayRef<VPValue *> Operands)
1568
1549
: VPRecipeWithIRFlags(VPDef::VPWidenGEPSC, Operands, *GEP) {
1569
1550
SmallVector<std::pair<unsigned , MDNode *>> Metadata;
1570
1551
(void )Metadata;
@@ -2489,8 +2470,7 @@ class VPReplicateRecipe : public VPRecipeWithIRFlags {
2489
2470
bool IsPredicated;
2490
2471
2491
2472
public:
2492
- template <typename IterT>
2493
- VPReplicateRecipe (Instruction *I, iterator_range<IterT> Operands,
2473
+ VPReplicateRecipe (Instruction *I, ArrayRef<VPValue *> Operands,
2494
2474
bool IsUniform, VPValue *Mask = nullptr )
2495
2475
: VPRecipeWithIRFlags(VPDef::VPReplicateSC, Operands, *I),
2496
2476
IsUniform (IsUniform), IsPredicated(Mask) {
0 commit comments