[PATCH] D60740: [InlineCost] cleanup calculations of Cost and Threshold

Artur Pilipenko via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 26 18:22:04 PDT 2019


apilipenko added inline comments.


================
Comment at: lib/Analysis/InlineCost.cpp:162-167
+  /// When we are able to prove that inlining the callee will make inlining
+  /// of a particular nested call-site profitable, we want to give a certain
+  /// bonus with size of a callee deducted.
+  /// Tracking the actually applied bonus here, as well as adding it directly
+  /// to Threshold.
+  int InlinedCallBonus = 0;
----------------
I don't think we need to store it here. Other bonuses, like VectorBonus,  are "speculative", i.e. we apply them first and revoke if the conditions don't hold.


================
Comment at: lib/Analysis/InlineCost.cpp:258-263
+  /// Apply a positive bonus to Threshold for a proven inlining of callee's callee.
+  void applyInlinedCallBonus(int Bonus) {
+    assert(Bonus >= 0);
+    Threshold += Bonus;
+    InlinedCallBonus += Bonus;
+  }
----------------
If you don't store it in a field, you don't need a setter function.


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D60740/new/

https://reviews.llvm.org/D60740





More information about the llvm-commits mailing list