From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 7921) id 85A82385842F; Wed, 17 Jan 2024 18:59:20 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 85A82385842F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1705517960; bh=5yW9djBpLJh6oYhCusYVbGMNb8y410VToVPLY6VdQiQ=; h=From:To:Subject:Date:From; b=oUt20ymtbT+XRd0k2sASMhfZv2UzCdJSCVBHMGTJni3iUjQDBJZm6ulozPGtBLcCI XvTNeh1ToYsc+7/Edh1TkUgjAUT7ooX3ehNbLimK3LBaldBUNI4I+Bv48RKfZnoTJk sFmh37i3Fp4PU6FRB6N64ksmgOditmB7r8ovA+3s= MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Vineet Gupta To: gcc-cvs@gcc.gnu.org Subject: [gcc r14-8193] RISC-V: fix some vsetvl debug info in pass's Phase 2 code [NFC] X-Act-Checkin: gcc X-Git-Author: Vineet Gupta X-Git-Refname: refs/heads/master X-Git-Oldrev: 7ee7e07d0fb996d9632178f5b9790842096351ae X-Git-Newrev: 3340878009acfc69f5315386437841a277174c83 Message-Id: <20240117185920.85A82385842F@sourceware.org> Date: Wed, 17 Jan 2024 18:59:20 +0000 (GMT) List-Id: https://gcc.gnu.org/g:3340878009acfc69f5315386437841a277174c83 commit r14-8193-g3340878009acfc69f5315386437841a277174c83 Author: Vineet Gupta Date: Tue Jan 16 13:23:42 2024 -0800 RISC-V: fix some vsetvl debug info in pass's Phase 2 code [NFC] 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 Diff: --- 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 78a2f7b38fa..41d4b80648f 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);