aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Analysis/TargetTransformInfo.cpp
diff options
context:
space:
mode:
authorSander de Smalen <sander.desmalen@arm.com>2021-04-14 16:53:01 +0100
committerSander de Smalen <sander.desmalen@arm.com>2021-04-14 17:20:36 +0100
commit4f42d873c20291077f5a1ed37b102330d505f00d (patch)
tree4e6942842f68dbe24d6759f1a70313b64f8f869e /llvm/lib/Analysis/TargetTransformInfo.cpp
parentd84bd951a8d39436b0ca0cd3fa93cacef2f969f1 (diff)
downloadllvm-4f42d873c20291077f5a1ed37b102330d505f00d.zip
llvm-4f42d873c20291077f5a1ed37b102330d505f00d.tar.gz
llvm-4f42d873c20291077f5a1ed37b102330d505f00d.tar.bz2
[TTI] NFC: Change getArithmeticInstrCost to return InstructionCost
This patch migrates the TTI cost interfaces to return an InstructionCost. See this patch for the introduction of the type: https://reviews.llvm.org/D91174 See this thread for context: http://lists.llvm.org/pipermail/llvm-dev/2020-November/146408.html Reviewed By: dmgreen Differential Revision: https://reviews.llvm.org/D100317
Diffstat (limited to 'llvm/lib/Analysis/TargetTransformInfo.cpp')
-rw-r--r--llvm/lib/Analysis/TargetTransformInfo.cpp15
1 files changed, 7 insertions, 8 deletions
diff --git a/llvm/lib/Analysis/TargetTransformInfo.cpp b/llvm/lib/Analysis/TargetTransformInfo.cpp
index 226ed7c..8a750e0 100644
--- a/llvm/lib/Analysis/TargetTransformInfo.cpp
+++ b/llvm/lib/Analysis/TargetTransformInfo.cpp
@@ -703,15 +703,14 @@ TargetTransformInfo::getOperandInfo(const Value *V,
return OpInfo;
}
-int TargetTransformInfo::getArithmeticInstrCost(
+InstructionCost TargetTransformInfo::getArithmeticInstrCost(
unsigned Opcode, Type *Ty, TTI::TargetCostKind CostKind,
- OperandValueKind Opd1Info,
- OperandValueKind Opd2Info, OperandValueProperties Opd1PropInfo,
- OperandValueProperties Opd2PropInfo, ArrayRef<const Value *> Args,
- const Instruction *CxtI) const {
- int Cost = TTIImpl->getArithmeticInstrCost(
- Opcode, Ty, CostKind, Opd1Info, Opd2Info, Opd1PropInfo, Opd2PropInfo,
- Args, CxtI);
+ OperandValueKind Opd1Info, OperandValueKind Opd2Info,
+ OperandValueProperties Opd1PropInfo, OperandValueProperties Opd2PropInfo,
+ ArrayRef<const Value *> Args, const Instruction *CxtI) const {
+ InstructionCost Cost =
+ TTIImpl->getArithmeticInstrCost(Opcode, Ty, CostKind, Opd1Info, Opd2Info,
+ Opd1PropInfo, Opd2PropInfo, Args, CxtI);
assert(Cost >= 0 && "TTI should not produce negative costs!");
return Cost;
}