This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Bug in ra-colorize.c:merge_moves?


Michael Matz <matz at suse dot de> writes:

> Hi,
> 
> On Mon, 3 Mar 2003, Daniel Berlin wrote:

First of all. Michael ! Thank you for your answer.

> > I've got a tree
> > with everything but your stack slots changes merged (including
> > pre-reload), and the number of coloring passes is about the same.
> > However, with your stack slots changes , it takes 3-5x as many
> > passes
> > in those functions that spill (some functions went from 3 passes to
> > 15
> > passes).
> 
> Ugh, that's much.  I wouldn't have expected this.  The only thing
> which
> _should_ have changed is, that now sometimes there are stack-accesses
> while coloring, where formerly there were simply only accesses to
> SPILL_SLOT_P() pseudos.  I believe Denis also makes some local
> optimizations while creating the code for the stack accesses early.

Yes it is.
IE: We have a web to spill:

i2  use web1
...
i3  use web1
...
i4  use web1

We generate spill insns:

i21 def web11 web1-pseudo-spill-slot
i2  use web11
...
i31 def web12 web1-pseudo-spill-slot
i3  use web12
...
i41 def web13 web1-pseudo-spill-slot
i4  use web13

My code substitute web1-pseudo-spill-slot to real stack slot and
trying to incorporate real stack slot to original insns (i2,i3,i4).

i2  use web1-real-stack-slot
...
i3  use web1-real-stack-slot
...
i4  use web1-real-stack-slot

So, number of webs reduced and possibility of graph colorization increased.

> > I should also point out the code i pointed out in the previous
> > message
> > is still broken, if you think it will ever do something.
> > It will never trigger, afaict.
> 
> It will, with pre-reload.  One sub function of build_i_graph() is
> select_regclass(), which calls web_class(), which can put a web into
> SPILLED.  This happens if one reference of a pseudo has conflicting
> constraints with all other references.  In that case this reference is
> "spilled" (for a lack of a better word, not to be confused with

I call it "splitting".

> spilling
> resulting from register pressure; it's similar to reloads just on
> pseudos).  Such a web is then marked as changed, and Denis uses the
> SPILLED list for this.
> 
> The integration with the allocator is rather ugly, I agree.  The use
> of
> the SPILLED list for this is confusing.  What this code basically does
> is

Why it's ugly ?
Are you think that creating of new list (ie SPLITTED) will be better ?

> bootstrap).

> On your platform.  Take one with stranger constraints, and involving
> sources which cast between funny types, and you somewhen will hit it.

The code which must support "splitting" before first colorization
phase was disabled because it's not complete.
See a comment "FIXME ..." in ra-build.c:web_class

Denis.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]