+2018-07-31 Richard Sandiford <richard.sandiford@arm.com>
+
+ * tree-vect-data-refs.c (vect_record_base_alignment): Replace vec_info
+ and gimple stmt arguments with a stmt_vec_info.
+ (vect_record_base_alignments): Update calls accordingly.
+ * tree-vect-slp.c (vect_record_max_nunits): Replace vec_info
+ and gimple stmt arguments with a stmt_vec_info.
+ (vect_build_slp_tree_1): Remove vinfo argument and update call
+ to vect_record_max_nunits.
+ (vect_build_slp_tree_2): Update calls to vect_build_slp_tree_1
+ and vect_record_max_nunits.
+
2018-07-31 Richard Sandiford <richard.sandiford@arm.com>
* tree-vectorizer.h (nested_in_vect_loop_p): Move further down
return res;
}
-/* Record in VINFO the base alignment guarantee given by DRB. STMT is
- the statement that contains DRB, which is useful for recording in the
- dump file. */
+/* Record the base alignment guarantee given by DRB, which occurs
+ in STMT_INFO. */
static void
-vect_record_base_alignment (vec_info *vinfo, gimple *stmt,
+vect_record_base_alignment (stmt_vec_info stmt_info,
innermost_loop_behavior *drb)
{
+ vec_info *vinfo = stmt_info->vinfo;
bool existed;
innermost_loop_behavior *&entry
= vinfo->base_alignments.get_or_insert (drb->base_address, &existed);
" misalignment: %d\n", drb->base_misalignment);
dump_printf_loc (MSG_NOTE, vect_location,
" based on: ");
- dump_gimple_stmt (MSG_NOTE, TDF_SLIM, stmt, 0);
+ dump_gimple_stmt (MSG_NOTE, TDF_SLIM, stmt_info->stmt, 0);
}
}
}
&& STMT_VINFO_VECTORIZABLE (stmt_info)
&& !STMT_VINFO_GATHER_SCATTER_P (stmt_info))
{
- vect_record_base_alignment (vinfo, stmt_info, &DR_INNERMOST (dr));
+ vect_record_base_alignment (stmt_info, &DR_INNERMOST (dr));
/* If DR is nested in the loop that is being vectorized, we can also
record the alignment of the base wrt the outer loop. */
if (loop && nested_in_vect_loop_p (loop, stmt_info))
vect_record_base_alignment
- (vinfo, stmt_info, &STMT_VINFO_DR_WRT_VEC_LOOP (stmt_info));
+ (stmt_info, &STMT_VINFO_DR_WRT_VEC_LOOP (stmt_info));
}
}
}
}
/* A subroutine of vect_build_slp_tree for checking VECTYPE, which is the
- caller's attempt to find the vector type in STMT with the narrowest
+ caller's attempt to find the vector type in STMT_INFO with the narrowest
element type. Return true if VECTYPE is nonnull and if it is valid
- for VINFO. When returning true, update MAX_NUNITS to reflect the
- number of units in VECTYPE. VINFO, GORUP_SIZE and MAX_NUNITS are
- as for vect_build_slp_tree. */
+ for STMT_INFO. When returning true, update MAX_NUNITS to reflect the
+ number of units in VECTYPE. GROUP_SIZE and MAX_NUNITS are as for
+ vect_build_slp_tree. */
static bool
-vect_record_max_nunits (vec_info *vinfo, gimple *stmt, unsigned int group_size,
+vect_record_max_nunits (stmt_vec_info stmt_info, unsigned int group_size,
tree vectype, poly_uint64 *max_nunits)
{
if (!vectype)
{
dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
"Build SLP failed: unsupported data-type in ");
- dump_gimple_stmt (MSG_MISSED_OPTIMIZATION, TDF_SLIM, stmt, 0);
+ dump_gimple_stmt (MSG_MISSED_OPTIMIZATION, TDF_SLIM,
+ stmt_info->stmt, 0);
dump_printf (MSG_MISSED_OPTIMIZATION, "\n");
}
/* Fatal mismatch. */
before adjusting *max_nunits for basic-block vectorization. */
poly_uint64 nunits = TYPE_VECTOR_SUBPARTS (vectype);
unsigned HOST_WIDE_INT const_nunits;
- if (is_a <bb_vec_info> (vinfo)
+ if (STMT_VINFO_BB_VINFO (stmt_info)
&& (!nunits.is_constant (&const_nunits)
|| const_nunits > group_size))
{
to (B1 <= A1 ? X1 : Y1); or be inverted to (A1 < B1) ? Y1 : X1. */
static bool
-vect_build_slp_tree_1 (vec_info *vinfo, unsigned char *swap,
+vect_build_slp_tree_1 (unsigned char *swap,
vec<stmt_vec_info> stmts, unsigned int group_size,
poly_uint64 *max_nunits, bool *matches,
bool *two_operators)
if (!vect_get_vector_types_for_stmt (stmt_info, &vectype,
&nunits_vectype)
|| (nunits_vectype
- && !vect_record_max_nunits (vinfo, stmt_info, group_size,
+ && !vect_record_max_nunits (stmt_info, group_size,
nunits_vectype, max_nunits)))
{
/* Fatal mismatch. */
{
tree scalar_type = TREE_TYPE (PHI_RESULT (stmt));
tree vectype = get_vectype_for_scalar_type (scalar_type);
- if (!vect_record_max_nunits (vinfo, stmt_info, group_size, vectype,
- max_nunits))
+ if (!vect_record_max_nunits (stmt_info, group_size, vectype, max_nunits))
return NULL;
vect_def_type def_type = STMT_VINFO_DEF_TYPE (stmt_info);
bool two_operators = false;
unsigned char *swap = XALLOCAVEC (unsigned char, group_size);
- if (!vect_build_slp_tree_1 (vinfo, swap, stmts, group_size,
+ if (!vect_build_slp_tree_1 (swap, stmts, group_size,
&this_max_nunits, matches, &two_operators))
return NULL;