http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39326
--- Comment #52 from Richard Biener <rguenth at gcc dot gnu.org> 2013-03-26 10:09:52 UTC --- (In reply to comment #51) > > (struct mem_ref): Replace mem member with ao_ref typed member. > > RTL gcse (-O2) suffers from the same slowness in its dependence tests. > Caching > ao_ref instead of just mem and alias-set in RTL mem-attrs would improve > this tremendously. > > A quick try reveals that gengtype is not at all happy with including > something in rtl.h though :/ Doing that (caching the ao_ref) doesn't help as much as it did on the GIMPLE level. The most time-consuming part of canon_true_dependence (which consumes 56% of compile-time) is find_base_term (37% of that 56%) followed by memrefs_conflict_p and only then (after caching ao_ref) rtx_refs_may_alias_p (18%). The find_base_term result is another thing that could be easily cached when doing dependence checks that repeatedly use one or another operand. For this testcase the most expensive caller is compute_transp. There is some obvious way to do less find_base_term calls in alias.c itself. I'm going to cleanup things there a bit.