Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions llvm/lib/Analysis/InlineCost.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -751,7 +751,7 @@ class InlineCostCallAnalyzer final : public CallAnalyzer {
if (CA.analyze().isSuccess()) {
// We were able to inline the indirect call! Subtract the cost from the
// threshold to get the bonus we want to apply, but don't go below zero.
Cost -= std::max(0, CA.getThreshold() - CA.getCost());
addCost(-std::max(0, CA.getThreshold() - CA.getCost()));
}
} else
// Otherwise simply add the cost for merely making the call.
Expand Down Expand Up @@ -1191,7 +1191,7 @@ class InlineCostCallAnalyzer final : public CallAnalyzer {
// If this function uses the coldcc calling convention, prefer not to inline
// it.
if (F.getCallingConv() == CallingConv::Cold)
Cost += InlineConstants::ColdccPenalty;
addCost(InlineConstants::ColdccPenalty);

LLVM_DEBUG(dbgs() << " Initial cost: " << Cost << "\n");

Expand Down Expand Up @@ -2193,7 +2193,7 @@ void InlineCostCallAnalyzer::updateThreshold(CallBase &Call, Function &Callee) {
// the cost of inlining it drops dramatically. It may seem odd to update
// Cost in updateThreshold, but the bonus depends on the logic in this method.
if (isSoleCallToLocalFunction(Call, F)) {
Cost -= LastCallToStaticBonus;
addCost(-LastCallToStaticBonus);
StaticBonusApplied = LastCallToStaticBonus;
}
}
Expand Down
Loading