@@ -898,11 +898,11 @@ class TargetTransformInfo {
898898
899899 // / Estimate the overhead of scalarizing an instruction. Insert and Extract
900900 // / are set if the demanded result elements need to be inserted and/or
901- // / extracted from vectors.
902- InstructionCost getScalarizationOverhead (VectorType *Ty,
903- const APInt &DemandedElts,
904- bool Insert, bool Extract,
905- TTI::TargetCostKind CostKind ) const ;
901+ // / extracted from vectors. The involved values may be passed in VL if
902+ // / Insert is true.
903+ InstructionCost getScalarizationOverhead (
904+ VectorType *Ty, const APInt &DemandedElts, bool Insert, bool Extract,
905+ TTI::TargetCostKind CostKind, ArrayRef<Value *> VL = std:: nullopt ) const ;
906906
907907 // / Estimate the overhead of scalarizing an instructions unique
908908 // / non-constant operands. The (potentially vector) types to use for each of
@@ -1973,10 +1973,10 @@ class TargetTransformInfo::Concept {
19731973 virtual bool isTargetIntrinsicTriviallyScalarizable (Intrinsic::ID ID) = 0;
19741974 virtual bool isTargetIntrinsicWithScalarOpAtArg (Intrinsic::ID ID,
19751975 unsigned ScalarOpdIdx) = 0;
1976- virtual InstructionCost getScalarizationOverhead (VectorType *Ty,
1977- const APInt &DemandedElts,
1978- bool Insert, bool Extract,
1979- TargetCostKind CostKind ) = 0;
1976+ virtual InstructionCost
1977+ getScalarizationOverhead (VectorType *Ty, const APInt &DemandedElts,
1978+ bool Insert, bool Extract, TargetCostKind CostKind ,
1979+ ArrayRef<Value *> VL = std:: nullopt ) = 0 ;
19801980 virtual InstructionCost
19811981 getOperandsScalarizationOverhead (ArrayRef<const Value *> Args,
19821982 ArrayRef<Type *> Tys,
@@ -2536,12 +2536,12 @@ class TargetTransformInfo::Model final : public TargetTransformInfo::Concept {
25362536 return Impl.isTargetIntrinsicWithScalarOpAtArg (ID, ScalarOpdIdx);
25372537 }
25382538
2539- InstructionCost getScalarizationOverhead (VectorType *Ty,
2540- const APInt &DemandedElts,
2541- bool Insert, bool Extract,
2542- TargetCostKind CostKind ) override {
2539+ InstructionCost
2540+ getScalarizationOverhead (VectorType *Ty, const APInt &DemandedElts,
2541+ bool Insert, bool Extract, TargetCostKind CostKind ,
2542+ ArrayRef<Value *> VL = std:: nullopt ) override {
25432543 return Impl.getScalarizationOverhead (Ty, DemandedElts, Insert, Extract,
2544- CostKind);
2544+ CostKind, VL );
25452545 }
25462546 InstructionCost
25472547 getOperandsScalarizationOverhead (ArrayRef<const Value *> Args,
0 commit comments