public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "rguenth at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/50328] New: loop interchange confuses vectorizer
Date: Thu, 08 Sep 2011 13:30:00 -0000	[thread overview]
Message-ID: <bug-50328-4@http.gcc.gnu.org/bugzilla/> (raw)

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

             Bug #: 50328
           Summary: loop interchange confuses vectorizer
    Classification: Unclassified
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Keywords: missed-optimization
          Severity: normal
          Priority: P3
         Component: tree-optimization
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: rguenth@gcc.gnu.org
                CC: irar@gcc.gnu.org


For

double dvec[256];

void test (void)
{
  long i, j;
  for (j = 0; j < 131072; ++j)
    for (i = 0; i < 256; ++i)
      dvec[i] *= 1.0000001;
}

the loops are interchanged with -Ofast -floop-interchange but the vectorizer
is confused by the extra IV lim inserts:

<bb 4>:
  # graphite_IV.6_21 = PHI <0(3), graphite_IV.6_22(5)>
  # dvec_I_lsm.7_26 = PHI <dvec_I_lsm.7_10(3), D.2732_25(5)>
  # ivtmp.9_19 = PHI <131072(3), ivtmp.9_29(5)>
  D.2732_25 = dvec_I_lsm.7_26 *
1.0000001000000000583867176828789524734020233154296875e+0;
  graphite_IV.6_22 = graphite_IV.6_21 + 1;
  ivtmp.9_29 = ivtmp.9_19 - 1;
  if (ivtmp.9_29 != 0)
    goto <bb 5>;
  else
    goto <bb 6>;

<bb 5>:
  goto <bb 4>;

this isn't detected as reduction for some reason.


             reply	other threads:[~2011-09-08 13:28 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-08 13:30 rguenth at gcc dot gnu.org [this message]
2011-09-08 13:37 ` [Bug tree-optimization/50328] " rguenth at gcc dot gnu.org
2011-09-08 13:42 ` rguenth at gcc dot gnu.org
2011-09-08 13:55 ` rguenth at gcc dot gnu.org
2011-09-08 14:09 ` [Bug tree-optimization/50328] reduction with constant or invariant not vectorized rguenth at gcc dot gnu.org
2011-09-08 14:22 ` rguenth at gcc dot gnu.org
2011-09-09  9:07 ` rguenth at gcc dot gnu.org
2011-09-09 12:37 ` rguenth at gcc dot gnu.org
2011-09-09 12:57 ` rguenth 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-50328-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).