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 PR37053: Move tweaks of commutative precedence to target hook


Maxim Kuvyrkov wrote:
Luis Machado wrote:

...


I gave it a try with Maxim's patch from ticket #37053 and it degraded
performance pretty badly (> 30%), and galgel degraded more than 75%.
Both 32-bit and 64-bit saw degradations.

The patch in PR37053 is the one adding target hook. This patch should not affect the generated code at all. If it does, can you please send the the difference in dumps? I understand that this patch does not seem to be a favorite here, but I'm curious where I've made a mistake.

The mistake is in rs6000_commutative_operand_precedence(); the precedence value should be decrement for everything but the pointers, current code does exactly the opposite.


The hook implementation should be:

static int
rs6000_commutative_operand_precedence (const_rtx op, int value)
{
  /* Prefer pointer objects over non pointer objects.
     For rationale see PR28690.  */
  if (GET_RTX_CLASS (GET_CODE (op)) == RTX_OBJ
      && ((REG_P (op) && REG_POINTER (op))
	  || (MEM_P (op) && MEM_POINTER (op))))
    /* value = -1 */;
  else
    /* value = -2 */
    --value;

  return value;
}

--
Maxim


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