public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "steven at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug rtl-optimization/39077] [4.3/4.4 Regression] GCSE-optimization causes enormous binary size increase (~20 times !)
Date: Sat, 21 Feb 2009 16:09:00 -0000	[thread overview]
Message-ID: <20090221160910.18355.qmail@sourceware.org> (raw)
In-Reply-To: <bug-39077-17262@http.gcc.gnu.org/bugzilla/>



------- Comment #10 from steven at gcc dot gnu dot org  2009-02-21 16:09 -------
OK, I checked what we're PREing here.  This is indeed partial-partial PRE.

I suppose something like the following is a good idea.  I'll admit it's
brute-force, but I'm not sure how else to stop GCSE-PRE from doing this (it's
baked into the LCM equations).

Jeff, what do you think about this PR?

Index: gcse.c
===================================================================
--- gcse.c      (revision 144303)
+++ gcse.c      (working copy)
@@ -3801,16 +3801,30 @@
       edge e;
       edge_iterator ei;

-      /* If the current block is the destination of an abnormal edge, we
-        kill all trapping expressions because we won't be able to properly
-        place the instruction on the edge.  So make them neither
-        anticipatable nor transparent.  This is fairly conservative.  */
-      FOR_EACH_EDGE (e, ei, bb->preds)
-       if (e->flags & EDGE_ABNORMAL)
-         {
-           sbitmap_difference (antloc[bb->index], antloc[bb->index],
trapping_expr);
-           sbitmap_difference (transp[bb->index], transp[bb->index],
trapping_expr);
-           break;
+      if (EDGE_COUNT (bb->preds) > 20) /* ??? Should be a PARAM */
+       {
+         /* If a block has a large number of incoming edges, then inserting
+            many expressions in the predecessors to make one/few expression
+            fully redundant is probably not a profitable transformation.
+            Make all expressions non-anticipatable and non-transparent.  */
+         sbitmap_zero (antloc[bb->index]);
+         sbitmap_zero (transp[bb->index]);
+       }
+      else
+       {
+         /* If the current block is the destination of an abnormal edge, we
+            kill all trapping expressions because we won't be able to properly
+            place the instruction on the edge.  So make them neither
+            anticipatable nor transparent.  This is fairly conservative.  */
+         FOR_EACH_EDGE (e, ei, bb->preds)
+           if (e->flags & EDGE_ABNORMAL)
+             {
+               sbitmap_difference (antloc[bb->index],
+                                   antloc[bb->index], trapping_expr);
+               sbitmap_difference (transp[bb->index],
+                                   transp[bb->index], trapping_expr);
+               break;
+             }
          }

       sbitmap_a_or_b (ae_kill[bb->index], transp[bb->index], comp[bb->index]);


-- 

steven at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |law at gcc dot gnu dot org


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


  parent reply	other threads:[~2009-02-21 16:09 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-02 16:18 [Bug c++/39077] New: " comer352l at googlemail dot com
2009-02-02 16:22 ` [Bug c++/39077] " comer352l at googlemail dot com
2009-02-03  9:55 ` [Bug rtl-optimization/39077] [4.3/4.4 Regression] " rguenth at gcc dot gnu dot org
2009-02-03  9:55 ` rguenth at gcc dot gnu dot org
2009-02-05 14:23 ` steven at gcc dot gnu dot org
2009-02-05 22:04 ` rguenth at gcc dot gnu dot org
2009-02-06 11:59 ` steven at gcc dot gnu dot org
2009-02-06 13:07 ` rguenth at gcc dot gnu dot org
2009-02-06 14:35 ` rguenth at gcc dot gnu dot org
2009-02-06 17:50 ` steven at gcc dot gnu dot org
2009-02-21 15:26 ` steven at gcc dot gnu dot org
2009-02-21 16:09 ` steven at gcc dot gnu dot org [this message]
2009-02-26  9:12 ` bonzini at gnu dot org
2009-02-26 16:53 ` law at redhat dot com
2009-03-08 21:38 ` steven at gcc dot gnu dot org
2009-04-12 23:46 ` [Bug rtl-optimization/39077] [4.3/4.4/4.5 " steven at gcc dot gnu dot org
2009-04-12 23:52 ` steven at gcc dot gnu dot org
2009-08-04 12:47 ` rguenth at gcc dot gnu dot org
2010-02-20 17:58 ` steven at gcc dot gnu dot org
2010-02-22 15:09 ` comer352l at googlemail dot com
2010-04-09 15:36 ` [Bug rtl-optimization/39077] [4.3/4.4/4.5/4.6 " comer352l at googlemail dot com
2010-05-22 18:30 ` rguenth 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=20090221160910.18355.qmail@sourceware.org \
    --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).