Commit b1af7da6 by Richard Biener Committed by Richard Biener

tree-vect-stmts.c (vectorizable_load): Initialize slp_perm earlier and remove ??? comment.

2015-05-27  Richard Biener  <rguenther@suse.de>

	* tree-vect-stmts.c (vectorizable_load): Initialize slp_perm
	earlier and remove ??? comment.
	(vect_analyze_stmt): If we are analyzing a pure SLP stmt
	and got called from loop analysis bail out.  Always pass the SLP
	node to the vectorizable_* functions.
	* tree-vect-loop.c (vect_analyze_loop_operations): Remove
	the premature SLP check here.
	* tree-vect-slp.c (vect_detect_hybrid_slp_stmts): Dump hybrid
	detected SLP stmts.
	(vect_detect_hybrid_slp_1): Likewise.

From-SVN: r223743
parent d4cecb13
2015-05-27 Richard Biener <rguenther@suse.de>
* tree-vect-stmts.c (vectorizable_load): Initialize slp_perm
earlier and remove ??? comment.
(vect_analyze_stmt): If we are analyzing a pure SLP stmt
and got called from loop analysis bail out. Always pass the SLP
node to the vectorizable_* functions.
* tree-vect-loop.c (vect_analyze_loop_operations): Remove
the premature SLP check here.
* tree-vect-slp.c (vect_detect_hybrid_slp_stmts): Dump hybrid
detected SLP stmts.
(vect_detect_hybrid_slp_1): Likewise.
2015-05-26 Jeff Law <law@redhat.com> 2015-05-26 Jeff Law <law@redhat.com>
* combine.c (find_split_point): Verify that the shift count is a * combine.c (find_split_point): Verify that the shift count is a
......
...@@ -1556,11 +1556,6 @@ vect_analyze_loop_operations (loop_vec_info loop_vinfo) ...@@ -1556,11 +1556,6 @@ vect_analyze_loop_operations (loop_vec_info loop_vinfo)
gsi_next (&si)) gsi_next (&si))
{ {
gimple stmt = gsi_stmt (si); gimple stmt = gsi_stmt (si);
if (STMT_SLP_TYPE (vinfo_for_stmt (stmt)))
{
need_to_vectorize = true;
continue;
}
if (!gimple_clobber_p (stmt) if (!gimple_clobber_p (stmt)
&& !vect_analyze_stmt (stmt, &need_to_vectorize, NULL)) && !vect_analyze_stmt (stmt, &need_to_vectorize, NULL))
return false; return false;
......
...@@ -2027,7 +2027,14 @@ vect_detect_hybrid_slp_stmts (slp_tree node, unsigned i, slp_vect_type stype) ...@@ -2027,7 +2027,14 @@ vect_detect_hybrid_slp_stmts (slp_tree node, unsigned i, slp_vect_type stype)
} }
if (stype == hybrid) if (stype == hybrid)
STMT_SLP_TYPE (stmt_vinfo) = hybrid; {
if (dump_enabled_p ())
{
dump_printf_loc (MSG_NOTE, vect_location, "marking hybrid: ");
dump_gimple_stmt (MSG_NOTE, TDF_SLIM, stmt, 0);
}
STMT_SLP_TYPE (stmt_vinfo) = hybrid;
}
FOR_EACH_VEC_ELT (SLP_TREE_CHILDREN (node), j, child) FOR_EACH_VEC_ELT (SLP_TREE_CHILDREN (node), j, child)
if (child) if (child)
...@@ -2051,7 +2058,14 @@ vect_detect_hybrid_slp_1 (tree *tp, int *, void *data) ...@@ -2051,7 +2058,14 @@ vect_detect_hybrid_slp_1 (tree *tp, int *, void *data)
gimple def_stmt = SSA_NAME_DEF_STMT (*tp); gimple def_stmt = SSA_NAME_DEF_STMT (*tp);
if (flow_bb_inside_loop_p (loopp, gimple_bb (def_stmt)) if (flow_bb_inside_loop_p (loopp, gimple_bb (def_stmt))
&& PURE_SLP_STMT (vinfo_for_stmt (def_stmt))) && PURE_SLP_STMT (vinfo_for_stmt (def_stmt)))
STMT_SLP_TYPE (vinfo_for_stmt (def_stmt)) = hybrid; {
if (dump_enabled_p ())
{
dump_printf_loc (MSG_NOTE, vect_location, "marking hybrid: ");
dump_gimple_stmt (MSG_NOTE, TDF_SLIM, def_stmt, 0);
}
STMT_SLP_TYPE (vinfo_for_stmt (def_stmt)) = hybrid;
}
} }
return NULL_TREE; return NULL_TREE;
......
...@@ -5940,6 +5940,9 @@ vectorizable_load (gimple stmt, gimple_stmt_iterator *gsi, gimple *vec_stmt, ...@@ -5940,6 +5940,9 @@ vectorizable_load (gimple stmt, gimple_stmt_iterator *gsi, gimple *vec_stmt,
return false; return false;
} }
if (slp && SLP_TREE_LOAD_PERMUTATION (slp_node).exists ())
slp_perm = true;
group_size = GROUP_SIZE (vinfo_for_stmt (first_stmt)); group_size = GROUP_SIZE (vinfo_for_stmt (first_stmt));
if (!slp if (!slp
&& !PURE_SLP_STMT (stmt_info) && !PURE_SLP_STMT (stmt_info)
...@@ -6004,10 +6007,7 @@ vectorizable_load (gimple stmt, gimple_stmt_iterator *gsi, gimple *vec_stmt, ...@@ -6004,10 +6007,7 @@ vectorizable_load (gimple stmt, gimple_stmt_iterator *gsi, gimple *vec_stmt,
&& (slp || PURE_SLP_STMT (stmt_info))) && (slp || PURE_SLP_STMT (stmt_info)))
&& (group_size > nunits && (group_size > nunits
|| nunits % group_size != 0 || nunits % group_size != 0
/* ??? During analysis phase we are not called with the /* We don't support load permutations. */
slp node/instance we are in so whether we'll end up
with a permutation we don't know. Still we don't
support load permutations. */
|| slp_perm)) || slp_perm))
{ {
dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location, dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
...@@ -6402,8 +6402,6 @@ vectorizable_load (gimple stmt, gimple_stmt_iterator *gsi, gimple *vec_stmt, ...@@ -6402,8 +6402,6 @@ vectorizable_load (gimple stmt, gimple_stmt_iterator *gsi, gimple *vec_stmt,
{ {
grouped_load = false; grouped_load = false;
vec_num = SLP_TREE_NUMBER_OF_VEC_STMTS (slp_node); vec_num = SLP_TREE_NUMBER_OF_VEC_STMTS (slp_node);
if (SLP_TREE_LOAD_PERMUTATION (slp_node).exists ())
slp_perm = true;
group_gap = GROUP_GAP (vinfo_for_stmt (first_stmt)); group_gap = GROUP_GAP (vinfo_for_stmt (first_stmt));
} }
else else
...@@ -7371,33 +7369,40 @@ vect_analyze_stmt (gimple stmt, bool *need_to_vectorize, slp_tree node) ...@@ -7371,33 +7369,40 @@ vect_analyze_stmt (gimple stmt, bool *need_to_vectorize, slp_tree node)
*need_to_vectorize = true; *need_to_vectorize = true;
} }
ok = true; if (PURE_SLP_STMT (stmt_info) && !node)
if (!bb_vinfo {
&& (STMT_VINFO_RELEVANT_P (stmt_info) dump_printf_loc (MSG_NOTE, vect_location,
|| STMT_VINFO_DEF_TYPE (stmt_info) == vect_reduction_def)) "handled only by SLP analysis\n");
ok = (vectorizable_simd_clone_call (stmt, NULL, NULL, NULL) return true;
|| vectorizable_conversion (stmt, NULL, NULL, NULL) }
|| vectorizable_shift (stmt, NULL, NULL, NULL)
|| vectorizable_operation (stmt, NULL, NULL, NULL) ok = true;
|| vectorizable_assignment (stmt, NULL, NULL, NULL) if (!bb_vinfo
|| vectorizable_load (stmt, NULL, NULL, NULL, NULL) && (STMT_VINFO_RELEVANT_P (stmt_info)
|| vectorizable_call (stmt, NULL, NULL, NULL) || STMT_VINFO_DEF_TYPE (stmt_info) == vect_reduction_def))
|| vectorizable_store (stmt, NULL, NULL, NULL) ok = (vectorizable_simd_clone_call (stmt, NULL, NULL, node)
|| vectorizable_reduction (stmt, NULL, NULL, NULL) || vectorizable_conversion (stmt, NULL, NULL, node)
|| vectorizable_condition (stmt, NULL, NULL, NULL, 0, NULL)); || vectorizable_shift (stmt, NULL, NULL, node)
else || vectorizable_operation (stmt, NULL, NULL, node)
{ || vectorizable_assignment (stmt, NULL, NULL, node)
if (bb_vinfo) || vectorizable_load (stmt, NULL, NULL, node, NULL)
ok = (vectorizable_simd_clone_call (stmt, NULL, NULL, node) || vectorizable_call (stmt, NULL, NULL, node)
|| vectorizable_conversion (stmt, NULL, NULL, node) || vectorizable_store (stmt, NULL, NULL, node)
|| vectorizable_shift (stmt, NULL, NULL, node) || vectorizable_reduction (stmt, NULL, NULL, node)
|| vectorizable_operation (stmt, NULL, NULL, node) || vectorizable_condition (stmt, NULL, NULL, NULL, 0, node));
|| vectorizable_assignment (stmt, NULL, NULL, node) else
|| vectorizable_load (stmt, NULL, NULL, node, NULL) {
|| vectorizable_call (stmt, NULL, NULL, node) if (bb_vinfo)
|| vectorizable_store (stmt, NULL, NULL, node) ok = (vectorizable_simd_clone_call (stmt, NULL, NULL, node)
|| vectorizable_condition (stmt, NULL, NULL, NULL, 0, node)); || vectorizable_conversion (stmt, NULL, NULL, node)
} || vectorizable_shift (stmt, NULL, NULL, node)
|| vectorizable_operation (stmt, NULL, NULL, node)
|| vectorizable_assignment (stmt, NULL, NULL, node)
|| vectorizable_load (stmt, NULL, NULL, node, NULL)
|| vectorizable_call (stmt, NULL, NULL, node)
|| vectorizable_store (stmt, NULL, NULL, node)
|| vectorizable_condition (stmt, NULL, NULL, NULL, 0, node));
}
if (!ok) if (!ok)
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment