@@ -909,11 +909,11 @@ class TargetTransformInfo {
909909
910910 // / Estimate the overhead of scalarizing an instruction. Insert and Extract
911911 // / are set if the demanded result elements need to be inserted and/or
912- // / extracted from vectors.
913- InstructionCost getScalarizationOverhead (VectorType *Ty,
914- const APInt &DemandedElts,
915- bool Insert, bool Extract,
916- TTI::TargetCostKind CostKind ) const ;
912+ // / extracted from vectors. The involved values may be passed in VL if
913+ // / Insert is true.
914+ InstructionCost getScalarizationOverhead (
915+ VectorType *Ty, const APInt &DemandedElts, bool Insert, bool Extract,
916+ TTI::TargetCostKind CostKind, ArrayRef<Value *> VL = std:: nullopt ) const ;
917917
918918 // / Estimate the overhead of scalarizing an instructions unique
919919 // / non-constant operands. The (potentially vector) types to use for each of
@@ -2001,10 +2001,10 @@ class TargetTransformInfo::Concept {
20012001 unsigned ScalarOpdIdx) = 0;
20022002 virtual bool isVectorIntrinsicWithOverloadTypeAtArg (Intrinsic::ID ID,
20032003 int ScalarOpdIdx) = 0;
2004- virtual InstructionCost getScalarizationOverhead (VectorType *Ty,
2005- const APInt &DemandedElts,
2006- bool Insert, bool Extract,
2007- TargetCostKind CostKind ) = 0;
2004+ virtual InstructionCost
2005+ getScalarizationOverhead (VectorType *Ty, const APInt &DemandedElts,
2006+ bool Insert, bool Extract, TargetCostKind CostKind ,
2007+ ArrayRef<Value *> VL = std:: nullopt ) = 0 ;
20082008 virtual InstructionCost
20092009 getOperandsScalarizationOverhead (ArrayRef<const Value *> Args,
20102010 ArrayRef<Type *> Tys,
@@ -2582,12 +2582,12 @@ class TargetTransformInfo::Model final : public TargetTransformInfo::Concept {
25822582 return Impl.isVectorIntrinsicWithOverloadTypeAtArg (ID, ScalarOpdIdx);
25832583 }
25842584
2585- InstructionCost getScalarizationOverhead (VectorType *Ty,
2586- const APInt &DemandedElts,
2587- bool Insert, bool Extract,
2588- TargetCostKind CostKind ) override {
2585+ InstructionCost
2586+ getScalarizationOverhead (VectorType *Ty, const APInt &DemandedElts,
2587+ bool Insert, bool Extract, TargetCostKind CostKind ,
2588+ ArrayRef<Value *> VL = std:: nullopt ) override {
25892589 return Impl.getScalarizationOverhead (Ty, DemandedElts, Insert, Extract,
2590- CostKind);
2590+ CostKind, VL );
25912591 }
25922592 InstructionCost
25932593 getOperandsScalarizationOverhead (ArrayRef<const Value *> Args,
0 commit comments