aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-vect-patterns.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/tree-vect-patterns.c')
-rw-r--r--gcc/tree-vect-patterns.c110
1 files changed, 63 insertions, 47 deletions
diff --git a/gcc/tree-vect-patterns.c b/gcc/tree-vect-patterns.c
index ef65c3f..b0974ec 100644
--- a/gcc/tree-vect-patterns.c
+++ b/gcc/tree-vect-patterns.c
@@ -416,10 +416,11 @@ vect_recog_dot_prod_pattern (VEC (gimple, heap) **stmts, tree *type_in,
pattern_stmt = gimple_build_assign_with_ops (DOT_PROD_EXPR, var,
oprnd00, oprnd01, oprnd1);
- if (vect_print_dump_info (REPORT_DETAILS))
+ if (dump_kind_p (MSG_OPTIMIZED_LOCATIONS))
{
- fprintf (vect_dump, "vect_recog_dot_prod_pattern: detected: ");
- print_gimple_stmt (vect_dump, pattern_stmt, 0, TDF_SLIM);
+ dump_printf_loc (MSG_OPTIMIZED_LOCATIONS, vect_location,
+ "vect_recog_dot_prod_pattern: detected: ");
+ dump_gimple_stmt (MSG_OPTIMIZED_LOCATIONS, TDF_SLIM, pattern_stmt, 0);
}
/* We don't allow changing the order of the computation in the inner-loop
@@ -675,8 +676,9 @@ vect_recog_widen_mult_pattern (VEC (gimple, heap) **stmts,
return NULL;
/* Pattern detected. */
- if (vect_print_dump_info (REPORT_DETAILS))
- fprintf (vect_dump, "vect_recog_widen_mult_pattern: detected: ");
+ if (dump_kind_p (MSG_OPTIMIZED_LOCATIONS))
+ dump_printf_loc (MSG_OPTIMIZED_LOCATIONS, vect_location,
+ "vect_recog_widen_mult_pattern: detected: ");
/* Check target support */
vectype = get_vectype_for_scalar_type (half_type0);
@@ -697,8 +699,8 @@ vect_recog_widen_mult_pattern (VEC (gimple, heap) **stmts,
pattern_stmt = gimple_build_assign_with_ops (WIDEN_MULT_EXPR, var, oprnd0,
oprnd1);
- if (vect_print_dump_info (REPORT_DETAILS))
- print_gimple_stmt (vect_dump, pattern_stmt, 0, TDF_SLIM);
+ if (dump_kind_p (MSG_NOTE))
+ dump_gimple_stmt_loc (MSG_NOTE, vect_location, TDF_SLIM, pattern_stmt, 0);
VEC_safe_push (gimple, heap, *stmts, last_stmt);
return pattern_stmt;
@@ -910,10 +912,11 @@ vect_recog_widen_sum_pattern (VEC (gimple, heap) **stmts, tree *type_in,
pattern_stmt = gimple_build_assign_with_ops (WIDEN_SUM_EXPR, var,
oprnd0, oprnd1);
- if (vect_print_dump_info (REPORT_DETAILS))
+ if (dump_kind_p (MSG_OPTIMIZED_LOCATIONS))
{
- fprintf (vect_dump, "vect_recog_widen_sum_pattern: detected: ");
- print_gimple_stmt (vect_dump, pattern_stmt, 0, TDF_SLIM);
+ dump_printf_loc (MSG_OPTIMIZED_LOCATIONS, vect_location,
+ "vect_recog_widen_sum_pattern: detected: ");
+ dump_gimple_stmt (MSG_OPTIMIZED_LOCATIONS, TDF_SLIM, pattern_stmt, 0);
}
/* We don't allow changing the order of the computation in the inner-loop
@@ -1214,10 +1217,11 @@ vect_recog_over_widening_pattern (VEC (gimple, heap) **stmts,
STMT_VINFO_RELATED_STMT (vinfo_for_stmt (stmt)) = pattern_stmt;
new_pattern_def_seq (vinfo_for_stmt (stmt), new_def_stmt);
- if (vect_print_dump_info (REPORT_DETAILS))
+ if (dump_kind_p (MSG_OPTIMIZED_LOCATIONS))
{
- fprintf (vect_dump, "created pattern stmt: ");
- print_gimple_stmt (vect_dump, pattern_stmt, 0, TDF_SLIM);
+ dump_printf_loc (MSG_OPTIMIZED_LOCATIONS, vect_location,
+ "created pattern stmt: ");
+ dump_gimple_stmt (MSG_OPTIMIZED_LOCATIONS, TDF_SLIM, pattern_stmt, 0);
}
type = gimple_expr_type (stmt);
@@ -1281,10 +1285,11 @@ vect_recog_over_widening_pattern (VEC (gimple, heap) **stmts,
return NULL;
/* Pattern detected. */
- if (vect_print_dump_info (REPORT_DETAILS))
+ if (dump_kind_p (MSG_OPTIMIZED_LOCATIONS))
{
- fprintf (vect_dump, "vect_recog_over_widening_pattern: detected: ");
- print_gimple_stmt (vect_dump, pattern_stmt, 0, TDF_SLIM);
+ dump_printf_loc (MSG_OPTIMIZED_LOCATIONS, vect_location,
+ "vect_recog_over_widening_pattern: detected: ");
+ dump_gimple_stmt (MSG_OPTIMIZED_LOCATIONS, TDF_SLIM, pattern_stmt, 0);
}
return pattern_stmt;
@@ -1416,8 +1421,9 @@ vect_recog_widen_shift_pattern (VEC (gimple, heap) **stmts,
return NULL;
/* Pattern detected. */
- if (vect_print_dump_info (REPORT_DETAILS))
- fprintf (vect_dump, "vect_recog_widen_shift_pattern: detected: ");
+ if (dump_kind_p (MSG_OPTIMIZED_LOCATIONS))
+ dump_printf_loc (MSG_OPTIMIZED_LOCATIONS, vect_location,
+ "vect_recog_widen_shift_pattern: detected: ");
/* Check target support. */
vectype = get_vectype_for_scalar_type (half_type0);
@@ -1439,8 +1445,8 @@ vect_recog_widen_shift_pattern (VEC (gimple, heap) **stmts,
pattern_stmt =
gimple_build_assign_with_ops (WIDEN_LSHIFT_EXPR, var, oprnd0, oprnd1);
- if (vect_print_dump_info (REPORT_DETAILS))
- print_gimple_stmt (vect_dump, pattern_stmt, 0, TDF_SLIM);
+ if (dump_kind_p (MSG_NOTE))
+ dump_gimple_stmt_loc (MSG_NOTE, vect_location, TDF_SLIM, pattern_stmt, 0);
VEC_safe_push (gimple, heap, *stmts, last_stmt);
return pattern_stmt;
@@ -1561,15 +1567,16 @@ vect_recog_vector_vector_shift_pattern (VEC (gimple, heap) **stmts,
}
/* Pattern detected. */
- if (vect_print_dump_info (REPORT_DETAILS))
- fprintf (vect_dump, "vect_recog_vector_vector_shift_pattern: detected: ");
+ if (dump_kind_p (MSG_OPTIMIZED_LOCATIONS))
+ dump_printf_loc (MSG_OPTIMIZED_LOCATIONS, vect_location,
+ "vect_recog_vector_vector_shift_pattern: detected: ");
/* Pattern supported. Create a stmt to be used to replace the pattern. */
var = vect_recog_temp_ssa_var (TREE_TYPE (oprnd0), NULL);
pattern_stmt = gimple_build_assign_with_ops (rhs_code, var, oprnd0, def);
- if (vect_print_dump_info (REPORT_DETAILS))
- print_gimple_stmt (vect_dump, pattern_stmt, 0, TDF_SLIM);
+ if (dump_kind_p (MSG_NOTE))
+ dump_gimple_stmt_loc (MSG_NOTE, vect_location, TDF_SLIM, pattern_stmt, 0);
VEC_safe_push (gimple, heap, *stmts, last_stmt);
return pattern_stmt;
@@ -1678,8 +1685,9 @@ vect_recog_divmod_pattern (VEC (gimple, heap) **stmts,
return NULL;
/* Pattern detected. */
- if (vect_print_dump_info (REPORT_DETAILS))
- fprintf (vect_dump, "vect_recog_divmod_pattern: detected: ");
+ if (dump_kind_p (MSG_OPTIMIZED_LOCATIONS))
+ dump_printf_loc (MSG_OPTIMIZED_LOCATIONS, vect_location,
+ "vect_recog_divmod_pattern: detected: ");
cond = build2 (LT_EXPR, boolean_type_node, oprnd0,
build_int_cst (itype, 0));
@@ -1781,8 +1789,9 @@ vect_recog_divmod_pattern (VEC (gimple, heap) **stmts,
signmask);
}
- if (vect_print_dump_info (REPORT_DETAILS))
- print_gimple_stmt (vect_dump, pattern_stmt, 0, TDF_SLIM);
+ if (dump_kind_p (MSG_NOTE))
+ dump_gimple_stmt_loc (MSG_NOTE, vect_location, TDF_SLIM, pattern_stmt,
+ 0);
VEC_safe_push (gimple, heap, *stmts, last_stmt);
@@ -2022,11 +2031,12 @@ vect_recog_divmod_pattern (VEC (gimple, heap) **stmts,
}
/* Pattern detected. */
- if (vect_print_dump_info (REPORT_DETAILS))
- fprintf (vect_dump, "vect_recog_divmod_pattern: detected: ");
-
- if (vect_print_dump_info (REPORT_DETAILS))
- print_gimple_stmt (vect_dump, pattern_stmt, 0, TDF_SLIM);
+ if (dump_kind_p (MSG_OPTIMIZED_LOCATIONS))
+ {
+ dump_printf_loc (MSG_OPTIMIZED_LOCATIONS, vect_location,
+ "vect_recog_divmod_pattern: detected: ");
+ dump_gimple_stmt (MSG_OPTIMIZED_LOCATIONS, TDF_SLIM, pattern_stmt, 0);
+ }
VEC_safe_push (gimple, heap, *stmts, last_stmt);
@@ -2189,8 +2199,9 @@ vect_recog_mixed_size_cond_pattern (VEC (gimple, heap) **stmts, tree *type_in,
*type_in = vecitype;
*type_out = vectype;
- if (vect_print_dump_info (REPORT_DETAILS))
- fprintf (vect_dump, "vect_recog_mixed_size_cond_pattern: detected: ");
+ if (dump_kind_p (MSG_OPTIMIZED_LOCATIONS))
+ dump_printf_loc (MSG_OPTIMIZED_LOCATIONS, vect_location,
+ "vect_recog_mixed_size_cond_pattern: detected: ");
return pattern_stmt;
}
@@ -2581,8 +2592,9 @@ vect_recog_bool_pattern (VEC (gimple, heap) **stmts, tree *type_in,
*type_out = vectype;
*type_in = vectype;
VEC_safe_push (gimple, heap, *stmts, last_stmt);
- if (vect_print_dump_info (REPORT_DETAILS))
- fprintf (vect_dump, "vect_recog_bool_pattern: detected: ");
+ if (dump_kind_p (MSG_OPTIMIZED_LOCATIONS))
+ dump_printf_loc (MSG_OPTIMIZED_LOCATIONS, vect_location,
+ "vect_recog_bool_pattern: detected: ");
return pattern_stmt;
}
@@ -2626,8 +2638,9 @@ vect_recog_bool_pattern (VEC (gimple, heap) **stmts, tree *type_in,
*type_out = vectype;
*type_in = vectype;
VEC_safe_push (gimple, heap, *stmts, last_stmt);
- if (vect_print_dump_info (REPORT_DETAILS))
- fprintf (vect_dump, "vect_recog_bool_pattern: detected: ");
+ if (dump_kind_p (MSG_OPTIMIZED_LOCATIONS))
+ dump_printf_loc (MSG_OPTIMIZED_LOCATIONS, vect_location,
+ "vect_recog_bool_pattern: detected: ");
return pattern_stmt;
}
else
@@ -2775,10 +2788,11 @@ vect_pattern_recog_1 (vect_recog_func_ptr vect_recog_func,
}
/* Found a vectorizable pattern. */
- if (vect_print_dump_info (REPORT_DETAILS))
+ if (dump_kind_p (MSG_OPTIMIZED_LOCATIONS))
{
- fprintf (vect_dump, "pattern recognized: ");
- print_gimple_stmt (vect_dump, pattern_stmt, 0, TDF_SLIM);
+ dump_printf_loc (MSG_OPTIMIZED_LOCATIONS, vect_location,
+ "pattern recognized: ");
+ dump_gimple_stmt (MSG_OPTIMIZED_LOCATIONS, TDF_SLIM, pattern_stmt, 0);
}
/* Mark the stmts that are involved in the pattern. */
@@ -2800,10 +2814,11 @@ vect_pattern_recog_1 (vect_recog_func_ptr vect_recog_func,
{
stmt_info = vinfo_for_stmt (stmt);
pattern_stmt = STMT_VINFO_RELATED_STMT (stmt_info);
- if (vect_print_dump_info (REPORT_DETAILS))
+ if (dump_kind_p (MSG_OPTIMIZED_LOCATIONS))
{
- fprintf (vect_dump, "additional pattern stmt: ");
- print_gimple_stmt (vect_dump, pattern_stmt, 0, TDF_SLIM);
+ dump_printf_loc (MSG_OPTIMIZED_LOCATIONS, vect_location,
+ "additional pattern stmt: ");
+ dump_gimple_stmt (MSG_OPTIMIZED_LOCATIONS, TDF_SLIM, pattern_stmt, 0);
}
vect_mark_pattern_stmts (stmt, pattern_stmt, NULL_TREE);
@@ -2900,8 +2915,9 @@ vect_pattern_recog (loop_vec_info loop_vinfo, bb_vec_info bb_vinfo)
VEC (gimple, heap) *stmts_to_replace = VEC_alloc (gimple, heap, 1);
gimple stmt;
- if (vect_print_dump_info (REPORT_DETAILS))
- fprintf (vect_dump, "=== vect_pattern_recog ===");
+ if (dump_kind_p (MSG_NOTE))
+ dump_printf_loc (MSG_NOTE, vect_location,
+ "=== vect_pattern_recog ===");
if (loop_vinfo)
{