Message ID | 20240203105012.208998-1-lehua.ding@rivai.ai |
---|---|
Headers |
Return-Path: <gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:9bc1:b0:106:209c:c626 with SMTP id op1csp955392dyc; Sat, 3 Feb 2024 02:51:36 -0800 (PST) X-Google-Smtp-Source: AGHT+IFm1p3I9vRzbkNk6+/aYFuJG9z5WvRetSdeaHcQ+w5lx8u2DkNXcGvEi/xnMGNT0jjVc/0q X-Received: by 2002:a05:6214:b6e:b0:681:9c10:e33c with SMTP id ey14-20020a0562140b6e00b006819c10e33cmr1228701qvb.53.1706957495895; Sat, 03 Feb 2024 02:51:35 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706957495; cv=pass; d=google.com; s=arc-20160816; b=QXkNR88UC6PT5XuxRQfJrv4tv0br4DRsQE8zqYlVyfY9X+gGpfXqcAkE7cIpz8bi5e LMT/TopKVBnvsOXKqM+wqYHrpCPXpQM2dHWoacHmoyjoZIPkEFy3lRrHI5KFFt3J7dee y5u8QrdShBfGO6RmZI8TyutSXbt9LZQmlpHE3Ws9P+6Lm00nlAP4b9atKok3H3mBpDKT nBXf9xY6XzoHy1jrCSr2bJGRUZ1Mq005xxZYxxc9MY7Izn7UWhr+rc/bUMrMQ+10d0zF 0gzl/FpONi5NZp5s9m9WOJ6h+JnYwneOMI29NEJx2jHTOJrxXTXnvl9Is91iriszM4QK MblA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:feedback-id :content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:arc-filter:dmarc-filter:delivered-to; bh=DZ1JQYbWAfiDgptDNTmlTv5WraEqoSLIh3NFQWFsFHY=; fh=h63rzFYOGIBqYqqCqUje0rcC6zVlMRSA5wlGken4wKg=; b=N+luOhJWZr2+1Vgqn+tU4PXXyhNxNcl0N0V3LBgabeJOeKMgWgi2NO08hfpVFluI6k hSHe+olNlDrT+MKH5uwDXyNxJNVJz8A/ppB+Tw+u3VDw+yV55Up9b1vCCLf49uP9wMqr Z5nyuVQB19o18bAOPgGSn08PdtZhqCok3uDWX2xpnEMpoYSKfYaT648SLkaSk1RpesXS 8R89P5RUeFSoanI443OIrmlMF2o3nmXKUSnLPLD9cmkzItgBCS4huWhzFjaU7EZvzL7q nK6KOML4knsQnuX+Bi0CoBCtbN0xHob5SkbxuJLOEPd6kdG4yCBkL4BWF0C+la//k9fl u51g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" X-Forwarded-Encrypted: i=1; AJvYcCVcC3kLWTEOo8ixUeE+88Uss8PUzRL31sNYEUm6fZA86dooYQFItiaZYGEXSOtQPLbGaQoT64/dHtnaZIALBrRRCQJmdw== Received: from server2.sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id m2-20020a05620a214200b00783f8df0214si4052166qkm.756.2024.02.03.02.51.35 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 03 Feb 2024 02:51:35 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 4F3373857B88 for <ouuuleilei@gmail.com>; Sat, 3 Feb 2024 10:51:35 +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+ouuuleilei=gmail.com@gcc.gnu.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1789874663417127143 X-GMAIL-MSGID: 1789874663417127143 |
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.