<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Dec 5, 2014 at 2:10 AM, Pablo Barrio <span dir="ltr"><<a href="mailto:pablo.barrio@arm.com" target="_blank">pablo.barrio@arm.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><p class="MsoNormal">The default inliner currently marks all recursive functions as “never” inline when calculating the cost (CallAnalyzer::analyzeCall() in lib/Analysis/IPA/InlineCost.cpp). Is there any reason for this?</p></blockquote></div><br>The reason used to be given in a comment in the code that got lost at some point.</div><div class="gmail_extra"><br></div><div class="gmail_extra">The idea is that inlining recursive calls is essentially loop unrolling. We need to model it's cost and effects more like loop unrolling intersected with inlining, and we don't really have a good model for that yet. It would be really nice to work up such a model, but would require loooots of benchmarking and careful tuning to find the right mixture.</div></div>