[PATCH] D16616: Avoid inlining call sites in unreachable-terminated block

Xinliang David Li via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 29 15:22:33 PST 2016


I mentioned this in another reply. This scenario is rare so this patch
is still good in general. If we want to handle it in the future, this
heuristics needs to be moved up and can be followed by other threshold
adjusting heuristics -- but that should not be required for this
patch.

David

On Thu, Jan 28, 2016 at 11:20 AM, Easwaran Raman <eraman at google.com> wrote:
> eraman added a comment.
>
> The only concern I have is the suppression of inlining of hot calls in the following hypothetical example:
>
> main() {
>
>   hot_call_1();
>   ...
>   hot_call_N()
>   exit(0);
>
> }
>
> Even though each of the hot_call_X calls are executed once, inlining may be beneficial (due to constprop for example). Short of checking for caller to be main (as you've done in your previous patch), is there a way to distinguish this case? I suppose this pattern is very rare in real code to worry about this.
>
>
> http://reviews.llvm.org/D16616
>
>
>


More information about the llvm-commits mailing list