Message ID | 20231209170347.12601-3-xry111@xry111.site |
---|---|
State | Unresolved |
Headers |
Return-Path: <gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:bcd1:0:b0:403:3b70:6f57 with SMTP id r17csp6152660vqy; Sat, 9 Dec 2023 09:05:15 -0800 (PST) X-Google-Smtp-Source: AGHT+IHCeSkolREN1gR/+BFdlpJvsGBJcgrQhoZdga8NvU5xGF8Y3w+tuTykIV1g7ood8UGtmrOZ X-Received: by 2002:a05:620a:6289:b0:77b:9d44:e88 with SMTP id ov9-20020a05620a628900b0077b9d440e88mr2602516qkn.43.1702141515631; Sat, 09 Dec 2023 09:05:15 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1702141515; cv=pass; d=google.com; s=arc-20160816; b=ax4KakqXXit00TK12/ZrO2LVCxZMJ1BKn0injjpgJH5HI9uKmRvCeRW/G9ZBmO2LUI F0A0tqLk2ZGTswv3r2YuV63PVJCwswmFKYuSWfE2jM4rRMcs29MqZyknp9EdxqBjejWG 8i9UXnWFB6hV0o5Jf57qJz4WofCp4Ms2BzMhY9oIVRqFRU9vXuOsa6kJL60oQfFFyr70 5Ku4ufHHPL7x4IkExWQHu9ZrLcRWti9P7qqkUkBB4IrB0eAuNbqYTOltud7u+TV2fDbD kyldZw8Q1/0mPYs+jyoNvPAETlM844vXqlGPdeiHUkiwLf4EvdgyjPPL4NBweLpRDuEj 9oNg== 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:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature:arc-filter:dmarc-filter:delivered-to; bh=Lf2LkjfeTGgsYXzu8DkBuD3EPcm3NHKx/+LZ47u9GRs=; fh=lAZEJv+juT1q6RYyAreaw+ZnRPAcRoheJ20Uybha2qY=; b=JFID3m1h7hwKsLKRST4JR5DgSq+Du/5LyHEmPXHg9J9PR8BYxiWvltVPUCMOHuwPFH O3tssrKNTM9xaPd7MAuu8uQEWwi3yAGXFD+G6m8FF7QAKTJ3oACppBRGPogrUAG/KBCe 8gOTmcFcXXF/sHrQ3d5+6xd6avtvuBR2DozmDp3Z4oz35CuaBkWes6zMqZ5Cmbdqr2wi SkP+StCyqYn6bJb8rqYM1TiStdx896OoY+q7XjTE6UPOHIv9eSN4Usmab0jTtSTAzlot dCNNyhTv2eSJil+SrrRh/cDmpUuDNCJLKH5iMkG/lTPe8a69twojICdjUwGjHCR54Fjx JstQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@xry111.site header.s=default header.b=eYFLCEHP; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=xry111.site Received: from server2.sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id z12-20020ab0770c000000b007c5c7cd43c9si911175uaq.31.2023.12.09.09.05.15 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 09 Dec 2023 09:05:15 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@xry111.site header.s=default header.b=eYFLCEHP; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=xry111.site Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 6C5E7385828C for <ouuuleilei@gmail.com>; Sat, 9 Dec 2023 17:05:14 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from xry111.site (xry111.site [89.208.246.23]) by sourceware.org (Postfix) with ESMTPS id 87E353858C53 for <gcc-patches@gcc.gnu.org>; Sat, 9 Dec 2023 17:04:19 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 87E353858C53 Authentication-Results: sourceware.org; dmarc=pass (p=reject dis=none) header.from=xry111.site Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=xry111.site ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 87E353858C53 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=89.208.246.23 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1702141462; cv=none; b=E+PL45tu0OJoXdXR1KVeiIe+9lV00w4J4M1ikq2eLuvM/qjbdXFrVAH8D3GTH5peEuBKxBUqg1xXEOZ9Mu2SqZxEocx+RWRuugEfHpuQ+pkufE8iG9OLX/lI4X78LvGM6v/eBO6aQVGqCuv2DCUHGRBfwxEDmWvPhYgkKtTBQDE= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1702141462; c=relaxed/simple; bh=FuxlXFPwOr4Up4grdnjCQvtLSeftoOBE1PXxAV84nkM=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=JGJi5ho4xg5VKyLCiqN5tBI1H9h15Ey937epQKlMV9KEPfmj6p79Hb6oEgsjhs5R2Zm4RMSVRiGmm/WuUG3Q3vqtVlGGDn989c1oYWpuFe/JPvCF87RZeT3kJIxA5CbHDzCl3e1fW3XThan74VFqYnRJDlHvPuAZWkMy4f6M6fs= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=xry111.site; s=default; t=1702141458; bh=FuxlXFPwOr4Up4grdnjCQvtLSeftoOBE1PXxAV84nkM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eYFLCEHPX1pHEH0khwo2noUDIC/v6sLg+mnbcJRaZ6itX/Xwvi+j5CKSCALMF8wfM 9dkR8XCom2+veSFWubzYwtkId+ZgauWo2dtiMMN3zFH7+D4aMMwgS09QY3zlvhJKTM Nt4uEaBimpNIdjuSC93ivIAOb/rxlS++A15wc6IA= Received: from stargazer.. (unknown [IPv6:240e:358:1144:3a00:dc73:854d:832e:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (Client did not present a certificate) (Authenticated sender: xry111@xry111.site) by xry111.site (Postfix) with ESMTPSA id A2D436693E; Sat, 9 Dec 2023 12:04:15 -0500 (EST) From: Xi Ruoyao <xry111@xry111.site> To: gcc-patches@gcc.gnu.org Cc: chenglulu <chenglulu@loongson.cn>, i@xen0n.name, xuchenghua@loongson.cn, c@jia.je, Xi Ruoyao <xry111@xry111.site> Subject: [PATCH 1/3] LoongArch: Include rtl.h for COSTS_N_INSNS instead of hard coding our own Date: Sun, 10 Dec 2023 01:03:46 +0800 Message-ID: <20231209170347.12601-3-xry111@xry111.site> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231209170347.12601-2-xry111@xry111.site> References: <20231209170347.12601-2-xry111@xry111.site> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-9.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, LIKELY_SPAM_FROM, SPF_HELO_PASS, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE 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: 1784824742013511753 X-GMAIL-MSGID: 1784824742013511753 |
Series |
LoongArch: Fix instruction costs
|
|
Checks
Context | Check | Description |
---|---|---|
snail/gcc-patch-check | warning | Git am fail log |
Commit Message
Xi Ruoyao
Dec. 9, 2023, 5:03 p.m. UTC
With loongarch-def.cc switched from C to C++, we can include rtl.h for COSTS_N_INSNS, instead of hard coding our own. THis is a non-functional change for now, but it will make the code more future-proof in case COSTS_N_INSNS in rtl.h would be changed. gcc/ChangeLog: * config/loongarch/loongarch-def.cc (rtl.h): Include. (COSTS_N_INSNS): Remove the macro definition. --- gcc/config/loongarch/loongarch-def.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
Comments
LGTM! Thanks. 在 2023/12/10 上午1:03, Xi Ruoyao 写道: > With loongarch-def.cc switched from C to C++, we can include rtl.h for > COSTS_N_INSNS, instead of hard coding our own. > > THis is a non-functional change for now, but it will make the code more > future-proof in case COSTS_N_INSNS in rtl.h would be changed. > > gcc/ChangeLog: > > * config/loongarch/loongarch-def.cc (rtl.h): Include. > (COSTS_N_INSNS): Remove the macro definition. > --- > gcc/config/loongarch/loongarch-def.cc | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/gcc/config/loongarch/loongarch-def.cc b/gcc/config/loongarch/loongarch-def.cc > index c41804a180e..6217b19268c 100644 > --- a/gcc/config/loongarch/loongarch-def.cc > +++ b/gcc/config/loongarch/loongarch-def.cc > @@ -22,6 +22,7 @@ along with GCC; see the file COPYING3. If not see > #include "system.h" > #include "coretypes.h" > #include "tm.h" > +#include "rtl.h" > > #include "loongarch-def.h" > #include "loongarch-str.h" > @@ -89,8 +90,6 @@ array_tune<loongarch_align> loongarch_cpu_align = > .set (CPU_LA464, la464_align ()) > .set (CPU_LA664, la464_align ()); > > -#define COSTS_N_INSNS(N) ((N) * 4) > - > /* Default RTX cost initializer. */ > loongarch_rtx_cost_data::loongarch_rtx_cost_data () > : fp_add (COSTS_N_INSNS (1)),
diff --git a/gcc/config/loongarch/loongarch-def.cc b/gcc/config/loongarch/loongarch-def.cc index c41804a180e..6217b19268c 100644 --- a/gcc/config/loongarch/loongarch-def.cc +++ b/gcc/config/loongarch/loongarch-def.cc @@ -22,6 +22,7 @@ along with GCC; see the file COPYING3. If not see #include "system.h" #include "coretypes.h" #include "tm.h" +#include "rtl.h" #include "loongarch-def.h" #include "loongarch-str.h" @@ -89,8 +90,6 @@ array_tune<loongarch_align> loongarch_cpu_align = .set (CPU_LA464, la464_align ()) .set (CPU_LA664, la464_align ()); -#define COSTS_N_INSNS(N) ((N) * 4) - /* Default RTX cost initializer. */ loongarch_rtx_cost_data::loongarch_rtx_cost_data () : fp_add (COSTS_N_INSNS (1)),