From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 9B2613860C3C; Fri, 31 Jul 2020 09:55:42 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9B2613860C3C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1596189342; bh=5yuUQvdOKXyu92wMMkGdwEFmjACtmdEcp6zDlnkDDAg=; h=From:To:Subject:Date:In-Reply-To:References:From; b=tGJnzBvFhlaCCXvkzPf/3M9s5bA/bN3OUl/cUm8SdSff8q5NKnaWv3cAgVcLcNE8r HTY4LoasZA4zyllKppcVvgiG5POBGUwz6ZODf2z09IVV6nf6xuyN161rfR1UY7nyi0 Sfx6uxog8H42IWN2NymhtyJGbcax39DTXpeopv4U= From: "rguenth at gcc dot 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 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: rtl-optimization X-Bugzilla-Version: 11.0 X-Bugzilla-Keywords: compile-time-hog, memory-hog, needs-reduction X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Jul 2020 09:55:42 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D96388 Richard Biener changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |law at gcc dot gnu.org --- Comment #11 from Richard Biener --- (In reply to Richard Biener from comment #10) > The partially reduced (In reply to Martin Li=C5=A1ka from comment #9) > > Created attachment 48962 [details] > > Partially reduced test-case > >=20 > > The reduction is quite stuck at this point. >=20 > 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. >=20 > scheduling 2 : 12.69 ( 71%) 0.10 ( 67%) 12.79 ( > 70%) 11128 kB ( 16%) >=20 > -fmem-report doesn't show anything interesting, looking for heap allocati= ons > now to find the offender. >=20 > 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)=20=20= =20=20=20=20=20=20=20=20=20=20 1 0 : 0.0% 0 0 : 0.0% 80 deps_list sched-deps.c:4105 (sched_deps_init)=20=20= =20=20=20=20=20=20=20=20=20=20 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...=