]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
tree-optimization/115597 - allow CSE of two-operator VEC_PERM nodes
authorRichard Biener <rguenther@suse.de>
Sun, 23 Jun 2024 09:26:39 +0000 (11:26 +0200)
committerRichard Biener <rguenther@suse.de>
Sun, 23 Jun 2024 12:18:24 +0000 (14:18 +0200)
The following makes sure to always CSE when there's SLP_TREE_SCALAR_STMTS
as otherwise a chain of two-operator node operations can result in
exponential behavior of the CSE process as likely seen when building
510.parest on aarch64.

PR tree-optimization/115597
* tree-vect-slp.cc (vect_cse_slp_nodes): Allow to CSE
VEC_PERM nodes.

gcc/tree-vect-slp.cc

index 4935cf9e521072fd528b0c238376f3c6e1cce645..e84aeabef942b57c6de3dba255d31b6b19d06fe4 100644 (file)
@@ -6080,7 +6080,6 @@ static void
 vect_cse_slp_nodes (scalar_stmts_to_slp_tree_map_t *bst_map, slp_tree& node)
 {
   if (SLP_TREE_DEF_TYPE (node) == vect_internal_def
-      && SLP_TREE_CODE (node) != VEC_PERM_EXPR
       /* Besides some VEC_PERM_EXPR, two-operator nodes also
         lack scalar stmts and thus CSE doesn't work via bst_map.  Ideally
         we'd have sth that works for all internal and external nodes.  */