aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/CodeGenPrepare.cpp
diff options
context:
space:
mode:
authorSimon Pilgrim <llvm-dev@redking.me.uk>2022-08-18 11:55:23 +0100
committerSimon Pilgrim <llvm-dev@redking.me.uk>2022-08-18 11:55:23 +0100
commitfdec50182d85ec0b8518af3baae37ae28b102f1c (patch)
treef620576762fe4f39bf29b33faa01c4f7938b2d2f /llvm/lib/CodeGen/CodeGenPrepare.cpp
parent27cbfa7cc8cdab121842adf4dd31f6811f523928 (diff)
downloadllvm-fdec50182d85ec0b8518af3baae37ae28b102f1c.zip
llvm-fdec50182d85ec0b8518af3baae37ae28b102f1c.tar.gz
llvm-fdec50182d85ec0b8518af3baae37ae28b102f1c.tar.bz2
[CostModel] Replace getUserCost with getInstructionCost
* Replace getUserCost with getInstructionCost, covering all cost kinds. * Remove getInstructionLatency, it's not implemented by any backends, and we should fold the functionality into getUserCost (now getInstructionCost) to make it easier for targets to handle the cost kinds with their existing cost callbacks. Original Patch by @samparker (Sam Parker) Differential Revision: https://reviews.llvm.org/D79483
Diffstat (limited to 'llvm/lib/CodeGen/CodeGenPrepare.cpp')
-rw-r--r--llvm/lib/CodeGen/CodeGenPrepare.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/CodeGenPrepare.cpp b/llvm/lib/CodeGen/CodeGenPrepare.cpp
index 92fe929..099be15 100644
--- a/llvm/lib/CodeGen/CodeGenPrepare.cpp
+++ b/llvm/lib/CodeGen/CodeGenPrepare.cpp
@@ -6603,8 +6603,8 @@ static bool sinkSelectOperand(const TargetTransformInfo *TTI, Value *V) {
// If it's safe to speculatively execute, then it should not have side
// effects; therefore, it's safe to sink and possibly *not* execute.
return I && I->hasOneUse() && isSafeToSpeculativelyExecute(I) &&
- TTI->getUserCost(I, TargetTransformInfo::TCK_SizeAndLatency) >=
- TargetTransformInfo::TCC_Expensive;
+ TTI->getInstructionCost(I, TargetTransformInfo::TCK_SizeAndLatency) >=
+ TargetTransformInfo::TCC_Expensive;
}
/// Returns true if a SelectInst should be turned into an explicit branch.