public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/34223]  New: missed optimization - complete unrolling pass before the vectorizer
@ 2007-11-25 10:26 eres at il dot ibm dot com
  2007-11-25 12:50 ` [Bug tree-optimization/34223] " rguenth at gcc dot gnu dot org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: eres at il dot ibm dot com @ 2007-11-25 10:26 UTC (permalink / raw)
  To: gcc-bugs

Consider the following test compiled with r130351 on ppc64-linux:

#define M 10
#define N 3

void
foo (int n, int *ub, int *uc)
{
  int i, j, tmp1;

  for (i = 0; i < n; i++)
    {
      tmp1 = 0;
      for (j = 0; j < M; j++)
        {
          tmp1 += uc[i] * ((int)(j << N) / M);
        }
      ub[i] = tmp1;
    }
}

Here is a snippet from the vectorizer dump:

c.c:12: note: not vectorized: relevant stmt not supported: D.1652_13 = j_29 <<
3
c.c:12: note: bad operation or unsupported loop bound.

[Adding a complete unrolling + ccp passes before the vectorizer can help to
vectorize the outer loop]


-- 
           Summary: missed optimization - complete unrolling pass before the
                    vectorizer
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: eres at il dot ibm dot com


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


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

* [Bug tree-optimization/34223] missed optimization - complete unrolling pass before the vectorizer
  2007-11-25 10:26 [Bug tree-optimization/34223] New: missed optimization - complete unrolling pass before the vectorizer eres at il dot ibm dot com
@ 2007-11-25 12:50 ` rguenth at gcc dot gnu dot org
  2007-11-25 13:36 ` steven at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2007-11-25 12:50 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from rguenth at gcc dot gnu dot org  2007-11-25 12:50 -------
Related to PR18754 - but vectorizer folks say early complete unrolling defeats
the vectorizer.  So possibly a compromise is to do early complete unrolling
only
for nested loops.


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |rguenth at gcc dot gnu dot
                   |                            |org
  BugsThisDependsOn|                            |18754
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2007-11-25 12:50:00
               date|                            |
            Summary|missed optimization -       |missed optimization -
                   |complete unrolling pass     |complete unrolling pass
                   |before the vectorizer       |before the vectorizer


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


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

* [Bug tree-optimization/34223] missed optimization - complete unrolling pass before the vectorizer
  2007-11-25 10:26 [Bug tree-optimization/34223] New: missed optimization - complete unrolling pass before the vectorizer eres at il dot ibm dot com
  2007-11-25 12:50 ` [Bug tree-optimization/34223] " rguenth at gcc dot gnu dot org
@ 2007-11-25 13:36 ` steven at gcc dot gnu dot org
  2007-11-25 14:13 ` eres at il dot ibm dot com
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: steven at gcc dot gnu dot org @ 2007-11-25 13:36 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from steven at gcc dot gnu dot org  2007-11-25 13:36 -------
Why is this a shift not supported:
not vectorized: relevant stmt not supported: D.1652_13 = j_29 << 3

Is j_29*8 supported (i.e. if you hack this expression to turn it into a
MULT_EXPR), does the vectorizer work then??


-- 


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


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

* [Bug tree-optimization/34223] missed optimization - complete unrolling pass before the vectorizer
  2007-11-25 10:26 [Bug tree-optimization/34223] New: missed optimization - complete unrolling pass before the vectorizer eres at il dot ibm dot com
  2007-11-25 12:50 ` [Bug tree-optimization/34223] " rguenth at gcc dot gnu dot org
  2007-11-25 13:36 ` steven at gcc dot gnu dot org
@ 2007-11-25 14:13 ` eres at il dot ibm dot com
  2008-04-22  9:51 ` rguenth at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: eres at il dot ibm dot com @ 2007-11-25 14:13 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from eres at il dot ibm dot com  2007-11-25 14:13 -------
(In reply to comment #2)
> Why is this a shift not supported:
> not vectorized: relevant stmt not supported: D.1652_13 = j_29 << 3
> Is j_29*8 supported (i.e. if you hack this expression to turn it into a
> MULT_EXPR), does the vectorizer work then??

Still the division is not supported... (on altivec).  the thing is that
complete unrolling and ccp can help in such cases.

c.c:12: note: not vectorized: relevant stmt not supported: D.1653_14 =
D.1652_13 / 10


-- 


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


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

* [Bug tree-optimization/34223] missed optimization - complete unrolling pass before the vectorizer
  2007-11-25 10:26 [Bug tree-optimization/34223] New: missed optimization - complete unrolling pass before the vectorizer eres at il dot ibm dot com
                   ` (2 preceding siblings ...)
  2007-11-25 14:13 ` eres at il dot ibm dot com
@ 2008-04-22  9:51 ` rguenth at gcc dot gnu dot org
  2008-04-27 16:28 ` rguenth at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2008-04-22  9:51 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from rguenth at gcc dot gnu dot org  2008-04-22 09:51 -------
Mine.


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |rguenth at gcc dot gnu dot
                   |dot org                     |org
             Status|NEW                         |ASSIGNED
           Keywords|                            |missed-optimization
   Last reconfirmed|2007-11-25 12:50:00         |2008-04-22 09:51:07
               date|                            |


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


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

* [Bug tree-optimization/34223] missed optimization - complete unrolling pass before the vectorizer
  2007-11-25 10:26 [Bug tree-optimization/34223] New: missed optimization - complete unrolling pass before the vectorizer eres at il dot ibm dot com
                   ` (3 preceding siblings ...)
  2008-04-22  9:51 ` rguenth at gcc dot gnu dot org
@ 2008-04-27 16:28 ` rguenth at gcc dot gnu dot org
  2008-04-27 17:16 ` rguenth at gcc dot gnu dot org
  2008-04-28  9:23 ` rguenth at gcc dot gnu dot org
  6 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2008-04-27 16:28 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from rguenth at gcc dot gnu dot org  2008-04-27 16:27 -------
Subject: Bug 34223

Author: rguenth
Date: Sun Apr 27 16:27:08 2008
New Revision: 134730

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=134730
Log:
2008-04-27  Richard Guenther  <rguenther@suse.de>

        PR tree-optimization/18754
        PR tree-optimization/34223
        * tree-pass.h (pass_complete_unrolli): Declare.
        * tree-ssa-loop-ivcanon.c (try_unroll_loop_completely): Print
        loop size before and after unconditionally of UL_NO_GROWTH in effect.
        Rewrite loop into loop closed SSA form if it is not already.
        (tree_unroll_loops_completely): Re-structure to iterate over
        innermost loops with intermediate CFG cleanups.
        Unroll outermost loops only if requested or the code does not grow
        doing so.
        * tree-ssa-loop.c (gate_tree_vectorize): Don't shortcut if no
        loops are available.
        (tree_vectorize): Instead do so here.
        (tree_complete_unroll): Also unroll outermost loops.
        (tree_complete_unroll_inner): New function.
        (gate_tree_complete_unroll_inner): Likewise.
        (pass_complete_unrolli): New pass.
        * tree-ssa-loop-manip.c (find_uses_to_rename_use): Only record
        uses outside of the loop.
        (tree_duplicate_loop_to_header_edge): Only verify loop-closed SSA
        form if it is available.  
        * tree-flow.h (tree_unroll_loops_completely): Add extra parameter.
        * passes.c (init_optimization_passes): Schedule complete inner
        loop unrolling pass before the first CCP pass after final inlining.

        * gcc.dg/tree-ssa/loop-36.c: New testcase.
        * gcc.dg/tree-ssa/loop-37.c: Likewise.
        * gcc.dg/vect/vect-118.c: Likewise.
        * gcc.dg/Wunreachable-8.c: XFAIL bogus warning.
        * gcc.dg/vect/vect-66.c: Increase loop trip count.
        * gcc.dg/vect/no-section-anchors-vect-66.c: Likewise.
        * gcc.dg/vect/no-section-anchors-vect-69.c: Likewise.
        * gcc.dg/vect/vect-76.c: Likewise.
        * gcc.dg/vect/vect-outer-6.c: Likewise.
        * gcc.dg/vect/vect-outer-1.c: Likewise.
        * gcc.dg/vect/vect-outer-1a.c: Likewise.
        * gcc.dg/vect/vect-11a.c: Likewise.
        * gcc.dg/vect/vect-shift-1.c: Likewise.
        * gcc.target/i386/vectorize1.c: Likewise.

Added:
    trunk/gcc/testsuite/gcc.dg/tree-ssa/loop-36.c
    trunk/gcc/testsuite/gcc.dg/tree-ssa/loop-37.c
    trunk/gcc/testsuite/gcc.dg/vect/vect-118.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/passes.c
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/gcc.dg/Wunreachable-8.c
    trunk/gcc/testsuite/gcc.dg/vect/no-section-anchors-vect-66.c
    trunk/gcc/testsuite/gcc.dg/vect/no-section-anchors-vect-69.c
    trunk/gcc/testsuite/gcc.dg/vect/vect-11a.c
    trunk/gcc/testsuite/gcc.dg/vect/vect-66.c
    trunk/gcc/testsuite/gcc.dg/vect/vect-76.c
    trunk/gcc/testsuite/gcc.dg/vect/vect-outer-1.c
    trunk/gcc/testsuite/gcc.dg/vect/vect-outer-1a.c
    trunk/gcc/testsuite/gcc.dg/vect/vect-outer-6.c
    trunk/gcc/testsuite/gcc.dg/vect/vect-shift-1.c
    trunk/gcc/testsuite/gcc.target/i386/vectorize1.c
    trunk/gcc/tree-flow.h
    trunk/gcc/tree-pass.h
    trunk/gcc/tree-ssa-loop-ivcanon.c
    trunk/gcc/tree-ssa-loop-manip.c
    trunk/gcc/tree-ssa-loop.c


-- 


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


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

* [Bug tree-optimization/34223] missed optimization - complete unrolling pass before the vectorizer
  2007-11-25 10:26 [Bug tree-optimization/34223] New: missed optimization - complete unrolling pass before the vectorizer eres at il dot ibm dot com
                   ` (4 preceding siblings ...)
  2008-04-27 16:28 ` rguenth at gcc dot gnu dot org
@ 2008-04-27 17:16 ` rguenth at gcc dot gnu dot org
  2008-04-28  9:23 ` rguenth at gcc dot gnu dot org
  6 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2008-04-27 17:16 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from rguenth at gcc dot gnu dot org  2008-04-27 17:16 -------
Fixed.


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED
   Target Milestone|---                         |4.4.0


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


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

* [Bug tree-optimization/34223] missed optimization - complete unrolling pass before the vectorizer
  2007-11-25 10:26 [Bug tree-optimization/34223] New: missed optimization - complete unrolling pass before the vectorizer eres at il dot ibm dot com
                   ` (5 preceding siblings ...)
  2008-04-27 17:16 ` rguenth at gcc dot gnu dot org
@ 2008-04-28  9:23 ` rguenth at gcc dot gnu dot org
  6 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2008-04-28  9:23 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from rguenth at gcc dot gnu dot org  2008-04-28 09:23 -------
Subject: Bug 34223

Author: rguenth
Date: Mon Apr 28 09:22:28 2008
New Revision: 134747

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=134747
Log:
2008-04-28  Richard Guenther  <rguenther@suse.de>

        PR testsuite/34223
        * gcc.dg/vect/vect-118.c: Rename to ...
        * gcc.dg/vect/O3-vect-pr34223.c: ... this.

Added:
    trunk/gcc/testsuite/gcc.dg/vect/O3-vect-pr34223.c
      - copied, changed from r134744,
trunk/gcc/testsuite/gcc.dg/vect/vect-118.c
Removed:
    trunk/gcc/testsuite/gcc.dg/vect/vect-118.c
Modified:
    trunk/gcc/testsuite/ChangeLog


-- 


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


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

end of thread, other threads:[~2008-04-28  9:23 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-11-25 10:26 [Bug tree-optimization/34223] New: missed optimization - complete unrolling pass before the vectorizer eres at il dot ibm dot com
2007-11-25 12:50 ` [Bug tree-optimization/34223] " rguenth at gcc dot gnu dot org
2007-11-25 13:36 ` steven at gcc dot gnu dot org
2007-11-25 14:13 ` eres at il dot ibm dot com
2008-04-22  9:51 ` rguenth at gcc dot gnu dot org
2008-04-27 16:28 ` rguenth at gcc dot gnu dot org
2008-04-27 17:16 ` rguenth at gcc dot gnu dot org
2008-04-28  9:23 ` rguenth at gcc dot gnu dot 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).