From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1666) id CEA353858D28; Mon, 7 Aug 2023 13:18:04 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CEA353858D28 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1691414284; bh=Gywy2L24DTLaKCiFxTuiii6qeCTk71EkJ+RmMw9a8a4=; h=From:To:Subject:Date:From; b=oJJbV9gJ+gGRQHXla7hcTfKfqi8ykGxJ/n60b602PAaoqhdaVffTVLlagDX11478z aKrtGGUWXAN+cAh6g/AeHeWyqSy7UWLuT+G92ipktzvJfBiqCAevIdlel6+epcruAl M+XRrVNr6t7cqvCBC/HYxjQvPSNhDn+cvd7vUHzE= MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Richard Biener To: gcc-cvs@gcc.gnu.org Subject: [gcc r14-3033] Improve -fopt-info-vec for basic-block vectorization X-Act-Checkin: gcc X-Git-Author: Richard Biener X-Git-Refname: refs/heads/master X-Git-Oldrev: 831017d5e72173f2c58e5475b7fcd35ee07a601f X-Git-Newrev: aa63c20420db78ca77ec243af02c7591b88d3b89 Message-Id: <20230807131804.CEA353858D28@sourceware.org> Date: Mon, 7 Aug 2023 13:18:04 +0000 (GMT) List-Id: https://gcc.gnu.org/g:aa63c20420db78ca77ec243af02c7591b88d3b89 commit r14-3033-gaa63c20420db78ca77ec243af02c7591b88d3b89 Author: Richard Biener Date: Mon Aug 7 13:53:59 2023 +0200 Improve -fopt-info-vec for basic-block vectorization We currently dump notes like flow_lam.f:65:72: optimized: basic block part vectorized using 32 byte vectors flow_lam.f:65:72: optimized: basic block part vectorized using 32 byte vectors flow_lam.f:65:72: optimized: basic block part vectorized using 32 byte vectors flow_lam.f:65:72: optimized: basic block part vectorized using 32 byte vectors .. repeating the same location for multiple instances because we clobber vect_location during BB vectorization. The following avoids this, improving things to flow_lam.f:15:72: optimized: basic block part vectorized using 32 byte vectors flow_lam.f:16:72: optimized: basic block part vectorized using 32 byte vectors flow_lam.f:17:72: optimized: basic block part vectorized using 32 byte vectors flow_lam.f:18:72: optimized: basic block part vectorized using 32 byte vectors ... * tree-vect-slp.cc (vect_slp_region): Save/restore vect_location around dumping code. Diff: --- gcc/tree-vect-slp.cc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/gcc/tree-vect-slp.cc b/gcc/tree-vect-slp.cc index a1b153035e1..eab3dcd40ec 100644 --- a/gcc/tree-vect-slp.cc +++ b/gcc/tree-vect-slp.cc @@ -7496,6 +7496,7 @@ vect_slp_region (vec bbs, vec datarefs, if (instance->subgraph_entries.is_empty ()) continue; + dump_user_location_t saved_vect_location = vect_location; vect_location = instance->location (); if (!unlimited_cost_model (NULL) && !vect_bb_vectorization_profitable_p @@ -7505,9 +7506,11 @@ vect_slp_region (vec bbs, vec datarefs, dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location, "not vectorized: vectorization is not " "profitable.\n"); + vect_location = saved_vect_location; continue; } + vect_location = saved_vect_location; if (!dbg_cnt (vect_slp)) continue; @@ -7557,6 +7560,9 @@ vect_slp_region (vec bbs, vec datarefs, "using SLP\n"); vectorized = true; + dump_user_location_t saved_vect_location = vect_location; + vect_location = instance->location (); + vect_schedule_slp (bb_vinfo, instance->subgraph_entries); unsigned HOST_WIDE_INT bytes; @@ -7572,6 +7578,8 @@ vect_slp_region (vec bbs, vec datarefs, "basic block part vectorized using " "variable length vectors\n"); } + + vect_location = saved_vect_location; } } else