public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jeff Law <law@redhat.com>
To: Wilco Dijkstra <Wilco.Dijkstra@arm.com>,
	GCC Patches <gcc-patches@gcc.gnu.org>
Cc: nd <nd@arm.com>
Subject: Re: [PATCH] Fix PR46932: Block auto increment on frame pointer
Date: Tue, 25 Jul 2017 22:29:00 -0000	[thread overview]
Message-ID: <1f366303-728e-afda-eebe-286226adbdcb@redhat.com> (raw)
In-Reply-To: <DB6PR0801MB2053AAC879CDEF7B956A356383B80@DB6PR0801MB2053.eurprd08.prod.outlook.com>

On 07/25/2017 03:25 PM, Wilco Dijkstra wrote:
> Jeff Law wrote:
> 
>> My only concern here would be cases where we don't end up eliminating FP
>> to SP.  But I'd think it's unlikely that we'd have enough auto-inc
>> opportunities on the frame pointer for it to matter much anyway.
> 
> What kind of case are you thinking of? Whether it is SP or FP doesn't matter,
> we cannot copy propagate the pointer:
None in particular.  My point was that we're unlikely to even see that
many cases where an autoinc opportunity exists using the frame pointer
to begin with.  So I don't see that restricting auto-incs involving FP
should ever cause significant problems.




> 
>         add     x1, fp, 32
>         strb    w0, [x1, -1]!
>     
> Not even if the elimination offset is zero:
> 
>         mov     x1, fp
>         strb    w0, [x1, 31]!
> 
> Basically an independent add is better than the above:
> 
>         strb    w0, [fp, 31]
>         add     x1, fp, 31
> 
> I think the phase is still overly aggressive and there are more cases where it 
> doesn't make sense to use auto increment. For example you will extra moves
> just like the 2nd case above when it's not the last use of the source.
Certainly possible in the general sense, though we have some targets (SH
IIRC) that try really hard to exploit autoinc addressing modes.    On
modern processors I would think the independent add is usually a better
choice.

Instructions with multiple outputs are problematic for out-of-order
processors.  You often end up holding resources within the CPU until the
instruction can fully retire and often no dependent insns are allowed to
move forward either, even if they just depended on the embedded
arithmetic which may be ready to retire had it been issued as a separate
instruction.

Jeff

      reply	other threads:[~2017-07-25 22:29 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-20 14:49 Wilco Dijkstra
2017-07-25 20:42 ` Jeff Law
2017-07-25 21:25   ` Wilco Dijkstra
2017-07-25 22:29     ` Jeff Law [this message]

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=1f366303-728e-afda-eebe-286226adbdcb@redhat.com \
    --to=law@redhat.com \
    --cc=Wilco.Dijkstra@arm.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=nd@arm.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).