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]

Re: new-regalloc.c patch


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);
}  


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