@@ -897,8 +897,7 @@ class BasicTTIImplBase : public TargetTransformInfoImplCRTPBase<T> {
897
897
unsigned Opcode, Type *Ty, TTI::TargetCostKind CostKind,
898
898
TTI::OperandValueInfo Opd1Info = {TTI::OK_AnyValue, TTI::OP_None},
899
899
TTI::OperandValueInfo Opd2Info = {TTI::OK_AnyValue, TTI::OP_None},
900
- ArrayRef<const Value *> Args = std::nullopt ,
901
- const Instruction *CxtI = nullptr ) {
900
+ ArrayRef<const Value *> Args = {}, const Instruction *CxtI = nullptr ) {
902
901
// Check if any of the operands are vector operands.
903
902
const TargetLoweringBase *TLI = getTLI ();
904
903
int ISD = TLI->InstructionOpcodeToISD (Opcode);
@@ -1023,7 +1022,7 @@ class BasicTTIImplBase : public TargetTransformInfoImplCRTPBase<T> {
1023
1022
ArrayRef<int > Mask,
1024
1023
TTI::TargetCostKind CostKind, int Index,
1025
1024
VectorType *SubTp,
1026
- ArrayRef<const Value *> Args = std:: nullopt ,
1025
+ ArrayRef<const Value *> Args = {} ,
1027
1026
const Instruction *CxtI = nullptr ) {
1028
1027
switch (improveShuffleKindFromMask (Kind, Mask, Tp, Index, SubTp)) {
1029
1028
case TTI::SK_Broadcast:
@@ -1657,9 +1656,9 @@ class BasicTTIImplBase : public TargetTransformInfoImplCRTPBase<T> {
1657
1656
if (isa<ScalableVectorType>(RetTy))
1658
1657
return BaseT::getIntrinsicInstrCost (ICA, CostKind);
1659
1658
unsigned Index = cast<ConstantInt>(Args[1 ])->getZExtValue ();
1660
- return thisT ()->getShuffleCost (
1661
- TTI::SK_ExtractSubvector, cast<VectorType>(Args[0 ]->getType ()),
1662
- std:: nullopt , CostKind, Index, cast<VectorType>(RetTy));
1659
+ return thisT ()->getShuffleCost (TTI::SK_ExtractSubvector,
1660
+ cast<VectorType>(Args[0 ]->getType ()), {} ,
1661
+ CostKind, Index, cast<VectorType>(RetTy));
1663
1662
}
1664
1663
case Intrinsic::vector_insert: {
1665
1664
// FIXME: Handle case where a scalable vector is inserted into a scalable
@@ -1668,19 +1667,19 @@ class BasicTTIImplBase : public TargetTransformInfoImplCRTPBase<T> {
1668
1667
return BaseT::getIntrinsicInstrCost (ICA, CostKind);
1669
1668
unsigned Index = cast<ConstantInt>(Args[2 ])->getZExtValue ();
1670
1669
return thisT ()->getShuffleCost (
1671
- TTI::SK_InsertSubvector, cast<VectorType>(Args[0 ]->getType ()),
1672
- std:: nullopt , CostKind, Index, cast<VectorType>(Args[1 ]->getType ()));
1670
+ TTI::SK_InsertSubvector, cast<VectorType>(Args[0 ]->getType ()), {},
1671
+ CostKind, Index, cast<VectorType>(Args[1 ]->getType ()));
1673
1672
}
1674
1673
case Intrinsic::vector_reverse: {
1675
- return thisT ()->getShuffleCost (
1676
- TTI::SK_Reverse, cast<VectorType>(Args[0 ]->getType ()), std:: nullopt ,
1677
- CostKind, 0 , cast<VectorType>(RetTy));
1674
+ return thisT ()->getShuffleCost (TTI::SK_Reverse,
1675
+ cast<VectorType>(Args[0 ]->getType ()), {} ,
1676
+ CostKind, 0 , cast<VectorType>(RetTy));
1678
1677
}
1679
1678
case Intrinsic::vector_splice: {
1680
1679
unsigned Index = cast<ConstantInt>(Args[2 ])->getZExtValue ();
1681
- return thisT ()->getShuffleCost (
1682
- TTI::SK_Splice, cast<VectorType>(Args[0 ]->getType ()), std:: nullopt ,
1683
- CostKind, Index, cast<VectorType>(RetTy));
1680
+ return thisT ()->getShuffleCost (TTI::SK_Splice,
1681
+ cast<VectorType>(Args[0 ]->getType ()), {} ,
1682
+ CostKind, Index, cast<VectorType>(RetTy));
1684
1683
}
1685
1684
case Intrinsic::vector_reduce_add:
1686
1685
case Intrinsic::vector_reduce_mul:
@@ -2600,9 +2599,8 @@ class BasicTTIImplBase : public TargetTransformInfoImplCRTPBase<T> {
2600
2599
while (NumVecElts > MVTLen) {
2601
2600
NumVecElts /= 2 ;
2602
2601
VectorType *SubTy = FixedVectorType::get (ScalarTy, NumVecElts);
2603
- ShuffleCost +=
2604
- thisT ()->getShuffleCost (TTI::SK_ExtractSubvector, Ty, std::nullopt ,
2605
- CostKind, NumVecElts, SubTy);
2602
+ ShuffleCost += thisT ()->getShuffleCost (TTI::SK_ExtractSubvector, Ty, {},
2603
+ CostKind, NumVecElts, SubTy);
2606
2604
ArithCost += thisT ()->getArithmeticInstrCost (Opcode, SubTy, CostKind);
2607
2605
Ty = SubTy;
2608
2606
++LongVectorCount;
@@ -2618,7 +2616,7 @@ class BasicTTIImplBase : public TargetTransformInfoImplCRTPBase<T> {
2618
2616
// By default reductions need one shuffle per reduction level.
2619
2617
ShuffleCost +=
2620
2618
NumReduxLevels * thisT ()->getShuffleCost (TTI::SK_PermuteSingleSrc, Ty,
2621
- std:: nullopt , CostKind, 0 , Ty);
2619
+ {} , CostKind, 0 , Ty);
2622
2620
ArithCost +=
2623
2621
NumReduxLevels * thisT ()->getArithmeticInstrCost (Opcode, Ty, CostKind);
2624
2622
return ShuffleCost + ArithCost +
@@ -2691,9 +2689,8 @@ class BasicTTIImplBase : public TargetTransformInfoImplCRTPBase<T> {
2691
2689
NumVecElts /= 2 ;
2692
2690
auto *SubTy = FixedVectorType::get (ScalarTy, NumVecElts);
2693
2691
2694
- ShuffleCost +=
2695
- thisT ()->getShuffleCost (TTI::SK_ExtractSubvector, Ty, std::nullopt ,
2696
- CostKind, NumVecElts, SubTy);
2692
+ ShuffleCost += thisT ()->getShuffleCost (TTI::SK_ExtractSubvector, Ty, {},
2693
+ CostKind, NumVecElts, SubTy);
2697
2694
2698
2695
IntrinsicCostAttributes Attrs (IID, SubTy, {SubTy, SubTy}, FMF);
2699
2696
MinMaxCost += getIntrinsicInstrCost (Attrs, CostKind);
@@ -2709,7 +2706,7 @@ class BasicTTIImplBase : public TargetTransformInfoImplCRTPBase<T> {
2709
2706
// architecture-dependent length.
2710
2707
ShuffleCost +=
2711
2708
NumReduxLevels * thisT ()->getShuffleCost (TTI::SK_PermuteSingleSrc, Ty,
2712
- std:: nullopt , CostKind, 0 , Ty);
2709
+ {} , CostKind, 0 , Ty);
2713
2710
IntrinsicCostAttributes Attrs (IID, Ty, {Ty, Ty}, FMF);
2714
2711
MinMaxCost += NumReduxLevels * getIntrinsicInstrCost (Attrs, CostKind);
2715
2712
// The last min/max should be in vector registers and we counted it above.
0 commit comments