public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug rtl-optimization/56590] New: Replace auto-inc-dec pass with generic address mode selection pass
@ 2013-03-10 17:05 olegendo at gcc dot gnu.org
  2015-02-03  2:23 ` [Bug rtl-optimization/56590] " amker at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: olegendo at gcc dot gnu.org @ 2013-03-10 17:05 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56590

             Bug #: 56590
           Summary: Replace auto-inc-dec pass with generic address mode
                    selection pass
    Classification: Unclassified
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: rtl-optimization
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: olegendo@gcc.gnu.org
            Target: sh*-*-*


At least on SH there are several address mode selection issues which I'd like
to group in this PR.

PR 54065
[SH] Prefer @(R0,Rn) addressing for floating-point load/store

PR 53911
[SH] Improve displacement addressing

PR 50749
Auto-inc-dec does not find subsequent contiguous mem accesses

PR 39423
[4.6/4.7/4.8 Regression] [SH] performance regression: lost mov @(disp,Rn)

PR 52049
SH Target: Inefficient constant address access

Based on my observations so far, I think the right thing to do is to replace
the current auto-inc-dec pass with a pass that optimizes address mode selection
in a more generic way, instead of just trying to find auto inc/dec
opportunities.

The basic idea is to look at all memory accesses in a function (or basic block
as a start) that share a base address and then try to select the cheapest
addressing modes for each memory access.  The current address cost target hook
can be used to determine the costs of a memory access with a particular
address.

I have already started working on such a replacement pass a while ago and would
like to first do a trial with the SH target.  Other targets might then also
pick it up if it seems beneficial to do so.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug rtl-optimization/56590] Replace auto-inc-dec pass with generic address mode selection pass
  2013-03-10 17:05 [Bug rtl-optimization/56590] New: Replace auto-inc-dec pass with generic address mode selection pass olegendo at gcc dot gnu.org
@ 2015-02-03  2:23 ` amker at gcc dot gnu.org
  2015-02-03 10:59 ` olegendo at gcc dot gnu.org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: amker at gcc dot gnu.org @ 2015-02-03  2:23 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56590

amker at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |amker at gcc dot gnu.org

--- Comment #1 from amker at gcc dot gnu.org ---
This surely sounds interesting.  Like I suggested in PR62173, RTL optimizer
might be able to do more in address expression re-association and addressing
mode choosing.
But it's difficult to change base/offset for addresses which are IVOPTed on
GIMPLE.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug rtl-optimization/56590] Replace auto-inc-dec pass with generic address mode selection pass
  2013-03-10 17:05 [Bug rtl-optimization/56590] New: Replace auto-inc-dec pass with generic address mode selection pass olegendo at gcc dot gnu.org
  2015-02-03  2:23 ` [Bug rtl-optimization/56590] " amker at gcc dot gnu.org
@ 2015-02-03 10:59 ` olegendo at gcc dot gnu.org
  2015-05-22 13:57 ` olegendo at gcc dot gnu.org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: olegendo at gcc dot gnu.org @ 2015-02-03 10:59 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56590

--- Comment #2 from Oleg Endo <olegendo at gcc dot gnu.org> ---
(In reply to amker from comment #1)
> This surely sounds interesting.  Like I suggested in PR62173, RTL optimizer
> might be able to do more in address expression re-association and addressing
> mode choosing.
> But it's difficult to change base/offset for addresses which are IVOPTed on
> GIMPLE.

(Proper) AMS is a difficult problem and depends a lot on the target address
mode capabilities and the context of the memory accesses.  I wouldn't try to do
that on GIMPLE or in ivopt.  There's simply not enough information on the
instructions that will be used for actually carrying out the memory accesses. 
Whatever is done on GIMPLE without taking the target into account will result
in missed optimization cases eventually.  I would rather not distribute the AMS
problem across sevaral compilation phases like doing a bit on GIMPLE and doing
a bit on RTL later.  Of course it'd be helpful if the tree optimizers can
prepare some things that make AMS optimization more successful.  But generally
I think an AMS pass should be able to work on its own.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug rtl-optimization/56590] Replace auto-inc-dec pass with generic address mode selection pass
  2013-03-10 17:05 [Bug rtl-optimization/56590] New: Replace auto-inc-dec pass with generic address mode selection pass olegendo at gcc dot gnu.org
  2015-02-03  2:23 ` [Bug rtl-optimization/56590] " amker at gcc dot gnu.org
  2015-02-03 10:59 ` olegendo at gcc dot gnu.org
@ 2015-05-22 13:57 ` olegendo at gcc dot gnu.org
  2015-10-03 15:31 ` olegendo at gcc dot gnu.org
  2023-07-22  3:07 ` pinskia at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: olegendo at gcc dot gnu.org @ 2015-05-22 13:57 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56590

--- Comment #3 from Oleg Endo <olegendo at gcc dot gnu.org> ---
There is a GSoC 2015 project which will try to address the AMS problem.
https://www.google-melange.com/gsoc/project/details/google/gsoc2015/erikvarga/5693417237512192

It will be initially for SH.  If it works out, it can be generalized so that
other targets can benefit from it, too.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug rtl-optimization/56590] Replace auto-inc-dec pass with generic address mode selection pass
  2013-03-10 17:05 [Bug rtl-optimization/56590] New: Replace auto-inc-dec pass with generic address mode selection pass olegendo at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2015-05-22 13:57 ` olegendo at gcc dot gnu.org
@ 2015-10-03 15:31 ` olegendo at gcc dot gnu.org
  2023-07-22  3:07 ` pinskia at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: olegendo at gcc dot gnu.org @ 2015-10-03 15:31 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56590

--- Comment #4 from Oleg Endo <olegendo at gcc dot gnu.org> ---
The AMS branch is here: https://github.com/erikvarga/gcc


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug rtl-optimization/56590] Replace auto-inc-dec pass with generic address mode selection pass
  2013-03-10 17:05 [Bug rtl-optimization/56590] New: Replace auto-inc-dec pass with generic address mode selection pass olegendo at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2015-10-03 15:31 ` olegendo at gcc dot gnu.org
@ 2023-07-22  3:07 ` pinskia at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-07-22  3:07 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56590

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |missed-optimization
           Severity|normal                      |enhancement

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2023-07-22  3:07 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-03-10 17:05 [Bug rtl-optimization/56590] New: Replace auto-inc-dec pass with generic address mode selection pass olegendo at gcc dot gnu.org
2015-02-03  2:23 ` [Bug rtl-optimization/56590] " amker at gcc dot gnu.org
2015-02-03 10:59 ` olegendo at gcc dot gnu.org
2015-05-22 13:57 ` olegendo at gcc dot gnu.org
2015-10-03 15:31 ` olegendo at gcc dot gnu.org
2023-07-22  3:07 ` pinskia at gcc dot gnu.org

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).