From patchwork Sat May 11 13:14:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?6ZKf5bGF5ZOy?= X-Patchwork-Id: 1934147 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Vc5q520j0z20KK for ; Sat, 11 May 2024 23:16:01 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 54D59384404C for ; Sat, 11 May 2024 13:15:59 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from smtpbgbr1.qq.com (smtpbgbr1.qq.com [54.207.19.206]) by sourceware.org (Postfix) with ESMTPS id B83023858D28 for ; Sat, 11 May 2024 13:14:29 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B83023858D28 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 B83023858D28 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=54.207.19.206 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1715433278; cv=none; b=io7gtp0bxO9raQ3dyuIDyyXbiFoOLz53EpYddR7T0zTIaJD9vhUxj3Luq9eqUxgJaFlugMXRAiruLoXz+ZbDFMhWQkYF1h7/DU8i+W28NrBkLt1iiRzJrpsZ+Lq5I4/HMcdJPV2vE+de6vsFefRW7T7/xcLbNd5gD4xmfH8GylA= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1715433278; c=relaxed/simple; bh=EH/XqGa6A2DMDn2PQRqYy0F8iU4MlsugbzA2GNk3Myg=; h=From:To:Subject:Date:Message-Id:MIME-Version; b=nME3RJRY9/EdVRTBEiwwYlwsz7nreju3mirYObGmkWlOJSJo5qUR+PoVR0BnDY1f1ib7kulqFnn0kewvqHRCidlDd/5ox6pTaUyRiOJ4ycwUOtZSg+VmJFeujWk7nrgaUQAPy72veOqW40AYkr92dXqTBxSIlxLYgmZXo53kWyM= ARC-Authentication-Results: i=1; server2.sourceware.org X-QQ-mid: bizesmtp87t1715433257tpz3ylar X-QQ-Originating-IP: yyZ5QH2fm1i0OV+0ZVRHI2ERY5Bv6IBJewBRCNHpVJc= Received: from rios-cad121.hadoop.rioslab.org ( [58.60.1.28]) by bizesmtp.qq.com (ESMTP) with id ; Sat, 11 May 2024 21:14:15 +0800 (CST) X-QQ-SSF: 01400000000000H0V000000A0000000 X-QQ-FEAT: +oIWmpEafD+Fx+NVWGnpOHRKlSSDw6oaSgJtSaEYM4WqxNI7QzXBicbvHO1XQ ZTmvBaWNX6XWrCgf9IzkZc0RnRVRczBW4eCSQFdpU7dfeeh9xT7CcrlXBxFi5Xb2Bq/8CJ/ MMUJBHU7EfKipG+7txGV1ElKkLCrmLWe/TLDswRUerhZ2hnV2MkfCu5evpaUd+qPvt8oxSO 3m/DIKGrbexZOKZMYkfLDNis2NStpZXBeYDFOekyvLIQrfT6JxVMzIUbJ/MeX5wncIntG+m MM7S7EwNDNn3gyTJyAcJJhH5aRaL5Su60hDsDvC0OI+HI8gWK6HNOHtqB+vPcU6JhWt4ADv Y0d5WCS4kJW2H66uqhyRbOq+DLPnIRPWY4h29gP2eI2aYbIhCm41vSLFoOsfkY1Jdi8tXCe CoI8iZyz8lM= X-QQ-GoodBg: 2 X-BIZMAIL-ID: 2519896629015961558 From: Juzhe-Zhong To: gcc-patches@gcc.gnu.org Cc: vmakarov@redhat.com, richard.sandiford@arm.com, jin.xia@rivai.ai, Juzhe-Zhong , Lehua Ding Subject: [SUBREG V3 0/4] Add DF_LIVE_SUBREG data and apply to IRA and LRA Date: Sat, 11 May 2024 21:14:09 +0800 Message-Id: <20240511131413.3394912-1-juzhe.zhong@rivai.ai> X-Mailer: git-send-email 2.36.3 MIME-Version: 1.0 X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:rivai.ai:qybglogicsvrgz:qybglogicsvrgz7a-one-0 X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, RCVD_IN_BARRACUDACENTRAL, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_PASS, SPF_PASS, TXREP, URIBL_BLACK 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org V3: Address comments from Dimitar Dimitrov 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. And these codes are pushed to the devel/subreg-coalesce branch. In addition, my colleague Shuo Chen will also be involved in some of the remain work, thank you for your support. 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. Note that these patches don't enable register coalesce with subreg liveness in IRA/LRA, so no performance change as expected. And we will enable register coalsece with subreg liveness tracking in the followup patches. Bootstrap and Regtested on x86-64 no regression. Co-authored-by: Lehua Ding Juzhe-Zhong (4): DF: Add -ftrack-subreg-liveness option DF: Add DF_LIVE_SUBREG problem IRA: Add DF_LIVE_SUBREG problem LRA: Apply DF_LIVE_SUBREG data gcc/Makefile.in | 1 + gcc/common.opt | 4 + gcc/common.opt.urls | 3 + gcc/df-problems.cc | 886 ++++++++++++++++++++++++++++++++++++++- gcc/df.h | 159 +++++++ gcc/doc/invoke.texi | 8 + 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 | 357 ++++++++++++---- 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 + 25 files changed, 1886 insertions(+), 136 deletions(-) create mode 100644 gcc/subreg-live-range.cc create mode 100644 gcc/subreg-live-range.h