[PATCH] D30651: [InlineCost, -Oz] Don't take into account the penalty of a fast call of frequently used functions

Evgeny Astigeevich via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 9 14:59:47 PST 2017


eastig added inline comments.


================
Comment at: lib/Analysis/InlineCost.cpp:1299
+    Cost += InlineConstants::CallPenalty;
+  }
+
----------------
efriedma wrote:
> You might want give a bonus to functions with few callers rather than a penalty to functions with many callers; as-is, you're basically decreasing the default inline threshold from 5 to -20.
As I can see Cost = Cost_we_cannot_remove - Cost_we_can_remove; where Cost_we_can_remove = Call + Ret + Arguments + Call_Penalty.
Could you please explain me the values of the threshold? Why is it 5 for Oz? Maybe, it's simpler to adjust the threshold than to add my code. 




https://reviews.llvm.org/D30651





More information about the llvm-commits mailing list