]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
tree-optimization/117343 - decide_masked_load_lanes and stale graph
authorRichard Biener <rguenther@suse.de>
Tue, 29 Oct 2024 10:26:13 +0000 (11:26 +0100)
committerRichard Biener <rguenth@gcc.gnu.org>
Tue, 29 Oct 2024 11:17:38 +0000 (12:17 +0100)
It turns out decide_masked_load_lanes accesses a stale SLP graph
so the following re-builds it instead.

PR tree-optimization/117343
* tree-vect-slp.cc (vect_optimize_slp_pass::build_vertices):
Support re-building the SLP graph.
(vect_optimize_slp_pass::run): Re-build the SLP graph before
decide_masked_load_lanes.

gcc/tree-vect-slp.cc

index 2e98a943e0615d503a10a60828dfc85a230505f2..a7f064bb0edf8b0b28020c1d30a38b046c82cdaf 100644 (file)
@@ -5632,6 +5632,8 @@ vect_optimize_slp_pass::build_vertices ()
   hash_set<slp_tree> visited;
   unsigned i;
   slp_instance instance;
+  m_vertices.truncate (0);
+  m_leafs.truncate (0);
   FOR_EACH_VEC_ELT (m_vinfo->slp_instances, i, instance)
     build_vertices (visited, SLP_INSTANCE_TREE (instance));
 }
@@ -7244,6 +7246,8 @@ vect_optimize_slp_pass::run ()
     }
   else
     remove_redundant_permutations ();
+  free_graph (m_slpg);
+  build_graph ();
   decide_masked_load_lanes ();
   free_graph (m_slpg);
 }