Skip to content

Commit 1d522a3

Browse files
committed
[TTI] Remove getInstructionThroughput cost helper.
Pulled out of D79483 - we can just as easily use getUserCost directly
1 parent 594c5b1 commit 1d522a3

File tree

2 files changed

+1
-66
lines changed

2 files changed

+1
-66
lines changed

llvm/include/llvm/Analysis/TargetTransformInfo.h

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -230,12 +230,10 @@ class TargetTransformInfo {
230230
enum TargetCostKind kind) const {
231231
InstructionCost Cost;
232232
switch (kind) {
233-
case TCK_RecipThroughput:
234-
Cost = getInstructionThroughput(I);
235-
break;
236233
case TCK_Latency:
237234
Cost = getInstructionLatency(I);
238235
break;
236+
case TCK_RecipThroughput:
239237
case TCK_CodeSize:
240238
case TCK_SizeAndLatency:
241239
Cost = getUserCost(I, kind);
@@ -1525,10 +1523,6 @@ class TargetTransformInfo {
15251523
/// Returns 1 as the default value.
15261524
InstructionCost getInstructionLatency(const Instruction *I) const;
15271525

1528-
/// Returns the expected throughput cost of the instruction.
1529-
/// Returns -1 if the cost is unknown.
1530-
InstructionCost getInstructionThroughput(const Instruction *I) const;
1531-
15321526
/// The abstract base class used to type erase specific TTI
15331527
/// implementations.
15341528
class Concept;

llvm/lib/Analysis/TargetTransformInfo.cpp

Lines changed: 0 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -1154,65 +1154,6 @@ TargetTransformInfo::getInstructionLatency(const Instruction *I) const {
11541154
return TTIImpl->getInstructionLatency(I);
11551155
}
11561156

1157-
InstructionCost
1158-
TargetTransformInfo::getInstructionThroughput(const Instruction *I) const {
1159-
TTI::TargetCostKind CostKind = TTI::TCK_RecipThroughput;
1160-
1161-
switch (I->getOpcode()) {
1162-
case Instruction::GetElementPtr:
1163-
case Instruction::Ret:
1164-
case Instruction::PHI:
1165-
case Instruction::Br:
1166-
case Instruction::Add:
1167-
case Instruction::FAdd:
1168-
case Instruction::Sub:
1169-
case Instruction::FSub:
1170-
case Instruction::Mul:
1171-
case Instruction::FMul:
1172-
case Instruction::UDiv:
1173-
case Instruction::SDiv:
1174-
case Instruction::FDiv:
1175-
case Instruction::URem:
1176-
case Instruction::SRem:
1177-
case Instruction::FRem:
1178-
case Instruction::Shl:
1179-
case Instruction::LShr:
1180-
case Instruction::AShr:
1181-
case Instruction::And:
1182-
case Instruction::Or:
1183-
case Instruction::Xor:
1184-
case Instruction::FNeg:
1185-
case Instruction::Select:
1186-
case Instruction::ICmp:
1187-
case Instruction::FCmp:
1188-
case Instruction::Store:
1189-
case Instruction::Load:
1190-
case Instruction::ZExt:
1191-
case Instruction::SExt:
1192-
case Instruction::FPToUI:
1193-
case Instruction::FPToSI:
1194-
case Instruction::FPExt:
1195-
case Instruction::PtrToInt:
1196-
case Instruction::IntToPtr:
1197-
case Instruction::SIToFP:
1198-
case Instruction::UIToFP:
1199-
case Instruction::Trunc:
1200-
case Instruction::FPTrunc:
1201-
case Instruction::BitCast:
1202-
case Instruction::AddrSpaceCast:
1203-
case Instruction::ExtractElement:
1204-
case Instruction::InsertElement:
1205-
case Instruction::ExtractValue:
1206-
case Instruction::ShuffleVector:
1207-
case Instruction::Call:
1208-
case Instruction::Switch:
1209-
return getUserCost(I, CostKind);
1210-
default:
1211-
// We don't have any information on this instruction.
1212-
return -1;
1213-
}
1214-
}
1215-
12161157
TargetTransformInfo::Concept::~Concept() = default;
12171158

12181159
TargetIRAnalysis::TargetIRAnalysis() : TTICallback(&getDefaultTTI) {}

0 commit comments

Comments
 (0)