From patchwork Mon Sep 11 09:19:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "juzhe.zhong@rivai.ai" X-Patchwork-Id: 137883 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ab0a:0:b0:3f2:4152:657d with SMTP id m10csp1964510vqo; Mon, 11 Sep 2023 02:20:14 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE9LncwTxeCE3Lhd9FueggTY0XA7LGAVJCCDIe7InrYlvKtUHSZ1c6Wl+J9HbeRYB0LkBwP X-Received: by 2002:a17:906:9c9:b0:9a1:f668:dae9 with SMTP id r9-20020a17090609c900b009a1f668dae9mr7865053eje.33.1694424013954; Mon, 11 Sep 2023 02:20:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694424013; cv=none; d=google.com; s=arc-20160816; b=GIJMx6gaCNMzsQ5hfMeH2PiiO+OSfYXYqH1+BdRmVTbZRoZg8lGztKeE8MjtuQUaHU D4SG8VMWdUUDky/2RcDtY9Gdhd1uAoDDXLCQ59nlIOZARgIjHAJPIogSeI0gaoaIR+RT giIJja2F9a5BRuNPsw3nwp4BTlHmyRfyvAunrMsfPnirz2ALZoR0zJ1C1sL/Nahmtf7b NETobz3sS/9gP2coLS9JfHilSiFlaINIecHxduIhD57l9Mi/ZbXljX3WRdaM2QjQrMnw s3kmf5DcWEVT/Ipf1KAA9t1llNqtDXWNw3C/Lq9tVhdCdWWGaWTWmv5T4WNjSF3Bxpq4 CCdg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:feedback-id :content-transfer-encoding:mime-version:message-id:date:subject:to :from:dmarc-filter:delivered-to; bh=thF6pgJbbFzNj54RUbvkIy8oOpR464v9xpZL4uSs6Vg=; fh=arl273cIQBNH1P6XLxHQvF0scgitfd773vOV+bwQx3o=; b=Zjo5OlNwrhjTEtMZE2L677Qxbl1zxVPNQAV032IVHDf3piNkt1GfsP3YS3PebHhFU1 aZIP/wSQGRq9yis3PTZmQt23/fVkDpN1U1a2ou6Xu67So4mzhxAvwUguswPVwoRW8cE8 +ILkRGYVlkRyAXrI9dj2b424OCjKgf9zSmFkXfMfWm2x4ipgh/RSyMHXGiA5TcIZjK11 DAG6kCovvFVpwZ/jQd27/CcwKE2/s1riWIwCPTJzUlsvGC8D2dLjRoiI7s2QMOBNkcpj moQjRpMDMY9jUKVERRs26fM+gXq0slE35KA0zoetYajQLJKRK0jXxua82XVfYhOtuaUx BQxA== ARC-Authentication-Results: i=1; mx.google.com; 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" Received: from server2.sourceware.org (ip-8-43-85-97.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id cw13-20020a170906c78d00b009a1f47d1065si6327796ejb.758.2023.09.11.02.20.13 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Sep 2023 02:20:13 -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; 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" Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 0A9CD3858C33 for ; Mon, 11 Sep 2023 09:20:11 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from smtpbgsg1.qq.com (smtpbgsg1.qq.com [54.254.200.92]) by sourceware.org (Postfix) with ESMTPS id 40FF33858D3C for ; Mon, 11 Sep 2023 09:19:41 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 40FF33858D3C Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=rivai.ai Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=rivai.ai X-QQ-mid: bizesmtp86t1694423973t405dul1 Received: from rios-cad122.hadoop.rioslab.org ( [58.60.1.26]) by bizesmtp.qq.com (ESMTP) with id ; Mon, 11 Sep 2023 17:19:32 +0800 (CST) X-QQ-SSF: 01400000000000G0V000000A0000000 X-QQ-FEAT: +ynUkgUhZJlxB/4ijCosorh5guZHXRQs4r3MBPcikMAT7dtEeaPLB9ZDGw/T5 yMBOyTOhp3bMsBhToTtulNIgw9wSDR+AMn0Vi0ZV4RwojdTvbHUWsVBj+8oepJnpShM8uDM zWVIOYVeI6z+htjdVoeSpsXQLUeUvOG2SsHVMYliG49FI8MusMmujnZQI3MHxXIh3Tf6WDL 2XoF9zPT/6uEIS43ek6XU19WL2wxhh/0jITwShyDWcTFPqqASUnI01kvkjHKAHyAF1EyG8R JKyjQ/vL3Jt4qKWcXx8OLeZploM+Mjhl3pJIqjtiv1qU/kQrclwLkDB4TNpJc8nITFRtZBt NpmtilipRoW9dWqFtVWDwCozPvBJ6UJPXTYOInG6Jrpk9wLkpJn21zFDVJVqY5iy2A5a+SO UF+Zs2yDGXf/rp9/6CFxwg== X-QQ-GoodBg: 2 X-BIZMAIL-ID: 9273582578246048096 From: Juzhe-Zhong To: gcc-patches@gcc.gnu.org Subject: [PATCH] RISC-V: Remove redundant functions Date: Mon, 11 Sep 2023 17:19:30 +0800 Message-Id: <20230911091930.2592988-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=-10.3 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, RCVD_IN_BARRACUDACENTRAL, 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: , Cc: kito.cheng@sifive.com, kito.cheng@gmail.com, Juzhe-Zhong Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1776732355020713168 X-GMAIL-MSGID: 1776732355020713168 I just finished V2 version of LMUL cost model. Turns out we don't these redundant functions. Remove them. gcc/ChangeLog: * config/riscv/riscv-protos.h (get_all_predecessors): Remove. (get_all_successors): Ditto. * config/riscv/riscv-v.cc (get_all_predecessors): Ditto. (get_all_successors): Ditto. --- gcc/config/riscv/riscv-protos.h | 2 -- gcc/config/riscv/riscv-v.cc | 48 --------------------------------- 2 files changed, 50 deletions(-) diff --git a/gcc/config/riscv/riscv-protos.h b/gcc/config/riscv/riscv-protos.h index 46d77ef927c..e91a55ec057 100644 --- a/gcc/config/riscv/riscv-protos.h +++ b/gcc/config/riscv/riscv-protos.h @@ -498,8 +498,6 @@ enum floating_point_rounding_mode get_frm_mode (rtx); opt_machine_mode vectorize_related_mode (machine_mode, scalar_mode, poly_uint64); unsigned int autovectorize_vector_modes (vec *, bool); -hash_set get_all_predecessors (basic_block); -hash_set get_all_successors (basic_block); bool cmp_lmul_le_one (machine_mode); bool cmp_lmul_gt_one (machine_mode); } diff --git a/gcc/config/riscv/riscv-v.cc b/gcc/config/riscv/riscv-v.cc index 3cd1f61de0e..4d95bd773a2 100644 --- a/gcc/config/riscv/riscv-v.cc +++ b/gcc/config/riscv/riscv-v.cc @@ -3388,54 +3388,6 @@ expand_fold_extract_last (rtx *ops) emit_label (end_label); } -hash_set -get_all_predecessors (basic_block bb) -{ - hash_set blocks; - auto_vec work_list; - hash_set visited_list; - work_list.safe_push (bb); - - while (!work_list.is_empty ()) - { - basic_block new_bb = work_list.pop (); - visited_list.add (new_bb); - edge e; - edge_iterator ei; - FOR_EACH_EDGE (e, ei, new_bb->preds) - { - if (!visited_list.contains (e->src)) - work_list.safe_push (e->src); - blocks.add (e->src); - } - } - return blocks; -} - -hash_set -get_all_successors (basic_block bb) -{ - hash_set blocks; - auto_vec work_list; - hash_set visited_list; - work_list.safe_push (bb); - - while (!work_list.is_empty ()) - { - basic_block new_bb = work_list.pop (); - visited_list.add (new_bb); - edge e; - edge_iterator ei; - FOR_EACH_EDGE (e, ei, new_bb->succs) - { - if (!visited_list.contains (e->dest)) - work_list.safe_push (e->dest); - blocks.add (e->dest); - } - } - return blocks; -} - /* Return true if the LMUL of comparison less than or equal to one. */ bool cmp_lmul_le_one (machine_mode mode)