public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/27809]  New: inefficient gimplification of globals
@ 2006-05-29 21:59 dann at godzilla dot ics dot uci dot edu
  2006-05-29 22:04 ` [Bug tree-optimization/27809] " pinskia at gcc dot gnu dot org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: dann at godzilla dot ics dot uci dot edu @ 2006-05-29 21:59 UTC (permalink / raw)
  To: gcc-bugs

This code:

int G;
int lll (int a) { bar (G, G, G, G); }

is gimplified like this:

lll (a)
{
  int G.2;

  G.2 = G;
  G.2 = G;
  G.2 = G;
  G.2 = G;
  bar (G.2, G.2, G.2, G.2);
}

Creating that many identical expressions is wastefull...


-- 
           Summary: inefficient gimplification of globals
           Product: gcc
           Version: 4.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: dann at godzilla dot ics dot uci dot edu


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


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

* [Bug tree-optimization/27809] inefficient gimplification of globals
  2006-05-29 21:59 [Bug tree-optimization/27809] New: inefficient gimplification of globals dann at godzilla dot ics dot uci dot edu
@ 2006-05-29 22:04 ` pinskia at gcc dot gnu dot org
  2006-06-13 14:14 ` rakdver at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-05-29 22:04 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from pinskia at gcc dot gnu dot org  2006-05-29 22:04 -------
Hmm, it should have produced G.3, G.n, at least I would have thought.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2006-05-29 22:04:22
               date|                            |


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


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

* [Bug tree-optimization/27809] inefficient gimplification of globals
  2006-05-29 21:59 [Bug tree-optimization/27809] New: inefficient gimplification of globals dann at godzilla dot ics dot uci dot edu
  2006-05-29 22:04 ` [Bug tree-optimization/27809] " pinskia at gcc dot gnu dot org
@ 2006-06-13 14:14 ` rakdver at gcc dot gnu dot org
  2006-06-13 14:26 ` dann at godzilla dot ics dot uci dot edu
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: rakdver at gcc dot gnu dot org @ 2006-06-13 14:14 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from rakdver at gcc dot gnu dot org  2006-06-13 14:09 -------
(In reply to comment #1)
> Hmm, it should have produced G.3, G.n, at least I would have thought.
> 

No, we intentionally use the same variable for the lexically identical
expressions, see internal_get_tmp_var/lookup_tmp_var.  Original intention was
to make PRE and other redundancy elimination optimization passes more efficient
(this was essential especially for the old SSAPRE pass that used lexical
equality of expressions to check for redundancies).  These reasons are no
longer relevant, but keeping the code saves a significant amount of memory and
compile time (I tried removing the code a few months ago, but since it slows
down compilation by some 1-2%, I never bothered with posting the patch).


-- 


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


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

* [Bug tree-optimization/27809] inefficient gimplification of globals
  2006-05-29 21:59 [Bug tree-optimization/27809] New: inefficient gimplification of globals dann at godzilla dot ics dot uci dot edu
  2006-05-29 22:04 ` [Bug tree-optimization/27809] " pinskia at gcc dot gnu dot org
  2006-06-13 14:14 ` rakdver at gcc dot gnu dot org
@ 2006-06-13 14:26 ` dann at godzilla dot ics dot uci dot edu
  2006-06-13 14:26 ` dberlin at gcc dot gnu dot org
  2008-12-07 12:11 ` rguenth at gcc dot gnu dot org
  4 siblings, 0 replies; 6+ messages in thread
From: dann at godzilla dot ics dot uci dot edu @ 2006-06-13 14:26 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from dann at godzilla dot ics dot uci dot edu  2006-06-13 14:22 -------
(In reply to comment #2)
> (In reply to comment #1)
> > Hmm, it should have produced G.3, G.n, at least I would have thought.
> > 
> 
> No, we intentionally use the same variable for the lexically identical
> expressions, see internal_get_tmp_var/lookup_tmp_var.  Original intention was
> to make PRE and other redundancy elimination optimization passes more efficient
> (this was essential especially for the old SSAPRE pass that used lexical
> equality of expressions to check for redundancies).  These reasons are no
> longer relevant, but keeping the code saves a significant amount of memory and
> compile time (I tried removing the code a few months ago, but since it slows
> down compilation by some 1-2%, I never bothered with posting the patch).

Using the same variable is surely good, wouldn't it be even better to not
create the redundant "G.2 = G" assignments in this PR?


-- 


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


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

* [Bug tree-optimization/27809] inefficient gimplification of globals
  2006-05-29 21:59 [Bug tree-optimization/27809] New: inefficient gimplification of globals dann at godzilla dot ics dot uci dot edu
                   ` (2 preceding siblings ...)
  2006-06-13 14:26 ` dann at godzilla dot ics dot uci dot edu
@ 2006-06-13 14:26 ` dberlin at gcc dot gnu dot org
  2008-12-07 12:11 ` rguenth at gcc dot gnu dot org
  4 siblings, 0 replies; 6+ messages in thread
From: dberlin at gcc dot gnu dot org @ 2006-06-13 14:26 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from dberlin at gcc dot gnu dot org  2006-06-13 14:26 -------
gimplification is almost certainly the wrong place to be doing the kind of
dataflow we'd need to determine where we could insert load/save pairs of
globals.
Really.


-- 


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


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

* [Bug tree-optimization/27809] inefficient gimplification of globals
  2006-05-29 21:59 [Bug tree-optimization/27809] New: inefficient gimplification of globals dann at godzilla dot ics dot uci dot edu
                   ` (3 preceding siblings ...)
  2006-06-13 14:26 ` dberlin at gcc dot gnu dot org
@ 2008-12-07 12:11 ` rguenth at gcc dot gnu dot org
  4 siblings, 0 replies; 6+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2008-12-07 12:11 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from rguenth at gcc dot gnu dot org  2008-12-07 12:08 -------
I agree.


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |INVALID


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


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

end of thread, other threads:[~2008-12-07 12:11 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-05-29 21:59 [Bug tree-optimization/27809] New: inefficient gimplification of globals dann at godzilla dot ics dot uci dot edu
2006-05-29 22:04 ` [Bug tree-optimization/27809] " pinskia at gcc dot gnu dot org
2006-06-13 14:14 ` rakdver at gcc dot gnu dot org
2006-06-13 14:26 ` dann at godzilla dot ics dot uci dot edu
2006-06-13 14:26 ` dberlin at gcc dot gnu dot org
2008-12-07 12:11 ` 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).