stmt_vec_info stmt_info;
unsigned int i;
FOR_EACH_VEC_ELT (stmts, i, stmt_info)
- if (is_pattern_stmt_p (stmt_info))
+ if (stmt_info && is_pattern_stmt_p (stmt_info))
return true;
return false;
}
{
inchash::hash h;
for (unsigned i = 0; i < x.length (); ++i)
- h.add_int (gimple_uid (x[i]->stmt));
+ h.add_int (x[i] ? gimple_uid (x[i]->stmt) : -1);
return h.end ();
}
inline bool
}
if (SLP_TREE_SCALAR_STMTS (node).exists ())
FOR_EACH_VEC_ELT (SLP_TREE_SCALAR_STMTS (node), i, stmt_info)
- dump_printf_loc (metadata, user_loc, "\t%sstmt %u %G",
- STMT_VINFO_LIVE_P (stmt_info) ? "[l] " : "",
- i, stmt_info->stmt);
+ if (stmt_info)
+ dump_printf_loc (metadata, user_loc, "\t%sstmt %u %G",
+ STMT_VINFO_LIVE_P (stmt_info) ? "[l] " : "",
+ i, stmt_info->stmt);
+ else
+ dump_printf_loc (metadata, user_loc, "\tstmt %u ---\n", i);
else
{
dump_printf_loc (metadata, user_loc, "\t{ ");
return;
FOR_EACH_VEC_ELT (SLP_TREE_SCALAR_STMTS (node), i, stmt_info)
- STMT_SLP_TYPE (stmt_info) = pure_slp;
+ if (stmt_info)
+ STMT_SLP_TYPE (stmt_info) = pure_slp;
FOR_EACH_VEC_ELT (SLP_TREE_CHILDREN (node), i, child)
if (child)
return;
FOR_EACH_VEC_ELT (SLP_TREE_SCALAR_STMTS (node), i, stmt_info)
- {
- gcc_assert (!STMT_VINFO_RELEVANT (stmt_info)
- || STMT_VINFO_RELEVANT (stmt_info) == vect_used_in_scope);
- STMT_VINFO_RELEVANT (stmt_info) = vect_used_in_scope;
- }
+ if (stmt_info)
+ {
+ gcc_assert (!STMT_VINFO_RELEVANT (stmt_info)
+ || STMT_VINFO_RELEVANT (stmt_info) == vect_used_in_scope);
+ STMT_VINFO_RELEVANT (stmt_info) = vect_used_in_scope;
+ }
FOR_EACH_VEC_ELT (SLP_TREE_CHILDREN (node), i, child)
if (child)
stmt_vec_info stmt_vinfo;
for (int i = 0; SLP_TREE_SCALAR_STMTS (node).iterate (i, &stmt_vinfo); i++)
- {
- stmt_vinfo = vect_orig_stmt (stmt_vinfo);
- last = last ? get_later_stmt (stmt_vinfo, last) : stmt_vinfo;
- }
+ if (stmt_vinfo)
+ {
+ stmt_vinfo = vect_orig_stmt (stmt_vinfo);
+ last = last ? get_later_stmt (stmt_vinfo, last) : stmt_vinfo;
+ }
return last;
}
stmt_vec_info stmt_vinfo;
for (int i = 0; SLP_TREE_SCALAR_STMTS (node).iterate (i, &stmt_vinfo); i++)
- {
- stmt_vinfo = vect_orig_stmt (stmt_vinfo);
- if (!first
- || get_later_stmt (stmt_vinfo, first) == first)
- first = stmt_vinfo;
- }
+ if (stmt_vinfo)
+ {
+ stmt_vinfo = vect_orig_stmt (stmt_vinfo);
+ if (!first
+ || get_later_stmt (stmt_vinfo, first) == first)
+ first = stmt_vinfo;
+ }
return first;
}
{
if (j != 0
&& (next_load_info != load_info
+ || ! load_info
|| DR_GROUP_GAP (load_info) != 1))
{
subchain_p = false;
unsigned int i;
FOR_EACH_VEC_ELT (SLP_TREE_SCALAR_STMTS (node), i, slp_stmt_info)
{
- if (STMT_VINFO_LIVE_P (slp_stmt_info)
+ if (slp_stmt_info
+ && STMT_VINFO_LIVE_P (slp_stmt_info)
&& !vectorizable_live_operation (vinfo, slp_stmt_info, node,
node_instance, i,
false, cost_vec))
|| VECTOR_BOOLEAN_TYPE_P (SLP_TREE_VECTYPE (node)))
return false;
+ FOR_EACH_VEC_ELT (SLP_TREE_SCALAR_STMTS (node), i, stmt_info)
+ if (!stmt_info)
+ return false;
+
if (dump_enabled_p ())
dump_printf_loc (MSG_NOTE, vect_location,
"Building vector operands of %p from scalars instead\n",
stmt_vec_info last_stmt = vect_find_last_scalar_stmt_in_slp (node);
FOR_EACH_VEC_ELT (SLP_TREE_SCALAR_STMTS (node), i, stmt_info)
{
- if (svisited.contains (stmt_info))
+ if (!stmt_info || svisited.contains (stmt_info))
continue;
stmt_vec_info orig_stmt_info = vect_orig_stmt (stmt_info);
if (STMT_VINFO_IN_PATTERN_P (orig_stmt_info)
stmt_vec_info stmt;
unsigned i;
FOR_EACH_VEC_ELT (SLP_TREE_SCALAR_STMTS (node), i, stmt)
- roots.remove (vect_orig_stmt (stmt));
+ if (stmt)
+ roots.remove (vect_orig_stmt (stmt));
slp_tree child;
FOR_EACH_VEC_ELT (SLP_TREE_CHILDREN (node), i, child)
unsigned i;
FOR_EACH_VEC_ELT (SLP_TREE_SCALAR_STMTS (node), i, stmt_info)
- vect_map_to_instance (instance, stmt_info, stmt_to_instance,
- instance_leader);
+ if (stmt_info)
+ vect_map_to_instance (instance, stmt_info, stmt_to_instance,
+ instance_leader);
if (vect_map_to_instance (instance, node, node_to_instance,
instance_leader))
if (SLP_TREE_DEF_TYPE (node) == vect_internal_def)
{
FOR_EACH_VEC_ELT (SLP_TREE_SCALAR_STMTS (node), i, stmt_info)
- vstmts.add (stmt_info);
+ if (stmt_info)
+ vstmts.add (stmt_info);
FOR_EACH_VEC_ELT (SLP_TREE_CHILDREN (node), i, child)
if (child)
ssa_op_iter op_iter;
def_operand_p def_p;
- if ((*life)[i])
+ if (!stmt_info || (*life)[i])
continue;
stmt_vec_info orig_stmt_info = vect_orig_stmt (stmt_info);
stmt_vec_info slp_stmt_info;
unsigned int i;
FOR_EACH_VEC_ELT (SLP_TREE_SCALAR_STMTS (node), i, slp_stmt_info)
- if (STMT_VINFO_LIVE_P (slp_stmt_info))
+ if (slp_stmt_info && STMT_VINFO_LIVE_P (slp_stmt_info))
{
done = vectorizable_live_operation (vinfo, slp_stmt_info, node,
instance, i, true, NULL);
FOR_EACH_VEC_ELT (SLP_TREE_SCALAR_STMTS (node), i, stmt_info)
{
+ if (!stmt_info)
+ continue;
gcall *stmt = dyn_cast <gcall *> (stmt_info->stmt);
if (!stmt || gimple_bb (stmt) == NULL)
continue;
stmt_vec_info slpstmt_info;
FOR_EACH_VEC_ELT (stmts, k, slpstmt_info)
- {
- gassign *slpstmt = as_a <gassign *> (slpstmt_info->stmt);
- if (!operand_equal_p (gimple_assign_rhs2 (slpstmt), op1, 0))
- scalar_shift_arg = false;
- }
+ if (slpstmt_info)
+ {
+ gassign *slpstmt = as_a <gassign *> (slpstmt_info->stmt);
+ if (!operand_equal_p (gimple_assign_rhs2 (slpstmt), op1, 0))
+ scalar_shift_arg = false;
+ }
/* For internal SLP defs we have to make sure we see scalar stmts
for all vector elements.
unsigned int i;
FOR_EACH_VEC_ELT (SLP_TREE_SCALAR_STMTS (slp_node), i, slp_stmt_info)
{
- if ((STMT_VINFO_LIVE_P (slp_stmt_info)
- || (loop_vinfo
- && LOOP_VINFO_EARLY_BREAKS (loop_vinfo)
- && STMT_VINFO_DEF_TYPE (slp_stmt_info)
- == vect_induction_def))
+ if (slp_stmt_info
+ && (STMT_VINFO_LIVE_P (slp_stmt_info)
+ || (loop_vinfo
+ && LOOP_VINFO_EARLY_BREAKS (loop_vinfo)
+ && STMT_VINFO_DEF_TYPE (slp_stmt_info)
+ == vect_induction_def))
&& !vectorizable_live_operation (vinfo, slp_stmt_info, slp_node,
slp_node_instance, i,
vec_stmt_p, cost_vec))