[Bug tree-optimization/54146] Very slow compile with attribute((flatten))

steven at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Fri Aug 3 09:00:00 GMT 2012


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54146

--- Comment #14 from Steven Bosscher <steven at gcc dot gnu.org> 2012-08-03 08:59:29 UTC ---
Created attachment 27930
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=27930
Do not inline_merge_summary if called via flatten_function

As I noted in comment #12, the flattening itself is the problem, not the
heuristics.  I have narrowed this down to inline_merge_summary. With the
attached hack, compile time (for only "check<CGAL::Gmpfi>();") drops from 6459s
to 1560s. I hi-jacked the unused timevar TV_LOCAL_ALLOC (from pre-IRA days) to
measure the time spent in inline_call. Without my hack, this is 4801s, and with
the hack it is only 0.37s (!). Do the math: 6459s-4801s=1658s~=1560s.
(NB: These timings are all with my stack_vars patch applied as well.)

With the hack, the remaining compile time is mostly spent in:
 tree loop init                  : 236.16
 integrated RA                   : 215.70
 if-conversion                   : 177.26 (but due to loop_optimizer_init)
 tree SSA incremental            : 154.69
 reload                          : 124.33

I don't understand how inline_merge_summary is supposed to work, so I'm going
to leave that one for Richi and Honza.



More information about the Gcc-bugs mailing list