compiler thoughts

All | Personal | Sun
« gcc4ss flags | Main | gcc flag compatibili... »
20060313 Monday March 13, 2006

inlining

There was a controversial posting regarding inlining in gcc/gcc4ss and I feel it needs to be clarified.

gcc4ss is using gimple form of tree representation that was introduced first in gcc 4.0. gcc4ss runs most of the gcc optimization without any interference and takes whatever gimple form is left after those optimizations. If the optimization level was -O3 that gimple form for a given function may contained some inlined functions, so IR conversion may not happen for these inlined functions. Therefore IR passed to scg4ss may contain less number of functions that was present in the original code. Since gcc inlines mostly very small functions it frees few extra cycles for the scg4ss optimizer. In C code it's rare situation, but in C++ such approach is deemed to be quite helpful. scg4ss profiler will not be able to collect any statistic for such inlined functions, but in case of C++ it's even better not to be distracted by lots of small methods.

gcc4ss also preserves gcc function attributes related to inlining when there is an equivalent in scg4ss's IR. Those attributes are nicely matched with profile feedback and cross file optimizations in scg4ss.

The funny thing about inlining is that few testcases of gcc testsuite were modified to pass with gcc4ss, because scg4ss is quite aggressive in inlining at -O3 and sees more opportunities to inline where plain gcc 4.0 does not.

Posted by alexey ( Mar 13 2006, 01:33:52 AM PST ) Permalink Comments [1]

Comments:

Well, it looks like scg4ss is actually doing inlining after optimizations. GCC is inlining before most optimizations are performed. Obviously inlining after optimizing would find more inlinining opportunities, this is a known issue in GCC, and is being worked on.

Posted by p on March 13, 2006 at 05:32 PM PST #

Post a Comment:

Comments are closed for this entry.

Disclaimer:

This site is a personal blog and is to be used for informational purposes only. The views expressed on this blog are those of the author only, and should not be attributed to any past or present employers.

Calendar

RSS Feeds

Search

Links

Navigation

Referers