public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "rguenth at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/46590] [4.6/4.7/4.8 Regression] long compile time with -O2 and many loops
Date: Tue, 21 Aug 2012 14:57:00 -0000	[thread overview]
Message-ID: <bug-46590-4-ic6XcAfTMt@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-46590-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #26 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-08-21 14:56:41 UTC ---
For a somewhat reduced testcase I now get at -O1:

 alias stmt walking      : 105.51 (45%) usr   0.33 (24%) sys
 tree SSA rewrite        :  22.01 ( 9%) usr   0.04 ( 3%) sys
 tree SSA incremental    :  25.25 (11%) usr   0.07 ( 5%) sys
 dominance frontiers     :  35.35 (15%) usr   0.02 ( 1%) sys
 dominance computation   :  14.60 ( 6%) usr   0.09 ( 7%) sys
 TOTAL                 : 234.28             1.38

as previously said most of the non-alias-stmt walk time is spent
on loop header copying.  WIth -O1 -fno-tree-ch we have

 alias stmt walking      : 101.52 (68%) usr   0.37 (34%) sys
 tree SSA rewrite        :   4.14 ( 3%) usr   0.01 ( 1%) sys
 tree SSA incremental    :   8.00 ( 5%) usr   0.02 ( 2%) sys
 dominance frontiers     :   6.14 ( 4%) usr   0.01 ( 1%) sys
 dominance computation   :   4.74 ( 3%) usr   0.06 ( 6%) sys
 TOTAL                 : 150.14             1.09

limiting stmt walk results in the ability to arbitrarily scale down its cost
with a param (we can either limit alias oracle query numbers or SCCVN
table lookups).  With 100 alias oracle queries per load/store we end up with

 alias stmt walking      :   1.60 ( 3%) usr   0.05 ( 5%) sys

with 100 SCCVN table lookups the figure is

 alias stmt walking      :   1.60 ( 3%) usr   0.06 ( 6%) sys

one assumes the lookups are expensive, the other one assumes the walk itself
is.
Increasing the latter to 1000 SCCVN table lookup produces

 alias stmt walking      :   9.24 (16%) usr   0.18 (19%) sys

which is around the expected 10-fold increase (but still reasonable given
the artificial nature of the testcase).  We could also, instead of
limiting each walk to a constant cost, have a per-function budget that
we can use up first before limiting further walks individually (helps
to not regress reasonably sized cases).


  parent reply	other threads:[~2012-08-21 14:57 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-21 13:23 [Bug tree-optimization/46590] New: " tkoenig at gcc dot gnu.org
2010-11-21 13:25 ` [Bug tree-optimization/46590] " tkoenig at gcc dot gnu.org
2010-11-21 17:19 ` dominiq at lps dot ens.fr
2010-11-21 18:55 ` tkoenig at gcc dot gnu.org
2010-11-21 19:13 ` rguenth at gcc dot gnu.org
2010-11-21 19:49 ` tkoenig at gcc dot gnu.org
2010-11-21 19:49 ` tkoenig at gcc dot gnu.org
2010-11-21 21:13 ` tkoenig at gcc dot gnu.org
2010-11-21 21:46 ` [Bug tree-optimization/46590] [4.6 Regression] " tkoenig at gcc dot gnu.org
2010-11-21 23:14 ` tkoenig at gcc dot gnu.org
2010-11-22 13:30 ` [Bug tree-optimization/46590] [4.5/4.6 " rguenth at gcc dot gnu.org
2010-11-22 13:30 ` [Bug tree-optimization/46590] [4.6 " rguenth at gcc dot gnu.org
2010-11-22 16:19 ` [Bug tree-optimization/46590] [4.5/4.6 " rguenth at gcc dot gnu.org
2010-11-24 12:40 ` rguenth at gcc dot gnu.org
2010-11-24 14:19 ` rguenth at gcc dot gnu.org
2011-01-03 20:25 ` rguenth at gcc dot gnu.org
2011-03-25 19:55 ` [Bug tree-optimization/46590] [4.5/4.6/4.7 " jakub at gcc dot gnu.org
2011-06-27 16:23 ` jakub at gcc dot gnu.org
2011-10-26 17:37 ` jakub at gcc dot gnu.org
2012-01-05  1:48 ` pinskia at gcc dot gnu.org
2012-01-19 15:20 ` matz at gcc dot gnu.org
2012-01-19 15:26 ` matz at gcc dot gnu.org
2012-01-26 16:23 ` matz at gcc dot gnu.org
2012-03-01 14:45 ` jakub at gcc dot gnu.org
2012-08-21  8:10 ` [Bug tree-optimization/46590] [4.6/4.7/4.8 " rguenth at gcc dot gnu.org
2012-08-21  9:44 ` steven at gcc dot gnu.org
2012-08-21 10:00 ` rguenther at suse dot de
2012-08-21 14:11 ` rguenth at gcc dot gnu.org
2012-08-21 14:57 ` rguenth at gcc dot gnu.org [this message]
2012-08-22 11:43 ` rguenth at gcc dot gnu.org
2012-08-22 13:21 ` rguenth at gcc dot gnu.org
2012-08-22 17:34 ` stevenb.gcc at gmail dot com
2012-08-23  7:14 ` rguenther at suse dot de
2012-08-23 11:43 ` rguenth at gcc dot gnu.org
2012-08-23 13:46 ` steven at gcc dot gnu.org
2012-09-03 10:46 ` rguenth at gcc dot gnu.org
2012-09-03 15:41 ` matz at gcc dot gnu.org
2012-09-04 13:18 ` rguenth at gcc dot gnu.org
2012-09-05 11:01 ` rguenth at gcc dot gnu.org
2012-09-05 13:30 ` rguenth at gcc dot gnu.org
2012-12-03 15:52 ` [Bug tree-optimization/46590] " rguenth at gcc dot gnu.org
2014-01-16 13:49 ` rguenth at gcc dot gnu.org
2014-01-16 15:51 ` rguenth at gcc dot gnu.org
2014-01-17 11:37 ` rguenth at gcc dot gnu.org
2014-01-17 12:09 ` rguenth at gcc dot gnu.org
2014-01-17 14:49 ` rguenth at gcc dot gnu.org
2014-10-21  9:23 ` rguenth at gcc dot gnu.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-46590-4-ic6XcAfTMt@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).