* [PATCH] tree-optimization/114057 - handle BB reduction remain defs as LIVE
@ 2024-03-27 11:49 Richard Biener
0 siblings, 0 replies; only message in thread
From: Richard Biener @ 2024-03-27 11:49 UTC (permalink / raw)
To: gcc-patches
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.
Bootstrapped and tested on x86_64-unknown-linux-gnu, pushed.
PR tree-optimization/114057
* tree-vect-slp.cc (vect_bb_slp_mark_live_stmts): Mark
BB reduction remain defs as scalar uses.
---
gcc/tree-vect-slp.cc | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/gcc/tree-vect-slp.cc b/gcc/tree-vect-slp.cc
index adb2d9ae1e5..2e5481acbc7 100644
--- a/gcc/tree-vect-slp.cc
+++ b/gcc/tree-vect-slp.cc
@@ -6665,8 +6665,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
{
@@ -6684,7 +6690,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 ();
--
2.35.3
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2024-03-27 11:49 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-27 11:49 [PATCH] tree-optimization/114057 - handle BB reduction remain defs as LIVE Richard Biener
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).