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: post-reload register copy-propagation


Howdy,

In kill_value_regno, Richard Henderson wrote:
> +       for (i = vd->e[regno].oldest_regno;
> + 	   vd->e[i].next_regno != regno;
> + 	   i = vd->e[i].next_regno)
> + 	continue;
> + 
> +       next = vd->e[regno].next_regno;
> +       while (1)
> + 	{
> + 	  vd->e[i].next_regno = next;
> + 	  if (next == INVALID_REGNUM)
> + 	    break;
> + 	  i = next;
> + 	  next = vd->e[next].next_regno;
> + 	}

As far as I can tell, this will cut the killed element out of the
list, and then copy the links between all of the trailing
elements.  The following should be equivalent, but quicker.

      for (i = vd->e[regno].oldest_regno;
	   vd->e[i].next_regno != regno;
	   i = vd->e[i].next_regno)
	continue;

      vd->e[i].next_regno = vd->e[regno].next_regno;

Matt


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