aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2024-05-17 15:23:38 +0200
committerRichard Biener <rguenther@suse.de>2024-06-21 11:42:48 +0200
commit85d32e6f75e7395c12b9979a47b70fe9479ca1ff (patch)
tree86c2580673b6a47edf1abf0ba874410b32433072
parent30fca2ce1dac57e3258cc5261242c97c256b63eb (diff)
downloadgcc-85d32e6f75e7395c12b9979a47b70fe9479ca1ff.zip
gcc-85d32e6f75e7395c12b9979a47b70fe9479ca1ff.tar.gz
gcc-85d32e6f75e7395c12b9979a47b70fe9479ca1ff.tar.bz2
Avoid SLP_REPRESENTATIVE access for VEC_PERM in SLP scheduling
SLP permute nodes can end up without a SLP_REPRESENTATIVE now, the following avoids touching it in this case in vect_schedule_slp_node. * tree-vect-slp.cc (vect_schedule_slp_node): Avoid looking at SLP_REPRESENTATIVE for VEC_PERM nodes. (cherry picked from commit 31e9bae0ea5e5413abfa3ca9050e66cc6760553e)
-rw-r--r--gcc/tree-vect-slp.cc28
1 files changed, 16 insertions, 12 deletions
diff --git a/gcc/tree-vect-slp.cc b/gcc/tree-vect-slp.cc
index 133606f..e55191c 100644
--- a/gcc/tree-vect-slp.cc
+++ b/gcc/tree-vect-slp.cc
@@ -9271,13 +9271,8 @@ vect_schedule_slp_node (vec_info *vinfo,
gcc_assert (SLP_TREE_NUMBER_OF_VEC_STMTS (node) != 0);
SLP_TREE_VEC_DEFS (node).create (SLP_TREE_NUMBER_OF_VEC_STMTS (node));
- if (dump_enabled_p ())
- dump_printf_loc (MSG_NOTE, vect_location,
- "------>vectorizing SLP node starting from: %G",
- stmt_info->stmt);
-
- if (STMT_VINFO_DATA_REF (stmt_info)
- && SLP_TREE_CODE (node) != VEC_PERM_EXPR)
+ if (SLP_TREE_CODE (node) != VEC_PERM_EXPR
+ && STMT_VINFO_DATA_REF (stmt_info))
{
/* Vectorized loads go before the first scalar load to make it
ready early, vectorized stores go before the last scalar
@@ -9289,10 +9284,10 @@ vect_schedule_slp_node (vec_info *vinfo,
last_stmt_info = vect_find_last_scalar_stmt_in_slp (node);
si = gsi_for_stmt (last_stmt_info->stmt);
}
- else if ((STMT_VINFO_TYPE (stmt_info) == cycle_phi_info_type
- || STMT_VINFO_TYPE (stmt_info) == induc_vec_info_type
- || STMT_VINFO_TYPE (stmt_info) == phi_info_type)
- && SLP_TREE_CODE (node) != VEC_PERM_EXPR)
+ else if (SLP_TREE_CODE (node) != VEC_PERM_EXPR
+ && (STMT_VINFO_TYPE (stmt_info) == cycle_phi_info_type
+ || STMT_VINFO_TYPE (stmt_info) == induc_vec_info_type
+ || STMT_VINFO_TYPE (stmt_info) == phi_info_type))
{
/* For PHI node vectorization we do not use the insertion iterator. */
si = gsi_none ();
@@ -9426,6 +9421,9 @@ vect_schedule_slp_node (vec_info *vinfo,
/* Handle purely internal nodes. */
if (SLP_TREE_CODE (node) == VEC_PERM_EXPR)
{
+ if (dump_enabled_p ())
+ dump_printf_loc (MSG_NOTE, vect_location,
+ "------>vectorizing SLP permutation node\n");
/* ??? the transform kind is stored to STMT_VINFO_TYPE which might
be shared with different SLP nodes (but usually it's the same
operation apart from the case the stmt is only there for denoting
@@ -9444,7 +9442,13 @@ vect_schedule_slp_node (vec_info *vinfo,
}
}
else
- vect_transform_stmt (vinfo, stmt_info, &si, node, instance);
+ {
+ if (dump_enabled_p ())
+ dump_printf_loc (MSG_NOTE, vect_location,
+ "------>vectorizing SLP node starting from: %G",
+ stmt_info->stmt);
+ vect_transform_stmt (vinfo, stmt_info, &si, node, instance);
+ }
}
/* Replace scalar calls from SLP node NODE with setting of their lhs to zero.