Question about indirect functions and PGO

Erick Ochoa
Fri Jul 10 11:19:17 GMT 2020

Forgot to mention that these functions take a function pointer as a 
parameter and as a result, the specialized functions are able to replace 
the indirect function call with a direct function call.

On 10/07/2020 13:17, Erick Ochoa wrote:
> Hello,
> I'm working on an optimization and I encountered this interesting 
> behaviour. There are a couple of functions that are specialized when the 
> program is not compiled with PGO (-fprofile-generate and -fprofile-use)
> However, when the program is compiled with PGO the compiler does not 
> specialize the function calls.
> I printing the program just after materializing all clones.
> I am running this version of GCC:
> Author: GCC Administrator <>
> Date:   Fri Jul 10 00:16:28 2020 +0000
>      Daily bump.
> I can imagine that the profiling information was used to determine that 
> specializing these functions is a bad tradeoff between binary size and 
> speed. But I do not know this for sure. How can I find out why these 
> functions were not specialized? (I.e. is there a threshold that wasn't 
> met, and if so, where is it located and what's its value?)
> Thanks!

More information about the Gcc mailing list