{
gimple *stmt = gsi_stmt (si);
if (!gimple_clobber_p (stmt)
- && !vect_analyze_stmt (stmt, &need_to_vectorize, NULL, NULL,
- &cost_vec))
+ && !vect_analyze_stmt (loop_vinfo->lookup_stmt (stmt),
+ &need_to_vectorize,
+ NULL, NULL, &cost_vec))
return false;
}
} /* bbs */
tree first_vect = PHI_RESULT (new_phis[0]);
gassign *new_vec_stmt = NULL;
vec_dest = vect_create_destination_var (scalar_dest, vectype);
- gimple *next_phi = new_phis[0];
+ stmt_vec_info next_phi_info = loop_vinfo->lookup_stmt (new_phis[0]);
for (int k = 1; k < ncopies; ++k)
{
- next_phi = STMT_VINFO_RELATED_STMT (vinfo_for_stmt (next_phi));
- tree second_vect = PHI_RESULT (next_phi);
+ next_phi_info = STMT_VINFO_RELATED_STMT (next_phi_info);
+ tree second_vect = PHI_RESULT (next_phi_info->stmt);
tree tem = make_ssa_name (vec_dest, new_vec_stmt);
new_vec_stmt = gimple_build_assign (tem, code,
first_vect, second_vect);
else
ratio = 1;
+ stmt_vec_info epilog_stmt_info = NULL;
for (k = 0; k < group_size; k++)
{
if (k % ratio == 0)
{
- epilog_stmt = new_phis[k / ratio];
+ epilog_stmt_info = loop_vinfo->lookup_stmt (new_phis[k / ratio]);
reduction_phi_info = reduction_phis[k / ratio];
if (double_reduc)
inner_phi = inner_phis[k / ratio];
if (double_reduc)
STMT_VINFO_VEC_STMT (exit_phi_vinfo) = inner_phi;
else
- STMT_VINFO_VEC_STMT (exit_phi_vinfo)
- = vinfo_for_stmt (epilog_stmt);
+ STMT_VINFO_VEC_STMT (exit_phi_vinfo) = epilog_stmt_info;
if (!double_reduc
|| STMT_VINFO_DEF_TYPE (exit_phi_vinfo)
!= vect_double_reduction_def)
optab optab;
tree new_temp = NULL_TREE;
enum vect_def_type dt, cond_reduc_dt = vect_unknown_def_type;
- gimple *cond_reduc_def_stmt = NULL;
+ stmt_vec_info cond_stmt_vinfo = NULL;
enum tree_code cond_reduc_op_code = ERROR_MARK;
tree scalar_type;
bool is_simple_use;
&& is_nonwrapping_integer_induction (def_stmt_info, loop))
{
cond_reduc_dt = dt;
- cond_reduc_def_stmt = def_stmt_info;
+ cond_stmt_vinfo = def_stmt_info;
}
}
}
}
else if (cond_reduc_dt == vect_induction_def)
{
- stmt_vec_info cond_stmt_vinfo = vinfo_for_stmt (cond_reduc_def_stmt);
tree base
= STMT_VINFO_LOOP_PHI_EVOLUTION_BASE_UNCHANGED (cond_stmt_vinfo);
tree step = STMT_VINFO_LOOP_PHI_EVOLUTION_PART (cond_stmt_vinfo);
int
vect_get_place_in_interleaving_chain (gimple *stmt, gimple *first_stmt)
{
- gimple *next_stmt = first_stmt;
+ stmt_vec_info stmt_info = vinfo_for_stmt (stmt);
+ stmt_vec_info first_stmt_info = vinfo_for_stmt (first_stmt);
+ stmt_vec_info next_stmt_info = first_stmt_info;
int result = 0;
- if (first_stmt != DR_GROUP_FIRST_ELEMENT (vinfo_for_stmt (stmt)))
+ if (first_stmt_info != DR_GROUP_FIRST_ELEMENT (stmt_info))
return -1;
do
{
- if (next_stmt == stmt)
+ if (next_stmt_info == stmt_info)
return result;
- next_stmt = DR_GROUP_NEXT_ELEMENT (vinfo_for_stmt (next_stmt));
- if (next_stmt)
- result += DR_GROUP_GAP (vinfo_for_stmt (next_stmt));
+ next_stmt_info = DR_GROUP_NEXT_ELEMENT (next_stmt_info);
+ if (next_stmt_info)
+ result += DR_GROUP_GAP (next_stmt_info);
}
- while (next_stmt);
+ while (next_stmt_info);
return -1;
}
vect_get_slp_defs (vec<tree> ops, slp_tree slp_node,
vec<vec<tree> > *vec_oprnds)
{
- gimple *first_stmt;
int number_of_vects = 0, i;
unsigned int child_index = 0;
HOST_WIDE_INT lhs_size_unit, rhs_size_unit;
tree oprnd;
bool vectorized_defs;
- first_stmt = SLP_TREE_SCALAR_STMTS (slp_node)[0];
+ stmt_vec_info first_stmt_info = SLP_TREE_SCALAR_STMTS (slp_node)[0];
FOR_EACH_VEC_ELT (ops, i, oprnd)
{
/* For each operand we check if it has vectorized definitions in a child
vect_schedule_slp_instance (), fix it by replacing LHS with
RHS, if necessary. See vect_get_smallest_scalar_type () for
details. */
- vect_get_smallest_scalar_type (first_stmt, &lhs_size_unit,
- &rhs_size_unit);
+ vect_get_smallest_scalar_type (first_stmt_info, &lhs_size_unit,
+ &rhs_size_unit);
if (rhs_size_unit != lhs_size_unit)
{
number_of_vects *= rhs_size_unit;
unsigned int i;
stmt_vec_info stmt_vinfo;
basic_block bb;
- gimple *phi;
bool live_p;
enum vect_relevant relevant;
bb = bbs[i];
for (si = gsi_start_phis (bb); !gsi_end_p (si); gsi_next (&si))
{
- phi = gsi_stmt (si);
+ stmt_vec_info phi_info = loop_vinfo->lookup_stmt (gsi_stmt (si));
if (dump_enabled_p ())
{
dump_printf_loc (MSG_NOTE, vect_location, "init: phi relevant? ");
- dump_gimple_stmt (MSG_NOTE, TDF_SLIM, phi, 0);
+ dump_gimple_stmt (MSG_NOTE, TDF_SLIM, phi_info->stmt, 0);
}
- if (vect_stmt_relevant_p (phi, loop_vinfo, &relevant, &live_p))
- vect_mark_relevant (&worklist, phi, relevant, live_p);
+ if (vect_stmt_relevant_p (phi_info, loop_vinfo, &relevant, &live_p))
+ vect_mark_relevant (&worklist, phi_info, relevant, live_p);
}
for (si = gsi_start_bb (bb); !gsi_end_p (si); gsi_next (&si))
{
- stmt = gsi_stmt (si);
+ stmt_vec_info stmt_info = loop_vinfo->lookup_stmt (gsi_stmt (si));
if (dump_enabled_p ())
{
dump_printf_loc (MSG_NOTE, vect_location, "init: stmt relevant? ");
- dump_gimple_stmt (MSG_NOTE, TDF_SLIM, stmt, 0);
+ dump_gimple_stmt (MSG_NOTE, TDF_SLIM, stmt_info->stmt, 0);
}
- if (vect_stmt_relevant_p (stmt, loop_vinfo, &relevant, &live_p))
- vect_mark_relevant (&worklist, stmt, relevant, live_p);
+ if (vect_stmt_relevant_p (stmt_info, loop_vinfo, &relevant, &live_p))
+ vect_mark_relevant (&worklist, stmt_info, relevant, live_p);
}
}
static void
vect_init_vector_1 (gimple *stmt, gimple *new_stmt, gimple_stmt_iterator *gsi)
{
+ stmt_vec_info stmt_vinfo = vinfo_for_stmt (stmt);
if (gsi)
- vect_finish_stmt_generation (stmt, new_stmt, gsi);
+ vect_finish_stmt_generation (stmt_vinfo, new_stmt, gsi);
else
{
- stmt_vec_info stmt_vinfo = vinfo_for_stmt (stmt);
loop_vec_info loop_vinfo = STMT_VINFO_LOOP_VINFO (stmt_vinfo);
if (loop_vinfo)
tree
vect_init_vector (gimple *stmt, tree val, tree type, gimple_stmt_iterator *gsi)
{
+ stmt_vec_info stmt_info = vinfo_for_stmt (stmt);
gimple *init_stmt;
tree new_temp;
new_temp = make_ssa_name (TREE_TYPE (type));
init_stmt = gimple_build_assign (new_temp, COND_EXPR,
val, true_val, false_val);
- vect_init_vector_1 (stmt, init_stmt, gsi);
+ vect_init_vector_1 (stmt_info, init_stmt, gsi);
val = new_temp;
}
}
val));
else
init_stmt = gimple_build_assign (new_temp, NOP_EXPR, val);
- vect_init_vector_1 (stmt, init_stmt, gsi);
+ vect_init_vector_1 (stmt_info, init_stmt, gsi);
val = new_temp;
}
}
new_temp = vect_get_new_ssa_name (type, vect_simple_var, "cst_");
init_stmt = gimple_build_assign (new_temp, val);
- vect_init_vector_1 (stmt, init_stmt, gsi);
+ vect_init_vector_1 (stmt_info, init_stmt, gsi);
return new_temp;
}
vec<tree> *vec_oprnds1,
slp_tree slp_node)
{
+ stmt_vec_info stmt_info = vinfo_for_stmt (stmt);
if (slp_node)
{
int nops = (op1 == NULL_TREE) ? 1 : 2;
tree vec_oprnd;
vec_oprnds0->create (1);
- vec_oprnd = vect_get_vec_def_for_operand (op0, stmt);
+ vec_oprnd = vect_get_vec_def_for_operand (op0, stmt_info);
vec_oprnds0->quick_push (vec_oprnd);
if (op1)
{
vec_oprnds1->create (1);
- vec_oprnd = vect_get_vec_def_for_operand (op1, stmt);
+ vec_oprnd = vect_get_vec_def_for_operand (op1, stmt_info);
vec_oprnds1->quick_push (vec_oprnd);
}
}
stmt_vec_info
vect_finish_replace_stmt (gimple *stmt, gimple *vec_stmt)
{
- gcc_assert (gimple_get_lhs (stmt) == gimple_get_lhs (vec_stmt));
+ stmt_vec_info stmt_info = vinfo_for_stmt (stmt);
+ gcc_assert (gimple_get_lhs (stmt_info->stmt) == gimple_get_lhs (vec_stmt));
- gimple_stmt_iterator gsi = gsi_for_stmt (stmt);
+ gimple_stmt_iterator gsi = gsi_for_stmt (stmt_info->stmt);
gsi_replace (&gsi, vec_stmt, false);
- return vect_finish_stmt_generation_1 (stmt, vec_stmt);
+ return vect_finish_stmt_generation_1 (stmt_info, vec_stmt);
}
/* Add VEC_STMT to the vectorized implementation of STMT and insert it
vect_finish_stmt_generation (gimple *stmt, gimple *vec_stmt,
gimple_stmt_iterator *gsi)
{
- gcc_assert (gimple_code (stmt) != GIMPLE_LABEL);
+ stmt_vec_info stmt_info = vinfo_for_stmt (stmt);
+ gcc_assert (gimple_code (stmt_info->stmt) != GIMPLE_LABEL);
if (!gsi_end_p (*gsi)
&& gimple_has_mem_ops (vec_stmt))
}
}
gsi_insert_before (gsi, vec_stmt, GSI_SAME_STMT);
- return vect_finish_stmt_generation_1 (stmt, vec_stmt);
+ return vect_finish_stmt_generation_1 (stmt_info, vec_stmt);
}
/* We want to vectorize a call to combined function CFN with function
void
vect_remove_stores (gimple *first_stmt)
{
- gimple *next = first_stmt;
+ stmt_vec_info next_stmt_info = vinfo_for_stmt (first_stmt);
gimple_stmt_iterator next_si;
- while (next)
+ while (next_stmt_info)
{
- stmt_vec_info stmt_info = vinfo_for_stmt (next);
-
- stmt_vec_info tmp = DR_GROUP_NEXT_ELEMENT (stmt_info);
- if (is_pattern_stmt_p (stmt_info))
- next = STMT_VINFO_RELATED_STMT (stmt_info);
+ stmt_vec_info tmp = DR_GROUP_NEXT_ELEMENT (next_stmt_info);
+ if (is_pattern_stmt_p (next_stmt_info))
+ next_stmt_info = STMT_VINFO_RELATED_STMT (next_stmt_info);
/* Free the attached stmt_vec_info and remove the stmt. */
- next_si = gsi_for_stmt (next);
- unlink_stmt_vdef (next);
+ next_si = gsi_for_stmt (next_stmt_info->stmt);
+ unlink_stmt_vdef (next_stmt_info->stmt);
gsi_remove (&next_si, true);
- release_defs (next);
- free_stmt_vec_info (next);
- next = tmp;
+ release_defs (next_stmt_info->stmt);
+ free_stmt_vec_info (next_stmt_info);
+ next_stmt_info = tmp;
}
}