aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2024-03-27 11:37:16 +0100
committerRichard Biener <rguenther@suse.de>2024-03-27 12:49:44 +0100
commit0b02da5b99e89347f5f8bf875ec8318f84adff18 (patch)
tree81a85dc03e2e1a3abb10ef3ca1e4ea20f68c082b
parentaac30f8416e992c524b86eaa40f35f30fe04b755 (diff)
downloadgcc-0b02da5b99e89347f5f8bf875ec8318f84adff18.zip
gcc-0b02da5b99e89347f5f8bf875ec8318f84adff18.tar.gz
gcc-0b02da5b99e89347f5f8bf875ec8318f84adff18.tar.bz2
tree-optimization/114057 - handle BB reduction remain defs as LIVE
The following makes sure to record the scalars we add to the BB reduction vectorization result as scalar uses for the purpose of computing live lanes. This restores vectorization in the bondfree.c TU of 435.gromacs. PR tree-optimization/114057 * tree-vect-slp.cc (vect_bb_slp_mark_live_stmts): Mark BB reduction remain defs as scalar uses.
-rw-r--r--gcc/tree-vect-slp.cc13
1 files changed, 10 insertions, 3 deletions
diff --git a/gcc/tree-vect-slp.cc b/gcc/tree-vect-slp.cc
index 23f9593..f57684c 100644
--- a/gcc/tree-vect-slp.cc
+++ b/gcc/tree-vect-slp.cc
@@ -6646,8 +6646,14 @@ vect_bb_slp_mark_live_stmts (bb_vec_info bb_vinfo)
auto_vec<slp_tree> worklist;
for (slp_instance instance : bb_vinfo->slp_instances)
- if (!visited.add (SLP_INSTANCE_TREE (instance)))
- worklist.safe_push (SLP_INSTANCE_TREE (instance));
+ {
+ if (SLP_INSTANCE_KIND (instance) == slp_inst_kind_bb_reduc)
+ for (tree op : SLP_INSTANCE_REMAIN_DEFS (instance))
+ if (TREE_CODE (op) == SSA_NAME)
+ scalar_use_map.put (op, 1);
+ if (!visited.add (SLP_INSTANCE_TREE (instance)))
+ worklist.safe_push (SLP_INSTANCE_TREE (instance));
+ }
do
{
@@ -6665,7 +6671,8 @@ vect_bb_slp_mark_live_stmts (bb_vec_info bb_vinfo)
if (child && !visited.add (child))
worklist.safe_push (child);
}
- } while (!worklist.is_empty ());
+ }
+ while (!worklist.is_empty ());
visited.empty ();