@@ -5698,8 +5698,10 @@ int X86TTIImpl::getScatterOverhead() const {
5698
5698
5699
5699
// Return an average cost of Gather / Scatter instruction, maybe improved later.
5700
5700
// FIXME: Add TargetCostKind support.
5701
- InstructionCost X86TTIImpl::getGSVectorCost (unsigned Opcode, Type *SrcVTy,
5702
- const Value *Ptr, Align Alignment,
5701
+ InstructionCost X86TTIImpl::getGSVectorCost (unsigned Opcode,
5702
+ TTI::TargetCostKind CostKind,
5703
+ Type *SrcVTy, const Value *Ptr,
5704
+ Align Alignment,
5703
5705
unsigned AddressSpace) {
5704
5706
5705
5707
assert (isa<VectorType>(SrcVTy) && " Unexpected type in getGSVectorCost" );
@@ -5750,8 +5752,8 @@ InstructionCost X86TTIImpl::getGSVectorCost(unsigned Opcode, Type *SrcVTy,
5750
5752
// Handle splitting of vector of pointers
5751
5753
auto *SplitSrcTy =
5752
5754
FixedVectorType::get (SrcVTy->getScalarType (), VF / SplitFactor);
5753
- return SplitFactor * getGSVectorCost (Opcode, SplitSrcTy, Ptr, Alignment ,
5754
- AddressSpace);
5755
+ return SplitFactor * getGSVectorCost (Opcode, CostKind, SplitSrcTy, Ptr ,
5756
+ Alignment, AddressSpace);
5755
5757
}
5756
5758
5757
5759
// The gather / scatter cost is given by Intel architects. It is a rough
@@ -5771,15 +5773,14 @@ InstructionCost X86TTIImpl::getGSVectorCost(unsigned Opcode, Type *SrcVTy,
5771
5773
// / VariableMask - The mask is non-constant at compile time.
5772
5774
// / Alignment - Alignment for one element.
5773
5775
// / AddressSpace - pointer[s] address space.
5774
- // /
5775
- // / FIXME: Add TargetCostKind support.
5776
- InstructionCost X86TTIImpl::getGSScalarCost ( unsigned Opcode, Type *SrcVTy,
5777
- bool VariableMask, Align Alignment,
5776
+ InstructionCost X86TTIImpl::getGSScalarCost ( unsigned Opcode,
5777
+ TTI:: TargetCostKind CostKind,
5778
+ Type *SrcVTy, bool VariableMask ,
5779
+ Align Alignment,
5778
5780
unsigned AddressSpace) {
5779
5781
Type *ScalarTy = SrcVTy->getScalarType ();
5780
5782
unsigned VF = cast<FixedVectorType>(SrcVTy)->getNumElements ();
5781
5783
APInt DemandedElts = APInt::getAllOnes (VF);
5782
- TTI::TargetCostKind CostKind = TTI::TCK_RecipThroughput;
5783
5784
5784
5785
InstructionCost MaskUnpackCost = 0 ;
5785
5786
if (VariableMask) {
@@ -5848,10 +5849,11 @@ InstructionCost X86TTIImpl::getGatherScatterOpCost(
5848
5849
(!isLegalMaskedScatter (SrcVTy, Align (Alignment)) ||
5849
5850
forceScalarizeMaskedScatter (cast<VectorType>(SrcVTy),
5850
5851
Align (Alignment)))))
5851
- return getGSScalarCost (Opcode, SrcVTy, VariableMask, Alignment,
5852
+ return getGSScalarCost (Opcode, CostKind, SrcVTy, VariableMask, Alignment,
5852
5853
AddressSpace);
5853
5854
5854
- return getGSVectorCost (Opcode, SrcVTy, Ptr, Alignment, AddressSpace);
5855
+ return getGSVectorCost (Opcode, CostKind, SrcVTy, Ptr, Alignment,
5856
+ AddressSpace);
5855
5857
}
5856
5858
5857
5859
bool X86TTIImpl::isLSRCostLess (const TargetTransformInfo::LSRCost &C1,
0 commit comments