From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id CDC513858C2F; Fri, 19 Jan 2024 10:22:26 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CDC513858C2F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1705659746; bh=kK3rhzmk30/JeCBRy0yh5lLkr4I4CT8g001Xgx9v0HE=; h=From:To:Subject:Date:In-Reply-To:References:From; b=JsQTEQ6m0mZUJG7RGVdkpvELjvNFXySHsAICKlnKj+YYMV//B8gaqIE2EDc6mv/28 r69f5JesgxhWrs/M9Oo8OlTOxVDzI36GVxNJ4V7kMzlw8Q3gkH/8ngSrpK+aGVLGXJ smvKBMfRAd9PyjxJk6MuXGvOd0psdUpW7PvfINSQ= From: "rguenther at suse dot de" To: gcc-bugs@gcc.gnu.org Subject: [Bug rtl-optimization/113495] RISC-V: Time and memory awful consumption of SPEC2017 wrf benchmark Date: Fri, 19 Jan 2024 10:22:23 +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, memory-hog X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenther at suse dot de X-Bugzilla-Status: UNCONFIRMED 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: 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=3D113495 --- Comment #26 from rguenther at suse dot de --- On Fri, 19 Jan 2024, juzhe.zhong at rivai dot ai wrote: > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D113495 >=20 > --- Comment #22 from JuzheZhong --- > (In reply to Richard Biener from comment #21) > > I once tried to avoid df_reorganize_refs and/or optimize this with the > > blocks involved but failed. >=20 > I am considering whether we should disable LICM for RISC-V by default if = vector > is enabled ? > Since the compile time explode 10 times is really horrible. I think that's a bad idea. It only explodes for some degenerate cases. The best would be to fix invariant motion to keep DF up-to-date so it can stop using df_analyze_loop and instead analyze the whole function. Or maybe change it to use the rtl-ssa framework instead. There's already param_loop_invariant_max_bbs_in_loop: /* Process the loops, innermost first. */ for (auto loop : loops_list (cfun, LI_FROM_INNERMOST)) { curr_loop =3D loop; /* move_single_loop_invariants for very large loops is time=20 consuming and might need a lot of memory. For -O1 only do loop invariant motion for very small loops. */ unsigned max_bbs =3D param_loop_invariant_max_bbs_in_loop; if (optimize < 2) max_bbs /=3D 10; if (loop->num_nodes <=3D max_bbs) move_single_loop_invariants (loop); } it might be possible to restrict invariant motion to innermost loops when the overall number of loops is too large (with a new param for that). And when the number of innermost loops also exceeds the limit avoid even that? The above also misses a optimize_loop_for_speed_p (loop) check (probably doesn't make a difference, but you could try).=