Message ID | 20240203105012.208998-1-lehua.ding@rivai.ai |
---|---|
Headers |
Return-Path: <gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org> X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 1C89D3857B8D for <patchwork@sourceware.org>; Sat, 3 Feb 2024 10:51:06 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from smtpbgau2.qq.com (smtpbgau2.qq.com [54.206.34.216]) by sourceware.org (Postfix) with ESMTPS id 652D73858C50 for <gcc-patches@gcc.gnu.org>; Sat, 3 Feb 2024 10:50:20 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 652D73858C50 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=rivai.ai Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=rivai.ai ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 652D73858C50 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=54.206.34.216 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1706957423; cv=none; b=dnYDye9vSdI3xcZH0JE/DgWpfWOfyLu+HQFI0BWglxXYPzQXZ2pVThzJnIxPvx3R0PO/49ZO+4GFtA4cn9zrZmt5G7UADCGBueBxQ+ibUr4ewpibwf+KL/4FAEY1aR6WDcc2mWQZwSDmnqEN3B+V+E65tKO2P6Hc6phbKgkKhg8= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1706957423; c=relaxed/simple; bh=L9zNsnx/dxaeE3nkE0aeFMw5z4sgLG7xhJOgb58WyUA=; h=From:To:Subject:Date:Message-Id:MIME-Version; b=RJSRujuUNeNH62Kfu86SlCiKB4uYPWMAJHOsVjuBZd9W/C6OAm6nFBrJEtTceHEFI6UIzTp71kPWL+/pcj7OkvFThLAaodfOKSOiOL9Pzcra1Osb3V2xg/L7X7wiGKKJEPmexmiypH34uI4ok0+15PTmask/CZLDZ1RROgwyym0= ARC-Authentication-Results: i=1; server2.sourceware.org X-QQ-mid: bizesmtp72t1706957413tkllo6hm X-QQ-Originating-IP: pAmQq26TZovm/qcZ0x9oIFoRopj/pl/rC5r7SaMXePY= Received: from rios-cad5.localdomain ( [58.60.1.25]) by bizesmtp.qq.com (ESMTP) with id ; Sat, 03 Feb 2024 18:50:12 +0800 (CST) X-QQ-SSF: 01400000000000C0F000000A0000000 X-QQ-FEAT: W+onFc5Tw4OK0Niq8ITNT90MKzWwzFXmCTzzoBC/CAL3V/TFcljUwTw7HiC6V ICkpckNztoQneg9t8uJ8QoRawYBVXpqj/7Dm0i40q6obdDuD7MG1Bf4Et/QgDeMb5g0rR/+ Pd5bRgtVjCIoP6EKeoBTpgajRq4rgzlgU9okGfF39LSXlWOb5bgnFmSPSNVQM2vU4oACY+S kZhz+78fS7Q6C4znNnZS5dRGP5hZnteXSh3w2zVbwUipCM9fMG4NYbMtZ1cqp97p6oq0AkB LGFW3//XygCCSr2iY+/r7Md2trwgLqqvs2J/mSkrJVEQzJAxEyBeNyoN1kAWpHs6ih04Fsh NG3zH1MpSXYOs/fg3b3yscN6Ns6hARk56qfp2lA X-QQ-GoodBg: 2 X-BIZMAIL-ID: 3352344956964685217 From: Lehua Ding <lehua.ding@rivai.ai> To: gcc-patches@gcc.gnu.org Cc: vmakarov@redhat.com, richard.sandiford@arm.com, juzhe.zhong@rivai.ai, lehua.ding@rivai.ai Subject: [PATCH 0/4] Add DF_LIVE_SUBREG data and apply to IRA and LRA Date: Sat, 3 Feb 2024 18:50:08 +0800 Message-Id: <20240203105012.208998-1-lehua.ding@rivai.ai> X-Mailer: git-send-email 2.36.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:rivai.ai:qybglogicsvrgz:qybglogicsvrgz5a-3 X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, RCVD_IN_BARRACUDACENTRAL, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H5, RCVD_IN_MSPIKE_WL, SPF_HELO_PASS, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE, URIBL_CSS_A autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list <gcc-patches.gcc.gnu.org> List-Unsubscribe: <https://gcc.gnu.org/mailman/options/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe> List-Archive: <https://gcc.gnu.org/pipermail/gcc-patches/> List-Post: <mailto:gcc-patches@gcc.gnu.org> List-Help: <mailto:gcc-patches-request@gcc.gnu.org?subject=help> List-Subscribe: <https://gcc.gnu.org/mailman/listinfo/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe> Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org |
Series |
Add DF_LIVE_SUBREG data and apply to IRA and LRA
|
|
Message
Lehua Ding
Feb. 3, 2024, 10:50 a.m. UTC
Hi, These patches are used to add a new data flow DF_LIVE_SUBREG, which will track subreg liveness and then apply it to IRA and LRA passes (enabled via -O3 or -ftrack-subreg-liveness). These patches are for GCC 15. These patches are separated from the subreg-coalesce patches submitted a few months ago. I refactored the code according to comments. The next patches will support subreg coalesce base on they. Here are some data abot build time of SPEC INT 2017 (x86-64 target): baseline baseline(+track-subreg-liveness) specint2017 build time : 1892s 1883s Regarding build times, I've run it a few times, but they all seem to take much less time. Since the difference is small, it's possible that it's just a change in environment. But it's theoretically possible, since supporting subreg-liveness could have reduced the number of living regs. For memory usage, I trided PR 69609 by valgrind, peak memory size grow from 2003910656 to 2003947520, very small increase. For SPEC INT 2017, when using upstream GCC (whitout these patches), I get a coredump when training the peak case, so no data yet. The cause of the core dump still needs to be investigated. No regression on x86-64, AArch64 and RISC-V target. Best, Lehua Lehua Ding (4): df: Add -ftrack-subreg-liveness option df: Add DF_LIVE_SUBREG problem ira: Apply DF_LIVE_SUBREG data lra: Apply DF_LIVE_SUBREG data gcc/Makefile.in | 1 + gcc/common.opt | 4 + gcc/df-problems.cc | 855 ++++++++++++++++++++++++++++++++++++++- gcc/df.h | 155 +++++++ gcc/ira-build.cc | 7 +- gcc/ira-color.cc | 8 +- gcc/ira-emit.cc | 12 +- gcc/ira-lives.cc | 7 +- gcc/ira.cc | 19 +- gcc/lra-coalesce.cc | 27 +- gcc/lra-constraints.cc | 109 ++++- gcc/lra-int.h | 4 + gcc/lra-lives.cc | 355 ++++++++++++---- gcc/lra-remat.cc | 8 +- gcc/lra-spills.cc | 27 +- gcc/lra.cc | 10 +- gcc/opts.cc | 1 + gcc/regs.h | 5 + gcc/sbitmap.cc | 98 +++++ gcc/sbitmap.h | 2 + gcc/subreg-live-range.cc | 53 +++ gcc/subreg-live-range.h | 206 ++++++++++ gcc/timevar.def | 1 + 23 files changed, 1839 insertions(+), 135 deletions(-) create mode 100644 gcc/subreg-live-range.cc create mode 100644 gcc/subreg-live-range.h
Comments
> For SPEC INT 2017, when using upstream GCC (whitout these patches), I get a > coredump when training the peak case, so no data yet. The cause of the core > dump still needs to be investigated. Typo, SPEC INT 2017 -> SPEC FP 2017 Also There is a bad news, the score of specint 2017 (with these patches) is dropped, a bit strange and I need to be locating the cause.
On 2/5/24 00:01, Lehua Ding wrote: >> For SPEC INT 2017, when using upstream GCC (whitout these patches), I >> get a >> coredump when training the peak case, so no data yet. The cause of the >> core >> dump still needs to be investigated. > > Typo, SPEC INT 2017 -> SPEC FP 2017 > Also There is a bad news, the score of specint 2017 (with these patches) > is dropped, a bit strange and I need to be locating the cause. Just a note. I doubt this will get much traction from a review standpoint until gcc-14 is basically out the door. My recommendation is to continue development, bugfixing, cleanup, etc between now and then. Consider creating a branch for the work in the upstream repo. Jeff
This series appears to be missing documentation for the new option in invoke.texi.
On 2024/2/6 0:10, Jeff Law wrote: > Just a note. I doubt this will get much traction from a review > standpoint until gcc-14 is basically out the door. > > My recommendation is to continue development, bugfixing, cleanup, etc > between now and then. Consider creating a branch for the work in the > upstream repo. OK, thanks for the guidance.
On 2024/2/6 2:17, Joseph Myers wrote: > This series appears to be missing documentation for the new option in > invoke.texi. > OK, I'll add that. Thanks.
On 2/5/24 11:10, Jeff Law wrote: > > > On 2/5/24 00:01, Lehua Ding wrote: >>> For SPEC INT 2017, when using upstream GCC (whitout these patches), >>> I get a >>> coredump when training the peak case, so no data yet. The cause of >>> the core >>> dump still needs to be investigated. >> >> Typo, SPEC INT 2017 -> SPEC FP 2017 >> Also There is a bad news, the score of specint 2017 (with these >> patches) is dropped, a bit strange and I need to be locating the cause. > Just a note. I doubt this will get much traction from a review > standpoint until gcc-14 is basically out the door. > > My recommendation is to continue development, bugfixing, cleanup, etc > between now and then. Consider creating a branch for the work in the > upstream repo. > > Thank you for posting this work. The compilation time improvement is a surprise for me and very encouraging. I agree with Jeff's recommendation to create a branch as most probably some people (at least me :) would like to try this on own set of benchmarks. I am planning to make a review of RA part of these patches at the beginning of April. Still when I have spare time I'll look at the patches and could give some feedback even earlier.