gcc-patches@gcc.gnu.org
[Top] [All Lists]

Re: [PATCH] Fix PR37053: Move tweaks of commutative precedence to targe

Subject: Re: [PATCH] Fix PR37053: Move tweaks of commutative precedence to target hook
From: Luis Machado
Date: Mon, 29 Jun 2009 13:42:10 -0300
Hi,

On Mon, 2009-06-29 at 10:03 -0300, Luis Machado wrote:
> Hi,
> 
> On Mon, 2009-06-29 at 16:41 +0400, Maxim Kuvyrkov wrote:
> > 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
> 
> I'll tweak that bit and will try again. I already see good numbers for
> galgel.
> 
> Luis

With the fix, most of the benchmarks seem to be back to normal, but swim
(both 32/64-bit) and parser (32-bit) went down a bit, about 5%.

Luis

<Prev in Thread] Current Thread [Next in Thread>