public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/19624] New: PRE pessimizes ivopts
@ 2005-01-25 14:45 rguenth at tat dot physik dot uni-tuebingen dot de
  2005-01-25 14:45 ` [Bug tree-optimization/19624] " rguenth at tat dot physik dot uni-tuebingen dot de
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: rguenth at tat dot physik dot uni-tuebingen dot de @ 2005-01-25 14:45 UTC (permalink / raw)
  To: gcc-bugs

The attached testcase is pessimized by PRE.  Be sure to get tree-level complete
loop unrolling enabled, f.i. with -O2 -funroll-loops with current mainline.

With PRE, a lot less computations are hoisted out of the inner loop.  Note this
is not a regression to 3.4, which is not able to decompose Loc<Dim> appropriately
or avoid instantiating temporary objects of this type.

-- 
           Summary: PRE pessimizes ivopts
           Product: gcc
           Version: 4.0.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: tree-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: rguenth at tat dot physik dot uni-tuebingen dot de
                CC: gcc-bugs at gcc dot gnu dot org


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


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

* [Bug tree-optimization/19624] PRE pessimizes ivopts
  2005-01-25 14:45 [Bug tree-optimization/19624] New: PRE pessimizes ivopts rguenth at tat dot physik dot uni-tuebingen dot de
@ 2005-01-25 14:45 ` rguenth at tat dot physik dot uni-tuebingen dot de
  2005-01-25 14:52 ` rguenth at tat dot physik dot uni-tuebingen dot de
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: rguenth at tat dot physik dot uni-tuebingen dot de @ 2005-01-25 14:45 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From rguenth at tat dot physik dot uni-tuebingen dot de  2005-01-25 14:45 -------
Created an attachment (id=8060)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=8060&action=view)
testcase

The testcase is reduced from a complex POOMA program.

-- 


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


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

* [Bug tree-optimization/19624] PRE pessimizes ivopts
  2005-01-25 14:45 [Bug tree-optimization/19624] New: PRE pessimizes ivopts rguenth at tat dot physik dot uni-tuebingen dot de
  2005-01-25 14:45 ` [Bug tree-optimization/19624] " rguenth at tat dot physik dot uni-tuebingen dot de
@ 2005-01-25 14:52 ` rguenth at tat dot physik dot uni-tuebingen dot de
  2005-01-25 15:23 ` dberlin at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: rguenth at tat dot physik dot uni-tuebingen dot de @ 2005-01-25 14:52 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From rguenth at tat dot physik dot uni-tuebingen dot de  2005-01-25 14:52 -------
Oh, in principle this should compile to roughly the same as

void c_test(double *a, double *b, int ei, int ej, int stridea, int strideb)
{
  for (int j=0; j<ej; ++j)
    for (int i=0; i<ei; ++i)
      a[i+j*stridea] = 0.5*(b[i+1+j*strideb] + b[i+(j+1)*strideb]);
}

... in principle (for the above -fno-tree-pre helps, too).

-- 


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


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

* [Bug tree-optimization/19624] PRE pessimizes ivopts
  2005-01-25 14:45 [Bug tree-optimization/19624] New: PRE pessimizes ivopts rguenth at tat dot physik dot uni-tuebingen dot de
  2005-01-25 14:45 ` [Bug tree-optimization/19624] " rguenth at tat dot physik dot uni-tuebingen dot de
  2005-01-25 14:52 ` rguenth at tat dot physik dot uni-tuebingen dot de
@ 2005-01-25 15:23 ` dberlin at gcc dot gnu dot org
  2005-01-25 15:27 ` rguenth at tat dot physik dot uni-tuebingen dot de
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: dberlin at gcc dot gnu dot org @ 2005-01-25 15:23 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From dberlin at gcc dot gnu dot org  2005-01-25 15:23 -------
Just as an FYI, i have absoutely no plans to make it so ivopts and PRE interact
perfectly.
I only plan to disable transforms in PRE that are always unprofitable.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |dberlin at gcc dot gnu dot
                   |dot org                     |org
             Status|UNCONFIRMED                 |ASSIGNED
     Ever Confirmed|                            |1
   Last reconfirmed|0000-00-00 00:00:00         |2005-01-25 15:23:01
               date|                            |


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


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

* [Bug tree-optimization/19624] PRE pessimizes ivopts
  2005-01-25 14:45 [Bug tree-optimization/19624] New: PRE pessimizes ivopts rguenth at tat dot physik dot uni-tuebingen dot de
                   ` (2 preceding siblings ...)
  2005-01-25 15:23 ` dberlin at gcc dot gnu dot org
@ 2005-01-25 15:27 ` rguenth at tat dot physik dot uni-tuebingen dot de
  2005-01-25 15:35 ` dberlin at dberlin dot org
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: rguenth at tat dot physik dot uni-tuebingen dot de @ 2005-01-25 15:27 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From rguenth at tat dot physik dot uni-tuebingen dot de  2005-01-25 15:27 -------
I guess making PRE and ivopts playing nicely together perfectly is near to
impossible - but any improvement in the 4.0 timeframe is welcome!

-- 


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


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

* [Bug tree-optimization/19624] PRE pessimizes ivopts
  2005-01-25 14:45 [Bug tree-optimization/19624] New: PRE pessimizes ivopts rguenth at tat dot physik dot uni-tuebingen dot de
                   ` (3 preceding siblings ...)
  2005-01-25 15:27 ` rguenth at tat dot physik dot uni-tuebingen dot de
@ 2005-01-25 15:35 ` dberlin at dberlin dot org
  2005-01-30 19:09 ` dberlin at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: dberlin at dberlin dot org @ 2005-01-25 15:35 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From dberlin at gcc dot gnu dot org  2005-01-25 15:35 -------
Subject: Re:  PRE pessimizes ivopts

On Tue, 2005-01-25 at 15:27 +0000, rguenth at tat dot physik dot
uni-tuebingen dot de wrote:
> ------- Additional Comments From rguenth at tat dot physik dot uni-tuebingen dot de  2005-01-25 15:27 -------
> I guess making PRE and ivopts playing nicely together perfectly is near to
> impossible

Yes, hence why i don't plan on promising it :)
There are always optimization interactions that are very very hard to
control or predict.
The best you can do is not make your optimization do things that are
always unprofitable, try to make them interact better where possible,
and hope for the best.

>  - but any improvement in the 4.0 timeframe is welcome!
> 



-- 


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


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

* [Bug tree-optimization/19624] PRE pessimizes ivopts
  2005-01-25 14:45 [Bug tree-optimization/19624] New: PRE pessimizes ivopts rguenth at tat dot physik dot uni-tuebingen dot de
                   ` (4 preceding siblings ...)
  2005-01-25 15:35 ` dberlin at dberlin dot org
@ 2005-01-30 19:09 ` dberlin at gcc dot gnu dot org
  2005-01-30 19:09 ` cvs-commit at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: dberlin at gcc dot gnu dot org @ 2005-01-30 19:09 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From dberlin at gcc dot gnu dot org  2005-01-30 19:08 -------
El Fixed

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED


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


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

* [Bug tree-optimization/19624] PRE pessimizes ivopts
  2005-01-25 14:45 [Bug tree-optimization/19624] New: PRE pessimizes ivopts rguenth at tat dot physik dot uni-tuebingen dot de
                   ` (5 preceding siblings ...)
  2005-01-30 19:09 ` dberlin at gcc dot gnu dot org
@ 2005-01-30 19:09 ` cvs-commit at gcc dot gnu dot org
  2005-01-30 19:10 ` pinskia at gcc dot gnu dot org
  2005-01-30 20:56 ` steven at gcc dot gnu dot org
  8 siblings, 0 replies; 10+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2005-01-30 19:09 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2005-01-30 19:09 -------
Subject: Bug 19624

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	dberlin@gcc.gnu.org	2005-01-30 19:08:37

Modified files:
	gcc            : Makefile.in tree-ssa-pre.c 
Added files:
	gcc/testsuite/gcc.dg/tree-ssa: ssa-pre-4.c ssa-pre-5.c 
	                               ssa-pre-6.c 

Log message:
	2005-01-30  Daniel Berlin  <dberlin@dberlin.org>
	
	Fix PR tree-optimization/19624
	
	* Makefile.in (tree-ssa-pre.o): Add CFGLOOP_H.
	* tree-ssa-pre.c: Add cfgloop.h.
	Update comment.
	(pre_stats): New member, constified.
	(inserted_exprs): New static variable.
	(NECESSARY): New macro.
	(create_expression_by_pieces): Fold the expression, and
	mark it as defaulting to not necessary. Also put in
	inserted_exprs.
	(fully_constant_expression): New function.
	(insert_into_preds_of_block): Modify to not insert phis when we
	are playing with induction variables.
	Push phis onto the inserted_exprs vector, and mark them as not
	necessary by default.
	(insert_aux): Call fully_constant_expression on eprime.
	If all edges produce the same value, mark it constant.
	(mark_operand_necessary): New function.
	(remove_dead_inserted_code): New function.
	(init_pre): Init loop optimizer to get loop info.
	(fini_pre): Free loop_optimizer, and inserted_exprs vec.
	(execute_pre): Commit edge inserts, then remove dead code.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/Makefile.in.diff?cvsroot=gcc&r1=1.1444&r2=1.1445
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/tree-ssa-pre.c.diff?cvsroot=gcc&r1=2.62&r2=2.63
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-4.c.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-5.c.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-6.c.diff?cvsroot=gcc&r1=NONE&r2=1.1



-- 


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


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

* [Bug tree-optimization/19624] PRE pessimizes ivopts
  2005-01-25 14:45 [Bug tree-optimization/19624] New: PRE pessimizes ivopts rguenth at tat dot physik dot uni-tuebingen dot de
                   ` (6 preceding siblings ...)
  2005-01-30 19:09 ` cvs-commit at gcc dot gnu dot org
@ 2005-01-30 19:10 ` pinskia at gcc dot gnu dot org
  2005-01-30 20:56 ` steven at gcc dot gnu dot org
  8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-01-30 19:10 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |missed-optimization
   Target Milestone|---                         |4.0.0


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


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

* [Bug tree-optimization/19624] PRE pessimizes ivopts
  2005-01-25 14:45 [Bug tree-optimization/19624] New: PRE pessimizes ivopts rguenth at tat dot physik dot uni-tuebingen dot de
                   ` (7 preceding siblings ...)
  2005-01-30 19:10 ` pinskia at gcc dot gnu dot org
@ 2005-01-30 20:56 ` steven at gcc dot gnu dot org
  8 siblings, 0 replies; 10+ messages in thread
From: steven at gcc dot gnu dot org @ 2005-01-30 20:56 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From steven at gcc dot gnu dot org  2005-01-30 20:56 -------
This pach doesn't have a ChangeLog. 

-- 


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


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

end of thread, other threads:[~2005-01-30 20:56 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-01-25 14:45 [Bug tree-optimization/19624] New: PRE pessimizes ivopts rguenth at tat dot physik dot uni-tuebingen dot de
2005-01-25 14:45 ` [Bug tree-optimization/19624] " rguenth at tat dot physik dot uni-tuebingen dot de
2005-01-25 14:52 ` rguenth at tat dot physik dot uni-tuebingen dot de
2005-01-25 15:23 ` dberlin at gcc dot gnu dot org
2005-01-25 15:27 ` rguenth at tat dot physik dot uni-tuebingen dot de
2005-01-25 15:35 ` dberlin at dberlin dot org
2005-01-30 19:09 ` dberlin at gcc dot gnu dot org
2005-01-30 19:09 ` cvs-commit at gcc dot gnu dot org
2005-01-30 19:10 ` pinskia at gcc dot gnu dot org
2005-01-30 20:56 ` steven 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).