From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id C68E6384CBBC; Wed, 17 Jan 2024 07:48:21 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C68E6384CBBC DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1705477701; bh=JXsEU5dXMBM1xQgUVr7lLQD1pDpgj06UDSY9yDY7ABA=; h=From:To:Subject:Date:In-Reply-To:References:From; b=UqLveaAm01sTfmX8DwrOWTJ2aqKvyisIHBWAYlghI9OAYiDGZQksSMcGUkFxbMTOA bAgthI3CRdNdTy9VDQfz4HabMWH7YqviAitLnFFpE5kllToUOq2usnq486mAjFfrCQ 4NUDCyEGnaNnbolsYi6Fh2T4DU9I8aBbzVbUF7eQ= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug rtl-optimization/111554] [12/13/14 regression] Timeout with with "-O3 -fno-dse -fno-inline -fno-store-merging -fno-toplevel-reorder -fno-tree-dce -fno-tree-dse" since r12-2097-g9f34b780b0461e Date: Wed, 17 Jan 2024 07:48:20 +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: 14.0 X-Bugzilla-Keywords: compile-time-hog, needs-reduction X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: mkuvyrkov at gcc dot gnu.org X-Bugzilla-Target-Milestone: 12.4 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D111554 --- Comment #13 from GCC Commits --- The master branch has been updated by Maxim Kuvyrkov : https://gcc.gnu.org/g:0c42d1782e48d8ad578ace2065cce9b3615f97c0 commit r14-8174-g0c42d1782e48d8ad578ace2065cce9b3615f97c0 Author: Maxim Kuvyrkov Date: Sun Nov 19 08:43:05 2023 +0000 sched-deps.cc (find_modifiable_mems): Avoid exponential behavior [PR963= 88] This patch avoids sched-deps.cc:find_inc() creating exponential number of dependencies, which become memory and compilation time hogs. Consider example (simplified from PR96388) ... =3D=3D=3D sp=3Dsp-4 // sp_insnA mem_insnA1[sp+A1] ... mem_insnAN[sp+AN] sp=3Dsp-4 // sp_insnB mem_insnB1[sp+B1] ... mem_insnBM[sp+BM] =3D=3D=3D [For simplicity, let's assume find_inc(backwards=3D=3Dtrue)]. In this example find_modifiable_mems() will arrange for mem_insnA* to be able to pass sp_insnA, and, while doing this, will create dependencies between all mem_insnA*s and sp_insnB -- because sp_insnB is a consumer of sp_insnA. After this sp_insnB will have N new backward dependencies. Then find_modifiable_mems() gets to mem_insnB*s and starts to create N new dependencies for _every_ mem_insnB*. This gets us N*M new dependencies. In PR96833's testcase N and M are 10k-15k, which causes RAM usage of 30GB and compilation time of 30 minutes, with sched2 accounting for 95% of both metrics. After this patch the RAM usage is down to 1GB and compilation time is down to 3-4 minutes, with sched2 no longer standing out on -ftime-report or memory usage. gcc/ChangeLog: PR rtl-optimization/96388 PR rtl-optimization/111554 * sched-deps.cc (find_inc): Avoid exponential behavior.=