[Bug ipa/88231] aligned functions laid down inefficiently

marxin at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed May 22 12:15:00 GMT 2019


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88231

--- Comment #6 from Martin Liška <marxin at gcc dot gnu.org> ---
(In reply to Andi Kleen from comment #4)
> I'm not sure it's a good idea to do this. Often the goal is not to get the
> absolute smallest code, but to get code that minimizes cache line usage.
> This is important for "frontend bound" code like gcc itself often is.
> 
> It would be rather better to use an algorithm like Petis-Hansen or the one
> in hfsort (see
> https://research.fb.com/wp-content/uploads/2017/01/cgo2017-hfsort-final1.
> pdf) to lay out the code based on expected call order to minimize foot
> print. For best result would need profile feedback of course, but it might
> already do a reasonable job based on static call frequencies.

I'm planning to implement that for GCC10 with LTO and PGO. So far, we've been
ordering functions with LTO by it's first call. We can definitely do better.


More information about the Gcc-bugs mailing list