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



-	*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.

Paolo


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