-----Original Message-----
From: Jan Hubicka [mailto:hubi...@ucw.cz] 
Sent: Thursday, February 12, 2015 10:34 PM
To: Ajit Kumar Agarwal
Cc: hubi...@ucw.cz; gcc@gcc.gnu.org; Vinod Kathail; Shail Aditya Gupta; 
Vidhumouli Hunsigida; Nagaraju Mekala
Subject: Re: Function outlining and partial Inlining

> Hello All:
> 
> The large functions are the important part of high performance 
> application. They contribute to performance bottleneck with many 
> respect. Some of the large hot functions are frequently executed but many 
> regions inside the functions are cold regions. The large Function blocks the 
> function inlining  to happen before of the code size constraints.
> 
> Such cold regions inside the hot large functions can be extracted out 
> and form the function outlining. Thus breaking the large functions Into 
> smaller function segments which causes the functions to be inlined at the 
> caller site or helps in partial inlining.
> 
> LLVM Compiler has the functionality and the optimizations for function 
> outlining based on regions like basic blocks, superblocks and 
> Hyperblocks which gets extracted out into smaller function segments and thus 
> enabling the partial inlining and function inlining to happen At the caller 
> site.
> 
> This optimization is the good case of profile guided optimizations and based 
> on the profile feedback data by the Compiler.
> Without profile information the above function outlining optimizations will 
> not be useful.
> 
> We are doing lot of optimization regarding polymorphism and also the 
> indirect icall promotion based on the profile feedback on the Callgraph 
> profile.
> 
> Are we doing the function outlining optimization in GCC with respect 
> to function inline and partial inline based on profile feedback Data. 
> If not this optimization can be implemented. If already implemented in GCC  
> Can I  know any pointer for such code in GCC and the Scope of this function 
> outlining optimization.

>>The outlining pass is called ipa-split.  The heuristic used is however quite 
>>simplistic and it looks for very specific case where you have small header of 
>>a function containing conditional and >>splits after that.  It does use 
>>profile.

>>Any work on improving the heuristics or providing interesting testcases to 
>>consider would be welcome.

>>I think LLVM pass is doing pretty much the same analysis minus the profile 
>>feedback considerations.  After splitting, LLVm will inline the header into 
>>all callers while GCC leaves this on the >>decision of inliner heuristics 
>>that may just merge the function back into one block.

>>The actual outlining logic is contained in tree-inline.c and also used by 
>>OpenMP.

Honza: LLVM has the logic of extraction of Loops using -loop-extract flags  
where the Loop code region is extracted into a function. The LLVM  has 
the heuristics that the header of the Loop is the entry block and there is a 
single entry to the Loop which does by Loop Simplification
pass in LLVM. Also the heuristics in LLVM has the heuristics that there should 
not be a branch from the entry block to the header of the Loop.

You have mentioned the GCC has the heuristics of having the conditional in the 
header after the splits point. Does GCC has the heuristics for
Conditional to split in the header or the heuristics can be augmented with the 
Loops as done in the LLVM. 

Thanks & Regards
Ajit

Honza
> 
> If not implemented , Can I propose to have the optimization like function 
> outlining in GCC.
> 
> Thoughts Please?
> 
> Thanks & Regards
> Ajit

Reply via email to