public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/60890] New: Performance regression in 4.8 for memory postinc
@ 2014-04-18 18:50 hariharan.gcc at gmail dot com
  2014-04-18 18:56 ` [Bug tree-optimization/60890] " pinskia at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: hariharan.gcc at gmail dot com @ 2014-04-18 18:50 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 60890
           Summary: Performance regression in 4.8 for memory postinc
           Product: gcc
           Version: 4.8.1
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: hariharan.gcc at gmail dot com

Created attachment 32632
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=32632&action=edit
The source testcase

The attached testcase is a simplified version of the code where i saw this
problem initially. At the end of tree stages, 4.7 compiler used to generate two
consecutive stores, and then add to update the pointer as shown below for the
stores in the innermost loop.

  MEM[base: aptr_54, offset: 0B] = res1_22;
  MEM[base: aptr_54, offset: 4B] = res2_27;
  D.1771_63 = (sizetype) aptr_54;
  D.1772_64 = D.1771_63 + 8;

4.8 compiler generates

  MEM[base: base_76, offset: 0B] = res1_32;
  _29 = (unsigned long) base_76;
  _83 = _29 + 8;
  base_84 = (int *) _83;
  MEM[base: base_84, offset: -4B] = res2_37;

for the same 2 stores. In our private port, which can do post-inc on load/store
operations, 4.7 used to generate optimal code whereas 4.8 code is not very
pretty.

The problem seems to stem from the fix made to Bug 48814, which generates
post-inc operations in a different order from 4.7. Should the tree optimization
passes have fixed it up?

At the end of tree-optimization passes, i can see the problem in x86 as well.
Compile the attached code with 4.7.x and 4.8.x to see the difference.


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

* [Bug tree-optimization/60890] Performance regression in 4.8 for memory postinc
  2014-04-18 18:50 [Bug tree-optimization/60890] New: Performance regression in 4.8 for memory postinc hariharan.gcc at gmail dot com
@ 2014-04-18 18:56 ` pinskia at gcc dot gnu.org
  2014-05-01 19:25 ` olegendo at gcc dot gnu.org
  2015-05-22 14:03 ` olegendo at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu.org @ 2014-04-18 18:56 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
This just sounds like IV-opts going wrong.


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

* [Bug tree-optimization/60890] Performance regression in 4.8 for memory postinc
  2014-04-18 18:50 [Bug tree-optimization/60890] New: Performance regression in 4.8 for memory postinc hariharan.gcc at gmail dot com
  2014-04-18 18:56 ` [Bug tree-optimization/60890] " pinskia at gcc dot gnu.org
@ 2014-05-01 19:25 ` olegendo at gcc dot gnu.org
  2015-05-22 14:03 ` olegendo at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: olegendo at gcc dot gnu.org @ 2014-05-01 19:25 UTC (permalink / raw)
  To: gcc-bugs

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

Oleg Endo <olegendo at gcc dot gnu.org> changed:

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

--- Comment #2 from Oleg Endo <olegendo at gcc dot gnu.org> ---
Ah, the post-inc problems ... I still believe that a dedicated AMS pass is the
way to go.  See also PR 56590.


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

* [Bug tree-optimization/60890] Performance regression in 4.8 for memory postinc
  2014-04-18 18:50 [Bug tree-optimization/60890] New: Performance regression in 4.8 for memory postinc hariharan.gcc at gmail dot com
  2014-04-18 18:56 ` [Bug tree-optimization/60890] " pinskia at gcc dot gnu.org
  2014-05-01 19:25 ` olegendo at gcc dot gnu.org
@ 2015-05-22 14:03 ` olegendo at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: olegendo at gcc dot gnu.org @ 2015-05-22 14:03 UTC (permalink / raw)
  To: gcc-bugs

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

--- 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] 4+ messages in thread

end of thread, other threads:[~2015-05-22 14:03 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-04-18 18:50 [Bug tree-optimization/60890] New: Performance regression in 4.8 for memory postinc hariharan.gcc at gmail dot com
2014-04-18 18:56 ` [Bug tree-optimization/60890] " pinskia at gcc dot gnu.org
2014-05-01 19:25 ` olegendo at gcc dot gnu.org
2015-05-22 14:03 ` olegendo 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).