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: Improving reload inheritance code generation and predictability


> +       my_spill_reg_order[n_spills - (*count)++ - 1] = regno;

I think that some of this arithmetic is unnecessarily complicated.

s/count/index/, initialize *index to n_spills, and do --*index here.

> +       for (spill_regs_found = 0, count = 0; count < n_spills; count++)
> +         {
> + 	  int regnum;
> + 
> + 	  i++;
> + 	  if (i >= n_spills)
> + 	    i -= n_spills;
> + 	  regnum = spill_regs[i];
> + 	  if (TEST_HARD_REG_BIT (spill_reg_search, regnum))

s/spill_regs_found/n_spills_left/, since we've changed the meaning
of count above.  

Here it's not necessary to iterate over all n_spills, we only need
to iterate n_spills_left times.

The rest of the logic is... just as impenetrable as before.  But I
guess nothing can really help that until you manage to remove it.


r~


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