This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Inlining Decision Priority Function.
- From: David Edelsohn <dje dot gcc at gmail dot com>
- To: Ajit Kumar Agarwal <ajit dot kumar dot agarwal at xilinx dot com>
- Cc: Jan Hubicka <hubicka at ucw dot cz>, Jeff Law <law at redhat dot com>, Richard Biener <richard dot guenther at gmail dot com>, "gcc at gcc dot gnu dot org" <gcc at gcc dot gnu dot org>, Vinod Kathail <vinodk at xilinx dot com>, Shail Aditya Gupta <shailadi at xilinx dot com>, Vidhumouli Hunsigida <vidhum at xilinx dot com>, Nagaraju Mekala <nmekala at xilinx dot com>
- Date: Sat, 12 Sep 2015 09:17:29 -0400
- Subject: Re: Inlining Decision Priority Function.
- Authentication-results: sourceware.org; auth=none
- References: <37378DC5BCD0EE48BA4B082E0B55DFAA42988B9D at XAP-PVEXMBX02 dot xlnx dot xilinx dot com>
Ajit,
As a start, look at the Inliner section of Honza's Status of
Interprocedural Optimizers presentation from Cauldron 2013.
https://gcc.gnu.org/wiki/cauldron2013?action=AttachFile&do=view&target=Status_of_interprocedural_optimizers.pdf
- David
On Sat, Sep 12, 2015 at 4:36 AM, Ajit Kumar Agarwal
<ajit.kumar.agarwal@xilinx.com> wrote:
> All:
>
> Inlining decisions that reduces the formulation of callee's stacks frame and including the callee in the caller context increases
> The performance.
>
> The priority function of Inlining decisions can be calculated as follows considering the following.
>
> 1. Level nest of the callee.
> 2. code size of the callee.
> 3. code size of the largest function in the program.
>
> Prority(c) = (level(c) + 1) * largetsize
> -----------------------------
> Size(c).
>
> The the Higher the priority for inlining decision for the callee with small code size and deepest in the call site of the call graph.
>
> The deeper the level of callee the greater is the priority and smaller the code size the higher is the priority.
>
> The priority function also considers the largest size of the functions in the program. If the size of the function is largest in the
> Program the higher is the prority.
>
> Priority(c) = Priority of the callee.
> Level(c) = Deepness of the callee.
> Size(c) = code size of the callee.
> Largetsize = largest size among all the functions in the program.
>
> The above heuristics for inlining should be considered for inlining. If we use similar heuristics in the inlining decisions Let me know.
>
> Thanks & Regards
> Ajit