aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-vect-slp.c
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2019-11-20 11:12:48 +0000
committerRichard Biener <rguenther@suse.de>2019-11-20 11:12:48 +0000
commit208ba1734b7a6c7303af8610a753f0b7ea3e124c (patch)
tree73cd2fd6139aabf3e03d6fd904fdfbccabfd77cf /gcc/tree-vect-slp.c
parent4d54166dac83343b17a97cbdd4a3afc1ab263aee (diff)
2019-11-20 Richard Biener <rguenther@suse.de>
* tree-vect-slp.c (vect_analyze_slp_instance): Dump constructors we are actually analyzing. (vect_slp_check_for_constructors): Do not vectorize uniform constuctors, do not dump here. * gcc.dg/vect/bb-slp-42.c: Adjust. * gcc.dg/vect/bb-slp-40.c: Likewise. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@278495 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-vect-slp.c')
-rw-r--r--gcc/tree-vect-slp.c39
1 files changed, 17 insertions, 22 deletions
diff --git a/gcc/tree-vect-slp.c b/gcc/tree-vect-slp.c
index 75d788051c1..36ea0b1dffb 100644
--- a/gcc/tree-vect-slp.c
+++ b/gcc/tree-vect-slp.c
@@ -2183,6 +2183,10 @@ vect_analyze_slp_instance (vec_info *vinfo,
else
return false;
}
+ if (dump_enabled_p ())
+ dump_printf_loc (MSG_NOTE, vect_location,
+ "Analyzing vectorizable constructor: %G\n",
+ stmt_info->stmt);
}
else
{
@@ -3116,31 +3120,22 @@ vect_slp_check_for_constructors (bb_vec_info bb_vinfo)
gimple_stmt_iterator gsi;
for (gsi = bb_vinfo->region_begin;
- gsi_stmt (gsi) != gsi_stmt (bb_vinfo->region_end); gsi_next (&gsi))
+ gsi_stmt (gsi) != gsi_stmt (bb_vinfo->region_end); gsi_next (&gsi))
{
- gimple *stmt = gsi_stmt (gsi);
-
- if (is_gimple_assign (stmt)
- && gimple_assign_rhs_code (stmt) == CONSTRUCTOR
- && TREE_CODE (gimple_assign_lhs (stmt)) == SSA_NAME
- && TREE_CODE (TREE_TYPE (gimple_assign_lhs (stmt))) == VECTOR_TYPE)
- {
- tree rhs = gimple_assign_rhs1 (stmt);
-
- if (CONSTRUCTOR_NELTS (rhs) == 0)
- continue;
-
- poly_uint64 subparts = TYPE_VECTOR_SUBPARTS (TREE_TYPE (rhs));
+ gassign *stmt = dyn_cast <gassign *> (gsi_stmt (gsi));
+ if (!stmt || gimple_assign_rhs_code (stmt) != CONSTRUCTOR)
+ continue;
- if (maybe_ne (subparts, CONSTRUCTOR_NELTS (rhs)))
- continue;
+ tree rhs = gimple_assign_rhs1 (stmt);
+ if (!VECTOR_TYPE_P (TREE_TYPE (rhs))
+ || maybe_ne (TYPE_VECTOR_SUBPARTS (TREE_TYPE (rhs)),
+ CONSTRUCTOR_NELTS (rhs))
+ || VECTOR_TYPE_P (TREE_TYPE (CONSTRUCTOR_ELT (rhs, 0)->value))
+ || uniform_vector_p (rhs))
+ continue;
- if (dump_enabled_p ())
- dump_printf_loc (MSG_NOTE, vect_location,
- "Found vectorizable constructor: %G\n", stmt);
- stmt_vec_info stmt_info = bb_vinfo->lookup_stmt (stmt);
- BB_VINFO_GROUPED_STORES (bb_vinfo).safe_push (stmt_info);
- }
+ stmt_vec_info stmt_info = bb_vinfo->lookup_stmt (stmt);
+ BB_VINFO_GROUPED_STORES (bb_vinfo).safe_push (stmt_info);
}
}