From cfe51dbc14b90a3fed7704a39bda215594639d2e Mon Sep 17 00:00:00 2001 From: =?utf8?q?Juan=20Manuel=20MARTINEZ=20CAAMA=C3=91O?= Date: Thu, 1 Jun 2023 16:54:49 +0200 Subject: [PATCH] [NFC][TargetTransformInfo] Make getInliningThreholdMultiplier and getInlinerVectorBonusPercent const Reviewed By: jlebar Differential Revision: https://reviews.llvm.org/D149739 --- llvm/include/llvm/Analysis/TargetTransformInfo.h | 8 ++++---- llvm/include/llvm/CodeGen/BasicTTIImpl.h | 4 ++-- llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.h | 4 ++-- llvm/lib/Target/NVPTX/NVPTXTargetTransformInfo.h | 2 +- llvm/lib/Target/SystemZ/SystemZTargetTransformInfo.h | 2 +- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/llvm/include/llvm/Analysis/TargetTransformInfo.h b/llvm/include/llvm/Analysis/TargetTransformInfo.h index 7f03fa8..0e10162 100644 --- a/llvm/include/llvm/Analysis/TargetTransformInfo.h +++ b/llvm/include/llvm/Analysis/TargetTransformInfo.h @@ -1669,9 +1669,9 @@ public: 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 @@ public: 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 index 1a5e94b..1c64577 100644 --- a/llvm/include/llvm/CodeGen/BasicTTIImpl.h +++ b/llvm/include/llvm/CodeGen/BasicTTIImpl.h @@ -532,10 +532,10 @@ public: 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 index cdd7686..630804f 100644 --- a/llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.h +++ b/llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.h @@ -230,10 +230,10 @@ public: 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 index b7bc0f2..0cee130 100644 --- a/llvm/lib/Target/NVPTX/NVPTXTargetTransformInfo.h +++ b/llvm/lib/Target/NVPTX/NVPTXTargetTransformInfo.h @@ -92,7 +92,7 @@ public: // 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 index 1c82e69..62c59dd 100644 --- a/llvm/lib/Target/SystemZ/SystemZTargetTransformInfo.h +++ b/llvm/lib/Target/SystemZ/SystemZTargetTransformInfo.h @@ -36,7 +36,7 @@ public: /// \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, -- 2.7.4