public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "jamborm at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug middle-end/38474] slow compilation at -O0 due to expand's temp slot goo
Date: Tue, 26 Jun 2012 14:26:00 -0000	[thread overview]
Message-ID: <bug-38474-4-MlOkNfhFO9@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-38474-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #61 from Martin Jambor <jamborm at gcc dot gnu.org> 2012-06-26 14:26:34 UTC ---
(In reply to comment #57)
> 
> I will, on Monday.

And by Monday I obviously meant yesterday ;-)

Anyway, on the machine where are debugged this, compilation at -O3
took over 16 seconds which dropped to about 13.5 seconds when I also
added -fno-devirtualize (-ftime-report showed that alias stmt walking
dropped from 82% to 75%).  This is mainly due to calls to
detect_type_change from compute_known_type_jump_func, there are 36454
of them and all are of course completely pointless because we do not
devirtualize in Fortran.

Looking into the code, it is apparent that I even attempted to avoid
such situations but somehow was not paying enough attention.  The
rather obvious patch below fixes that.  With it, the compile time at
-O3 drops to 13.5 without any additional options (~50 calls to
detect_type_change_ssa and detect_type change from other places remain
but those are not a big problem here, they are not so easy to get rid
of and I hope to eventually remove the type detection machinery from
IPA altogether so I'll keep those for later).

I'll bootstrap and test the patch and post it to the mailing list
soon.

Index: gcc/ipa-prop.c
===================================================================
--- gcc/ipa-prop.c      (revision 188931)
+++ gcc/ipa-prop.c      (working copy)
@@ -912,8 +912,8 @@ compute_known_type_jump_func (tree op, s
       || is_global_var (base))
     return;

-  if (detect_type_change (op, base, call, jfunc, offset)
-      || !TYPE_BINFO (TREE_TYPE (base)))
+  if (!TYPE_BINFO (TREE_TYPE (base))
+      || detect_type_change (op, base, call, jfunc, offset))
     return;


  parent reply	other threads:[~2012-06-26 14:26 UTC|newest]

Thread overview: 51+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <bug-38474-4@http.gcc.gnu.org/bugzilla/>
2011-04-28 16:04 ` rguenth at gcc dot gnu.org
2011-12-02 13:06 ` steven at gcc dot gnu.org
2011-12-02 13:25 ` matz at gcc dot gnu.org
2012-05-27 23:24 ` steven at gcc dot gnu.org
2012-05-29  7:53 ` Joost.VandeVondele at mat dot ethz.ch
2012-05-29 13:09 ` matz at gcc dot gnu.org
2012-05-29 13:12 ` matz at gcc dot gnu.org
2012-05-29 15:08 ` hubicka at gcc dot gnu.org
2012-05-29 16:00 ` jamborm at gcc dot gnu.org
2012-06-15 14:56 ` matz at gcc dot gnu.org
2012-06-15 15:13 ` matz at gcc dot gnu.org
2012-06-15 15:26 ` Joost.VandeVondele at mat dot ethz.ch
2012-06-26 14:26 ` jamborm at gcc dot gnu.org [this message]
2012-06-26 14:45 ` matz at gcc dot gnu.org
2012-06-26 14:58 ` rguenth at gcc dot gnu.org
2012-06-26 15:01 ` jamborm at gcc dot gnu.org
2012-06-29 14:34 ` jamborm at gcc dot gnu.org
2012-07-02 15:28 ` jamborm at gcc dot gnu.org
2012-07-02 15:44 ` jamborm at gcc dot gnu.org
2012-07-02 15:53 ` jamborm at gcc dot gnu.org
2012-08-28  8:25 ` steven at gcc dot gnu.org
2012-08-28 11:28 ` Joost.VandeVondele at mat dot ethz.ch
2012-08-28 14:55 ` Joost.VandeVondele at mat dot ethz.ch
2012-08-28 15:07 ` steven at gcc dot gnu.org
2013-03-06 11:01 ` [Bug middle-end/38474] compile time explosion in dataflow_set_preserve_mem_locs at -O3 steven at gcc dot gnu.org
2013-03-07 10:32 ` rguenth at gcc dot gnu.org
2013-03-07 14:55 ` rguenth at gcc dot gnu.org
2013-12-06 13:43 ` rguenth at gcc dot gnu.org
2013-12-06 14:20 ` rguenth at gcc dot gnu.org
2013-12-09 15:13 ` rguenth at gcc dot gnu.org
2013-12-10 12:31 ` rguenth at gcc dot gnu.org
2021-02-10 14:52 ` rguenth at gcc dot gnu.org
2021-02-10 15:03 ` rguenth at gcc dot gnu.org
2021-02-10 15:46 ` rguenth at gcc dot gnu.org
2021-02-10 15:47 ` rguenth at gcc dot gnu.org
2021-02-10 15:51 ` jakub at gcc dot gnu.org
2021-02-10 15:55 ` rguenther at suse dot de
2021-02-10 16:02 ` rguenth at gcc dot gnu.org
2021-02-10 16:06 ` jakub at gcc dot gnu.org
2021-02-10 16:06 ` rguenth at gcc dot gnu.org
2021-02-10 16:28 ` rguenth at gcc dot gnu.org
2021-02-10 16:49 ` jakub at gcc dot gnu.org
2021-02-11  9:32 ` rguenth at gcc dot gnu.org
2021-02-12  8:57 ` cvs-commit at gcc dot gnu.org
2021-02-12 10:29 ` rguenth at gcc dot gnu.org
2021-02-12 10:35 ` rguenth at gcc dot gnu.org
2021-02-12 11:42 ` cvs-commit at gcc dot gnu.org
2021-02-12 14:40 ` rguenth at gcc dot gnu.org
2021-02-16 12:38 ` cvs-commit at gcc dot gnu.org
2021-04-29  8:04 ` cvs-commit at gcc dot gnu.org
2008-12-10 15:26 [Bug middle-end/38474] New: slow compilation at -O0 (callgraph optimization, inline heuristics, ggc expand ) jv244 at cam dot ac dot uk
2010-05-23 21:03 ` [Bug middle-end/38474] slow compilation at -O0 due to expand's temp slot goo 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-38474-4-MlOkNfhFO9@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).