From patchwork Thu May 4 00:44:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans-Peter Nilsson X-Patchwork-Id: 89883 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp1712870vqo; Wed, 3 May 2023 17:45:01 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7CYRe528bzI3I9kqW+8rVLZ8c7MtFYGvNmH8cuv6AZgKQQMQcp54AeL4pW3rYWzQPlIYUc X-Received: by 2002:a17:907:7fac:b0:965:9d20:a41b with SMTP id qk44-20020a1709077fac00b009659d20a41bmr1153737ejc.16.1683161100796; Wed, 03 May 2023 17:45:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683161100; cv=none; d=google.com; s=arc-20160816; b=asjQIR6+7NNSjbQziVE5LsBxdNDDo8SPGi0R5tRgMkShkPwTUNtujdjpU0EElSnNdS JpqTovk3vGR6+aPs7ZaBEnGMhYHcLkEihDUg8IpgaAuB4JHEpwBZnOoICUbAjAzVkaa3 VAwUobvtyt1IYG93j4Df0Wr/ya7YrVAqhUYKJVwMTXAiBuuRlPUXEeNrXs1oZDagsqAZ RnPBXuxrgWadKXZX9mTJ4xSUIkclEbgJ6uziJeWPoncOYA8TSok79pbtUfSORxD+Kkqq quZ7jdgFBSKXzX9uzXHtt8Ymb+C2sySYuUTdmEGy8ndNKNC2ChCFbE4s9Eppf3k49kgt 8/rQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence:date:message-id :content-transfer-encoding:mime-version:subject:to:dmarc-filter :delivered-to:dkim-signature:dkim-filter; bh=PAIJeMuufUUbhlMkGbuUqF2nEBbkllhIIItFa4nMi5Y=; b=rbBGtsP6W4B1EpA3A0mzlv1/BxfJ0TSXwJ1VHFlTOxCp12ei4BhNVxY0YzrMWAm2Uo IaZ9dkGeN2lw2f15Fc3lWKfHh8TFuMOW7pXB87TBm9wyykyV9fqLRTDxH6za9tz2jFl0 vD+eCGd8HcVl1qa/T05rrxrBYVg5mDYdkU5I9CcFba6Bvmxoxez9VaxQ00I6/yqARiYa 40c+1oJ4YHD/4cuqnzhdRDbGZinT6QoNbYXiPgwC7m+g+EfKs2GSwwFiEjM5truST1Td Lb14r4F5pYtOsOsE2550lIDWmQh/P3oNt/6MlLTK7Ied5662Pn/jT+RK98gRLj9arez6 BYsQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=OBf0ms36; 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=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id c19-20020a170906d19300b0094f794d4c2csi25224246ejz.530.2023.05.03.17.45.00 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 May 2023 17:45:00 -0700 (PDT) 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=@gcc.gnu.org header.s=default header.b=OBf0ms36; 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=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id A1F9C3857711 for ; Thu, 4 May 2023 00:44:59 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A1F9C3857711 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1683161099; bh=PAIJeMuufUUbhlMkGbuUqF2nEBbkllhIIItFa4nMi5Y=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=OBf0ms36+3o5gijdMWwrdFU0uce1h18qB3iYhSpc0DEUwG4B9JZNJNPIoVXh5UKCG PcF4dM47WUpSl95ESq8gS5vr7jOmhhrk/UU/Eu/kKfdmNKb2WpHqAffMVxxHklw3c7 lYFbHjpIa7B1WPLHRBLVeGWpaXxtGy8b+Sd1BjNw= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from smtp1.axis.com (smtp1.axis.com [195.60.68.17]) by sourceware.org (Postfix) with ESMTPS id 735853858D28 for ; Thu, 4 May 2023 00:44:16 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 735853858D28 To: Subject: [committed] CRIS-LRA: Define TARGET_SPILL_CLASS MIME-Version: 1.0 Message-ID: <20230504004415.3F59E20438@pchp3.se.axis.com> Date: Thu, 4 May 2023 02:44:15 +0200 X-Spam-Status: No, score=-11.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, 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.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Hans-Peter Nilsson via Gcc-patches From: Hans-Peter Nilsson Reply-To: Hans-Peter Nilsson Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1764922334105661728?= X-GMAIL-MSGID: =?utf-8?q?1764922334105661728?= This has no effect on arith-rand-ll (which suffers badly from LRA) and marginal effects (0.01% improvement) on coremark, but the size of coremark shrinks by 0.2%. An earlier version was tested with a tree around 2023-03 which showed (marginally) that ALL_REGS is preferable to GENERAL_REGS. * config/cris/cris.cc (TARGET_SPILL_CLASS): Define to ALL_REGS. --- gcc/config/cris/cris.cc | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/gcc/config/cris/cris.cc b/gcc/config/cris/cris.cc index 641e7ea25fb1..373b9999e0db 100644 --- a/gcc/config/cris/cris.cc +++ b/gcc/config/cris/cris.cc @@ -134,6 +134,7 @@ static void cris_init_libfuncs (void); static unsigned int cris_postdbr_cmpelim (void); static reg_class_t cris_preferred_reload_class (rtx, reg_class_t); +static reg_class_t cris_spill_class (reg_class_t, machine_mode); static int cris_register_move_cost (machine_mode, reg_class_t, reg_class_t); static int cris_memory_move_cost (machine_mode, reg_class_t, bool); @@ -224,6 +225,9 @@ int cris_cpu_version = CRIS_DEFAULT_CPU_VERSION; #undef TARGET_PREFERRED_RELOAD_CLASS #define TARGET_PREFERRED_RELOAD_CLASS cris_preferred_reload_class +#undef TARGET_SPILL_CLASS +#define TARGET_SPILL_CLASS cris_spill_class + /* We don't define TARGET_FIXED_CONDITION_CODE_REGS, as at the time of this writing, it has an effect only on pre-reload CSE and when scheduling (and for "macro fusion" at that). Neither applies for @@ -1684,6 +1688,14 @@ cris_preferred_reload_class (rtx x, reg_class_t rclass) return rclass; } +/* Worker function for TARGET_SPILL_CLASS. */ + +static reg_class_t +cris_spill_class (reg_class_t /* orig_class */, machine_mode) +{ + return ALL_REGS; +} + /* Worker function for TARGET_REGISTER_MOVE_COST. */ static int