This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: new-regalloc.c patch
- To: Daniel Berlin <dberlin at redhat dot com>
- Subject: Re: new-regalloc.c patch
- From: Denis Chertykov <denisc at overta dot ru>
- Date: 03 Feb 2001 21:13:32 +0300
- Cc: Denis Chertykov <denisc at overta dot ru>, <gcc-patches at gcc dot gnu dot org>
- References: <Pine.LNX.4.31.0102031232100.22675-100000@www.cgsoftware.com>
Daniel Berlin <dberlin@redhat.com> writes:
> > You say that edge weight of v1 and v2 equal to
> > MAX (v1 hard regs, v2 hard regs).
> >
> > Is this true ?
> Yes.
> Assuming the registers must be consecutive.
So, `edge_weight' is:
/* Determine the edge weight from reg v1 to reg v2. */
static int
edge_weight (v1, v2)
unsigned int v1;
unsigned int v2;
{
int w1 = 1, w2 = 1;
if (! REGNO_REG_SET_P (precolored, v1))
w1 = CLASS_MAX_NREGS (reg_preferred_class (v1), PSEUDO_REGNO_MODE (v1));
if (! REGNO_REG_SET_P (precolored, v2))
w2 = CLASS_MAX_NREGS (reg_preferred_class (v2), PSEUDO_REGNO_MODE (v2));
return MAX(w2,w1);
}