aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2023-08-07 13:53:59 +0200
committerRichard Biener <rguenther@suse.de>2023-08-07 15:16:47 +0200
commitaa63c20420db78ca77ec243af02c7591b88d3b89 (patch)
tree27b965a93d70203ee49a6b76b2f174a5e5f51038
parent831017d5e72173f2c58e5475b7fcd35ee07a601f (diff)
downloadgcc-aa63c20420db78ca77ec243af02c7591b88d3b89.zip
gcc-aa63c20420db78ca77ec243af02c7591b88d3b89.tar.gz
gcc-aa63c20420db78ca77ec243af02c7591b88d3b89.tar.bz2
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.
-rw-r--r--gcc/tree-vect-slp.cc8
1 files changed, 8 insertions, 0 deletions
diff --git a/gcc/tree-vect-slp.cc b/gcc/tree-vect-slp.cc
index a1b1530..eab3dcd 100644
--- a/gcc/tree-vect-slp.cc
+++ b/gcc/tree-vect-slp.cc
@@ -7496,6 +7496,7 @@ vect_slp_region (vec<basic_block> bbs, vec<data_reference_p> 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<basic_block> bbs, vec<data_reference_p> 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<basic_block> bbs, vec<data_reference_p> 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<basic_block> bbs, vec<data_reference_p> datarefs,
"basic block part vectorized using "
"variable length vectors\n");
}
+
+ vect_location = saved_vect_location;
}
}
else