+2016-01-12 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/69157
+ * tree-vect-stmts.c (vectorizable_mask_load_store): Check
+ stmts def type only during analyze phase.
+ (vectorizable_call): Likewise.
+ (vectorizable_simd_clone_call): Likewise.
+ (vectorizable_conversion): Likewise.
+ (vectorizable_assignment): Likewise.
+ (vectorizable_shift): Likewise.
+ (vectorizable_operation): Likewise.
+ (vectorizable_store): Likewise.
+ (vectorizable_load): Likewise.
+
+2016-01-12 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/69174
+ * tree-vect-stmts.c (vect_mark_relevant): Remove excessive vertical
+ space.
+ (vectorizable_load): Properly compute the number of loads needed
+ for permuted strided SLP loads and do not spuriously assign
+ to SLP_TREE_VEC_STMTS.
+
2016-01-12 Andris Pavenis <andris.pavenis@iki.fi>
* config/i386/djgpp.h (PREFERRED_DEBUGGING_TYPE): Define to DWARF2
gimple *pattern_stmt;
if (dump_enabled_p ())
- dump_printf_loc (MSG_NOTE, vect_location,
- "mark relevant %d, live %d.\n", relevant, live_p);
+ {
+ dump_printf_loc (MSG_NOTE, vect_location,
+ "mark relevant %d, live %d: ", relevant, live_p);
+ dump_gimple_stmt (MSG_NOTE, TDF_SLIM, stmt, 0);
+ }
/* If this stmt is an original stmt in a pattern, we might need to mark its
related pattern stmt instead of the original stmt. However, such stmts
if (!STMT_VINFO_RELEVANT_P (stmt_info))
return false;
- if (STMT_VINFO_DEF_TYPE (stmt_info) != vect_internal_def)
+ if (STMT_VINFO_DEF_TYPE (stmt_info) != vect_internal_def
+ && ! vec_stmt)
return false;
if (!STMT_VINFO_DATA_REF (stmt_info))
if (!STMT_VINFO_RELEVANT_P (stmt_info) && !bb_vinfo)
return false;
- if (STMT_VINFO_DEF_TYPE (stmt_info) != vect_internal_def)
+ if (STMT_VINFO_DEF_TYPE (stmt_info) != vect_internal_def
+ && ! vec_stmt)
return false;
/* Is GS a vectorizable call? */
if (!STMT_VINFO_RELEVANT_P (stmt_info) && !bb_vinfo)
return false;
- if (STMT_VINFO_DEF_TYPE (stmt_info) != vect_internal_def)
+ if (STMT_VINFO_DEF_TYPE (stmt_info) != vect_internal_def
+ && ! vec_stmt)
return false;
if (gimple_call_lhs (stmt)
if (!STMT_VINFO_RELEVANT_P (stmt_info) && !bb_vinfo)
return false;
- if (STMT_VINFO_DEF_TYPE (stmt_info) != vect_internal_def)
+ if (STMT_VINFO_DEF_TYPE (stmt_info) != vect_internal_def
+ && ! vec_stmt)
return false;
if (!is_gimple_assign (stmt))
if (!STMT_VINFO_RELEVANT_P (stmt_info) && !bb_vinfo)
return false;
- if (STMT_VINFO_DEF_TYPE (stmt_info) != vect_internal_def)
+ if (STMT_VINFO_DEF_TYPE (stmt_info) != vect_internal_def
+ && ! vec_stmt)
return false;
/* Is vectorizable assignment? */
if (!STMT_VINFO_RELEVANT_P (stmt_info) && !bb_vinfo)
return false;
- if (STMT_VINFO_DEF_TYPE (stmt_info) != vect_internal_def)
+ if (STMT_VINFO_DEF_TYPE (stmt_info) != vect_internal_def
+ && ! vec_stmt)
return false;
/* Is STMT a vectorizable binary/unary operation? */
if (!STMT_VINFO_RELEVANT_P (stmt_info) && !bb_vinfo)
return false;
- if (STMT_VINFO_DEF_TYPE (stmt_info) != vect_internal_def)
+ if (STMT_VINFO_DEF_TYPE (stmt_info) != vect_internal_def
+ && ! vec_stmt)
return false;
/* Is STMT a vectorizable binary/unary operation? */
if (!STMT_VINFO_RELEVANT_P (stmt_info) && !bb_vinfo)
return false;
- if (STMT_VINFO_DEF_TYPE (stmt_info) != vect_internal_def)
+ if (STMT_VINFO_DEF_TYPE (stmt_info) != vect_internal_def
+ && ! vec_stmt)
return false;
/* Is vectorizable store? */
if (!STMT_VINFO_RELEVANT_P (stmt_info) && !bb_vinfo)
return false;
- if (STMT_VINFO_DEF_TYPE (stmt_info) != vect_internal_def)
+ if (STMT_VINFO_DEF_TYPE (stmt_info) != vect_internal_def
+ && ! vec_stmt)
return false;
/* Is vectorizable load? */
else
ltype = vectype;
ltype = build_aligned_type (ltype, TYPE_ALIGN (TREE_TYPE (vectype)));
- ncopies = SLP_TREE_NUMBER_OF_VEC_STMTS (slp_node);
+ /* For SLP permutation support we need to load the whole group,
+ not only the number of vector stmts the permutation result
+ fits in. */
if (slp_perm)
- dr_chain.create (ncopies);
+ {
+ ncopies = (group_size * vf + nunits - 1) / nunits;
+ dr_chain.create (ncopies);
+ }
+ else
+ ncopies = SLP_TREE_NUMBER_OF_VEC_STMTS (slp_node);
}
for (j = 0; j < ncopies; j++)
{
if (slp)
{
- SLP_TREE_VEC_STMTS (slp_node).quick_push (new_stmt);
if (slp_perm)
dr_chain.quick_push (gimple_assign_lhs (new_stmt));
+ else
+ SLP_TREE_VEC_STMTS (slp_node).quick_push (new_stmt);
}
else
{