Home > front end >  What is the callgraph expansion stage in g ?
What is the callgraph expansion stage in g ?

Time:12-30

I am profiling my program;s compilation and looking for bottlenecks. I originally thought template instantiation would be the most expensive part but seems to be callgraph funciton expansion. Problem is, I have no idea what that stage refers to.

callgraph functions expansion      :  28.98 ( 80%)   0.95 ( 39%)  29.98 ( 73%)   782M ( 60%)
 template instantiation             :   2.36 (  7%)   0.47 ( 19%)   2.84 (  7%)   191M ( 15%)

I have tried to search it up online but I find no answers.

CodePudding user response:

It appears to be part of the optimization process implemented by GCC. I was able to find one reference, The GCC call graph module, which describes it as the final step performed by the front-end of the compiler:

  1. Expansion: We proceed in reverse DFS order on functions that are still present in the call-graph, applying inter-procedural optimizations such as inlining to the functions, and finally leaving them to the back-end to do the actual optimization and compilation.
  • Related