Skip to content

Commit cfe51db

Browse files
committed
[NFC][TargetTransformInfo] Make getInliningThreholdMultiplier and getInlinerVectorBonusPercent const
Reviewed By: jlebar Differential Revision: https://reviews.llvm.org/D149739
1 parent 99941f6 commit cfe51db

File tree

5 files changed

+10
-10
lines changed

5 files changed

+10
-10
lines changed

llvm/include/llvm/Analysis/TargetTransformInfo.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1669,9 +1669,9 @@ class TargetTransformInfo::Concept {
16691669
getPointersChainCost(ArrayRef<const Value *> Ptrs, const Value *Base,
16701670
const TTI::PointersChainInfo &Info, Type *AccessTy,
16711671
TTI::TargetCostKind CostKind) = 0;
1672-
virtual unsigned getInliningThresholdMultiplier() = 0;
1672+
virtual unsigned getInliningThresholdMultiplier() const = 0;
16731673
virtual unsigned adjustInliningThreshold(const CallBase *CB) = 0;
1674-
virtual int getInlinerVectorBonusPercent() = 0;
1674+
virtual int getInlinerVectorBonusPercent() const = 0;
16751675
virtual InstructionCost getMemcpyCost(const Instruction *I) = 0;
16761676
virtual unsigned
16771677
getEstimatedNumberOfCaseClusters(const SwitchInst &SI, unsigned &JTSize,
@@ -2032,13 +2032,13 @@ class TargetTransformInfo::Model final : public TargetTransformInfo::Concept {
20322032
TargetCostKind CostKind) override {
20332033
return Impl.getPointersChainCost(Ptrs, Base, Info, AccessTy, CostKind);
20342034
}
2035-
unsigned getInliningThresholdMultiplier() override {
2035+
unsigned getInliningThresholdMultiplier() const override {
20362036
return Impl.getInliningThresholdMultiplier();
20372037
}
20382038
unsigned adjustInliningThreshold(const CallBase *CB) override {
20392039
return Impl.adjustInliningThreshold(CB);
20402040
}
2041-
int getInlinerVectorBonusPercent() override {
2041+
int getInlinerVectorBonusPercent() const override {
20422042
return Impl.getInlinerVectorBonusPercent();
20432043
}
20442044
InstructionCost getMemcpyCost(const Instruction *I) override {

llvm/include/llvm/CodeGen/BasicTTIImpl.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -532,10 +532,10 @@ class BasicTTIImplBase : public TargetTransformInfoImplCRTPBase<T> {
532532
return TargetTransformInfo::TCC_Expensive;
533533
}
534534

535-
unsigned getInliningThresholdMultiplier() { return 1; }
535+
unsigned getInliningThresholdMultiplier() const { return 1; }
536536
unsigned adjustInliningThreshold(const CallBase *CB) { return 0; }
537537

538-
int getInlinerVectorBonusPercent() { return 150; }
538+
int getInlinerVectorBonusPercent() const { return 150; }
539539

540540
void getUnrollingPreferences(Loop *L, ScalarEvolution &SE,
541541
TTI::UnrollingPreferences &UP,

llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -230,10 +230,10 @@ class GCNTTIImpl final : public BasicTTIImplBase<GCNTTIImpl> {
230230
bool areInlineCompatible(const Function *Caller,
231231
const Function *Callee) const;
232232

233-
unsigned getInliningThresholdMultiplier() { return 11; }
233+
unsigned getInliningThresholdMultiplier() const { return 11; }
234234
unsigned adjustInliningThreshold(const CallBase *CB) const;
235235

236-
int getInlinerVectorBonusPercent() { return 0; }
236+
int getInlinerVectorBonusPercent() const { return 0; }
237237

238238
InstructionCost getArithmeticReductionCost(
239239
unsigned Opcode, VectorType *Ty, std::optional<FastMathFlags> FMF,

llvm/lib/Target/NVPTX/NVPTXTargetTransformInfo.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ class NVPTXTTIImpl : public BasicTTIImplBase<NVPTXTTIImpl> {
9292

9393
// Increase the inlining cost threshold by a factor of 11, reflecting that
9494
// calls are particularly expensive in NVPTX.
95-
unsigned getInliningThresholdMultiplier() { return 11; }
95+
unsigned getInliningThresholdMultiplier() const { return 11; }
9696

9797
InstructionCost getArithmeticInstrCost(
9898
unsigned Opcode, Type *Ty, TTI::TargetCostKind CostKind,

llvm/lib/Target/SystemZ/SystemZTargetTransformInfo.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class SystemZTTIImpl : public BasicTTIImplBase<SystemZTTIImpl> {
3636
/// \name Scalar TTI Implementations
3737
/// @{
3838

39-
unsigned getInliningThresholdMultiplier() { return 3; }
39+
unsigned getInliningThresholdMultiplier() const { return 3; }
4040
unsigned adjustInliningThreshold(const CallBase *CB) const;
4141

4242
InstructionCost getIntImmCost(const APInt &Imm, Type *Ty,

0 commit comments

Comments
 (0)