Commit 78c60e3d by Sharad Singhai Committed by Sharad Singhai

invoke.texi: Add documentation for the new option.

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.

From-SVN: r191883
parent d0cfc262
2012-09-30 Sharad Singhai <singhai@google.com>
* doc/invoke.texi: Add documentation for the new -fopt-info 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.
2012-09-30 Joern Rennecke <joern.rennecke@embecosm.com> 2012-09-30 Joern Rennecke <joern.rennecke@embecosm.com>
PR rtl-optimization/38449: PR rtl-optimization/38449:
......
...@@ -916,7 +916,7 @@ MKDEPS_H = $(srcdir)/../libcpp/include/mkdeps.h ...@@ -916,7 +916,7 @@ MKDEPS_H = $(srcdir)/../libcpp/include/mkdeps.h
SYMTAB_H = $(srcdir)/../libcpp/include/symtab.h $(OBSTACK_H) SYMTAB_H = $(srcdir)/../libcpp/include/symtab.h $(OBSTACK_H)
CPP_ID_DATA_H = $(CPPLIB_H) $(srcdir)/../libcpp/include/cpp-id-data.h CPP_ID_DATA_H = $(CPPLIB_H) $(srcdir)/../libcpp/include/cpp-id-data.h
CPP_INTERNAL_H = $(srcdir)/../libcpp/internal.h $(CPP_ID_DATA_H) CPP_INTERNAL_H = $(srcdir)/../libcpp/internal.h $(CPP_ID_DATA_H)
TREE_DUMP_H = tree-dump.h $(SPLAY_TREE_H) TREE_DUMP_H = tree-dump.h $(SPLAY_TREE_H) dumpfile.h
TREE_PASS_H = tree-pass.h $(TIMEVAR_H) dumpfile.h TREE_PASS_H = tree-pass.h $(TIMEVAR_H) dumpfile.h
TREE_FLOW_H = tree-flow.h tree-flow-inline.h tree-ssa-operands.h \ TREE_FLOW_H = tree-flow.h tree-flow-inline.h tree-ssa-operands.h \
$(BITMAP_H) sbitmap.h $(BASIC_BLOCK_H) $(GIMPLE_H) \ $(BITMAP_H) sbitmap.h $(BASIC_BLOCK_H) $(GIMPLE_H) \
...@@ -1193,6 +1193,7 @@ OBJS = \ ...@@ -1193,6 +1193,7 @@ OBJS = \
domwalk.o \ domwalk.o \
double-int.o \ double-int.o \
dse.o \ dse.o \
dumpfile.o \
dwarf2asm.o \ dwarf2asm.o \
dwarf2cfi.o \ dwarf2cfi.o \
dwarf2out.o \ dwarf2out.o \
...@@ -2182,9 +2183,8 @@ tree.o: tree.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \ ...@@ -2182,9 +2183,8 @@ tree.o: tree.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \
$(TREE_PASS_H) $(LANGHOOKS_DEF_H) $(DIAGNOSTIC_H) $(CGRAPH_H) \ $(TREE_PASS_H) $(LANGHOOKS_DEF_H) $(DIAGNOSTIC_H) $(CGRAPH_H) \
$(EXCEPT_H) debug.h intl.h tree-diagnostic.h $(TREE_PRETTY_PRINT_H) \ $(EXCEPT_H) debug.h intl.h tree-diagnostic.h $(TREE_PRETTY_PRINT_H) \
$(COMMON_TARGET_H) $(COMMON_TARGET_H)
tree-dump.o: tree-dump.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ tree-dump.o: tree-dump.c $(CONFIG_H) $(SYSTEM_H) $(TM_H) $(TREE_H) \
$(TREE_H) langhooks.h toplev.h $(SPLAY_TREE_H) $(TREE_DUMP_H) \ langhooks.h $(TREE_DUMP_H) tree-iterator.h
tree-iterator.h $(TREE_PASS_H) $(DIAGNOSTIC_H)
tree-inline.o : tree-inline.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ tree-inline.o : tree-inline.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
$(TREE_H) $(RTL_H) $(FLAGS_H) $(PARAMS_H) $(INPUT_H) insn-config.h \ $(TREE_H) $(RTL_H) $(FLAGS_H) $(PARAMS_H) $(INPUT_H) insn-config.h \
$(HASHTAB_H) langhooks.h $(TREE_INLINE_H) $(CGRAPH_H) \ $(HASHTAB_H) langhooks.h $(TREE_INLINE_H) $(CGRAPH_H) \
...@@ -2544,12 +2544,12 @@ graphite-optimize-isl.o : graphite-optimize-isl.c $(CONFIG_H) $(SYSTEM_H) \ ...@@ -2544,12 +2544,12 @@ graphite-optimize-isl.o : graphite-optimize-isl.c $(CONFIG_H) $(SYSTEM_H) \
coretypes.h dumpfile.h $(TREE_FLOW_H) $(CFGLOOP_H) $(TREE_DATA_REF_H) $(SCEV_H) \ coretypes.h dumpfile.h $(TREE_FLOW_H) $(CFGLOOP_H) $(TREE_DATA_REF_H) $(SCEV_H) \
sese.h graphite-poly.h sese.h graphite-poly.h
tree-vect-loop.o: tree-vect-loop.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ tree-vect-loop.o: tree-vect-loop.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
$(TM_H) $(GGC_H) $(TREE_H) $(BASIC_BLOCK_H) $(TREE_FLOW_H) \ $(TM_H) $(GGC_H) $(TREE_H) $(BASIC_BLOCK_H) $(TREE_FLOW_H) dumpfile.h \
$(CFGLOOP_H) $(EXPR_H) $(RECOG_H) $(OPTABS_H) \ $(CFGLOOP_H) $(EXPR_H) $(RECOG_H) $(OPTABS_H) \
$(DIAGNOSTIC_CORE_H) $(SCEV_H) $(TREE_VECTORIZER_H) \ $(DIAGNOSTIC_CORE_H) $(SCEV_H) $(TREE_VECTORIZER_H) \
$(GIMPLE_PRETTY_PRINT_H) $(TARGET_H) $(TREE_DATA_REF_H) $(GIMPLE_PRETTY_PRINT_H) $(TARGET_H) $(TREE_DATA_REF_H)
tree-vect-loop-manip.o: tree-vect-loop-manip.c $(CONFIG_H) $(SYSTEM_H) \ tree-vect-loop-manip.o: tree-vect-loop-manip.c $(CONFIG_H) $(SYSTEM_H) \
coretypes.h $(TM_H) $(GGC_H) $(TREE_H) $(BASIC_BLOCK_H) \ coretypes.h dumpfile.h $(TM_H) $(GGC_H) $(TREE_H) $(BASIC_BLOCK_H) \
$(TREE_FLOW_H) $(CFGLOOP_H) $(DIAGNOSTIC_CORE_H) \ $(TREE_FLOW_H) $(CFGLOOP_H) $(DIAGNOSTIC_CORE_H) \
$(SCEV_H) $(TREE_VECTORIZER_H) langhooks.h $(GIMPLE_PRETTY_PRINT_H) $(SCEV_H) $(TREE_VECTORIZER_H) langhooks.h $(GIMPLE_PRETTY_PRINT_H)
tree-vect-patterns.o: tree-vect-patterns.c $(CONFIG_H) $(SYSTEM_H) \ tree-vect-patterns.o: tree-vect-patterns.c $(CONFIG_H) $(SYSTEM_H) \
...@@ -2558,8 +2558,8 @@ tree-vect-patterns.o: tree-vect-patterns.c $(CONFIG_H) $(SYSTEM_H) \ ...@@ -2558,8 +2558,8 @@ tree-vect-patterns.o: tree-vect-patterns.c $(CONFIG_H) $(SYSTEM_H) \
$(TREE_FLOW_H) $(CFGLOOP_H) $(EXPR_H) $(OPTABS_H) $(PARAMS_H) \ $(TREE_FLOW_H) $(CFGLOOP_H) $(EXPR_H) $(OPTABS_H) $(PARAMS_H) \
$(TREE_DATA_REF_H) $(TREE_VECTORIZER_H) $(RECOG_H) $(DIAGNOSTIC_CORE_H) \ $(TREE_DATA_REF_H) $(TREE_VECTORIZER_H) $(RECOG_H) $(DIAGNOSTIC_CORE_H) \
$(GIMPLE_PRETTY_PRINT_H) $(GIMPLE_PRETTY_PRINT_H)
tree-vect-slp.o: tree-vect-slp.c $(CONFIG_H) $(SYSTEM_H) \ tree-vect-slp.o: tree-vect-slp.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
coretypes.h $(TM_H) $(GGC_H) $(TREE_H) $(TARGET_H) $(BASIC_BLOCK_H) \ dumpfile.h $(TM_H) $(GGC_H) $(TREE_H) $(TARGET_H) $(BASIC_BLOCK_H) \
$(DIAGNOSTIC_H) $(TREE_FLOW_H) $(CFGLOOP_H) \ $(DIAGNOSTIC_H) $(TREE_FLOW_H) $(CFGLOOP_H) \
$(EXPR_H) $(RECOG_H) $(OPTABS_H) $(TREE_VECTORIZER_H) \ $(EXPR_H) $(RECOG_H) $(OPTABS_H) $(TREE_VECTORIZER_H) \
$(GIMPLE_PRETTY_PRINT_H) $(TREE_DATA_REF_H) langhooks.h $(GIMPLE_PRETTY_PRINT_H) $(TREE_DATA_REF_H) langhooks.h
...@@ -2574,7 +2574,7 @@ tree-vect-data-refs.o: tree-vect-data-refs.c $(CONFIG_H) $(SYSTEM_H) \ ...@@ -2574,7 +2574,7 @@ tree-vect-data-refs.o: tree-vect-data-refs.c $(CONFIG_H) $(SYSTEM_H) \
$(EXPR_H) $(OPTABS_H) $(SCEV_H) $(TREE_VECTORIZER_H) \ $(EXPR_H) $(OPTABS_H) $(SCEV_H) $(TREE_VECTORIZER_H) \
$(DIAGNOSTIC_CORE_H) $(TM_P_H) $(GIMPLE_PRETTY_PRINT_H) $(DIAGNOSTIC_CORE_H) $(TM_P_H) $(GIMPLE_PRETTY_PRINT_H)
tree-vectorizer.o: tree-vectorizer.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ tree-vectorizer.o: tree-vectorizer.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
$(TM_H) $(GGC_H) $(TREE_H) $(TREE_FLOW_H) \ dumpfile.h $(TM_H) $(GGC_H) $(TREE_H) $(TREE_FLOW_H) \
$(CFGLOOP_H) $(TREE_PASS_H) $(TREE_VECTORIZER_H) \ $(CFGLOOP_H) $(TREE_PASS_H) $(TREE_VECTORIZER_H) \
$(TREE_PRETTY_PRINT_H) $(TREE_PRETTY_PRINT_H)
tree-loop-distribution.o: tree-loop-distribution.c $(CONFIG_H) $(SYSTEM_H) \ tree-loop-distribution.o: tree-loop-distribution.c $(CONFIG_H) $(SYSTEM_H) \
...@@ -2623,7 +2623,7 @@ diagnostic.o : diagnostic.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ ...@@ -2623,7 +2623,7 @@ diagnostic.o : diagnostic.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
version.h $(DEMANGLE_H) $(INPUT_H) intl.h $(BACKTRACE_H) $(DIAGNOSTIC_H) \ version.h $(DEMANGLE_H) $(INPUT_H) intl.h $(BACKTRACE_H) $(DIAGNOSTIC_H) \
diagnostic.def diagnostic.def
opts.o : opts.c $(OPTS_H) $(OPTIONS_H) $(DIAGNOSTIC_CORE_H) $(CONFIG_H) $(SYSTEM_H) \ opts.o : opts.c $(OPTS_H) $(OPTIONS_H) $(DIAGNOSTIC_CORE_H) $(CONFIG_H) $(SYSTEM_H) \
coretypes.h $(TM_H) \ coretypes.h dumpfile.h $(TM_H) \
$(DIAGNOSTIC_H) insn-attr-common.h intl.h $(COMMON_TARGET_H) \ $(DIAGNOSTIC_H) insn-attr-common.h intl.h $(COMMON_TARGET_H) \
$(FLAGS_H) $(PARAMS_H) opts-diagnostic.h $(FLAGS_H) $(PARAMS_H) opts-diagnostic.h
opts-global.o : opts-global.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ opts-global.o : opts-global.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
...@@ -2923,6 +2923,8 @@ dce.o : dce.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ ...@@ -2923,6 +2923,8 @@ dce.o : dce.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
$(TREE_H) $(REGS_H) hard-reg-set.h $(FLAGS_H) $(EXCEPT_H) $(DF_H) cselib.h \ $(TREE_H) $(REGS_H) hard-reg-set.h $(FLAGS_H) $(EXCEPT_H) $(DF_H) cselib.h \
$(DBGCNT_H) dce.h $(VALTRACK_H) $(TREE_PASS_H) $(DBGCNT_H) $(TM_P_H) \ $(DBGCNT_H) dce.h $(VALTRACK_H) $(TREE_PASS_H) $(DBGCNT_H) $(TM_P_H) \
$(EMIT_RTL_H) $(EMIT_RTL_H)
dumpfile.o: dumpfile.c dumpfile.h $(CONFIG_H) $(SYSTEM_H) coretypes.h \
$(DIAGNOSTIC_CORE_H) $(GIMPLE_PRETTY_PRINT_H) $(TREE_H)
dse.o : dse.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ dse.o : dse.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
$(TREE_H) $(TM_P_H) $(REGS_H) hard-reg-set.h $(FLAGS_H) insn-config.h \ $(TREE_H) $(TM_P_H) $(REGS_H) hard-reg-set.h $(FLAGS_H) insn-config.h \
$(RECOG_H) $(EXPR_H) $(DF_H) cselib.h $(DBGCNT_H) \ $(RECOG_H) $(EXPR_H) $(DF_H) cselib.h $(DBGCNT_H) \
......
...@@ -2535,7 +2535,7 @@ print_ada_declaration (pretty_printer *buffer, tree t, tree type, ...@@ -2535,7 +2535,7 @@ print_ada_declaration (pretty_printer *buffer, tree t, tree type,
int is_class = false; int is_class = false;
tree name = TYPE_NAME (TREE_TYPE (t)); tree name = TYPE_NAME (TREE_TYPE (t));
tree decl_name = DECL_NAME (t); tree decl_name = DECL_NAME (t);
bool dump_internal = get_dump_file_info (TDI_ada)->flags & TDF_RAW; bool dump_internal = get_dump_file_info (TDI_ada)->pflags & TDF_RAW;
tree orig = NULL_TREE; tree orig = NULL_TREE;
if (cpp_check && cpp_check (t, IS_TEMPLATE)) if (cpp_check && cpp_check (t, IS_TEMPLATE))
......
2012-09-30 Sharad Singhai <singhai@google.com>
* c-decl.c (c_write_global_declarations): Use a different method
to determine if the dump has ben initialized.
2012-09-14 Joseph Myers <joseph@codesourcery.com> 2012-09-14 Joseph Myers <joseph@codesourcery.com>
PR c/54552 PR c/54552
......
...@@ -10079,10 +10079,10 @@ c_write_global_declarations (void) ...@@ -10079,10 +10079,10 @@ c_write_global_declarations (void)
gcc_assert (!current_scope); gcc_assert (!current_scope);
/* Handle -fdump-ada-spec[-slim]. */ /* Handle -fdump-ada-spec[-slim]. */
if (dump_enabled_p (TDI_ada)) if (dump_initialized_p (TDI_ada))
{ {
/* Build a table of files to generate specs for */ /* Build a table of files to generate specs for */
if (get_dump_file_info (TDI_ada)->flags & TDF_SLIM) if (get_dump_file_info (TDI_ada)->pflags & TDF_SLIM)
collect_source_ref (main_input_filename); collect_source_ref (main_input_filename);
else else
for_each_global_decl (collect_source_ref_cb); for_each_global_decl (collect_source_ref_cb);
......
...@@ -141,9 +141,6 @@ bool use_gnu_debug_info_extensions ...@@ -141,9 +141,6 @@ bool use_gnu_debug_info_extensions
Variable Variable
unsigned int initial_max_fld_align = TARGET_DEFAULT_PACK_STRUCT unsigned int initial_max_fld_align = TARGET_DEFAULT_PACK_STRUCT
Variable
enum vect_verbosity_levels user_vect_verbosity_level = MAX_VERBOSITY_LEVEL
; Type of stack check. ; Type of stack check.
Variable Variable
enum stack_check_type flag_stack_check = NO_STACK_CHECK enum stack_check_type flag_stack_check = NO_STACK_CHECK
...@@ -1536,6 +1533,14 @@ fomit-frame-pointer ...@@ -1536,6 +1533,14 @@ fomit-frame-pointer
Common Report Var(flag_omit_frame_pointer) Optimization Common Report Var(flag_omit_frame_pointer) Optimization
When possible do not generate stack frames When possible do not generate stack frames
fopt-info
Common Report Var(flag_opt_info) Optimization
Enable all optimization info dumps on stderr
fopt-info-
Common Joined RejectNegative Var(common_deferred_options) Defer
-fopt-info[-<type>=filename] Dump compiler optimization details
foptimize-register-move foptimize-register-move
Common Report Var(flag_regmove) Optimization Common Report Var(flag_regmove) Optimization
Do the full register move optimization pass Do the full register move optimization pass
...@@ -2195,6 +2200,10 @@ ftree-vectorize ...@@ -2195,6 +2200,10 @@ ftree-vectorize
Common Report Var(flag_tree_vectorize) Optimization Common Report Var(flag_tree_vectorize) Optimization
Enable loop vectorization on trees Enable loop vectorization on trees
ftree-vectorizer-verbose=
Common RejectNegative Joined UInteger Var(common_deferred_options) Defer
-ftree-vectorizer-verbose=<number> This switch is deprecated. Use -fopt-info instead.
ftree-slp-vectorize ftree-slp-vectorize
Common Report Var(flag_tree_slp_vectorize) Init(2) Optimization Common Report Var(flag_tree_slp_vectorize) Init(2) Optimization
Enable basic block vectorization (SLP) on trees Enable basic block vectorization (SLP) on trees
...@@ -2207,10 +2216,6 @@ ftree-vect-loop-version ...@@ -2207,10 +2216,6 @@ ftree-vect-loop-version
Common Report Var(flag_tree_vect_loop_version) Init(1) Optimization Common Report Var(flag_tree_vect_loop_version) Init(1) Optimization
Enable loop versioning when doing loop vectorization on trees Enable loop versioning when doing loop vectorization on trees
ftree-vectorizer-verbose=
Common RejectNegative Joined UInteger
-ftree-vectorizer-verbose=<number> Set the verbosity level of the vectorizer
ftree-scev-cprop ftree-scev-cprop
Common Report Var(flag_tree_scev_cprop) Init(1) Optimization Common Report Var(flag_tree_scev_cprop) Init(1) Optimization
Enable copy propagation of scalar-evolution information. Enable copy propagation of scalar-evolution information.
......
2012-09-30 Sharad Singhai <singhai@google.com>
* decl2.c (cp_write_global_declarations): Use a different method
to determine if the dump has ben initialized.
2012-09-29 Paolo Carlini <paolo.carlini@oracle.com> 2012-09-29 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/54738 PR c++/54738
......
...@@ -3698,9 +3698,9 @@ cp_write_global_declarations (void) ...@@ -3698,9 +3698,9 @@ cp_write_global_declarations (void)
cgraph_process_same_body_aliases (); cgraph_process_same_body_aliases ();
/* Handle -fdump-ada-spec[-slim] */ /* Handle -fdump-ada-spec[-slim] */
if (dump_enabled_p (TDI_ada)) if (dump_initialized_p (TDI_ada))
{ {
if (get_dump_file_info (TDI_ada)->flags & TDF_SLIM) if (get_dump_file_info (TDI_ada)->pflags & TDF_SLIM)
collect_source_ref (main_input_filename); collect_source_ref (main_input_filename);
else else
collect_source_refs (global_namespace); collect_source_refs (global_namespace);
......
...@@ -22,6 +22,8 @@ along with GCC; see the file COPYING3. If not see ...@@ -22,6 +22,8 @@ along with GCC; see the file COPYING3. If not see
#ifndef GCC_DUMPFILE_H #ifndef GCC_DUMPFILE_H
#define GCC_DUMPFILE_H 1 #define GCC_DUMPFILE_H 1
#include "line-map.h"
/* Different tree dump places. When you add new tree dump places, /* Different tree dump places. When you add new tree dump places,
extend the DUMP_FILES array in tree-dump.c. */ extend the DUMP_FILES array in tree-dump.c. */
enum tree_dump_index enum tree_dump_index
...@@ -43,9 +45,11 @@ enum tree_dump_index ...@@ -43,9 +45,11 @@ enum tree_dump_index
TDI_end TDI_end
}; };
/* Bit masks to control dumping. Not all values are applicable to /* Bit masks to control dumping. Not all values are applicable to all
all dumps. Add new ones at the end. When you define new dumps. Add new ones at the end. When you define new values, extend
values, extend the DUMP_OPTIONS array in tree-dump.c */ the DUMP_OPTIONS array in tree-dump.c. The TDF_* flags coexist with
MSG_* flags (for -fopt-info) and the bit values must be chosen
to allow that. */
#define TDF_ADDRESS (1 << 0) /* dump node addresses */ #define TDF_ADDRESS (1 << 0) /* dump node addresses */
#define TDF_SLIM (1 << 1) /* don't go wild following links */ #define TDF_SLIM (1 << 1) /* don't go wild following links */
#define TDF_RAW (1 << 2) /* don't unparse the function */ #define TDF_RAW (1 << 2) /* don't unparse the function */
...@@ -82,18 +86,59 @@ enum tree_dump_index ...@@ -82,18 +86,59 @@ enum tree_dump_index
#define TDF_CSELIB (1 << 23) /* Dump cselib details. */ #define TDF_CSELIB (1 << 23) /* Dump cselib details. */
#define TDF_SCEV (1 << 24) /* Dump SCEV details. */ #define TDF_SCEV (1 << 24) /* Dump SCEV details. */
#define TDF_COMMENT (1 << 25) /* Dump lines with prefix ";;" */ #define TDF_COMMENT (1 << 25) /* Dump lines with prefix ";;" */
#define MSG_OPTIMIZED_LOCATIONS (1 << 26) /* -fopt-info optimized sources */
#define MSG_MISSED_OPTIMIZATION (1 << 27) /* missed opportunities */
#define MSG_NOTE (1 << 28) /* general optimization info */
#define MSG_ALL (MSG_OPTIMIZED_LOCATIONS | MSG_MISSED_OPTIMIZATION \
| MSG_NOTE)
/* Define a tree dump switch. */
struct dump_file_info
{
const char *suffix; /* suffix to give output file. */
const char *swtch; /* command line dump switch */
const char *glob; /* command line glob */
const char *pfilename; /* filename for the pass-specific stream */
const char *alt_filename; /* filename for the opt-info stream */
FILE *pstream; /* pass-specific dump stream */
FILE *alt_stream; /* opt-info stream */
int pflags; /* dump flags */
int alt_flags; /* flags for opt-info */
int pstate; /* state of pass-specific stream */
int alt_state; /* state of the opt-info stream */
int num; /* dump file number */
};
/* In tree-dump.c */
/* In dumpfile.c */
extern char *get_dump_file_name (int); extern char *get_dump_file_name (int);
extern int dump_enabled_p (int);
extern int dump_initialized_p (int); extern int dump_initialized_p (int);
extern FILE *dump_begin (int, int *); extern FILE *dump_begin (int, int *);
extern void dump_end (int, FILE *); extern void dump_end (int, FILE *);
extern int dump_start (int, int *);
extern void dump_finish (int);
extern void dump_node (const_tree, int, FILE *); extern void dump_node (const_tree, int, FILE *);
extern int dump_switch_p (const char *); extern int dump_switch_p (const char *);
extern int opt_info_switch_p (const char *);
extern const char *dump_flag_name (int); extern const char *dump_flag_name (int);
extern bool dump_kind_p (int);
extern void dump_printf (int, const char *, ...) ATTRIBUTE_PRINTF_2;
extern void dump_printf_loc (int, source_location,
const char *, ...) ATTRIBUTE_PRINTF_3;
extern void dump_basic_block (int, basic_block, int);
extern void dump_generic_expr_loc (int, source_location, int, tree);
extern void dump_generic_expr (int, int, tree);
extern void dump_gimple_stmt_loc (int, source_location, int, gimple, int);
extern void dump_gimple_stmt (int, int, gimple, int);
extern void print_combine_total_stats (void);
extern unsigned int dump_register (const char *, const char *, const char *,
int);
extern bool enable_rtl_dump_file (void);
/* In combine.c */
extern void dump_combine_total_stats (FILE *);
/* In cfghooks.c */
extern void dump_bb (FILE *, basic_block, int, int);
/* Global variables used to communicate with passes. */ /* Global variables used to communicate with passes. */
extern FILE *dump_file; extern FILE *dump_file;
...@@ -103,16 +148,4 @@ extern const char *dump_file_name; ...@@ -103,16 +148,4 @@ extern const char *dump_file_name;
/* Return the dump_file_info for the given phase. */ /* Return the dump_file_info for the given phase. */
extern struct dump_file_info *get_dump_file_info (int); extern struct dump_file_info *get_dump_file_info (int);
/* Define a tree dump switch. */
struct dump_file_info
{
const char *suffix; /* suffix to give output file. */
const char *swtch; /* command line switch */
const char *glob; /* command line glob */
int flags; /* user flags */
int state; /* state of play */
int num; /* dump file number */
};
#endif /* GCC_DUMPFILE_H */ #endif /* GCC_DUMPFILE_H */
...@@ -200,20 +200,4 @@ enum fp_contract_mode { ...@@ -200,20 +200,4 @@ enum fp_contract_mode {
FP_CONTRACT_FAST = 2 FP_CONTRACT_FAST = 2
}; };
/* Vectorizer verbosity levels. */
enum vect_verbosity_levels {
REPORT_NONE,
REPORT_VECTORIZED_LOCATIONS,
REPORT_UNVECTORIZED_LOCATIONS,
REPORT_COST,
REPORT_ALIGNMENT,
REPORT_DR_DETAILS,
REPORT_BAD_FORM_LOOPS,
REPORT_OUTER_LOOPS,
REPORT_SLP,
REPORT_DETAILS,
/* New verbosity levels should be added before this one. */
MAX_VERBOSITY_LEVEL
};
#endif /* ! GCC_FLAG_TYPES_H */ #endif /* ! GCC_FLAG_TYPES_H */
...@@ -233,6 +233,40 @@ read_cmdline_options (struct gcc_options *opts, struct gcc_options *opts_set, ...@@ -233,6 +233,40 @@ read_cmdline_options (struct gcc_options *opts, struct gcc_options *opts_set,
} }
} }
/* Handle -ftree-vectorizer-verbose=ARG by remapping it to -fopt-info.
It remaps the old verbosity values as following:
REPORT_NONE ==> No dump is output
REPORT_VECTORIZED_LOCATIONS ==> "-optimized"
REPORT_UNVECTORIZED_LOCATIONS ==> "-missed"
Any higher verbosity levels get mapped to "-optall" flags. */
static void
dump_remap_tree_vectorizer_verbose (const char *arg)
{
int value = atoi (arg);
const char *remapped_opt_info = NULL;
switch (value)
{
case 0:
break;
case 1:
remapped_opt_info = "optimized";
break;
case 2:
remapped_opt_info = "missed";
break;
default:
remapped_opt_info = "optall";
break;
}
if (remapped_opt_info)
opt_info_switch_p (remapped_opt_info);
}
/* Language mask determined at initialization. */ /* Language mask determined at initialization. */
static unsigned int initial_lang_mask; static unsigned int initial_lang_mask;
...@@ -322,6 +356,9 @@ handle_common_deferred_options (void) ...@@ -322,6 +356,9 @@ handle_common_deferred_options (void)
if (flag_dump_all_passed) if (flag_dump_all_passed)
enable_rtl_dump_file (); enable_rtl_dump_file ();
if (flag_opt_info)
opt_info_switch_p (NULL);
FOR_EACH_VEC_ELT (cl_deferred_option, vec, i, opt) FOR_EACH_VEC_ELT (cl_deferred_option, vec, i, opt)
{ {
switch (opt->opt_index) switch (opt->opt_index)
...@@ -351,6 +388,12 @@ handle_common_deferred_options (void) ...@@ -351,6 +388,12 @@ handle_common_deferred_options (void)
error ("unrecognized command line option %<-fdump-%s%>", opt->arg); error ("unrecognized command line option %<-fdump-%s%>", opt->arg);
break; break;
case OPT_fopt_info_:
if (!opt_info_switch_p (opt->arg))
error ("unrecognized command line option %<-fopt-info%s%>",
opt->arg);
break;
case OPT_fenable_: case OPT_fenable_:
case OPT_fdisable_: case OPT_fdisable_:
if (opt->opt_index == OPT_fenable_) if (opt->opt_index == OPT_fenable_)
...@@ -410,6 +453,10 @@ handle_common_deferred_options (void) ...@@ -410,6 +453,10 @@ handle_common_deferred_options (void)
stack_limit_rtx = gen_rtx_SYMBOL_REF (Pmode, ggc_strdup (opt->arg)); stack_limit_rtx = gen_rtx_SYMBOL_REF (Pmode, ggc_strdup (opt->arg));
break; break;
case OPT_ftree_vectorizer_verbose_:
dump_remap_tree_vectorizer_verbose (opt->arg);
break;
default: default:
gcc_unreachable (); gcc_unreachable ();
} }
......
...@@ -139,19 +139,6 @@ set_struct_debug_option (struct gcc_options *opts, location_t loc, ...@@ -139,19 +139,6 @@ set_struct_debug_option (struct gcc_options *opts, location_t loc,
} }
} }
/* Handle -ftree-vectorizer-verbose=VAL for options OPTS. */
static void
vect_set_verbosity_level (struct gcc_options *opts, int val)
{
if (val < MAX_VERBOSITY_LEVEL)
opts->x_user_vect_verbosity_level = (enum vect_verbosity_levels) val;
else
opts->x_user_vect_verbosity_level
= (enum vect_verbosity_levels) (MAX_VERBOSITY_LEVEL - 1);
}
/* Strip off a legitimate source ending from the input string NAME of /* Strip off a legitimate source ending from the input string NAME of
length LEN. Rather than having to know the names used by all of length LEN. Rather than having to know the names used by all of
our front ends, we strip off an ending of a period followed by our front ends, we strip off an ending of a period followed by
...@@ -1559,6 +1546,11 @@ common_handle_option (struct gcc_options *opts, ...@@ -1559,6 +1546,11 @@ common_handle_option (struct gcc_options *opts,
diagnostic_set_caret_max_width (dc, value); diagnostic_set_caret_max_width (dc, value);
break; break;
case OPT_fopt_info:
case OPT_fopt_info_:
/* Deferred. */
break;
case OPT_fpack_struct_: case OPT_fpack_struct_:
if (value <= 0 || (value & (value - 1)) || value > 16) if (value <= 0 || (value & (value - 1)) || value > 16)
error_at (loc, error_at (loc,
...@@ -1694,7 +1686,9 @@ common_handle_option (struct gcc_options *opts, ...@@ -1694,7 +1686,9 @@ common_handle_option (struct gcc_options *opts,
break; break;
case OPT_ftree_vectorizer_verbose_: case OPT_ftree_vectorizer_verbose_:
vect_set_verbosity_level (opts, value); /* -ftree-vectorizer-verbose is deprecated. It is defined in
-terms of fopt-info=N. */
/* Deferred. */
break; break;
case OPT_g: case OPT_g:
......
...@@ -231,27 +231,23 @@ finish_optimization_passes (void) ...@@ -231,27 +231,23 @@ finish_optimization_passes (void)
timevar_push (TV_DUMP); timevar_push (TV_DUMP);
if (profile_arc_flag || flag_test_coverage || flag_branch_probabilities) if (profile_arc_flag || flag_test_coverage || flag_branch_probabilities)
{ {
dump_file = dump_begin (pass_profile.pass.static_pass_number, NULL); dump_start (pass_profile.pass.static_pass_number, NULL);
end_branch_prob (); end_branch_prob ();
if (dump_file) dump_finish (pass_profile.pass.static_pass_number);
dump_end (pass_profile.pass.static_pass_number, dump_file);
} }
if (optimize > 0) if (optimize > 0)
{ {
dump_file = dump_begin (pass_combine.pass.static_pass_number, NULL); dump_start (pass_profile.pass.static_pass_number, NULL);
if (dump_file) print_combine_total_stats ();
{ dump_finish (pass_combine.pass.static_pass_number);
dump_combine_total_stats (dump_file);
dump_end (pass_combine.pass.static_pass_number, dump_file);
}
} }
/* Do whatever is necessary to finish printing the graphs. */ /* Do whatever is necessary to finish printing the graphs. */
if (graph_dump_format != no_graph) if (graph_dump_format != no_graph)
for (i = TDI_end; (dfi = get_dump_file_info (i)) != NULL; ++i) for (i = TDI_end; (dfi = get_dump_file_info (i)) != NULL; ++i)
if (dump_initialized_p (i) if (dump_initialized_p (i)
&& (dfi->flags & TDF_GRAPH) != 0 && (dfi->pflags & TDF_GRAPH) != 0
&& (name = get_dump_file_name (i)) != NULL) && (name = get_dump_file_name (i)) != NULL)
{ {
finish_graph_dump_file (name); finish_graph_dump_file (name);
...@@ -1238,9 +1234,9 @@ register_pass (struct register_pass_info *pass_info) ...@@ -1238,9 +1234,9 @@ register_pass (struct register_pass_info *pass_info)
else else
tdi = TDI_rtl_all; tdi = TDI_rtl_all;
/* Check if dump-all flag is specified. */ /* Check if dump-all flag is specified. */
if (get_dump_file_info (tdi)->state) if (get_dump_file_info (tdi)->pstate)
get_dump_file_info (added_pass_nodes->pass->static_pass_number) get_dump_file_info (added_pass_nodes->pass->static_pass_number)
->state = get_dump_file_info (tdi)->state; ->pstate = get_dump_file_info (tdi)->pstate;
XDELETE (added_pass_nodes); XDELETE (added_pass_nodes);
added_pass_nodes = next_node; added_pass_nodes = next_node;
} }
...@@ -1945,7 +1941,7 @@ pass_init_dump_file (struct opt_pass *pass) ...@@ -1945,7 +1941,7 @@ pass_init_dump_file (struct opt_pass *pass)
{ {
bool initializing_dump = !dump_initialized_p (pass->static_pass_number); bool initializing_dump = !dump_initialized_p (pass->static_pass_number);
dump_file_name = get_dump_file_name (pass->static_pass_number); dump_file_name = get_dump_file_name (pass->static_pass_number);
dump_file = dump_begin (pass->static_pass_number, &dump_flags); dump_start (pass->static_pass_number, &dump_flags);
if (dump_file && current_function_decl) if (dump_file && current_function_decl)
dump_function_header (dump_file, current_function_decl, dump_flags); dump_function_header (dump_file, current_function_decl, dump_flags);
return initializing_dump; return initializing_dump;
...@@ -1967,11 +1963,7 @@ pass_fini_dump_file (struct opt_pass *pass) ...@@ -1967,11 +1963,7 @@ pass_fini_dump_file (struct opt_pass *pass)
dump_file_name = NULL; dump_file_name = NULL;
} }
if (dump_file) dump_finish (pass->static_pass_number);
{
dump_end (pass->static_pass_number, dump_file);
dump_file = NULL;
}
} }
/* After executing the pass, apply expected changes to the function /* After executing the pass, apply expected changes to the function
...@@ -2213,7 +2205,7 @@ execute_one_pass (struct opt_pass *pass) ...@@ -2213,7 +2205,7 @@ execute_one_pass (struct opt_pass *pass)
&& (cfun->curr_properties & (PROP_cfg | PROP_rtl)) && (cfun->curr_properties & (PROP_cfg | PROP_rtl))
== (PROP_cfg | PROP_rtl)) == (PROP_cfg | PROP_rtl))
{ {
get_dump_file_info (pass->static_pass_number)->flags |= TDF_GRAPH; get_dump_file_info (pass->static_pass_number)->pflags |= TDF_GRAPH;
dump_flags |= TDF_GRAPH; dump_flags |= TDF_GRAPH;
clean_graph_dump_file (dump_file_name); clean_graph_dump_file (dump_file_name);
} }
......
...@@ -255,7 +255,7 @@ void ...@@ -255,7 +255,7 @@ void
statistics_init (void) statistics_init (void)
{ {
statistics_dump_file = dump_begin (statistics_dump_nr, NULL); statistics_dump_file = dump_begin (statistics_dump_nr, NULL);
statistics_dump_flags = get_dump_file_info (statistics_dump_nr)->flags; statistics_dump_flags = get_dump_file_info (statistics_dump_nr)->pflags;
} }
/* Lookup or add a statistics counter in the hashtable HASH with ID, VAL /* Lookup or add a statistics counter in the hashtable HASH with ID, VAL
......
...@@ -32,5 +32,5 @@ sse2_test (void) ...@@ -32,5 +32,5 @@ sse2_test (void)
} }
} }
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */ /* { dg-final { scan-tree-dump-times "Vectorized loops: 1" 1 "vect" } } */
/* { dg-final { cleanup-tree-dump "vect" } } */ /* { dg-final { cleanup-tree-dump "vect" } } */
...@@ -26,17 +26,10 @@ along with GCC; see the file COPYING3. If not see ...@@ -26,17 +26,10 @@ along with GCC; see the file COPYING3. If not see
#include "tree.h" #include "tree.h"
#include "splay-tree.h" #include "splay-tree.h"
#include "filenames.h" #include "filenames.h"
#include "diagnostic-core.h"
#include "toplev.h"
#include "tree-dump.h" #include "tree-dump.h"
#include "langhooks.h" #include "langhooks.h"
#include "tree-iterator.h" #include "tree-iterator.h"
/* If non-NULL, return one past-the-end of the matching SUBPART of
the WHOLE string. */
#define skip_leading_substring(whole, part) \
(strncmp (whole, part, strlen (part)) ? NULL : whole + strlen (part))
static unsigned int queue (dump_info_p, const_tree, int); static unsigned int queue (dump_info_p, const_tree, int);
static void dump_index (dump_info_p, unsigned int); static void dump_index (dump_info_p, unsigned int);
static void dequeue_and_dump (dump_info_p); static void dequeue_and_dump (dump_info_p);
...@@ -162,6 +155,22 @@ dump_maybe_newline (dump_info_p di) ...@@ -162,6 +155,22 @@ dump_maybe_newline (dump_info_p di)
} }
} }
/* Dump FUNCTION_DECL FN as tree dump PHASE. */
void
dump_function (int phase, tree fn)
{
FILE *stream;
int flags;
stream = dump_begin (phase, &flags);
if (stream)
{
dump_function_to_file (fn, stream, flags);
dump_end (phase, stream);
}
}
/* Dump pointer PTR using FIELD to identify it. */ /* Dump pointer PTR using FIELD to identify it. */
void void
...@@ -766,362 +775,3 @@ dump_node (const_tree t, int flags, FILE *stream) ...@@ -766,362 +775,3 @@ dump_node (const_tree t, int flags, FILE *stream)
} }
splay_tree_delete (di.nodes); splay_tree_delete (di.nodes);
} }
/* Table of tree dump switches. This must be consistent with the
tree_dump_index enumeration in tree-pass.h. */
static struct dump_file_info dump_files[TDI_end] =
{
{NULL, NULL, NULL, 0, 0, 0},
{".cgraph", "ipa-cgraph", NULL, TDF_IPA, 0, 0},
{".tu", "translation-unit", NULL, TDF_TREE, 0, 1},
{".class", "class-hierarchy", NULL, TDF_TREE, 0, 2},
{".original", "tree-original", NULL, TDF_TREE, 0, 3},
{".gimple", "tree-gimple", NULL, TDF_TREE, 0, 4},
{".nested", "tree-nested", NULL, TDF_TREE, 0, 5},
{".vcg", "tree-vcg", NULL, TDF_TREE, 0, 6},
{".ads", "ada-spec", NULL, 0, 0, 7},
#define FIRST_AUTO_NUMBERED_DUMP 8
{NULL, "tree-all", NULL, TDF_TREE, 0, 0},
{NULL, "rtl-all", NULL, TDF_RTL, 0, 0},
{NULL, "ipa-all", NULL, TDF_IPA, 0, 0},
};
/* Dynamically registered tree dump files and switches. */
static struct dump_file_info *extra_dump_files;
static size_t extra_dump_files_in_use;
static size_t extra_dump_files_alloced;
/* Define a name->number mapping for a dump flag value. */
struct dump_option_value_info
{
const char *const name; /* the name of the value */
const int value; /* the value of the name */
};
/* Table of dump options. This must be consistent with the TDF_* flags
in tree.h */
static const struct dump_option_value_info dump_options[] =
{
{"address", TDF_ADDRESS},
{"asmname", TDF_ASMNAME},
{"slim", TDF_SLIM},
{"raw", TDF_RAW},
{"graph", TDF_GRAPH},
{"details", TDF_DETAILS},
{"cselib", TDF_CSELIB},
{"stats", TDF_STATS},
{"blocks", TDF_BLOCKS},
{"vops", TDF_VOPS},
{"lineno", TDF_LINENO},
{"uid", TDF_UID},
{"stmtaddr", TDF_STMTADDR},
{"memsyms", TDF_MEMSYMS},
{"verbose", TDF_VERBOSE},
{"eh", TDF_EH},
{"alias", TDF_ALIAS},
{"nouid", TDF_NOUID},
{"enumerate_locals", TDF_ENUMERATE_LOCALS},
{"scev", TDF_SCEV},
{"all", ~(TDF_RAW | TDF_SLIM | TDF_LINENO | TDF_TREE | TDF_RTL | TDF_IPA
| TDF_STMTADDR | TDF_GRAPH | TDF_DIAGNOSTIC | TDF_VERBOSE
| TDF_RHS_ONLY | TDF_NOUID | TDF_ENUMERATE_LOCALS | TDF_SCEV)},
{NULL, 0}
};
unsigned int
dump_register (const char *suffix, const char *swtch, const char *glob,
int flags)
{
static int next_dump = FIRST_AUTO_NUMBERED_DUMP;
int num = next_dump++;
size_t count = extra_dump_files_in_use++;
if (count >= extra_dump_files_alloced)
{
if (extra_dump_files_alloced == 0)
extra_dump_files_alloced = 32;
else
extra_dump_files_alloced *= 2;
extra_dump_files = XRESIZEVEC (struct dump_file_info,
extra_dump_files,
extra_dump_files_alloced);
}
memset (&extra_dump_files[count], 0, sizeof (struct dump_file_info));
extra_dump_files[count].suffix = suffix;
extra_dump_files[count].swtch = swtch;
extra_dump_files[count].glob = glob;
extra_dump_files[count].flags = flags;
extra_dump_files[count].num = num;
return count + TDI_end;
}
/* Return the dump_file_info for the given phase. */
struct dump_file_info *
get_dump_file_info (int phase)
{
if (phase < TDI_end)
return &dump_files[phase];
else if ((size_t) (phase - TDI_end) >= extra_dump_files_in_use)
return NULL;
else
return extra_dump_files + (phase - TDI_end);
}
/* Return the name of the dump file for the given phase.
If the dump is not enabled, returns NULL. */
char *
get_dump_file_name (int phase)
{
char dump_id[10];
struct dump_file_info *dfi;
if (phase == TDI_none)
return NULL;
dfi = get_dump_file_info (phase);
if (dfi->state == 0)
return NULL;
if (dfi->num < 0)
dump_id[0] = '\0';
else
{
char suffix;
if (dfi->flags & TDF_TREE)
suffix = 't';
else if (dfi->flags & TDF_IPA)
suffix = 'i';
else
suffix = 'r';
if (snprintf (dump_id, sizeof (dump_id), ".%03d%c", dfi->num, suffix) < 0)
dump_id[0] = '\0';
}
return concat (dump_base_name, dump_id, dfi->suffix, NULL);
}
/* Begin a tree dump for PHASE. Stores any user supplied flag in
*FLAG_PTR and returns a stream to write to. If the dump is not
enabled, returns NULL.
Multiple calls will reopen and append to the dump file. */
FILE *
dump_begin (int phase, int *flag_ptr)
{
char *name;
struct dump_file_info *dfi;
FILE *stream;
if (phase == TDI_none || !dump_enabled_p (phase))
return NULL;
name = get_dump_file_name (phase);
dfi = get_dump_file_info (phase);
stream = fopen (name, dfi->state < 0 ? "w" : "a");
if (!stream)
error ("could not open dump file %qs: %m", name);
else
dfi->state = 1;
free (name);
if (flag_ptr)
*flag_ptr = dfi->flags;
return stream;
}
/* Returns nonzero if tree dump PHASE is enabled. If PHASE is
TDI_tree_all, return nonzero if any dump is enabled. */
int
dump_enabled_p (int phase)
{
if (phase == TDI_tree_all)
{
size_t i;
for (i = TDI_none + 1; i < (size_t) TDI_end; i++)
if (dump_files[i].state)
return 1;
for (i = 0; i < extra_dump_files_in_use; i++)
if (extra_dump_files[i].state)
return 1;
return 0;
}
else
{
struct dump_file_info *dfi = get_dump_file_info (phase);
return dfi->state;
}
}
/* Returns nonzero if tree dump PHASE has been initialized. */
int
dump_initialized_p (int phase)
{
struct dump_file_info *dfi = get_dump_file_info (phase);
return dfi->state > 0;
}
/* Returns the switch name of PHASE. */
const char *
dump_flag_name (int phase)
{
struct dump_file_info *dfi = get_dump_file_info (phase);
return dfi->swtch;
}
/* Finish a tree dump for PHASE. STREAM is the stream created by
dump_begin. */
void
dump_end (int phase ATTRIBUTE_UNUSED, FILE *stream)
{
fclose (stream);
}
/* Enable all tree dumps. Return number of enabled tree dumps. */
static int
dump_enable_all (int flags)
{
int ir_dump_type = (flags & (TDF_TREE | TDF_RTL | TDF_IPA));
int n = 0;
size_t i;
for (i = TDI_none + 1; i < (size_t) TDI_end; i++)
if ((dump_files[i].flags & ir_dump_type))
{
dump_files[i].state = -1;
dump_files[i].flags |= flags;
n++;
}
for (i = 0; i < extra_dump_files_in_use; i++)
if ((extra_dump_files[i].flags & ir_dump_type))
{
extra_dump_files[i].state = -1;
extra_dump_files[i].flags |= flags;
n++;
}
return n;
}
/* Parse ARG as a dump switch. Return nonzero if it is, and store the
relevant details in the dump_files array. */
static int
dump_switch_p_1 (const char *arg, struct dump_file_info *dfi, bool doglob)
{
const char *option_value;
const char *ptr;
int flags;
if (doglob && !dfi->glob)
return 0;
option_value = skip_leading_substring (arg, doglob ? dfi->glob : dfi->swtch);
if (!option_value)
return 0;
if (*option_value && *option_value != '-')
return 0;
ptr = option_value;
flags = 0;
while (*ptr)
{
const struct dump_option_value_info *option_ptr;
const char *end_ptr;
unsigned length;
while (*ptr == '-')
ptr++;
end_ptr = strchr (ptr, '-');
if (!end_ptr)
end_ptr = ptr + strlen (ptr);
length = end_ptr - ptr;
for (option_ptr = dump_options; option_ptr->name; option_ptr++)
if (strlen (option_ptr->name) == length
&& !memcmp (option_ptr->name, ptr, length))
{
flags |= option_ptr->value;
goto found;
}
warning (0, "ignoring unknown option %q.*s in %<-fdump-%s%>",
length, ptr, dfi->swtch);
found:;
ptr = end_ptr;
}
dfi->state = -1;
dfi->flags |= flags;
/* Process -fdump-tree-all and -fdump-rtl-all, by enabling all the
known dumps. */
if (dfi->suffix == NULL)
dump_enable_all (dfi->flags);
return 1;
}
int
dump_switch_p (const char *arg)
{
size_t i;
int any = 0;
for (i = TDI_none + 1; i != TDI_end; i++)
any |= dump_switch_p_1 (arg, &dump_files[i], false);
/* Don't glob if we got a hit already */
if (!any)
for (i = TDI_none + 1; i != TDI_end; i++)
any |= dump_switch_p_1 (arg, &dump_files[i], true);
for (i = 0; i < extra_dump_files_in_use; i++)
any |= dump_switch_p_1 (arg, &extra_dump_files[i], false);
if (!any)
for (i = 0; i < extra_dump_files_in_use; i++)
any |= dump_switch_p_1 (arg, &extra_dump_files[i], true);
return any;
}
/* Dump FUNCTION_DECL FN as tree dump PHASE. */
void
dump_function (int phase, tree fn)
{
FILE *stream;
int flags;
stream = dump_begin (phase, &flags);
if (stream)
{
dump_function_to_file (fn, stream, flags);
dump_end (phase, stream);
}
}
bool
enable_rtl_dump_file (void)
{
return dump_enable_all (TDF_RTL | TDF_DETAILS | TDF_BLOCKS) > 0;
}
...@@ -89,12 +89,9 @@ extern void dump_string_field (dump_info_p, const char *, const char *); ...@@ -89,12 +89,9 @@ extern void dump_string_field (dump_info_p, const char *, const char *);
extern void queue_and_dump_index (dump_info_p, const char *, const_tree, int); extern void queue_and_dump_index (dump_info_p, const char *, const_tree, int);
extern void queue_and_dump_type (dump_info_p, const_tree); extern void queue_and_dump_type (dump_info_p, const_tree);
extern void dump_function (int, tree); extern void dump_function (int, tree);
extern void dump_function_to_file (tree, FILE *, int);
extern void debug_function (tree, int);
extern int dump_flag (dump_info_p, int, const_tree); extern int dump_flag (dump_info_p, int, const_tree);
extern unsigned int dump_register (const char *, const char *, const char *, /* In tree-cfg.c */
int); extern void dump_function_to_file (tree, FILE *, int);
#endif /* ! GCC_TREE_DUMP_H */ #endif /* ! GCC_TREE_DUMP_H */
...@@ -1944,7 +1944,6 @@ gather_scalar_reductions (loop_p loop, htab_t reduction_list) ...@@ -1944,7 +1944,6 @@ gather_scalar_reductions (loop_p loop, htab_t reduction_list)
gimple_stmt_iterator gsi; gimple_stmt_iterator gsi;
loop_vec_info simple_loop_info; loop_vec_info simple_loop_info;
vect_dump = NULL;
simple_loop_info = vect_analyze_loop_form (loop); simple_loop_info = vect_analyze_loop_form (loop);
for (gsi = gsi_start_phis (loop->header); !gsi_end_p (gsi); gsi_next (&gsi)) for (gsi = gsi_start_phis (loop->header); !gsi_end_p (gsi); gsi_next (&gsi))
......
...@@ -58,6 +58,7 @@ along with GCC; see the file COPYING3. If not see ...@@ -58,6 +58,7 @@ along with GCC; see the file COPYING3. If not see
#include "config.h" #include "config.h"
#include "system.h" #include "system.h"
#include "coretypes.h" #include "coretypes.h"
#include "dumpfile.h"
#include "tm.h" #include "tm.h"
#include "ggc.h" #include "ggc.h"
#include "tree.h" #include "tree.h"
...@@ -67,13 +68,6 @@ along with GCC; see the file COPYING3. If not see ...@@ -67,13 +68,6 @@ along with GCC; see the file COPYING3. If not see
#include "tree-vectorizer.h" #include "tree-vectorizer.h"
#include "tree-pass.h" #include "tree-pass.h"
/* vect_dump will be set to stderr or dump_file if exist. */
FILE *vect_dump;
/* vect_verbosity_level set to an invalid value
to mark that it's uninitialized. */
static enum vect_verbosity_levels vect_verbosity_level = MAX_VERBOSITY_LEVEL;
/* Loop or bb location. */ /* Loop or bb location. */
LOC vect_location; LOC vect_location;
...@@ -81,82 +75,6 @@ LOC vect_location; ...@@ -81,82 +75,6 @@ LOC vect_location;
VEC(vec_void_p,heap) *stmt_vec_info_vec; VEC(vec_void_p,heap) *stmt_vec_info_vec;
/* Function vect_set_dump_settings.
Fix the verbosity level of the vectorizer if the
requested level was not set explicitly using the flag
-ftree-vectorizer-verbose=N.
Decide where to print the debugging information (dump_file/stderr).
If the user defined the verbosity level, but there is no dump file,
print to stderr, otherwise print to the dump file. */
static void
vect_set_dump_settings (bool slp)
{
vect_dump = dump_file;
/* Check if the verbosity level was defined by the user: */
if (user_vect_verbosity_level != MAX_VERBOSITY_LEVEL)
{
vect_verbosity_level = user_vect_verbosity_level;
/* Ignore user defined verbosity if dump flags require higher level of
verbosity. */
if (dump_file)
{
if (((dump_flags & TDF_DETAILS)
&& vect_verbosity_level >= REPORT_DETAILS)
|| ((dump_flags & TDF_STATS)
&& vect_verbosity_level >= REPORT_UNVECTORIZED_LOCATIONS))
return;
}
else
{
/* If there is no dump file, print to stderr in case of loop
vectorization. */
if (!slp)
vect_dump = stderr;
return;
}
}
/* User didn't specify verbosity level: */
if (dump_file && (dump_flags & TDF_DETAILS))
vect_verbosity_level = REPORT_DETAILS;
else if (dump_file && (dump_flags & TDF_STATS))
vect_verbosity_level = REPORT_UNVECTORIZED_LOCATIONS;
else
vect_verbosity_level = REPORT_NONE;
gcc_assert (dump_file || vect_verbosity_level == REPORT_NONE);
}
/* Function debug_loop_details.
For vectorization debug dumps. */
bool
vect_print_dump_info (enum vect_verbosity_levels vl)
{
if (vl > vect_verbosity_level)
return false;
if (!current_function_decl || !vect_dump)
return false;
if (vect_location == UNKNOWN_LOC)
fprintf (vect_dump, "\n%s:%d: note: ",
DECL_SOURCE_FILE (current_function_decl),
DECL_SOURCE_LINE (current_function_decl));
else
fprintf (vect_dump, "\n%d: ", LOC_LINE (vect_location));
return true;
}
/* Function vectorize_loops. /* Function vectorize_loops.
Entry point to loop vectorization phase. */ Entry point to loop vectorization phase. */
...@@ -176,9 +94,6 @@ vectorize_loops (void) ...@@ -176,9 +94,6 @@ vectorize_loops (void)
if (vect_loops_num <= 1) if (vect_loops_num <= 1)
return 0; return 0;
/* Fix the verbosity level if not defined explicitly by the user. */
vect_set_dump_settings (false);
init_stmt_vec_info_vec (); init_stmt_vec_info_vec ();
/* ----------- Analyze loops. ----------- */ /* ----------- Analyze loops. ----------- */
...@@ -190,12 +105,10 @@ vectorize_loops (void) ...@@ -190,12 +105,10 @@ vectorize_loops (void)
if (optimize_loop_nest_for_speed_p (loop)) if (optimize_loop_nest_for_speed_p (loop))
{ {
loop_vec_info loop_vinfo; loop_vec_info loop_vinfo;
vect_location = find_loop_location (loop); vect_location = find_loop_location (loop);
if (vect_location != UNKNOWN_LOC if (vect_location != UNKNOWN_LOC && dump_kind_p (MSG_ALL))
&& vect_verbosity_level > REPORT_NONE) dump_printf (MSG_ALL, "\nAnalyzing loop at %s:%d\n",
fprintf (vect_dump, "\nAnalyzing loop at %s:%d\n", LOC_FILE (vect_location), LOC_LINE (vect_location));
LOC_FILE (vect_location), LOC_LINE (vect_location));
loop_vinfo = vect_analyze_loop (loop); loop_vinfo = vect_analyze_loop (loop);
loop->aux = loop_vinfo; loop->aux = loop_vinfo;
...@@ -203,11 +116,9 @@ vectorize_loops (void) ...@@ -203,11 +116,9 @@ vectorize_loops (void)
if (!loop_vinfo || !LOOP_VINFO_VECTORIZABLE_P (loop_vinfo)) if (!loop_vinfo || !LOOP_VINFO_VECTORIZABLE_P (loop_vinfo))
continue; continue;
if (vect_location != UNKNOWN_LOC if (vect_location != UNKNOWN_LOC && dump_kind_p (MSG_ALL))
&& vect_verbosity_level > REPORT_NONE) dump_printf (MSG_ALL, "\n\nVectorizing loop at %s:%d\n",
fprintf (vect_dump, "\n\nVectorizing loop at %s:%d\n", LOC_FILE (vect_location), LOC_LINE (vect_location));
LOC_FILE (vect_location), LOC_LINE (vect_location));
vect_transform_loop (loop_vinfo); vect_transform_loop (loop_vinfo);
num_vectorized_loops++; num_vectorized_loops++;
} }
...@@ -215,11 +126,11 @@ vectorize_loops (void) ...@@ -215,11 +126,11 @@ vectorize_loops (void)
vect_location = UNKNOWN_LOC; vect_location = UNKNOWN_LOC;
statistics_counter_event (cfun, "Vectorized loops", num_vectorized_loops); statistics_counter_event (cfun, "Vectorized loops", num_vectorized_loops);
if (vect_print_dump_info (REPORT_UNVECTORIZED_LOCATIONS) if (dump_kind_p (MSG_ALL)
|| (num_vectorized_loops > 0 || (num_vectorized_loops > 0 && dump_kind_p (MSG_ALL)))
&& vect_print_dump_info (REPORT_VECTORIZED_LOCATIONS))) dump_printf_loc (MSG_ALL, vect_location,
fprintf (vect_dump, "vectorized %u loops in function.\n", "vectorized %u loops in function.\n",
num_vectorized_loops); num_vectorized_loops);
/* ----------- Finalize. ----------- */ /* ----------- Finalize. ----------- */
...@@ -248,9 +159,6 @@ execute_vect_slp (void) ...@@ -248,9 +159,6 @@ execute_vect_slp (void)
{ {
basic_block bb; basic_block bb;
/* Fix the verbosity level if not defined explicitly by the user. */
vect_set_dump_settings (true);
init_stmt_vec_info_vec (); init_stmt_vec_info_vec ();
FOR_EACH_BB (bb) FOR_EACH_BB (bb)
...@@ -260,9 +168,9 @@ execute_vect_slp (void) ...@@ -260,9 +168,9 @@ execute_vect_slp (void)
if (vect_slp_analyze_bb (bb)) if (vect_slp_analyze_bb (bb))
{ {
vect_slp_transform_bb (bb); vect_slp_transform_bb (bb);
if (dump_kind_p (MSG_OPTIMIZED_LOCATIONS))
if (vect_print_dump_info (REPORT_VECTORIZED_LOCATIONS)) dump_printf_loc (MSG_OPTIMIZED_LOCATIONS, vect_location,
fprintf (vect_dump, "basic block vectorized using SLP\n"); "basic block vectorized using SLP\n");
} }
} }
...@@ -335,12 +243,9 @@ increase_alignment (void) ...@@ -335,12 +243,9 @@ increase_alignment (void)
{ {
DECL_ALIGN (decl) = TYPE_ALIGN (vectype); DECL_ALIGN (decl) = TYPE_ALIGN (vectype);
DECL_USER_ALIGN (decl) = 1; DECL_USER_ALIGN (decl) = 1;
if (dump_file) dump_printf (MSG_NOTE, "Increasing alignment of decl: ");
{ dump_generic_expr (MSG_NOTE, TDF_SLIM, decl);
fprintf (dump_file, "Increasing alignment of decl: "); dump_printf (MSG_NOTE, "\n");
print_generic_expr (dump_file, decl, TDF_SLIM);
fprintf (dump_file, "\n");
}
} }
} }
return 0; return 0;
......
...@@ -848,9 +848,8 @@ known_alignment_for_access_p (struct data_reference *data_ref_info) ...@@ -848,9 +848,8 @@ known_alignment_for_access_p (struct data_reference *data_ref_info)
return (DR_MISALIGNMENT (data_ref_info) != -1); return (DR_MISALIGNMENT (data_ref_info) != -1);
} }
/* vect_dump will be set to stderr or dump_file if exist. */ /* Source location */
extern FILE *vect_dump; extern LOC vect_location;
extern LOC vect_loop_location;
/*-----------------------------------------------------------------*/ /*-----------------------------------------------------------------*/
/* Function prototypes. */ /* Function prototypes. */
...@@ -1012,7 +1011,5 @@ void vect_pattern_recog (loop_vec_info, bb_vec_info); ...@@ -1012,7 +1011,5 @@ void vect_pattern_recog (loop_vec_info, bb_vec_info);
/* In tree-vectorizer.c. */ /* In tree-vectorizer.c. */
unsigned vectorize_loops (void); unsigned vectorize_loops (void);
/* Vectorization debug information */
extern bool vect_print_dump_info (enum vect_verbosity_levels);
#endif /* GCC_TREE_VECTORIZER_H */ #endif /* GCC_TREE_VECTORIZER_H */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment