@@ -751,7 +751,7 @@ class InlineCostCallAnalyzer final : public CallAnalyzer {
751
751
if (CA.analyze ().isSuccess ()) {
752
752
// We were able to inline the indirect call! Subtract the cost from the
753
753
// threshold to get the bonus we want to apply, but don't go below zero.
754
- Cost -= std::max (0 , CA.getThreshold () - CA.getCost ());
754
+ addCost (- std::max (0 , CA.getThreshold () - CA.getCost () ));
755
755
}
756
756
} else
757
757
// Otherwise simply add the cost for merely making the call.
@@ -1191,7 +1191,7 @@ class InlineCostCallAnalyzer final : public CallAnalyzer {
1191
1191
// If this function uses the coldcc calling convention, prefer not to inline
1192
1192
// it.
1193
1193
if (F.getCallingConv () == CallingConv::Cold)
1194
- Cost += InlineConstants::ColdccPenalty;
1194
+ addCost ( InlineConstants::ColdccPenalty) ;
1195
1195
1196
1196
LLVM_DEBUG (dbgs () << " Initial cost: " << Cost << " \n " );
1197
1197
@@ -2193,7 +2193,7 @@ void InlineCostCallAnalyzer::updateThreshold(CallBase &Call, Function &Callee) {
2193
2193
// the cost of inlining it drops dramatically. It may seem odd to update
2194
2194
// Cost in updateThreshold, but the bonus depends on the logic in this method.
2195
2195
if (isSoleCallToLocalFunction (Call, F)) {
2196
- Cost -= LastCallToStaticBonus;
2196
+ addCost (- LastCallToStaticBonus) ;
2197
2197
StaticBonusApplied = LastCallToStaticBonus;
2198
2198
}
2199
2199
}
0 commit comments