public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "wschmidt at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/57309] New: Spill code degrades vectorized loop for 437.leslie3d on PPC64
Date: Fri, 17 May 2013 03:06:00 -0000	[thread overview]
Message-ID: <bug-57309-4@http.gcc.gnu.org/bugzilla/> (raw)

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

            Bug ID: 57309
           Summary: Spill code degrades vectorized loop for 437.leslie3d
                    on PPC64
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Keywords: missed-optimization
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: wschmidt at gcc dot gnu.org
                CC: bergner at vnet dot ibm.com
              Host: powerpc*-*-*
            Target: powerpc*-*-*
             Build: powerpc*-*-*

Note: This bug does NOT occur on current trunk.

To reproduce, it's necessary to patch config/rs6000/rs6000.h so that
MALLOC_ABI_ALIGNMENT is defined as:

#define MALLOC_ABI_ALIGNMENT (TARGET_64BIT ? 128 : 64)

This allows more vectorization opportunities for loops that access malloc'd
arrays that can be vectorized with 128-bit vectors.

I observed that making this change introduces a degradation of SPEC CPU2006
437.leslie3d, built for 64-bit PowerPC Linux.  There are a number of degraded
loops in the code, which seem to all be pretty similar.  In all cases the loops
are vectorized with and without the patch, but with the patch there is no need
for prolog code to align the data.  Unfortunately, with the patch, the loops
also contain a great deal of spill code (ld, addi, lxvd2x, stxvd2x) which
reloads not only vector registers, but also GPRs used for address computation
of vector loads and stores.  Without the spill code, the main loop body would
be vectorized identically with and without the patch.

One of the worst degraded loops is in function fluxk.  I have oprofile data
available to identify the loop as well as some dumps showing how the loop is
transformed in various phases, available by request.


             reply	other threads:[~2013-05-17  3:06 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-17  3:06 wschmidt at gcc dot gnu.org [this message]
2013-05-17  8:42 ` [Bug target/57309] " rguenth at gcc dot gnu.org
2013-05-17 11:58 ` wschmidt at gcc dot gnu.org

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=bug-57309-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.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).