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 @@ -1669,9 +1669,9 @@ getPointersChainCost(ArrayRef Ptrs, const Value *Base, const TTI::PointersChainInfo &Info, Type *AccessTy, TTI::TargetCostKind CostKind) = 0; - virtual unsigned getInliningThresholdMultiplier() = 0; + virtual unsigned getInliningThresholdMultiplier() const = 0; virtual unsigned adjustInliningThreshold(const CallBase *CB) = 0; - virtual int getInlinerVectorBonusPercent() = 0; + virtual int getInlinerVectorBonusPercent() const = 0; virtual InstructionCost getMemcpyCost(const Instruction *I) = 0; virtual unsigned getEstimatedNumberOfCaseClusters(const SwitchInst &SI, unsigned &JTSize, @@ -2032,13 +2032,13 @@ TargetCostKind CostKind) override { return Impl.getPointersChainCost(Ptrs, Base, Info, AccessTy, CostKind); } - unsigned getInliningThresholdMultiplier() override { + unsigned getInliningThresholdMultiplier() const override { return Impl.getInliningThresholdMultiplier(); } unsigned adjustInliningThreshold(const CallBase *CB) override { return Impl.adjustInliningThreshold(CB); } - int getInlinerVectorBonusPercent() override { + int getInlinerVectorBonusPercent() const override { return Impl.getInlinerVectorBonusPercent(); } InstructionCost getMemcpyCost(const Instruction *I) override { diff --git a/llvm/include/llvm/CodeGen/BasicTTIImpl.h b/llvm/include/llvm/CodeGen/BasicTTIImpl.h --- a/llvm/include/llvm/CodeGen/BasicTTIImpl.h +++ b/llvm/include/llvm/CodeGen/BasicTTIImpl.h @@ -532,10 +532,10 @@ return TargetTransformInfo::TCC_Expensive; } - unsigned getInliningThresholdMultiplier() { return 1; } + unsigned getInliningThresholdMultiplier() const { return 1; } unsigned adjustInliningThreshold(const CallBase *CB) { return 0; } - int getInlinerVectorBonusPercent() { return 150; } + int getInlinerVectorBonusPercent() const { return 150; } void getUnrollingPreferences(Loop *L, ScalarEvolution &SE, TTI::UnrollingPreferences &UP, diff --git a/llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.h b/llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.h --- a/llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.h +++ b/llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.h @@ -230,10 +230,10 @@ bool areInlineCompatible(const Function *Caller, const Function *Callee) const; - unsigned getInliningThresholdMultiplier() { return 11; } + unsigned getInliningThresholdMultiplier() const { return 11; } unsigned adjustInliningThreshold(const CallBase *CB) const; - int getInlinerVectorBonusPercent() { return 0; } + int getInlinerVectorBonusPercent() const { return 0; } InstructionCost getArithmeticReductionCost( unsigned Opcode, VectorType *Ty, std::optional FMF, diff --git a/llvm/lib/Target/NVPTX/NVPTXTargetTransformInfo.h b/llvm/lib/Target/NVPTX/NVPTXTargetTransformInfo.h --- a/llvm/lib/Target/NVPTX/NVPTXTargetTransformInfo.h +++ b/llvm/lib/Target/NVPTX/NVPTXTargetTransformInfo.h @@ -92,7 +92,7 @@ // Increase the inlining cost threshold by a factor of 11, reflecting that // calls are particularly expensive in NVPTX. - unsigned getInliningThresholdMultiplier() { return 11; } + unsigned getInliningThresholdMultiplier() const { return 11; } InstructionCost getArithmeticInstrCost( unsigned Opcode, Type *Ty, TTI::TargetCostKind CostKind, diff --git a/llvm/lib/Target/SystemZ/SystemZTargetTransformInfo.h b/llvm/lib/Target/SystemZ/SystemZTargetTransformInfo.h --- a/llvm/lib/Target/SystemZ/SystemZTargetTransformInfo.h +++ b/llvm/lib/Target/SystemZ/SystemZTargetTransformInfo.h @@ -36,7 +36,7 @@ /// \name Scalar TTI Implementations /// @{ - unsigned getInliningThresholdMultiplier() { return 3; } + unsigned getInliningThresholdMultiplier() const { return 3; } unsigned adjustInliningThreshold(const CallBase *CB) const; InstructionCost getIntImmCost(const APInt &Imm, Type *Ty,