From patchwork Tue Jan 16 21:41:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vineet Gupta X-Patchwork-Id: 1887214 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=rivosinc-com.20230601.gappssmtp.com header.i=@rivosinc-com.20230601.gappssmtp.com header.a=rsa-sha256 header.s=20230601 header.b=QjYAdecr; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4TF2XN43bSz23ds for ; Wed, 17 Jan 2024 08:41:56 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 8D7E13857BAF for ; Tue, 16 Jan 2024 21:41:54 +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 7A61C3857C4A for ; Tue, 16 Jan 2024 21:41:29 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 7A61C3857C4A Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=rivosinc.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=rivosinc.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 7A61C3857C4A Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::42b ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1705441292; cv=none; b=jkEVPiUupjt9I4bbrEolih3t+BuXoLqtuVopNDR3BCKrxfFP0KrCersd7JASNRG1PGPFhCEGCbx8Aq3sSMnJFIvQ0RkbVXx3/MSFI6CpO8b1gqn8SIG0GxSdsAU2Cyu7rfHKMHqjaM0JNmbwuqhNtRjeKz6vcCwUsA5z8XdPXUs= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1705441292; c=relaxed/simple; bh=CkACz2hVcQQyb6GC200Z+R8EgEfe7BwYEX5Q+ktN6Uk=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=GDEy8EEyZMeiVVk80Cdn1sdOjh+dl+Yj7wIy/uUtgfjiNJMFvUY4FgXaRGHTckSTYQ6POX9HJMaJBB9qQXAbxoDnf8m/m4qcT52tW0YKvlPnkUJU79iiyRDLPcAhHJpY7hyudm2MFElv5cF1PV590rk0BjlivCn9BZT6YbvrW+w= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-pf1-x42b.google.com with SMTP id d2e1a72fcca58-6d9f94b9186so8620358b3a.0 for ; Tue, 16 Jan 2024 13:41:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1705441288; x=1706046088; 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=/KHGCI3KAcdjI/hhQbuv5BwcNuneGTJ9pJQvlFufXR4=; b=QjYAdecr7345ocE7EgJk52+7OQbPdOYfdP6/TdxcNJXi+iN/j6EIW0Yf644lcBBd9R BNTuY/IMub/a2q3ni2rJCSuLWvtQNpf7rGzwihYZ6UaXXm5oLzKGXmiiFq2yBmpZ4eG2 TtRjhzBSeg4vI2vGKhUxMDL8P2xQsK+GLQlt3QaCckNTWAh9jCjaLkk2Tj0rvsz7j5hJ TVajRXOpHB6S6WKJSUKhXXWD2smMaVOOOQLnfHt+IhVUCmCaKAbEWOQVJLo2LXHLgHUr 2Y0PFErHk8FwMYFJPCLHdrk5xIwx6FL4Px3nbW3/vglvw/6vFsrnP1gj348RutFYuHhU ZdWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705441288; x=1706046088; 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=/KHGCI3KAcdjI/hhQbuv5BwcNuneGTJ9pJQvlFufXR4=; b=uxERWFDvvUl6GxgRg7RO8aoGN65CjWyX67mMtyE+7CjB5x/PtpftTi0EoQYpT/+d8F TkQZM0X2sda9tDBXlbrAn9Ts7DEiUifrog5DGpPFAufwo+gmYp0mDhLKrO2iRC8bMPxb nS0ImzPS/3c61mRr2k7MZnFLE7XmvrqagTYwM4OAakuU9MxQdPzfBv9NNkBVLUCcgjQL Gc3vgRfM0uW2P0omvxhmx/Rf2b+6pNKMQJmKDmlTv7fey+S/8nyrWMDbITbt68VyB8NA IF0CSE0AaVLmIm7uC+9xwqVWCptgRbXS5a8XeZXAkvJ8HI6pABPyQHk6EAOl8mr0ko9V EfDw== X-Gm-Message-State: AOJu0Yzedf3TKH+NPlmIZtD8Krwiw1dl4gVCoeT+NKkCIYwIIjxhv3sd H/lei3J29dVy7waMHyO+Wiq8qACDCMcxxgSDa6DEdKKQxFQ= X-Google-Smtp-Source: AGHT+IGwXQL8b5gJgpJUdRF6VZI/GkQqh6w/0FFdOdMLEosRSHl2NLAGXiLKWWITmlZJVSHdCRSFLA== X-Received: by 2002:a05:6a20:3d95:b0:19a:29c4:aa75 with SMTP id s21-20020a056a203d9500b0019a29c4aa75mr8711154pzi.91.1705441288236; Tue, 16 Jan 2024 13:41:28 -0800 (PST) Received: from vineet-framework.hq.rivosinc.com ([12.44.203.122]) by smtp.gmail.com with ESMTPSA id d8-20020a62f808000000b006d9ce7d3258sm47183pfh.204.2024.01.16.13.41.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Jan 2024 13:41:28 -0800 (PST) From: Vineet Gupta To: gcc-patches@gcc.gnu.org, Robin Dapp , "juzhe . zhong @ rivai . ai" Cc: Jeff Law , kito.cheng@gmail.com, gnu-toolchain@rivosinc.com, Vineet Gupta Subject: [PATCH] RISC-V: fix some vsetvl debug info in pass's Phase 2 code [NFC] Date: Tue, 16 Jan 2024 13:41:23 -0800 Message-Id: <20240116214123.22958-1-vineetg@rivosinc.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Spam-Status: No, score=-11.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org When staring at VSETVL pass for PR/113429, spotted some minor improvements. 1. For readablity, remove some redundant condition check in Phase 2 function earliest_fuse_vsetvl_info (). 2. Add iteration count in debug prints in same function. gcc/ChangeLog: * config/riscv/riscv-vsetvl.cc (earliest_fuse_vsetvl_info): Remove redundant checks in else condition for readablity. (earliest_fuse_vsetvl_info) Print iteration count in debug prints. (earliest_fuse_vsetvl_info) Fix misleading vsetvl info dump details in certain cases. Signed-off-by: Vineet Gupta Signed-off-by: Vineet Gupta --- gcc/config/riscv/riscv-vsetvl.cc | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/gcc/config/riscv/riscv-vsetvl.cc b/gcc/config/riscv/riscv-vsetvl.cc index 78a2f7b38faf..41d4b80648f6 100644 --- a/gcc/config/riscv/riscv-vsetvl.cc +++ b/gcc/config/riscv/riscv-vsetvl.cc @@ -2343,7 +2343,7 @@ public: void compute_lcm_local_properties (); void fuse_local_vsetvl_info (); - bool earliest_fuse_vsetvl_info (); + bool earliest_fuse_vsetvl_info (int iter); void pre_global_vsetvl_info (); void emit_vsetvl (); void cleaup (); @@ -2961,7 +2961,7 @@ pre_vsetvl::fuse_local_vsetvl_info () bool -pre_vsetvl::earliest_fuse_vsetvl_info () +pre_vsetvl::earliest_fuse_vsetvl_info (int iter) { compute_avl_def_data (); compute_vsetvl_def_data (); @@ -2984,7 +2984,8 @@ pre_vsetvl::earliest_fuse_vsetvl_info () if (dump_file && (dump_flags & TDF_DETAILS)) { - fprintf (dump_file, "\n Compute LCM earliest insert data:\n\n"); + fprintf (dump_file, "\n Compute LCM earliest insert data (lift %d):\n\n", + iter); fprintf (dump_file, " Expression List (%u):\n", num_exprs); for (unsigned i = 0; i < num_exprs; i++) { @@ -3032,7 +3033,7 @@ pre_vsetvl::earliest_fuse_vsetvl_info () if (dump_file && (dump_flags & TDF_DETAILS)) { - fprintf (dump_file, " Fused global info result:\n"); + fprintf (dump_file, " Fused global info result (lift %d):\n", iter); } bool changed = false; @@ -3142,8 +3143,7 @@ pre_vsetvl::earliest_fuse_vsetvl_info () if (src_block_info.has_info ()) src_block_info.probability += dest_block_info.probability; } - else if (src_block_info.has_info () - && !m_dem.compatible_p (prev_info, curr_info)) + else { /* Cancel lift up if probabilities are equal. */ if (successors_probability_equal_p (eg->src)) @@ -3151,11 +3151,11 @@ pre_vsetvl::earliest_fuse_vsetvl_info () if (dump_file && (dump_flags & TDF_DETAILS)) { fprintf (dump_file, - " Change empty bb %u to from:", + " Reset bb %u:", eg->src->index); prev_info.dump (dump_file, " "); fprintf (dump_file, - " to (higher probability):"); + " due to (same probability):"); curr_info.dump (dump_file, " "); } src_block_info.set_empty_info (); @@ -3170,7 +3170,7 @@ pre_vsetvl::earliest_fuse_vsetvl_info () if (dump_file && (dump_flags & TDF_DETAILS)) { fprintf (dump_file, - " Change empty bb %u to from:", + " Change bb %u from:", eg->src->index); prev_info.dump (dump_file, " "); fprintf (dump_file, @@ -3627,7 +3627,7 @@ pass_vsetvl::lazy_vsetvl () { if (dump_file) fprintf (dump_file, " Try lift up %d.\n\n", fused_count); - changed = pre.earliest_fuse_vsetvl_info (); + changed = pre.earliest_fuse_vsetvl_info (fused_count); fused_count += 1; } while (changed);