aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Analysis/InlineCost.cpp
diff options
context:
space:
mode:
authorKazu Hirata <kazu@google.com>2022-06-20 22:45:45 -0700
committerKazu Hirata <kazu@google.com>2022-06-20 22:45:45 -0700
commit7a47ee51a145a40332311330ef45b5d62d8ae023 (patch)
tree2e7ac16bc8430595cbe68692d08111f028b5f995 /llvm/lib/Analysis/InlineCost.cpp
parent9cfbe7bbfea762d72b60c51c8ab5dadf6b317a9a (diff)
downloadllvm-7a47ee51a145a40332311330ef45b5d62d8ae023.zip
llvm-7a47ee51a145a40332311330ef45b5d62d8ae023.tar.gz
llvm-7a47ee51a145a40332311330ef45b5d62d8ae023.tar.bz2
[llvm] Don't use Optional::getValue (NFC)
Diffstat (limited to 'llvm/lib/Analysis/InlineCost.cpp')
-rw-r--r--llvm/lib/Analysis/InlineCost.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/llvm/lib/Analysis/InlineCost.cpp b/llvm/lib/Analysis/InlineCost.cpp
index c3451f0..0b2c72e 100644
--- a/llvm/lib/Analysis/InlineCost.cpp
+++ b/llvm/lib/Analysis/InlineCost.cpp
@@ -836,7 +836,7 @@ class InlineCostCallAnalyzer final : public CallAnalyzer {
auto *CallerBB = CandidateCall.getParent();
BlockFrequencyInfo *CallerBFI = &(GetBFI(*(CallerBB->getParent())));
CycleSavings += getCallsiteCost(this->CandidateCall, DL);
- CycleSavings *= CallerBFI->getBlockProfileCount(CallerBB).getValue();
+ CycleSavings *= *CallerBFI->getBlockProfileCount(CallerBB);
// Remove the cost of the cold basic blocks.
int Size = Cost - ColdSize;
@@ -906,7 +906,7 @@ class InlineCostCallAnalyzer final : public CallAnalyzer {
if (auto Result = costBenefitAnalysis()) {
DecidedByCostBenefit = true;
- if (Result.getValue())
+ if (*Result)
return InlineResult::success();
else
return InlineResult::failure("Cost over threshold.");
@@ -998,7 +998,7 @@ public:
BoostIndirectCalls(BoostIndirect), IgnoreThreshold(IgnoreThreshold),
CostBenefitAnalysisEnabled(isCostBenefitAnalysisEnabled()),
Writer(this) {
- AllowRecursiveCall = Params.AllowRecursiveCall.getValue();
+ AllowRecursiveCall = *Params.AllowRecursiveCall;
}
/// Annotation Writer for instruction details
@@ -1262,7 +1262,7 @@ void InlineCostAnnotationWriter::emitInstructionAnnot(
auto C = ICCA->getSimplifiedValue(const_cast<Instruction *>(I));
if (C) {
OS << ", simplified to ";
- C.getValue()->print(OS, true);
+ (*C)->print(OS, true);
}
OS << "\n";
}
@@ -1855,7 +1855,7 @@ void InlineCostCallAnalyzer::updateThreshold(CallBase &Call, Function &Callee) {
// current threshold, but AutoFDO + ThinLTO currently relies on this
// behavior to prevent inlining of hot callsites during ThinLTO
// compile phase.
- Threshold = HotCallSiteThreshold.getValue();
+ Threshold = *HotCallSiteThreshold;
} else if (isColdCallSite(Call, CallerBFI)) {
LLVM_DEBUG(dbgs() << "Cold callsite.\n");
// Do not apply bonuses for a cold callsite including the