diff --git a/llvm/include/llvm/Analysis/TargetTransformInfo.h b/llvm/include/llvm/Analysis/TargetTransformInfo.h --- a/llvm/include/llvm/Analysis/TargetTransformInfo.h +++ b/llvm/include/llvm/Analysis/TargetTransformInfo.h @@ -293,7 +293,7 @@ /// \return the expected cost of a memcpy, which could e.g. depend on the /// source/destination type and alignment and the number of bytes copied. - int getMemcpyCost(const Instruction *I) const; + InstructionCost getMemcpyCost(const Instruction *I) const; /// \return The estimated number of case clusters when lowering \p 'SI'. /// \p JTSize Set a jump table size only when \p SI is suitable for a jump @@ -1408,7 +1408,7 @@ virtual unsigned getInliningThresholdMultiplier() = 0; virtual unsigned adjustInliningThreshold(const CallBase *CB) = 0; virtual int getInlinerVectorBonusPercent() = 0; - virtual int getMemcpyCost(const Instruction *I) = 0; + virtual InstructionCost getMemcpyCost(const Instruction *I) = 0; virtual unsigned getEstimatedNumberOfCaseClusters(const SwitchInst &SI, unsigned &JTSize, ProfileSummaryInfo *PSI, @@ -1709,7 +1709,7 @@ int getInlinerVectorBonusPercent() override { return Impl.getInlinerVectorBonusPercent(); } - int getMemcpyCost(const Instruction *I) override { + InstructionCost getMemcpyCost(const Instruction *I) override { return Impl.getMemcpyCost(I); } InstructionCost getUserCost(const User *U, ArrayRef Operands, diff --git a/llvm/include/llvm/Analysis/TargetTransformInfoImpl.h b/llvm/include/llvm/Analysis/TargetTransformInfoImpl.h --- a/llvm/include/llvm/Analysis/TargetTransformInfoImpl.h +++ b/llvm/include/llvm/Analysis/TargetTransformInfoImpl.h @@ -75,7 +75,7 @@ int getInlinerVectorBonusPercent() const { return 150; } - unsigned getMemcpyCost(const Instruction *I) const { + InstructionCost getMemcpyCost(const Instruction *I) const { return TTI::TCC_Expensive; } diff --git a/llvm/lib/Analysis/TargetTransformInfo.cpp b/llvm/lib/Analysis/TargetTransformInfo.cpp --- a/llvm/lib/Analysis/TargetTransformInfo.cpp +++ b/llvm/lib/Analysis/TargetTransformInfo.cpp @@ -885,8 +885,8 @@ return Cost; } -int TargetTransformInfo::getMemcpyCost(const Instruction *I) const { - int Cost = TTIImpl->getMemcpyCost(I); +InstructionCost TargetTransformInfo::getMemcpyCost(const Instruction *I) const { + InstructionCost Cost = TTIImpl->getMemcpyCost(I); assert(Cost >= 0 && "TTI should not produce negative costs!"); return Cost; } diff --git a/llvm/lib/Target/ARM/ARMTargetTransformInfo.h b/llvm/lib/Target/ARM/ARMTargetTransformInfo.h --- a/llvm/lib/Target/ARM/ARMTargetTransformInfo.h +++ b/llvm/lib/Target/ARM/ARMTargetTransformInfo.h @@ -183,7 +183,7 @@ return isLegalMaskedGather(Ty, Alignment); } - int getMemcpyCost(const Instruction *I); + InstructionCost getMemcpyCost(const Instruction *I); int getNumMemOps(const IntrinsicInst *I) const; diff --git a/llvm/lib/Target/ARM/ARMTargetTransformInfo.cpp b/llvm/lib/Target/ARM/ARMTargetTransformInfo.cpp --- a/llvm/lib/Target/ARM/ARMTargetTransformInfo.cpp +++ b/llvm/lib/Target/ARM/ARMTargetTransformInfo.cpp @@ -1126,7 +1126,7 @@ return -1; } -int ARMTTIImpl::getMemcpyCost(const Instruction *I) { +InstructionCost ARMTTIImpl::getMemcpyCost(const Instruction *I) { int NumOps = getNumMemOps(cast(I)); // To model the cost of a library call, we assume 1 for the call, and