diff --git a/llvm/include/llvm/Analysis/TargetTransformInfo.h b/llvm/include/llvm/Analysis/TargetTransformInfo.h index 23254d92d1c91a..646c61dc464083 100644 --- a/llvm/include/llvm/Analysis/TargetTransformInfo.h +++ b/llvm/include/llvm/Analysis/TargetTransformInfo.h @@ -1223,8 +1223,9 @@ class TargetTransformInfo { /// The 'SE' parameter holds pointer for the scalar evolution object which /// is used in order to get the Ptr step value in case of constant stride. /// The 'Ptr' parameter holds SCEV of the access pointer. - int getAddressComputationCost(Type *Ty, ScalarEvolution *SE = nullptr, - const SCEV *Ptr = nullptr) const; + InstructionCost getAddressComputationCost(Type *Ty, + ScalarEvolution *SE = nullptr, + const SCEV *Ptr = nullptr) const; /// \returns The cost, if any, of keeping values of the given types alive /// over a callsite. @@ -1628,8 +1629,8 @@ class TargetTransformInfo::Concept { ArrayRef Tys, TTI::TargetCostKind CostKind) = 0; virtual unsigned getNumberOfParts(Type *Tp) = 0; - virtual int getAddressComputationCost(Type *Ty, ScalarEvolution *SE, - const SCEV *Ptr) = 0; + virtual InstructionCost + getAddressComputationCost(Type *Ty, ScalarEvolution *SE, const SCEV *Ptr) = 0; virtual unsigned getCostOfKeepingLiveOverCall(ArrayRef Tys) = 0; virtual bool getTgtMemIntrinsic(IntrinsicInst *Inst, MemIntrinsicInfo &Info) = 0; @@ -2135,8 +2136,8 @@ class TargetTransformInfo::Model final : public TargetTransformInfo::Concept { unsigned getNumberOfParts(Type *Tp) override { return Impl.getNumberOfParts(Tp); } - int getAddressComputationCost(Type *Ty, ScalarEvolution *SE, - const SCEV *Ptr) override { + InstructionCost getAddressComputationCost(Type *Ty, ScalarEvolution *SE, + const SCEV *Ptr) override { return Impl.getAddressComputationCost(Ty, SE, Ptr); } unsigned getCostOfKeepingLiveOverCall(ArrayRef Tys) override { diff --git a/llvm/include/llvm/Analysis/TargetTransformInfoImpl.h b/llvm/include/llvm/Analysis/TargetTransformInfoImpl.h index 392c283f9794d6..966660e1c8f66b 100644 --- a/llvm/include/llvm/Analysis/TargetTransformInfoImpl.h +++ b/llvm/include/llvm/Analysis/TargetTransformInfoImpl.h @@ -611,8 +611,8 @@ class TargetTransformInfoImplBase { unsigned getNumberOfParts(Type *Tp) const { return 0; } - unsigned getAddressComputationCost(Type *Tp, ScalarEvolution *, - const SCEV *) const { + InstructionCost getAddressComputationCost(Type *Tp, ScalarEvolution *, + const SCEV *) const { return 0; } diff --git a/llvm/include/llvm/CodeGen/BasicTTIImpl.h b/llvm/include/llvm/CodeGen/BasicTTIImpl.h index a52ed344fec06d..ebc49bb04c9f68 100644 --- a/llvm/include/llvm/CodeGen/BasicTTIImpl.h +++ b/llvm/include/llvm/CodeGen/BasicTTIImpl.h @@ -1898,8 +1898,8 @@ class BasicTTIImplBase : public TargetTransformInfoImplCRTPBase { return LT.first; } - unsigned getAddressComputationCost(Type *Ty, ScalarEvolution *, - const SCEV *) { + InstructionCost getAddressComputationCost(Type *Ty, ScalarEvolution *, + const SCEV *) { return 0; } diff --git a/llvm/lib/Analysis/TargetTransformInfo.cpp b/llvm/lib/Analysis/TargetTransformInfo.cpp index 331863ce20435c..6d78abce8d3261 100644 --- a/llvm/lib/Analysis/TargetTransformInfo.cpp +++ b/llvm/lib/Analysis/TargetTransformInfo.cpp @@ -876,10 +876,10 @@ unsigned TargetTransformInfo::getNumberOfParts(Type *Tp) const { return TTIImpl->getNumberOfParts(Tp); } -int TargetTransformInfo::getAddressComputationCost(Type *Tp, - ScalarEvolution *SE, - const SCEV *Ptr) const { - int Cost = TTIImpl->getAddressComputationCost(Tp, SE, Ptr); +InstructionCost +TargetTransformInfo::getAddressComputationCost(Type *Tp, ScalarEvolution *SE, + const SCEV *Ptr) const { + InstructionCost Cost = TTIImpl->getAddressComputationCost(Tp, SE, Ptr); assert(Cost >= 0 && "TTI should not produce negative costs!"); return Cost; } diff --git a/llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp b/llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp index a3accfb5ac8286..0724ab494f3e63 100644 --- a/llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp +++ b/llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp @@ -940,8 +940,9 @@ InstructionCost AArch64TTIImpl::getArithmeticInstrCost( } } -int AArch64TTIImpl::getAddressComputationCost(Type *Ty, ScalarEvolution *SE, - const SCEV *Ptr) { +InstructionCost AArch64TTIImpl::getAddressComputationCost(Type *Ty, + ScalarEvolution *SE, + const SCEV *Ptr) { // Address computations in vectorized code with non-consecutive addresses will // likely result in more instructions compared to scalar code where the // computation can more often be merged into the index mode. The resulting diff --git a/llvm/lib/Target/AArch64/AArch64TargetTransformInfo.h b/llvm/lib/Target/AArch64/AArch64TargetTransformInfo.h index 1bc2611dfaa740..af179a93fbadb6 100644 --- a/llvm/lib/Target/AArch64/AArch64TargetTransformInfo.h +++ b/llvm/lib/Target/AArch64/AArch64TargetTransformInfo.h @@ -169,7 +169,8 @@ class AArch64TTIImpl : public BasicTTIImplBase { ArrayRef Args = ArrayRef(), const Instruction *CxtI = nullptr); - int getAddressComputationCost(Type *Ty, ScalarEvolution *SE, const SCEV *Ptr); + InstructionCost getAddressComputationCost(Type *Ty, ScalarEvolution *SE, + const SCEV *Ptr); InstructionCost getCmpSelInstrCost(unsigned Opcode, Type *ValTy, Type *CondTy, CmpInst::Predicate VecPred, diff --git a/llvm/lib/Target/ARM/ARMTargetTransformInfo.cpp b/llvm/lib/Target/ARM/ARMTargetTransformInfo.cpp index 34d978fa5e8f34..7a06ce27292925 100644 --- a/llvm/lib/Target/ARM/ARMTargetTransformInfo.cpp +++ b/llvm/lib/Target/ARM/ARMTargetTransformInfo.cpp @@ -977,8 +977,9 @@ InstructionCost ARMTTIImpl::getCmpSelInstrCost(unsigned Opcode, Type *ValTy, BaseT::getCmpSelInstrCost(Opcode, ValTy, CondTy, VecPred, CostKind, I); } -int ARMTTIImpl::getAddressComputationCost(Type *Ty, ScalarEvolution *SE, - const SCEV *Ptr) { +InstructionCost ARMTTIImpl::getAddressComputationCost(Type *Ty, + ScalarEvolution *SE, + const SCEV *Ptr) { // Address computations in vectorized code with non-consecutive addresses will // likely result in more instructions compared to scalar code where the // computation can more often be merged into the index mode. The resulting diff --git a/llvm/lib/Target/ARM/ARMTargetTransformInfo.h b/llvm/lib/Target/ARM/ARMTargetTransformInfo.h index 67574a9cc0beea..09b86b33d900ec 100644 --- a/llvm/lib/Target/ARM/ARMTargetTransformInfo.h +++ b/llvm/lib/Target/ARM/ARMTargetTransformInfo.h @@ -215,8 +215,8 @@ class ARMTTIImpl : public BasicTTIImplBase { InstructionCost getVectorInstrCost(unsigned Opcode, Type *Val, unsigned Index); - int getAddressComputationCost(Type *Val, ScalarEvolution *SE, - const SCEV *Ptr); + InstructionCost getAddressComputationCost(Type *Val, ScalarEvolution *SE, + const SCEV *Ptr); InstructionCost getArithmeticInstrCost( unsigned Opcode, Type *Ty, diff --git a/llvm/lib/Target/Hexagon/HexagonTargetTransformInfo.cpp b/llvm/lib/Target/Hexagon/HexagonTargetTransformInfo.cpp index db16f730a91751..96f1597bebedca 100644 --- a/llvm/lib/Target/Hexagon/HexagonTargetTransformInfo.cpp +++ b/llvm/lib/Target/Hexagon/HexagonTargetTransformInfo.cpp @@ -150,8 +150,9 @@ HexagonTTIImpl::getIntrinsicInstrCost(const IntrinsicCostAttributes &ICA, return BaseT::getIntrinsicInstrCost(ICA, CostKind); } -unsigned HexagonTTIImpl::getAddressComputationCost(Type *Tp, - ScalarEvolution *SE, const SCEV *S) { +InstructionCost HexagonTTIImpl::getAddressComputationCost(Type *Tp, + ScalarEvolution *SE, + const SCEV *S) { return 0; } diff --git a/llvm/lib/Target/Hexagon/HexagonTargetTransformInfo.h b/llvm/lib/Target/Hexagon/HexagonTargetTransformInfo.h index 1564710e18428b..fe799e81d4c599 100644 --- a/llvm/lib/Target/Hexagon/HexagonTargetTransformInfo.h +++ b/llvm/lib/Target/Hexagon/HexagonTargetTransformInfo.h @@ -113,8 +113,8 @@ class HexagonTTIImpl : public BasicTTIImplBase { TTI::TargetCostKind CostKind); InstructionCost getIntrinsicInstrCost(const IntrinsicCostAttributes &ICA, TTI::TargetCostKind CostKind); - unsigned getAddressComputationCost(Type *Tp, ScalarEvolution *SE, - const SCEV *S); + InstructionCost getAddressComputationCost(Type *Tp, ScalarEvolution *SE, + const SCEV *S); InstructionCost getMemoryOpCost(unsigned Opcode, Type *Src, MaybeAlign Alignment, unsigned AddressSpace, TTI::TargetCostKind CostKind, diff --git a/llvm/lib/Target/X86/X86TargetTransformInfo.cpp b/llvm/lib/Target/X86/X86TargetTransformInfo.cpp index 82de3ff12b7892..84f62e35d9d4a5 100644 --- a/llvm/lib/Target/X86/X86TargetTransformInfo.cpp +++ b/llvm/lib/Target/X86/X86TargetTransformInfo.cpp @@ -3336,8 +3336,9 @@ X86TTIImpl::getMaskedMemoryOpCost(unsigned Opcode, Type *SrcTy, Align Alignment, return Cost + LT.first; } -int X86TTIImpl::getAddressComputationCost(Type *Ty, ScalarEvolution *SE, - const SCEV *Ptr) { +InstructionCost X86TTIImpl::getAddressComputationCost(Type *Ty, + ScalarEvolution *SE, + const SCEV *Ptr) { // Address computations in vectorized code with non-consecutive addresses will // likely result in more instructions compared to scalar code where the // computation can more often be merged into the index mode. The resulting diff --git a/llvm/lib/Target/X86/X86TargetTransformInfo.h b/llvm/lib/Target/X86/X86TargetTransformInfo.h index 5707ddda36ec13..024b14b7953b89 100644 --- a/llvm/lib/Target/X86/X86TargetTransformInfo.h +++ b/llvm/lib/Target/X86/X86TargetTransformInfo.h @@ -155,8 +155,8 @@ class X86TTIImpl : public BasicTTIImplBase { Align Alignment, TTI::TargetCostKind CostKind, const Instruction *I); - int getAddressComputationCost(Type *PtrTy, ScalarEvolution *SE, - const SCEV *Ptr); + InstructionCost getAddressComputationCost(Type *PtrTy, ScalarEvolution *SE, + const SCEV *Ptr); Optional instCombineIntrinsic(InstCombiner &IC, IntrinsicInst &II) const;