From: "Richard Earnshaw (lists)" <Richard.Earnshaw@arm.com>
To: Fredrik Hederstierna <fredrik.hederstierna@verisure.com>,
Segher Boessenkool <segher@kernel.crashing.org>
Cc: Jeff Law <law@redhat.com>, "gcc@gcc.gnu.org" <gcc@gcc.gnu.org>
Subject: Re: ARM peephole2 from 2003 never merged, still valid
Date: Thu, 06 Jun 2019 16:06:00 -0000 [thread overview]
Message-ID: <96a7575b-246d-d732-bdca-44e67aa7f499@arm.com> (raw)
In-Reply-To: <HE1PR1001MB130623C4604DD29C4CB18FD2EF170@HE1PR1001MB1306.EURPRD10.PROD.OUTLOOK.COM>
On 06/06/2019 15:55, Fredrik Hederstierna wrote:
>> From: Segher Boessenkool <segher@kernel.crashing.org>
>> Sent: Thursday, June 6, 2019 4:02 PM
>> To: Richard Earnshaw (lists)
>> Cc: Jeff Law; Fredrik Hederstierna; gcc@gcc.gnu.org
>> Subject: Re: ARM peephole2 from 2003 never merged, still valid
> Â
>> That doesn't stop combine from considering it. It does make that first SET
>> survive, so that you get a parallel as final insn. It may not like that
>> one of the parallel SETs is just a move. Needs testcase :-)
>
> Hi all, thanks for investigating this,
> I added semi-stripped testcase in original issue taken from CSiBE teem sources
>
> See attachment in
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=9663
>
> Tested gcc-9.1.0 for ARM 32bit targets, first without peephole2 patch:
>
> 00000000 <nrrdRangeSet>:
> 0: e92d407f push {r0, r1, r2, r3, r4, r5, r6, lr}
> 4: e2504000 subs r4, r0, #0
> 8: 0a00003f beq 10c <nrrdRangeSet+0x10c>
> c: e3510000 cmp r1, #0
> 10: e1a05001 mov r5, r1
>
> then with new peephole2 patch:
>
> 00000000 <nrrdRangeSet>:
> 0: e92d407f push {r0, r1, r2, r3, r4, r5, r6, lr}
> 4: e2504000 subs r4, r0, #0
> 8: 0a00003e beq 108 <nrrdRangeSet+0x108>
> c: e2515000 subs r5, r1, #0
>
> Thanks, Fredrik
>
The reason combine doesn't catch this is because at the time it runs the
MOV is in a different basic block. Later on it is sunk into the same
basic block, but it's then too late to do the merge.
R.
next prev parent reply other threads:[~2019-06-06 16:06 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-24 8:48 Question about GCC benchmarks and uninitialized variables Fredrik Hederstierna
2018-07-24 9:04 ` Alexander Monakov
2018-07-24 12:17 ` David Brown
2019-05-30 9:13 ` Question about GCC not warning for some noncompliant SEI CERT C code examples Fredrik Hederstierna
2019-05-30 14:28 ` Martin Sebor
2019-05-30 14:48 ` Jeff Law
2019-06-01 23:35 ` ARM peephole2 from 2003 never merged, still valid Fredrik Hederstierna
2019-06-01 23:41 ` Fredrik Hederstierna
2019-06-02 12:28 ` Segher Boessenkool
2019-06-05 23:03 ` Jeff Law
2019-06-05 23:46 ` Segher Boessenkool
2019-06-06 9:13 ` Richard Earnshaw (lists)
2019-06-06 14:02 ` Segher Boessenkool
2019-06-06 14:55 ` Fredrik Hederstierna
2019-06-06 16:06 ` Richard Earnshaw (lists) [this message]
2019-06-06 16:49 ` Segher Boessenkool
2019-07-08 6:41 ` Fredrik Hederstierna
2019-07-09 19:13 ` Jeff Law
2019-06-14 20:30 ` 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=96a7575b-246d-d732-bdca-44e67aa7f499@arm.com \
--to=richard.earnshaw@arm.com \
--cc=fredrik.hederstierna@verisure.com \
--cc=gcc@gcc.gnu.org \
--cc=law@redhat.com \
--cc=segher@kernel.crashing.org \
/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).