[llvm] cfe51db - [NFC][TargetTransformInfo] Make getInliningThreholdMultiplier and getInlinerVectorBonusPercent const
Juan Manuel MARTINEZ CAAMAÑO via llvm-commits
llvm-commits at lists.llvm.org
Thu Jun 1 08:09:17 PDT 2023
Author: Juan Manuel MARTINEZ CAAMAÑO
Date: 2023-06-01T17:09:01+02:00
New Revision: cfe51dbc14b90a3fed7704a39bda215594639d2e
URL: https://github.com/llvm/llvm-project/commit/cfe51dbc14b90a3fed7704a39bda215594639d2e
DIFF: https://github.com/llvm/llvm-project/commit/cfe51dbc14b90a3fed7704a39bda215594639d2e.diff
LOG: [NFC][TargetTransformInfo] Make getInliningThreholdMultiplier and getInlinerVectorBonusPercent const
Reviewed By: jlebar
Differential Revision: https://reviews.llvm.org/D149739
Added:
Modified:
llvm/include/llvm/Analysis/TargetTransformInfo.h
llvm/include/llvm/CodeGen/BasicTTIImpl.h
llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.h
llvm/lib/Target/NVPTX/NVPTXTargetTransformInfo.h
llvm/lib/Target/SystemZ/SystemZTargetTransformInfo.h
Removed:
################################################################################
diff --git a/llvm/include/llvm/Analysis/TargetTransformInfo.h b/llvm/include/llvm/Analysis/TargetTransformInfo.h
index 7f03fa801298a..0e10162a6435d 100644
--- a/llvm/include/llvm/Analysis/TargetTransformInfo.h
+++ b/llvm/include/llvm/Analysis/TargetTransformInfo.h
@@ -1669,9 +1669,9 @@ class TargetTransformInfo::Concept {
getPointersChainCost(ArrayRef<const Value *> 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 @@ class TargetTransformInfo::Model final : public TargetTransformInfo::Concept {
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 1a5e94b8f1085..1c645775d470c 100644
--- a/llvm/include/llvm/CodeGen/BasicTTIImpl.h
+++ b/llvm/include/llvm/CodeGen/BasicTTIImpl.h
@@ -532,10 +532,10 @@ class BasicTTIImplBase : public TargetTransformInfoImplCRTPBase<T> {
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 cdd76861335fb..630804f169bfc 100644
--- a/llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.h
+++ b/llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.h
@@ -230,10 +230,10 @@ class GCNTTIImpl final : public BasicTTIImplBase<GCNTTIImpl> {
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<FastMathFlags> FMF,
diff --git a/llvm/lib/Target/NVPTX/NVPTXTargetTransformInfo.h b/llvm/lib/Target/NVPTX/NVPTXTargetTransformInfo.h
index b7bc0f215421d..0cee130e1e114 100644
--- a/llvm/lib/Target/NVPTX/NVPTXTargetTransformInfo.h
+++ b/llvm/lib/Target/NVPTX/NVPTXTargetTransformInfo.h
@@ -92,7 +92,7 @@ class NVPTXTTIImpl : public BasicTTIImplBase<NVPTXTTIImpl> {
// 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 1c82e6940033b..62c59ddc3f06a 100644
--- a/llvm/lib/Target/SystemZ/SystemZTargetTransformInfo.h
+++ b/llvm/lib/Target/SystemZ/SystemZTargetTransformInfo.h
@@ -36,7 +36,7 @@ class SystemZTTIImpl : public BasicTTIImplBase<SystemZTTIImpl> {
/// \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,
More information about the llvm-commits
mailing list