summaryrefslogtreecommitdiff
path: root/gcc/tree-vect-patterns.c
diff options
context:
space:
mode:
authorsinghai <singhai@138bc75d-0d04-0410-961f-82ee72b054a4>2012-10-01 05:43:06 +0000
committersinghai <singhai@138bc75d-0d04-0410-961f-82ee72b054a4>2012-10-01 05:43:06 +0000
commit7bd765d4ede65c5e4895dfd9ea458b3f35b8483a (patch)
tree525ba5cb84f1f7d04874c56225d38fe09fea8455 /gcc/tree-vect-patterns.c
parent769bf18a20ee2540ca7601cdafabd62b18b9751b (diff)
downloadgcc-7bd765d4ede65c5e4895dfd9ea458b3f35b8483a.tar.gz
2012-09-30 Sharad Singhai <singhai@google.com>
* doc/invoke.texi: Add documentation for the new option. * tree-dump.c: Move general dump file related functionality into dumpfile.c. Remove unneeded headers. * tree-dump.h: Move function declarations into dumpfile.h. * dumpfile.h: Include "line-map.h". Add defines for MSG flags. (struct dump_file_info): Move here from tree-dump.c. Rename flags to pflags, state to pstate, stream to pstream, filename to pfilename. All callers updated. Add alt_flags, alt_state, alt_filenmae, alt_stream. * tree-vectorizer.c: Include "dumpfile.h". Remove vect_dump. (vect_set_dump_settings): Remove. (vect_print_dump_info): Ditto. * tree-vectorizer.h: Remove declaration of vect_dump and vect_print_dump_info. * tree-vect-loop.c: Include "dumpfile.h". Use new dump style. * tree-vect-data-refs.c: Ditto. * tree-vect-stmts.c: Ditto. * tree-vect-slp.c: Ditto. * tree-vect-patterns.c: Ditto. * tree-vect-loop-manip.c: Ditto. * testsuite/gcc.target/i386/vect-double-1.c: Fix test. * opts.c (vect_set_verbosity_level): Remove. (common_handle_option): Handle -fopt-info flag. Deprecate -ftree-vectorizer-verbose. * tree-parloops.c (gather_scalar_reductions): Remove reference to vect_dump. * flag-types.h: Remove vect_verbosity_levels. * common.opt: Add -fopt-info. Deprecate -ftree-vectorizer-verbose. * opts-global.c (dump_remap_tree_vectorizer_verbose): New function. (handle_common_deferred_options): Handle -fopt-info and -ftree-vectorizer-verbose. * Makefile.in: Add dumpfile.o. (tree-dump.o): Update dependencies. (tree-vect-loop.o): Ditto. (tree-vect-loop-manip.o): Ditto. (tree-vect-slp.o): Ditto. (tree-vect-stmts.o): Ditto. (tree-vectorizer.o): Ditto. (opts.o): Ditto. * passes.c (finish_optimization_passes): Instead of using dump_begin/dump_end, use dump_start/dump_finish. Do not use dump_file. (pass_init_dump_file): Ditto. * c-decl.c (c_write_global_declarations): Use a different method to determine if the dump has ben initialized. * decl2.c (cp_write_global_declarations): Use a different method to determine if the dump has ben initialized. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@191883 138bc75d-0d04-0410-961f-82ee72b054a4
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 ef65c3f8858..b0974ec196d 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)
{