From patchwork Tue Oct 17 11:34:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lehua Ding X-Patchwork-Id: 154113 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2908:b0:403:3b70:6f57 with SMTP id ib8csp4072439vqb; Tue, 17 Oct 2023 04:45:32 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGoC3r9RESCTpEW9Pwmm4X2+jvr/zdLxBfjPHJ8aUlIfUI2j9gIlhu1s5HeTh9eGVBn14od X-Received: by 2002:a05:622a:1999:b0:401:e2bb:e423 with SMTP id u25-20020a05622a199900b00401e2bbe423mr2005345qtc.55.1697543132108; Tue, 17 Oct 2023 04:45:32 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1697543132; cv=pass; d=google.com; s=arc-20160816; b=nzmEdMx4rCY1wsvVNjh6BzOBtxJe875egVa6wU4FFdkyYmhXy/nUM9efwGxJW2vSco fvm8NgUrqQ2bXa4S/T90lj5ssjQ4nXm+f3J4m1Jv3gGsnaaBZH9ZVIS6QqX7UipnUTDJ Ltm6O8Yn078WfKucwdTdOj8lYs9tMpQ+Wdv2L4ILxbVYzk57VQTu3y9KYCiRH1SFVQBW F6ECIVR8bqP2PETL43x18e2IAD0NQGrgzti8ULc7WUpP7Dl6iO4fA6UaFu+5Cdl/YBUa cZyMmPie8UKvY2kLwKAX/TVcZNWD9Qh2PrlroTFa7Gcq5oUCHAiyQtxI7jnkhbJ6qqcI oEDA== 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:references:in-reply-to :message-id:date:subject:cc:to:from:arc-filter:dmarc-filter :delivered-to; bh=au9YhjsNRX7YDYSi1lnX05EOiedjU0O3800dfI9oKxo=; fh=x/Q0OlwHuvCZ3FpkiZPiUSvevOYVxUAi4aNnf76mUPQ=; b=WtnsZT4GozghMF8/uG05lNg1Lf6vJYToGzySoipg03822B/1sjdhnaT8E1UgJBUKH7 2HhYM9jsRWywxhnmnB8ByBgVsQVI368m24PvS7QFcllBGr3CT8NTZImoMlFEuz0onGYG 0qrhFU5vmmOHWFz43QHkZqOaSoWabIwbK7WIJRhnXEUF+q+/q1kpMIrMPkzHyYIsDcD0 4YmvXCyR6krQ4Bn/JAKA7N/KodDFUVN7DpJpvDWOukgEtAKrU3yh1JdTco/VyWE41AEx f+cRgZklYaOFjzsNRNA5srL6ucNlJm20A5tQyJzD3IsEDJ3w70lM5gH+37+q1j9ILReW EKdQ== 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" Received: from server2.sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id c14-20020a05622a024e00b0041979c13981si1009837qtx.298.2023.10.17.04.45.32 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Oct 2023 04:45:32 -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; 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 D66A43831E2A for ; Tue, 17 Oct 2023 11:44:07 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from smtpbgjp3.qq.com (smtpbgjp3.qq.com [54.92.39.34]) by sourceware.org (Postfix) with ESMTPS id B54AD3856DDA for ; Tue, 17 Oct 2023 11:35:51 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B54AD3856DDA 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 B54AD3856DDA Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=54.92.39.34 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1697542554; cv=none; b=I78aPxsU5DhzDXdhSBU48U6WOV9AfZAZLBM2ZXfULMfTc6m3SLvWj3XxMoZedUVqgM26ElzOt/QwSKjlqtI73fC/2JaY7dizvmvq2sxMwOflNTE8JiI2twP5szt4SGAUHUBQKpf3cKRTLhJLJaA5rrg6g9v+nM1zX/5CnBbO1TY= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1697542554; c=relaxed/simple; bh=XdYWvrG+53tfCuTOFCqnBDL4dDTWsnWd2rxzjYHIMow=; h=From:To:Subject:Date:Message-Id:MIME-Version; b=QI3yrPwPp1y5XaNjfU/Nd/jJXzdCYjkXYQ7LoNdU/QG6OVwo8buSqnfnFIDTjg2mH9J9Lp4qKZy2nlZyLO4PWtZ0Fq5oU4rAN92dgeEbZhy+Qp23JXODW7mQ3CoD2zjG5ZIQi0yfjHQXtgAxCmZmzLe/OkoUxkOR4CZ95PSISLE= ARC-Authentication-Results: i=1; server2.sourceware.org X-QQ-mid: bizesmtp62t1697542547te43mws0 Received: from rios-cad121.hadoop.rioslab.org ( [58.60.1.9]) by bizesmtp.qq.com (ESMTP) with id ; Tue, 17 Oct 2023 19:35:45 +0800 (CST) X-QQ-SSF: 01400000000000C0F000000A0000000 X-QQ-FEAT: fUovMdwdtmYdeYXDqoWggBIquU5t8SN+SgJSXD+b19pK+RQLYqJnEQfsfSPiQ qwFqYewdtawPi9UTBv5ip8BcXqQeK1hqg3jUSQwDHy4McrxMsInLmYYywTQCXbJpMqpmZNw rDtISx+X6KuzhWt7VqLeUg3uQ0ILs0yovQK+RBONGSrhYH/n7m3fV0Cou0t6ApoVneztA9a zeR5K/d1Qw0kcbkWJY6GYG/1uxRMBHIqyPrX5XG7Uu318EW5xTh6ukoSTLqSkLL3rPp0PlW JxS5Nl0sKRXDSBlFiIbch9w272oQHMzCGvZYzxzBPkysIuwsQ5nItYnLBtShjVDJZ2CGs5k qHA38PwpJ2Coup6xNsVvzKh1HqQszUBCm0Hxq1epnlA9+2tpAmiGEGtWtvzDl3EEZcTg5S4 WSg2DbitlqE= X-QQ-GoodBg: 2 X-BIZMAIL-ID: 16958652230946603234 From: Lehua Ding To: gcc-patches@gcc.gnu.org Cc: juzhe.zhong@rivai.ai, kito.cheng@gmail.com, rdapp.gcc@gmail.com, palmer@rivosinc.com, jeffreyalaw@gmail.com, lehua.ding@rivai.ai Subject: [PATCH V2 11/14] RISC-V: P11: Adjust vector_block_info to vsetvl_block_info class Date: Tue, 17 Oct 2023 19:34:57 +0800 Message-Id: <20231017113500.1160997-12-lehua.ding@rivai.ai> X-Mailer: git-send-email 2.36.3 In-Reply-To: <20231017113500.1160997-1-lehua.ding@rivai.ai> References: <20231017113500.1160997-1-lehua.ding@rivai.ai> MIME-Version: 1.0 X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:rivai.ai:qybglogicsvrgz:qybglogicsvrgz6a-0 X-Spam-Status: No, score=-11.6 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780002987053251145 X-GMAIL-MSGID: 1780002987053251145 This sub-patch adjust vector_block_info codes and rename to vsetvl_block_info. gcc/ChangeLog: * config/riscv/riscv-vsetvl.cc (class vsetvl_block_info): New. * config/riscv/riscv-vsetvl.h (struct vector_block_info): Removed. --- gcc/config/riscv/riscv-vsetvl.cc | 55 +++++++++++++++++++++++++++++++- gcc/config/riscv/riscv-vsetvl.h | 14 -------- 2 files changed, 54 insertions(+), 15 deletions(-) -- 2.36.3 diff --git a/gcc/config/riscv/riscv-vsetvl.cc b/gcc/config/riscv/riscv-vsetvl.cc index b5ed1ea774a..d91b0272d9f 100644 --- a/gcc/config/riscv/riscv-vsetvl.cc +++ b/gcc/config/riscv/riscv-vsetvl.cc @@ -85,7 +85,6 @@ along with GCC; see the file COPYING3. If not see #include "predict.h" #include "profile-count.h" #include "gcse.h" -#include "riscv-vsetvl.h" using namespace rtl_ssa; using namespace riscv_vector; @@ -1218,6 +1217,60 @@ public: } }; +class vsetvl_block_info +{ +public: + /* The static execute probability of the demand info. */ + profile_probability probability; + + auto_vec infos; + vsetvl_info m_info; + bb_info *m_bb; + + bool full_available; + + vsetvl_block_info () : m_bb (nullptr), full_available (false) + { + infos.safe_grow_cleared (0); + m_info.set_empty (); + } + vsetvl_block_info (const vsetvl_block_info &other) + : probability (other.probability), infos (other.infos.copy ()), + m_info (other.m_info), m_bb (other.m_bb) + {} + + vsetvl_info &get_header_info () + { + gcc_assert (!empty_p ()); + return infos.is_empty () ? m_info : infos[0]; + } + vsetvl_info &get_footer_info () + { + gcc_assert (!empty_p ()); + return infos.is_empty () ? m_info : infos[infos.length () - 1]; + } + const vsetvl_info &get_header_info () const + { + gcc_assert (!empty_p ()); + return infos.is_empty () ? m_info : infos[0]; + } + const vsetvl_info &get_footer_info () const + { + gcc_assert (!empty_p ()); + return infos.is_empty () ? m_info : infos[infos.length () - 1]; + } + + bool empty_p () const { return infos.is_empty () && !has_info (); } + bool has_info () const { return !m_info.empty_p (); } + void set_info (const vsetvl_info &info) + { + gcc_assert (infos.is_empty ()); + m_info = info; + m_info.set_bb (m_bb); + } + void set_empty_info () { m_info.set_empty (); } +}; + class demand_system { private: diff --git a/gcc/config/riscv/riscv-vsetvl.h b/gcc/config/riscv/riscv-vsetvl.h index 96e36403af7..16c84e0684b 100644 --- a/gcc/config/riscv/riscv-vsetvl.h +++ b/gcc/config/riscv/riscv-vsetvl.h @@ -55,19 +55,5 @@ enum def_type CLOBBER_DEF = 1 << 4 }; -struct vector_block_info -{ - /* The local_dem vector insn_info of the block. */ - vector_insn_info local_dem; - - /* The reaching_out vector insn_info of the block. */ - vector_insn_info reaching_out; - - /* The static execute probability of the demand info. */ - profile_probability probability; - - vector_block_info () = default; -}; - } // namespace riscv_vector #endif