Questions about function inlining implemented by GCC

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

 

I’m a beginner to learn how GCC fulfill the optimizations by reading the source code from gcc-mirror on Github.

 

Currently, I focus on inlining, but I’m confused about how it constructs the function summaries (compute_fn_summary in ipa-fnsummary.c), estimating the size and time of a function (analyze_function_body in ipa-fnsummary.c). Specifically,

*      I find parameters “param_uninlined_function_insns” and “param_uninlined_function_time” are adopted for estimating the size and time separately, but I have no idea about how to specify their values? In params.opt, the former has the initial value of 2, while the latter has no default value. I think they are either assigned with values given by the users in the command line, i.e., by -param, or specified by the optimization flags directly, such -O3. However, I fail to find such assignment in the repository.

*      GCC fetches the optimization options of a specific function by accessing “function_specific_optimization” of its declaration tree node with the macro “opt_for_fn”. Similarly, I cannot find where and how the member variable is specified based on what information. In addition, according to the variable name, does it mean each function could be optimized with different options from each other? If so, how to appoint specific options for a function?

 

Thanks for the time to answer the questions.

 

 

Reixiong Hu





[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux