public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Ramana Radhakrishnan <ramana.radhakrishnan@arm.com>
To: Andrew Pinski <pinskia@gmail.com>,
	Sebastian Pop <sebpop@gmail.com>,
	 Richard Biener <rguenther@suse.de>
Cc: GCC Patches <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH][0/n] Merge from match-and-simplify
Date: Fri, 17 Oct 2014 07:29:00 -0000	[thread overview]
Message-ID: <5440C51E.9030604@arm.com> (raw)
In-Reply-To: <CA+=Sn1mFvukeSpkXNN7+rkTFok5hNHA-410noLj1+o2ChRKsMA@mail.gmail.com>



On 16/10/14 21:43, Andrew Pinski wrote:
> On Thu, Oct 16, 2014 at 1:38 PM, Sebastian Pop <sebpop@gmail.com> wrote:
>> Richard Biener wrote:
>>>
>>> I have posted 5 patches as part of a larger series to merge
>>> (parts) from the match-and-simplify branch.  While I think
>>> there was overall consensus that the idea behind the project
>>> is sound there are technical questions left for how the
>>> thing should look in the end.  I've raised them in 3/n
>>> which is the only patch of the series that contains any
>>> patterns sofar.
>>>
>>> To re-iterate here (as I expect most people will only look
>>> at [0/n] patches ;)), the question is whether we are fine
>>> with making fold-const (thus fold_{unary,binary,ternary})
>>> not handle some cases it handles currently.


>>
>> I have tested on aarch64 all the code in the match-and-simplify against trunk as
>> of the last merge at r216315:
>>
>> 2014-10-16  Richard Biener  <rguenther@suse.de>
>>
>>          Merge from trunk r216235 through r216315.
>>
>> Overall, I see a lot of perf regressions (about 2/3 of the tests) than
>> improvements (1/3 of the tests).  I will try to reduce tests.

>>
>> For instance, saxpy regresses at -O3 on aarch64:
>>
>> void saxpy(double* x, double* y, double* z) {
>>      int i=0;
>>      for (i = 0 ; i < ARRAY_SIZE; i++) {
>>          z[i] = x[i] + scalar*y[i];
>>      }
>> }
>
> This looks like a scheduling issue rather than anything else.  The
> scheduler for a57 is not complete and does not model some things like
> the fusion of the compares and branch which is most likely what you
> are seeing.


Huh !! how is that related to the code generation shown by Seb ?

See the replacement of subs by cmp and sub. Folding cmp into other flag 
setting instructions is a very useful optimization on ARM and AArch64 
and that's what appears missing in fold-const. That maybe what's causing 
the slowdown. I've never known that to be caused by any scheduler 
vagaries !

regards
Ramana




>
> Thanks,
> Andrew Pinski
>
>>
>> $ diff -u base.s mas.s
>> --- base.s      2014-10-16 15:30:15.351430000 -0500
>> +++ mas.s       2014-10-16 15:30:16.183035000 -0500
>> @@ -2,12 +2,14 @@
>>          add     x1, x2, 800
>>          ldr     q0, [x0, x2]
>>          add     x3, x2, 1600
>> +       cmp     x0, 784
>>          ldr     q1, [x0, x1]
>> +       add     x1, x0, 16
>>          fmla    v0.2d, v1.2d, v2.2d
>>          str     q0, [x0, x3]
>> -       add     x0, x0, 16
>> -       cmp     x0, 800
>> +       mov     x0, x1
>>          bne     .L140
>>   .LBE179:
>> -       subs    w4, w4, #1
>> +       cmp     w4, 1
>> +       sub     w4, w4, #1
>>          bne     .L139
>>
>>
>>
>> Thanks,
>> Sebastian
>

  reply	other threads:[~2014-10-17  7:28 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-15 13:20 Richard Biener
2014-10-15 16:30 ` Kyrill Tkachov
2014-10-17  7:39   ` Ramana Radhakrishnan
2014-10-17  8:24     ` Richard Biener
2014-10-17 11:58       ` Richard Biener
2014-10-15 17:13 ` Jakub Jelinek
2014-10-16 20:43 ` Sebastian Pop
2014-10-16 20:50   ` Andrew Pinski
2014-10-17  7:29     ` Ramana Radhakrishnan [this message]
2014-10-17  8:00   ` Richard Biener
2014-10-17 16:44     ` Sebastian Pop
2014-10-17 17:37       ` Richard Biener
2014-10-17 18:32       ` Sebastian Pop
2014-10-20 11:47         ` Richard Biener
2014-10-22 21:06           ` Jeff Law

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5440C51E.9030604@arm.com \
    --to=ramana.radhakrishnan@arm.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=pinskia@gmail.com \
    --cc=rguenther@suse.de \
    --cc=sebpop@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).