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

Easwaran Raman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 14 16:40:22 PDT 2017


eraman 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.
----------------
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().


https://reviews.llvm.org/D30899





More information about the llvm-commits mailing list