aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Transforms/Utils/SimplifyCFG.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Transforms/Utils/SimplifyCFG.cpp')
-rw-r--r--llvm/lib/Transforms/Utils/SimplifyCFG.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/llvm/lib/Transforms/Utils/SimplifyCFG.cpp b/llvm/lib/Transforms/Utils/SimplifyCFG.cpp
index 76f09c0..21f8d54 100644
--- a/llvm/lib/Transforms/Utils/SimplifyCFG.cpp
+++ b/llvm/lib/Transforms/Utils/SimplifyCFG.cpp
@@ -381,7 +381,7 @@ static InstructionCost computeSpeculationCost(const User *I,
assert((!isa<Instruction>(I) ||
isSafeToSpeculativelyExecute(cast<Instruction>(I))) &&
"Instruction is not safe to speculatively execute!");
- return TTI.getUserCost(I, TargetTransformInfo::TCK_SizeAndLatency);
+ return TTI.getInstructionCost(I, TargetTransformInfo::TCK_SizeAndLatency);
}
/// If we have a merge point of an "if condition" as accepted above,
@@ -3626,8 +3626,8 @@ bool llvm::FoldBranchToCommonDest(BranchInst *BI, DomTreeUpdater *DTU,
// Account for the cost of duplicating this instruction into each
// predecessor. Ignore free instructions.
- if (!TTI ||
- TTI->getUserCost(&I, CostKind) != TargetTransformInfo::TCC_Free) {
+ if (!TTI || TTI->getInstructionCost(&I, CostKind) !=
+ TargetTransformInfo::TCC_Free) {
NumBonusInsts += PredCount;
// Early exits once we reach the limit.
@@ -3799,7 +3799,8 @@ static bool mergeConditionalStoreToAddress(
return false; // Not in white-list - not worthwhile folding.
// And finally, if this is a non-free instruction that we are okay
// speculating, ensure that we consider the speculation budget.
- Cost += TTI.getUserCost(&I, TargetTransformInfo::TCK_SizeAndLatency);
+ Cost +=
+ TTI.getInstructionCost(&I, TargetTransformInfo::TCK_SizeAndLatency);
if (Cost > Budget)
return false; // Eagerly refuse to fold as soon as we're out of budget.
}