Message ID | 20231006174954.392381-1-vineetg@rivosinc.com |
---|---|
State | Accepted |
Headers |
Return-Path: <gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:a888:0:b0:403:3b70:6f57 with SMTP id x8csp499440vqo; Fri, 6 Oct 2023 10:52:55 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEuLasPQFHxyLBU5mUot70wp6AWMECWXXUrvYkzP3kJ8VRUy+F9sCjTGAJrLrkbQ+DgWOnP X-Received: by 2002:a17:907:2cf7:b0:9ae:7870:1522 with SMTP id hz23-20020a1709072cf700b009ae78701522mr7906956ejc.53.1696614775318; Fri, 06 Oct 2023 10:52:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696614775; cv=none; d=google.com; s=arc-20160816; b=P21N/GsIbH8vXara4LK+/HK1MpL62LJZlP3l+FK3Lxxrka/+3xrBbctGxUj+4Ji6/5 EntKIrOIUmNEYNkfCUHNL2oe+fpWwog9/QWUg6eaY1jbc3i4eEFZ4BZyRjMqaSQE/Du7 qDQv4c3HngjmZbTC/O9h7vSKAZ4PxEV2nS7QCPLMmG/K9kZn4o8GoOmVj0MXDWy17t2k 8p3+j72uqrAnw41BOEs9lE3vGcNIoodXMFSFPMTzM1W9HGMG9NVsRIh10vG7UTqXY/Xg vV7OP1aeNTODuMpZu4hQifkKdQJzbW3S2hWlaFnQUhwHFOcLZhVftC0N6efngNb9tugG I3KQ== ARC-Message-Signature: i=1; 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:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from:dkim-signature :dmarc-filter:delivered-to; bh=efkYd52pzlT5VFonTpdoz1GBd2sn3rCWCv0Vn0kF1fI=; fh=6LuN+AdISKomSbFiaVS6xnyPqmlwSGOmNbrRIUPUkrY=; b=nSWZSROZXBJpchngiQ7wLzTGNR1ro4/Z6gYHtqCnb1ULnEJjG0PS5+e6p9+AfeoITM LAct+ER7ogU0Y+gDkLr5i3c5VjGo23J4svQo6h+RtJoF4EoKGuZSb2KBWb4l1lNZ0fgz Sc+zfyR54VQPRXRTl1+4sNTxSF8HjhMxLioKuog4qmBe7oAJVfc/joP74FOlHYln/keN 0Ofo6wdjzyjxvRFqa2UEmmhteJChM5km0Ncuu6PDxnHAIk+ssbbUfi0ENRuW/y3KFhNy JL6zBKPrkMNnG088zXCAm06K4aVu9M7isVdEze6GY4H/cXGK0Zhb2HXe5n2UUEgoIvbp qEWQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@rivosinc-com.20230601.gappssmtp.com header.s=20230601 header.b=KhVIqpUN; 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 (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id a25-20020a17090640d900b009a224eb0938si1725882ejk.21.2023.10.06.10.52.55 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Oct 2023 10:52:55 -0700 (PDT) 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; dkim=pass header.i=@rivosinc-com.20230601.gappssmtp.com header.s=20230601 header.b=KhVIqpUN; 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 70532385DC2F for <ouuuleilei@gmail.com>; Fri, 6 Oct 2023 17:52:21 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-pf1-x42b.google.com (mail-pf1-x42b.google.com [IPv6:2607:f8b0:4864:20::42b]) by sourceware.org (Postfix) with ESMTPS id DCBE53856956 for <gcc-patches@gcc.gnu.org>; Fri, 6 Oct 2023 17:49:58 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org DCBE53856956 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=rivosinc.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=rivosinc.com Received: by mail-pf1-x42b.google.com with SMTP id d2e1a72fcca58-6934202b8bdso2038593b3a.1 for <gcc-patches@gcc.gnu.org>; Fri, 06 Oct 2023 10:49:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1696614597; x=1697219397; darn=gcc.gnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=efkYd52pzlT5VFonTpdoz1GBd2sn3rCWCv0Vn0kF1fI=; b=KhVIqpUNAwXWHO28h1d4mCSyCcgss6B0YLMkgjneKfe2orvmyQ8XeZt2rtiTSI9zZN VSni642zI/GO9Ad0K0leQGE6rGj2b/RDKENSBjfz9hpe46jV4wAl/SVb7D3IBCDpMDx0 ey5fsZ2hNq4D3H6J0uKpzt5YOAYR/3zyhJ3Z5sOYgc+8Er/MI58XDA1Sg9cvwQ9/M3IT yIKDUxKkh+tQSbSYjqnoP9VWO/NjuafVIEA91B5Q8g87Ku3/Pj2xLN4y8Ck2B7gGMt+4 OEHSuyLly4qeJcm2tN6WB+SDSvf5TEq9F/3kVqXNqJv/CgTqWW3YxA1ao+2XX08lAJw0 +x1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696614597; x=1697219397; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=efkYd52pzlT5VFonTpdoz1GBd2sn3rCWCv0Vn0kF1fI=; b=J+Tug9fwYyMJe4x9GWjMv5M2U2m3Ybbe6MOOgcjl8K/bc+DmgW0DX+NSA9/fqHnEe/ lH70TxVDvLkASg+VQqD6mQ9H6gA8HEgw93ouAq5GJuHFHk6f3pyfJhU+9EMjet1dc7aQ rDLfI3ulVyJDEBgh8nixhLQ2ZoyJZ7nUpORXWgTtrVWnr+khHqM+wNGtmXVPQ2gX5Sid 63uqTJtf5QaWFBPksapN6RiIhqSMHwqW9hTE8tFsH+tBsGw/s8FzlUjMQ4fpeYy3Ahid Joz3X+Czh8k7v223v00SVfO/rG44UEQcehpDulPoh7duDGfvhw2b2c25/0TO8kjXEApH 22ow== X-Gm-Message-State: AOJu0YwSvK0GENE92NWGA6srcJ9bWHISwvObn6il9O36GNhRV3Vp83WW 4/LKe48QvKztE2l10t5FNb/2W/3w1iEzh9kSH2Y= X-Received: by 2002:a05:6a20:938b:b0:15a:2c0b:6c73 with SMTP id x11-20020a056a20938b00b0015a2c0b6c73mr10647509pzh.12.1696614597560; Fri, 06 Oct 2023 10:49:57 -0700 (PDT) Received: from vineet-framework.ba.rivosinc.com (c-98-210-197-24.hsd1.ca.comcast.net. [98.210.197.24]) by smtp.gmail.com with ESMTPSA id e24-20020a62aa18000000b006979f70fdd5sm1736889pff.219.2023.10.06.10.49.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Oct 2023 10:49:57 -0700 (PDT) From: Vineet Gupta <vineetg@rivosinc.com> To: gcc-patches@gcc.gnu.org Cc: kito.cheng@gmail.com, Jeff Law <jeffreyalaw@gmail.com>, Palmer Dabbelt <palmer@rivosinc.com>, gnu-toolchain@rivosinc.com, Vineet Gupta <vineetg@rivosinc.com> Subject: [PATCH v2] RISC-V: const: hide mvconst splitter from IRA Date: Fri, 6 Oct 2023 10:49:54 -0700 Message-Id: <20231006174954.392381-1-vineetg@rivosinc.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-10.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham 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: 1779029534937537774 X-GMAIL-MSGID: 1779029534937537774 |
Series |
[v2] RISC-V: const: hide mvconst splitter from IRA
|
|
Checks
Context | Check | Description |
---|---|---|
snail/gcc-patch-check | success | Github commit url |
Commit Message
Vineet Gupta
Oct. 6, 2023, 5:49 p.m. UTC
Vlad recently introduced a new gate @ira_in_progress, similar to
counterparts @{reload,lra}_in_progress.
Use this to hide the constant synthesis splitter from being recog* ()
by IRA register equivalence logic which is eager to undo the splits,
generating worse code for constants (and sometimes no code at all).
See PR/109279 (large constant), PR/110748 (const -0.0) ...
Granted the IRA logic is subsided with -fsched-pressure which is now
enabled for RISC-V backend, the gate makes this future-proof in
addition to helping with -O1 etc.
This fixes 1 addition test
========= Summary of gcc testsuite =========
| # of unexpected case / # of unique unexpected case
| gcc | g++ | gfortran |
rv32imac/ ilp32/ medlow | 416 / 103 | 13 / 6 | 67 / 12 |
rv32imafdc/ ilp32d/ medlow | 416 / 103 | 13 / 6 | 24 / 4 |
rv64imac/ lp64/ medlow | 417 / 104 | 9 / 3 | 67 / 12 |
rv64imafdc/ lp64d/ medlow | 416 / 103 | 5 / 2 | 6 / 1 |
Also similar to v1, this doesn't move RISC-V SPEC scores at all.
gcc/ChangeLog:
* config/riscv/riscv.md (mvconst_internal): Add !ira_in_progress.
Suggested-by: Jeff Law <jeffreyalaw@gmail.com>
Signed-off-by: Vineet Gupta <vineetg@rivosinc.com>
---
changes since v1:
- Fix bug: new condition to prevent recognition not splitting itself
---
gcc/config/riscv/riscv.md | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
Comments
On 10/6/23 11:49, Vineet Gupta wrote: > Vlad recently introduced a new gate @ira_in_progress, similar to > counterparts @{reload,lra}_in_progress. > > Use this to hide the constant synthesis splitter from being recog* () > by IRA register equivalence logic which is eager to undo the splits, > generating worse code for constants (and sometimes no code at all). > > See PR/109279 (large constant), PR/110748 (const -0.0) ... > > Granted the IRA logic is subsided with -fsched-pressure which is now > enabled for RISC-V backend, the gate makes this future-proof in > addition to helping with -O1 etc. > > This fixes 1 addition test > > ========= Summary of gcc testsuite ========= > | # of unexpected case / # of unique unexpected case > | gcc | g++ | gfortran | > > rv32imac/ ilp32/ medlow | 416 / 103 | 13 / 6 | 67 / 12 | > rv32imafdc/ ilp32d/ medlow | 416 / 103 | 13 / 6 | 24 / 4 | > rv64imac/ lp64/ medlow | 417 / 104 | 9 / 3 | 67 / 12 | > rv64imafdc/ lp64d/ medlow | 416 / 103 | 5 / 2 | 6 / 1 | > > Also similar to v1, this doesn't move RISC-V SPEC scores at all. > > gcc/ChangeLog: > * config/riscv/riscv.md (mvconst_internal): Add !ira_in_progress. OK jeff
diff --git a/gcc/config/riscv/riscv.md b/gcc/config/riscv/riscv.md index e00b8ee3579d..9b990ec2566d 100644 --- a/gcc/config/riscv/riscv.md +++ b/gcc/config/riscv/riscv.md @@ -1997,13 +1997,16 @@ ;; Pretend to have the ability to load complex const_int in order to get ;; better code generation around them. -;; ;; But avoid constants that are special cased elsewhere. +;; +;; Hide it from IRA register equiv recog* () to elide potential undoing of split +;; (define_insn_and_split "*mvconst_internal" [(set (match_operand:GPR 0 "register_operand" "=r") (match_operand:GPR 1 "splittable_const_int_operand" "i"))] - "!(p2m1_shift_operand (operands[1], <MODE>mode) - || high_mask_shift_operand (operands[1], <MODE>mode))" + "!ira_in_progress + && !(p2m1_shift_operand (operands[1], <MODE>mode) + || high_mask_shift_operand (operands[1], <MODE>mode))" "#" "&& 1" [(const_int 0)]