Skip to content

Commit 3c67155

Browse files
committed
Hide methods pulled in by using directive
1 parent 3f4bd77 commit 3c67155

21 files changed

+41
-30
lines changed

llvm/include/llvm/Analysis/TargetTransformInfoImpl.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ class TargetTransformInfoImplBase {
4747

4848
const DataLayout &getDataLayout() const { return DL; }
4949

50+
// FIXME: It looks like this implementation is dead. All clients appear to
51+
// use the (non-const) version from `TargetTransformInfoImplCRTPBase`.
5052
InstructionCost getGEPCost(Type *PointeeType, const Value *Ptr,
5153
ArrayRef<const Value *> Operands, Type *AccessType,
5254
TTI::TargetCostKind CostKind) const {

llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,7 @@ bool AArch64TTIImpl::shouldMaximizeVectorBandwidth(
371371
/// Calculate the cost of materializing a 64-bit value. This helper
372372
/// method might only calculate a fraction of a larger immediate. Therefore it
373373
/// is valid to return a cost of ZERO.
374-
InstructionCost AArch64TTIImpl::getIntImmCost(int64_t Val) {
374+
InstructionCost AArch64TTIImpl::getIntImmCost(int64_t Val) const {
375375
// Check if the immediate can be encoded within an instruction.
376376
if (Val == 0 || AArch64_AM::isLogicalImmediate(Val, 64))
377377
return 0;
@@ -386,8 +386,9 @@ InstructionCost AArch64TTIImpl::getIntImmCost(int64_t Val) {
386386
}
387387

388388
/// Calculate the cost of materializing the given constant.
389-
InstructionCost AArch64TTIImpl::getIntImmCost(const APInt &Imm, Type *Ty,
390-
TTI::TargetCostKind CostKind) {
389+
InstructionCost
390+
AArch64TTIImpl::getIntImmCost(const APInt &Imm, Type *Ty,
391+
TTI::TargetCostKind CostKind) const {
391392
assert(Ty->isIntegerTy());
392393

393394
unsigned BitSize = Ty->getPrimitiveSizeInBits();

llvm/lib/Target/AArch64/AArch64TargetTransformInfo.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,9 @@ class AArch64TTIImpl : public BasicTTIImplBase<AArch64TTIImpl> {
9999
/// @{
100100

101101
using BaseT::getIntImmCost;
102-
InstructionCost getIntImmCost(int64_t Val);
102+
InstructionCost getIntImmCost(int64_t Val) const;
103103
InstructionCost getIntImmCost(const APInt &Imm, Type *Ty,
104-
TTI::TargetCostKind CostKind);
104+
TTI::TargetCostKind CostKind) const;
105105
InstructionCost getIntImmCostInst(unsigned Opcode, unsigned Idx,
106106
const APInt &Imm, Type *Ty,
107107
TTI::TargetCostKind CostKind,

llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -835,7 +835,7 @@ GCNTTIImpl::getMinMaxReductionCost(Intrinsic::ID IID, VectorType *Ty,
835835
InstructionCost GCNTTIImpl::getVectorInstrCost(unsigned Opcode, Type *ValTy,
836836
TTI::TargetCostKind CostKind,
837837
unsigned Index, Value *Op0,
838-
Value *Op1) {
838+
Value *Op1) const {
839839
switch (Opcode) {
840840
case Instruction::ExtractElement:
841841
case Instruction::InsertElement: {

llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,8 @@ class GCNTTIImpl final : public BasicTTIImplBase<GCNTTIImpl> {
169169
using BaseT::getVectorInstrCost;
170170
InstructionCost getVectorInstrCost(unsigned Opcode, Type *ValTy,
171171
TTI::TargetCostKind CostKind,
172-
unsigned Index, Value *Op0, Value *Op1);
172+
unsigned Index, Value *Op0,
173+
Value *Op1) const;
173174

174175
bool isReadRegisterSourceOfDivergence(const IntrinsicInst *ReadReg) const;
175176
bool isSourceOfDivergence(const Value *V) const;

llvm/lib/Target/AMDGPU/R600TargetTransformInfo.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ InstructionCost R600TTIImpl::getCFInstrCost(unsigned Opcode,
110110
InstructionCost R600TTIImpl::getVectorInstrCost(unsigned Opcode, Type *ValTy,
111111
TTI::TargetCostKind CostKind,
112112
unsigned Index, Value *Op0,
113-
Value *Op1) {
113+
Value *Op1) const {
114114
switch (Opcode) {
115115
case Instruction::ExtractElement:
116116
case Instruction::InsertElement: {

llvm/lib/Target/AMDGPU/R600TargetTransformInfo.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,8 @@ class R600TTIImpl final : public BasicTTIImplBase<R600TTIImpl> {
6363
using BaseT::getVectorInstrCost;
6464
InstructionCost getVectorInstrCost(unsigned Opcode, Type *ValTy,
6565
TTI::TargetCostKind CostKind,
66-
unsigned Index, Value *Op0, Value *Op1);
66+
unsigned Index, Value *Op0,
67+
Value *Op1) const;
6768
};
6869

6970
} // end namespace llvm

llvm/lib/Target/ARM/ARMTargetTransformInfo.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ std::optional<Value *> ARMTTIImpl::simplifyDemandedVectorEltsIntrinsic(
318318
}
319319

320320
InstructionCost ARMTTIImpl::getIntImmCost(const APInt &Imm, Type *Ty,
321-
TTI::TargetCostKind CostKind) {
321+
TTI::TargetCostKind CostKind) const {
322322
assert(Ty->isIntegerTy());
323323

324324
unsigned Bits = Ty->getPrimitiveSizeInBits();
@@ -901,7 +901,7 @@ InstructionCost ARMTTIImpl::getCastInstrCost(unsigned Opcode, Type *Dst,
901901
InstructionCost ARMTTIImpl::getVectorInstrCost(unsigned Opcode, Type *ValTy,
902902
TTI::TargetCostKind CostKind,
903903
unsigned Index, Value *Op0,
904-
Value *Op1) {
904+
Value *Op1) const {
905905
// Penalize inserting into an D-subregister. We end up with a three times
906906
// lower estimated throughput on swift.
907907
if (ST->hasSlowLoadDSubregister() && Opcode == Instruction::InsertElement &&

llvm/lib/Target/ARM/ARMTargetTransformInfo.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ class ARMTTIImpl : public BasicTTIImplBase<ARMTTIImpl> {
135135

136136
using BaseT::getIntImmCost;
137137
InstructionCost getIntImmCost(const APInt &Imm, Type *Ty,
138-
TTI::TargetCostKind CostKind);
138+
TTI::TargetCostKind CostKind) const;
139139

140140
InstructionCost getIntImmCostInst(unsigned Opcode, unsigned Idx,
141141
const APInt &Imm, Type *Ty,
@@ -249,7 +249,8 @@ class ARMTTIImpl : public BasicTTIImplBase<ARMTTIImpl> {
249249
using BaseT::getVectorInstrCost;
250250
InstructionCost getVectorInstrCost(unsigned Opcode, Type *Val,
251251
TTI::TargetCostKind CostKind,
252-
unsigned Index, Value *Op0, Value *Op1);
252+
unsigned Index, Value *Op0,
253+
Value *Op1) const;
253254

254255
InstructionCost getAddressComputationCost(Type *Val, ScalarEvolution *SE,
255256
const SCEV *Ptr);

llvm/lib/Target/Hexagon/HexagonTargetTransformInfo.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ InstructionCost HexagonTTIImpl::getCastInstrCost(unsigned Opcode, Type *DstTy,
320320
InstructionCost HexagonTTIImpl::getVectorInstrCost(unsigned Opcode, Type *Val,
321321
TTI::TargetCostKind CostKind,
322322
unsigned Index, Value *Op0,
323-
Value *Op1) {
323+
Value *Op1) const {
324324
Type *ElemTy = Val->isVectorTy() ? cast<VectorType>(Val)->getElementType()
325325
: Val;
326326
if (Opcode == Instruction::InsertElement) {

0 commit comments

Comments
 (0)