[PATCH] D30062: Estimate speedup due to inlining and use that to adjust threshold.

Easwaran Raman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 16 19:59:26 PST 2017


eraman added a comment.

Thanks for the comment!



================
Comment at: lib/Analysis/InlineCost.cpp:1356
+    if (!F.isDeclaration())
+      CalleeBFI = &((*GetBFI)(F));
+    // While evaluating the weighted savings due to removal of argument setup
----------------
efriedma wrote:
> CalleeBFI is unused?
Ouch. This is badly broken. In two places where I should have used CalleeBFI, I've used CallerBFI.  getBlockFreq returns 0 if the BB is not in the function whose BFI is used. The tests still pass because I've used getEntryFreq of Caller (instead of Callee) which still returns a valid value and the weighted savings associated with the entry block (elimination of the call and arg setup) is enough to result in the speedup. I'll send a revised patch tomorrow.


https://reviews.llvm.org/D30062





More information about the llvm-commits mailing list