------- Comment #55 from mkuvyrkov at gcc dot gnu dot org  2007-01-10 11:42 
-------
Created an attachment (id=12879)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=12879&action=view)
Patch for scheduler dependency lists.

Hi,

This patch introduces new dependency lists to scheduler thus making LOG_LINKs
not used in the schedulers.  The patch is preliminary and I will post an
updated version to gcc-patches in a few days.

The structure of a change:
As before, we have backward dependencies (INSN_DEPS - replacement for
LOG_LINKS) and forward dependencies (INSN_DEPEND).  These lists consist of
dep_nodes.
Each dep_node has a pointer to dep_data_node which contains dependency data
(data field), dep_node of the backward dep_list (back field) and dep_node of
the forward dep_list (forw field).  Thus we can easily get forward dep_node by
the backward one and vice versa.
Each dep_node also contains a pointer to the next field of the previous node in
the dep_list (to the place where pointer to it is stored) making removal from
the list fast and easy.

Changes are mostly just a pattern replacement of macros names.  Patched
compiler produces exactly the same output as original (except for one small
thing: removal of DEPS_LIST from rtl.def somehow results in different numbering
of the registers.  The same occurs if add an additional rtx description to
rtl.def.  Don't know why this happens, but will be glad if someone explained.)

Minimal changes to the backends were introduced.
1. ia64 scheduler hook adjust_cost was restored to its original version (as in
gcc 4.1)
2. ia64 and rs6000 backends were fixed to walk through the new dependency
lists, which they do for their own heuristics. (no other backend do that).
3. rs6000 scheduler hook is_costly_dependency () was changed so that there'll
be no need to do a compatibility transformation (as being done for adjust_cost,
btw) for a hook that is implemented on a single target.

The patch was bootstrapped on x86_64 and ia64.  Also I've build a cross to
powerpc-740.

Results (on x86_64):
scheduler2 is now 4s instead of 12s.
Memory consumption: 11.5M instead of 48M


Thanks,

Maxim


-- 


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

Reply via email to