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 rtl-optimization/96388] scheduling takes forever with -fPIC
Date: Fri, 31 Jul 2020 09:55:42 +0000	[thread overview]
Message-ID: <bug-96388-4-yz37kMRmlw@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-96388-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96388

Richard Biener <rguenth at gcc dot gnu.org> changed:

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

--- Comment #11 from Richard Biener <rguenth at gcc dot gnu.org> ---
(In reply to Richard Biener from comment #10)
> The partially reduced (In reply to Martin Liška from comment #9)
> > Created attachment 48962 [details]
> > Partially reduced test-case
> > 
> > The reduction is quite stuck at this point.
> 
> No longer keys on -fPIC though, so the bisection for this is likely wrong.
> -fno-schedule-insns2 improves it from 18s to 5s compile time and from
> 1.1GB of peak RSS to 320MB.
> 
>  scheduling 2                       :  12.69 ( 71%)   0.10 ( 67%)  12.79 (
> 70%)   11128 kB ( 16%)
> 
> -fmem-report doesn't show anything interesting, looking for heap allocations
> now to find the offender.
> 
> Can you bisect your reduced testcase again?  GCC 8.4 behaves the same for it
> rather than being good but GCC 4.8.5 is fine.

For the testcase most time is spent in constrain_operands and
update_conflict_hard_regno_costs.  It looks like the main issue
is a very large chain of dependences and thus going from
27000 schedule_insn calls to 10 000 000 calls to try_ready
which means the sd_iterator iterates over many dependent instructions,
not stopping at "common dependences".  That's likely also the source
of the memory use (the dn_pool), though memory reporting with
--enable-gather-detailed-mem-stats doesn't seem to work for this pool?

dep_node                        sched-deps.c:4107 (sched_deps_init)            
     1         0 :  0.0%        0         0 :  0.0%          80
deps_list                       sched-deps.c:4105 (sched_deps_init)            
     1         0 :  0.0%     2179k      136k:  0.9%          16

There's also 10 million dep_replacement nodes which are all allocated
via XCNEW ... another object_allocator would be more efficient here
I guess.  Could it be that sched-deps makes a tree out of a dependence
graph?

CCing the only active haifa scheduler maintainer...

  parent reply	other threads:[~2020-07-31  9:55 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-30  7:20 [Bug rtl-optimization/96388] New: " rguenth at gcc dot gnu.org
2020-07-30  7:21 ` [Bug rtl-optimization/96388] " rguenth at gcc dot gnu.org
2020-07-30  7:24 ` rguenth at gcc dot gnu.org
2020-07-30  7:25 ` rguenth at gcc dot gnu.org
2020-07-30  7:58 ` marxin at gcc dot gnu.org
2020-07-30  8:20 ` marxin at gcc dot gnu.org
2020-07-30  8:34 ` rguenth at gcc dot gnu.org
2020-07-30  8:36 ` marxin at gcc dot gnu.org
2020-07-30  8:37 ` rguenth at gcc dot gnu.org
2020-07-30 13:29 ` marxin at gcc dot gnu.org
2020-07-31  9:04 ` rguenth at gcc dot gnu.org
2020-07-31  9:55 ` rguenth at gcc dot gnu.org [this message]
2020-07-31 10:03 ` rguenth at gcc dot gnu.org
2020-07-31 11:31 ` marxin at gcc dot gnu.org
2023-10-30 10:29 ` mkuvyrkov at gcc dot gnu.org
2023-11-18 16:59 ` mkuvyrkov at gcc dot gnu.org
2023-11-20 12:08 ` mkuvyrkov at gcc dot gnu.org
2024-01-17  7:48 ` cvs-commit at gcc dot gnu.org
2024-01-17  7:49 ` mkuvyrkov at gcc dot gnu.org
2024-01-20 17:17 ` pinskia 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-96388-4-yz37kMRmlw@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).