This is the mail archive of the
mailing list for the GCC project.
Re: [new-ra] good register classes for webs
- From: Michael Matz <matz at suse dot de>
- To: Gazovik <gazovik at overta dot ru>
- Cc: denisc at overta dot ru, gcc-patches at gcc dot gnu dot org
- Date: Wed, 3 Mar 2004 17:25:02 +0100 (CET)
- Subject: Re: [new-ra] good register classes for webs
- References: <email@example.com>
On Wed, 3 Mar 2004, Gazovik wrote:
> This is a patch for choosing better register classes for webs. This
> patch based on pre-rload not on regclass.
> (You must be more happy with this ;)
Yay, cool. I think I begin to like this ;-)
> After that I have a four passes of different web_class_... routines.
Yes, this is similar to how I think it should work, very nice.
Btw. I had thought in that past about reducing the memory overhead of the
cost collection. With restructuring the order this might be possible.
For instance your web_class_costs only works on one web each time, and
web_class_insn_alt only works on all references in one insn (i.e. on just
a limited set of the web_costs entries). So maybe it would be possible to
do the loops in select_regclass() like so: ?
foreach insn i in bb
int index = 0
foreach web w in i (without duplicates)
web_class_costs (w, NULL, web_costs[index++])
web_class_insn_alt (i, insn_alternative, web_costs)
foreach web w
web_cost = 0
web_class_costs (w, insn_alternative, web_cost)
web_class_insn_alt would then need to be changed to lookup in the
web_costs array by number (per insn) of reference instead of by web id.
This saves memory (web_costs needs only be as long as the most webs used
in one single insn), but at the expense of possibly recalculating
web_costs for the same web as often as it is referenced in different
insns. I don't know which is better.
Anyway, I think you should check it in after fixing some typos:
> (web_class_insn_alt): New functin. Select insn alternatives
> according to costs of register classes.
> (web_class_spill): New functin. Add spill code for refs with
> * ra-colorize.c (colorize_one_web): Add code which disable
"code _to_ disable"
> * ra.c (one_pass): Remeber last max uid of insn and use it
> * pre-reload.h
> + /* Firts pass of web_class. Choose the best reg_class for each web. */
"First", two spaces between sentences.
> + /* Second pass of web_clsss. Select a better alternative for each insn
"web_class", two spaces.
> + depend from reg_class of each web. */
> ! for (j = 0; j < N_REG_CLASSES; ++j)
A pity, that there is no better way than iterating over all register
classes in the inner loops per references (yes, regclass is doing the
> ! /* FIXME: firstname.lastname@example.org */
> ! if (ra_pass != 1)
> ! return;
What doesn't work yet in the later passes, or was it that we don't expect
to add any code in them?