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

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 8 16:03:30 PST 2017


efriedma added a comment.

Probably needs new benchmarking numbers with that change.

The functionality mostly makes sense now, but the comments/naming are really confusing. "Frequent" makes it sound like a check based on runtime profiling check rather than the absolute number of callers.  And there isn't any comment explaining why we want to more aggressively inline local functions with 2 callers.



================
Comment at: lib/Analysis/InlineCost.cpp:1299
+    Cost += InlineConstants::CallPenalty;
+  }
+
----------------
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.


https://reviews.llvm.org/D30651





More information about the llvm-commits mailing list