public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "irar at il dot ibm dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/33447]  New: Non-empty latch block prevents loop vectorization
Date: Sun, 16 Sep 2007 11:49:00 -0000	[thread overview]
Message-ID: <bug-33447-9531@http.gcc.gnu.org/bugzilla/> (raw)

The following loop (from linpk.f90) contains a non-empty latch block before
tree optimizations:

Source code:
Line
               m = MOD(N,4)
323                IF ( m.NE.0 ) THEN
324                   DO i = 1 , m
325                      Dy(i) = Dy(i) + Da*Dx(i)
326                   ENDDO
327                   IF ( N.LT.4 ) RETURN
328                ENDIF
329                mp1 = m + 1
330                DO i = mp1 , N , 4
331                   Dy(i) = Dy(i) + Da*Dx(i)
332                   Dy(i+1) = Dy(i+1) + Da*Dx(i+1)
333                   Dy(i+2) = Dy(i+2) + Da*Dx(i+2)
334                   Dy(i+3) = Dy(i+3) + Da*Dx(i+3)
335                ENDDO 

The first SSA dump:

<bb 17>:
  ...

  if (countm1.32_8 == 0)
    goto <bb 19>;
  else
    goto <bb 18>;

<bb 18>:
  countm1.32_98 = countm1.32_8 + 4294967295;
  goto <bb 17>;

This is also related to PR 28643 and PR 33244. However, in these PRs some tree
optimization puts stmts/phi nodes in the latch block, while in the lnpck
example the latch block is non-empty to begin with.


-- 
           Summary: Non-empty latch block prevents loop vectorization
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Keywords: missed-optimization
          Severity: enhancement
          Priority: P3
         Component: tree-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: irar at il dot ibm dot com


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


             reply	other threads:[~2007-09-16 11:49 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-16 11:49 irar at il dot ibm dot com [this message]
2009-01-03  0:52 ` [Bug tree-optimization/33447] " steven at gcc dot gnu dot 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-33447-9531@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).