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: [PATCH] Prevent coalesce in new-ra when class size == 1


Hi,

On Fri, 23 Jul 2004, Pat Haugen wrote:

> > Also an possible improvement would be to use the prefer_colors member of
> > webs (i.e. set it in your new function).  By that the webs will not be
> > coalesced, but the chance of the other web getting the same colors as the
> 
> > one with only one register possible is higher.
> 
> Does it make sense to do this when we haven't colored the webs yet so we
> don't really know that the web with only one color in it's preferred class
> will actually get that color?

Suppose A is the web with many possible registers, and web B is the one 
with only one color in the preferred class (lets call this color R1).  If 
A is colored before B, and R1 happens to be free for it, it will be 
preferred to other colors (as all available colors at this point are 
equally "good" this behaviour doesn't constrain the colorization process).  
If then later B will be colored it will also get R1 (hopefully at least, 
because that's the color in its preferred class), and magically we have 
made one move unnecessary.

Similar arguments hold if A is colored only after B.  I.e. this can't do 
harm to the colorization (as far as one can say this about any change to 
these heuristics ;-) ), but in some cases might do good ;)

If none of the prefer_colors is available we don't loose anything.  We 
just leave one move there.


Ciao,
Michael.


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