[PATCH] D30899: [InlineCost] CallPenalty knob to provide custom values

Evgeny Astigeevich via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 15 02:40:09 PDT 2017


eastig added inline comments.


================
Comment at: lib/Transforms/IPO/Inliner.cpp:292
   // The candidate cost to be imposed upon the current function.
-  int CandidateCost = IC.getCost() - (InlineConstants::CallPenalty + 1);
+  int CandidateCost = IC.getCost() - (IC.getCallPenalty() + 1);
   // This bool tracks what happens if we do NOT inline C into B.
----------------
eraman wrote:
> r286814 subtracts CallPenalty while computing the inline cost (which is returned by IC.getCost()), but this code is not updated to reflect that. I think CandidateCost should be IC.getCost() - 1, which will eliminate the need for IC.getCallPenalty().
Thank you for information. It makes things simpler. I'll have a look at this.


https://reviews.llvm.org/D30899





More information about the llvm-commits mailing list