+2020-05-06 Richard Biener <rguenther@suse.de>
+
+ * tree-vectorizer.h (vect_transform_slp_perm_load): Adjust.
+ * tree-vect-data-refs.c (vect_slp_analyze_node_dependences):
+ Remove slp_instance parameter, just iterate over all scalar stmts.
+ (vect_slp_analyze_instance_dependence): Adjust and likewise.
+ * tree-vect-slp.c (vect_bb_slp_scalar_cost): Remove unused BB
+ parameter.
+ (vect_schedule_slp): Just iterate over all scalar stmts.
+ (vect_supported_load_permutation_p): Adjust.
+ (vect_transform_slp_perm_load): Remove slp_instance parameter,
+ instead use the number of lanes in the node as group size.
+ * tree-vect-stmts.c (vect_model_load_cost): Get vectorization
+ factor instead of slp_instance as parameter.
+ (vectorizable_load): Adjust.
+
2020-05-06 Andreas Schwab <schwab@suse.de>
* config/aarch64/driver-aarch64.c: Include "aarch64-protos.h".
disambiguating the loads. */
static bool
-vect_slp_analyze_node_dependences (vec_info *vinfo,
- slp_instance instance, slp_tree node,
+vect_slp_analyze_node_dependences (vec_info *vinfo, slp_tree node,
vec<stmt_vec_info> stores,
stmt_vec_info last_store_info)
{
in NODE verifying we can sink them up to the last stmt in the
group. */
stmt_vec_info last_access_info = vect_find_last_scalar_stmt_in_slp (node);
- for (unsigned k = 0; k < SLP_INSTANCE_GROUP_SIZE (instance); ++k)
+ for (unsigned k = 0; k < SLP_TREE_SCALAR_STMTS (node).length (); ++k)
{
stmt_vec_info access_info = SLP_TREE_SCALAR_STMTS (node)[k];
if (access_info == last_access_info)
stmt_vec_info last_store_info = NULL;
if (store)
{
- if (! vect_slp_analyze_node_dependences (vinfo, instance, store,
- vNULL, NULL))
+ if (! vect_slp_analyze_node_dependences (vinfo, store, vNULL, NULL))
return false;
/* Mark stores in this instance and remember the last one. */
last_store_info = vect_find_last_scalar_stmt_in_slp (store);
- for (unsigned k = 0; k < SLP_INSTANCE_GROUP_SIZE (instance); ++k)
+ for (unsigned k = 0; k < SLP_TREE_SCALAR_STMTS (store).length (); ++k)
gimple_set_visited (SLP_TREE_SCALAR_STMTS (store)[k]->stmt, true);
}
slp_tree load;
unsigned int i;
FOR_EACH_VEC_ELT (SLP_INSTANCE_LOADS (instance), i, load)
- if (! vect_slp_analyze_node_dependences (vinfo, instance, load,
+ if (! vect_slp_analyze_node_dependences (vinfo, load,
store
? SLP_TREE_SCALAR_STMTS (store)
: vNULL, last_store_info))
/* Unset the visited flag. */
if (store)
- for (unsigned k = 0; k < SLP_INSTANCE_GROUP_SIZE (instance); ++k)
+ for (unsigned k = 0; k < SLP_TREE_SCALAR_STMTS (store).length (); ++k)
gimple_set_visited (SLP_TREE_SCALAR_STMTS (store)[k]->stmt, false);
return res;
vec<tree> tem;
unsigned n_perms;
if (!vect_transform_slp_perm_load (vinfo, node, tem, NULL,
- 1, slp_instn, true, &n_perms))
+ 1, true, &n_perms))
{
if (dump_enabled_p ())
dump_printf_loc (MSG_MISSED_OPTIMIZATION,
FOR_EACH_VEC_ELT (SLP_INSTANCE_LOADS (slp_instn), i, node)
if (node->load_permutation.exists ()
&& !vect_transform_slp_perm_load (vinfo, node, vNULL, NULL, test_vf,
- slp_instn, true, &n_perms))
+ true, &n_perms))
return false;
return true;
update LIFE according to uses of NODE. */
static void
-vect_bb_slp_scalar_cost (vec_info *vinfo, basic_block bb,
+vect_bb_slp_scalar_cost (vec_info *vinfo,
slp_tree node, vec<bool, va_heap> *life,
stmt_vector_for_cost *cost_vec,
hash_set<slp_tree> &visited)
/* Do not directly pass LIFE to the recursive call, copy it to
confine changes in the callee to the current child/subtree. */
subtree_life.safe_splice (*life);
- vect_bb_slp_scalar_cost (vinfo, bb, child, &subtree_life, cost_vec,
+ vect_bb_slp_scalar_cost (vinfo, child, &subtree_life, cost_vec,
visited);
subtree_life.truncate (0);
}
{
auto_vec<bool, 20> life;
life.safe_grow_cleared (SLP_INSTANCE_GROUP_SIZE (instance));
- vect_bb_slp_scalar_cost (bb_vinfo, BB_VINFO_BB (bb_vinfo),
+ vect_bb_slp_scalar_cost (bb_vinfo,
SLP_INSTANCE_TREE (instance),
&life, &scalar_costs, visited);
}
vect_transform_slp_perm_load (vec_info *vinfo,
slp_tree node, vec<tree> dr_chain,
gimple_stmt_iterator *gsi, poly_uint64 vf,
- slp_instance slp_node_instance, bool analyze_only,
- unsigned *n_perms)
+ bool analyze_only, unsigned *n_perms)
{
stmt_vec_info stmt_info = SLP_TREE_SCALAR_STMTS (node)[0];
int vec_index = 0;
tree vectype = STMT_VINFO_VECTYPE (stmt_info);
- unsigned int group_size = SLP_INSTANCE_GROUP_SIZE (slp_node_instance);
+ unsigned int group_size = SLP_TREE_SCALAR_STMTS (node).length ();
unsigned int mask_element;
machine_mode mode;
if (is_a <loop_vec_info> (vinfo))
vect_remove_slp_scalar_calls (vinfo, root);
- for (j = 0; SLP_TREE_SCALAR_STMTS (root).iterate (j, &store_info)
- && j < SLP_INSTANCE_GROUP_SIZE (instance); j++)
+ for (j = 0; SLP_TREE_SCALAR_STMTS (root).iterate (j, &store_info); j++)
{
if (!STMT_VINFO_DATA_REF (store_info))
break;
static void
vect_model_load_cost (vec_info *vinfo,
- stmt_vec_info stmt_info, unsigned ncopies,
+ stmt_vec_info stmt_info, unsigned ncopies, poly_uint64 vf,
vect_memory_access_type memory_access_type,
- slp_instance instance,
slp_tree slp_node,
stmt_vector_for_cost *cost_vec)
{
unsigned n_perms;
unsigned assumed_nunits
= vect_nunits_for_cost (STMT_VINFO_VECTYPE (first_stmt_info));
- unsigned slp_vf = (ncopies * assumed_nunits) / instance->group_size;
vect_transform_slp_perm_load (vinfo, slp_node, vNULL, NULL,
- slp_vf, instance, true,
- &n_perms);
+ vf, true, &n_perms);
inside_cost += record_stmt_cost (cost_vec, n_perms, vec_perm,
first_stmt_info, 0, vect_body);
/* And adjust the number of loads performed. This handles
memory_access_type, &gs_info, mask);
STMT_VINFO_TYPE (stmt_info) = load_vec_info_type;
- vect_model_load_cost (vinfo, stmt_info, ncopies, memory_access_type,
- slp_node_instance, slp_node, cost_vec);
+ vect_model_load_cost (vinfo, stmt_info, ncopies, vf, memory_access_type,
+ slp_node, cost_vec);
return true;
}
{
unsigned n_perms;
vect_transform_slp_perm_load (vinfo, slp_node, dr_chain, gsi, vf,
- slp_node_instance, false, &n_perms);
+ false, &n_perms);
}
return true;
}
{
unsigned n_perms;
if (!vect_transform_slp_perm_load (vinfo, slp_node, dr_chain, gsi, vf,
- slp_node_instance, false,
- &n_perms))
+ false, &n_perms))
{
dr_chain.release ();
return false;
extern void vect_free_slp_instance (slp_instance, bool);
extern bool vect_transform_slp_perm_load (vec_info *, slp_tree, vec<tree>,
gimple_stmt_iterator *, poly_uint64,
- slp_instance, bool, unsigned *);
+ bool, unsigned *);
extern bool vect_slp_analyze_operations (vec_info *);
extern void vect_schedule_slp (vec_info *);
extern opt_result vect_analyze_slp (vec_info *, unsigned);