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] Fix PR middle-end/28690, indexed load/store performance + reload bug


On Tue, 2006-12-05 at 14:26 +0100, Paolo Bonzini wrote:
> > -	*addr = gen_rtx_PLUS (Pmode, *addr, base);
> > +	{
> > +	  /* For performance reasons on some processors, prefer
> > +	     the pointer being the first operand of the PLUS.  */
> > +	  if (REG_P (*addr) && !REG_POINTER (*addr)
> > +	      && REG_P (base) && REG_POINTER (base))
> > +	    *addr = gen_rtx_PLUS (Pmode, base, *addr);
> > +	  else
> > +	    *addr = gen_rtx_PLUS (Pmode, *addr, base);
> 
> In theory, given the change you made to rtlanal.c, this should be done with
> 
>    *addr = simplify_gen_binary (PLUS, Pmode, base, *addr);
> 
> If this does not work, it is probably because the
> swap_commutative_operands_p change does not affect other users of
> commutative_operand_precedence.

Ok, now that we have the latent reload bug fixed, I'm looking at the
three users of commutative_operand_precedence().  They are:

  swap_commutative_operands_p()
  swap_commutative_operands_with_target()
  simplify_plus_minus_op_data_cmp()

Looking at them, it seems like we _might_ be able to just marge all
of them into one routine.  However, I have a question regarding your
change to simplify_plus_minus_op_data_cmp() on 2006-09-05.  Specifically
the change that breaks ties for REGs by comparing their regnos.  Do you
remember why you made that change (checked in as part of PR26847)?

Peter




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