From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 87E623861858; Wed, 24 Jan 2024 00:30:48 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 87E623861858 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1706056248; bh=tixdZLo3Br60G36TTQbqAsc9DQCe1PZILRYOpS6uGrA=; h=From:To:Subject:Date:In-Reply-To:References:From; b=yZaDMqPaM5yUb9j+OauTA88GGKKn1aynhw0zkH6rFXNeAM3FH0Q84vK4mUo2RaeHG s4LxV93MyBvX1mXvhIXBi2Nle95B5T8dGRB1bO2G874ZanF524tYAoC8JRy/Ewc1w1 WyKLjfyOtiaBIRNx2JBmOsAnqAv7cmq3XgP6kHiw= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug rtl-optimization/113495] RISC-V: Time and memory awful consumption of SPEC2017 wrf benchmark Date: Wed, 24 Jan 2024 00:30:39 +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: cvs-commit at gcc dot gnu.org 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 #32 from GCC Commits --- The master branch has been updated by Pan Li : https://gcc.gnu.org/g:3132d2d36b4705bb762e61b1c8ca4da7c78a8321 commit r14-8378-g3132d2d36b4705bb762e61b1c8ca4da7c78a8321 Author: Juzhe-Zhong Date: Tue Jan 23 18:12:49 2024 +0800 RISC-V: Fix large memory usage of VSETVL PASS [PR113495] SPEC 2017 wrf benchmark expose unreasonble memory usage of VSETVL PASS that is, VSETVL PASS consume over 33 GB memory which make use impossible to compile SPEC 2017 wrf in a laptop. The root cause is wasting-memory variables: unsigned num_exprs =3D num_bbs * num_regs; sbitmap *avl_def_loc =3D sbitmap_vector_alloc (num_bbs, num_exprs); sbitmap *m_kill =3D sbitmap_vector_alloc (num_bbs, num_exprs); m_avl_def_in =3D sbitmap_vector_alloc (num_bbs, num_exprs); m_avl_def_out =3D sbitmap_vector_alloc (num_bbs, num_exprs); I find that compute_avl_def_data can be achieved by RTL_SSA framework. Replace the code implementation base on RTL_SSA framework. After this patch, the memory-hog issue is fixed. simple vsetvl memory usage (valgrind --tool=3Dmassif --pages-as-heap=3D= yes --massif-out-file=3Dmassif.out) is 1.673 GB. lazy vsetvl memory usage (valgrind --tool=3Dmassif --pages-as-heap=3Dyes --massif-out-file=3Dmassif.out) is 2.441 GB. Tested on both RV32 and RV64, no regression. gcc/ChangeLog: PR target/113495 * config/riscv/riscv-vsetvl.cc (get_expr_id): Remove. (get_regno): Ditto. (get_bb_index): Ditto. (pre_vsetvl::compute_avl_def_data): Ditto. (pre_vsetvl::earliest_fuse_vsetvl_info): Fix large memory usage. (pre_vsetvl::pre_global_vsetvl_info): Ditto. gcc/testsuite/ChangeLog: PR target/113495 * gcc.target/riscv/rvv/vsetvl/avl_single-107.c: Adapt test.=