This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: additional refinements to the ra-conflict.
- From: Michael Matz <matz at suse dot de>
- To: Kenneth Zadeck <zadeck at naturalbridge dot com>
- Cc: gcc-patches <gcc-patches at gcc dot gnu dot org>, Vladimir Makarov <vmakarov at redhat dot com>, "Park, Seongbae" <seongbae dot park at gmail dot com>, Steven Bosscher <stevenb dot gcc at gmail dot com>
- Date: Fri, 4 Apr 2008 03:49:09 +0200 (CEST)
- Subject: Re: additional refinements to the ra-conflict.
- References: <47F561AC.5060700@naturalbridge.com>
Hi Kenny,
On Thu, 3 Apr 2008, Kenneth Zadeck wrote:
> This patch adds enough refinements to the existing conflict builder to
> get rid of the REG_NO_CONFLICT notes from global.
I quickly skimmed over this to see the general approach. One question: is
it possible that you reach your goal of allocating two (partly
conflicting) mw pseudos to the same hardreg by not creating the conflict
edge at all? I'm asking because this would generate wrong code sometimes.
I don't see any changes in global.c which would allow it to assign the
same hardreg to partly conflicting pseudos (see our mail exchange), except
if the input conflicts are clear of half-conflicts.
If I got this wrong, you can ignore the following (and instead enlighten
me why the necessary conflicts are there :) ). Anyway, consider two mw
pseudos A and B (with parts A.0, A.1, B.0 and B.1).
Suppose there's only one conflict: A.0 <-> B.1. Hence a valid allocation
could assign both to e.g. hardreg 1.
Further, consider how global.c:find_reg works: After having found a free
reg for the allocno in question, it will mark all covered hardregs as
taken away in all conflicts of that allocno.
Now, if that conflict is missing, you would also miss to mark some
hardregs as taken. For instance if A is allocated first and happens to
get hardreg 1 (i.e. takes hardregs 1 and 2), and the conflict between A
and B is invisible for find_reg, hardregs 1 and 2 are available (as far as
find_reg knows) also for B. Assuming that B only conflicts with A and
nothing else, no hardreg will be taken away for it. So find_reg would be
free to assign B to hardreg 0. And that would lead to wrong code as
register 1 is now used by B.1 and A.0, which is exactly the assumed
conflict.
Hmm, so either global.c doesn't yet handle partly conflicting mw pseudos
or it generates wrong code.
Ciao,
Michael.