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
This commit is contained in:
parent
d0cfc26205
commit
78c60e3da2
27 changed files with 2137 additions and 1990 deletions
|
@ -1,3 +1,48 @@
|
|||
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>
|
||||
|
||||
PR rtl-optimization/38449:
|
||||
|
|
|
@ -916,7 +916,7 @@ MKDEPS_H = $(srcdir)/../libcpp/include/mkdeps.h
|
|||
SYMTAB_H = $(srcdir)/../libcpp/include/symtab.h $(OBSTACK_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)
|
||||
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_FLOW_H = tree-flow.h tree-flow-inline.h tree-ssa-operands.h \
|
||||
$(BITMAP_H) sbitmap.h $(BASIC_BLOCK_H) $(GIMPLE_H) \
|
||||
|
@ -1193,6 +1193,7 @@ OBJS = \
|
|||
domwalk.o \
|
||||
double-int.o \
|
||||
dse.o \
|
||||
dumpfile.o \
|
||||
dwarf2asm.o \
|
||||
dwarf2cfi.o \
|
||||
dwarf2out.o \
|
||||
|
@ -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) \
|
||||
$(EXCEPT_H) debug.h intl.h tree-diagnostic.h $(TREE_PRETTY_PRINT_H) \
|
||||
$(COMMON_TARGET_H)
|
||||
tree-dump.o: tree-dump.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
|
||||
$(TREE_H) langhooks.h toplev.h $(SPLAY_TREE_H) $(TREE_DUMP_H) \
|
||||
tree-iterator.h $(TREE_PASS_H) $(DIAGNOSTIC_H)
|
||||
tree-dump.o: tree-dump.c $(CONFIG_H) $(SYSTEM_H) $(TM_H) $(TREE_H) \
|
||||
langhooks.h $(TREE_DUMP_H) tree-iterator.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 \
|
||||
$(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) \
|
|||
coretypes.h dumpfile.h $(TREE_FLOW_H) $(CFGLOOP_H) $(TREE_DATA_REF_H) $(SCEV_H) \
|
||||
sese.h graphite-poly.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) \
|
||||
$(DIAGNOSTIC_CORE_H) $(SCEV_H) $(TREE_VECTORIZER_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) \
|
||||
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) \
|
||||
$(SCEV_H) $(TREE_VECTORIZER_H) langhooks.h $(GIMPLE_PRETTY_PRINT_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) \
|
|||
$(TREE_FLOW_H) $(CFGLOOP_H) $(EXPR_H) $(OPTABS_H) $(PARAMS_H) \
|
||||
$(TREE_DATA_REF_H) $(TREE_VECTORIZER_H) $(RECOG_H) $(DIAGNOSTIC_CORE_H) \
|
||||
$(GIMPLE_PRETTY_PRINT_H)
|
||||
tree-vect-slp.o: tree-vect-slp.c $(CONFIG_H) $(SYSTEM_H) \
|
||||
coretypes.h $(TM_H) $(GGC_H) $(TREE_H) $(TARGET_H) $(BASIC_BLOCK_H) \
|
||||
tree-vect-slp.o: tree-vect-slp.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
|
||||
dumpfile.h $(TM_H) $(GGC_H) $(TREE_H) $(TARGET_H) $(BASIC_BLOCK_H) \
|
||||
$(DIAGNOSTIC_H) $(TREE_FLOW_H) $(CFGLOOP_H) \
|
||||
$(EXPR_H) $(RECOG_H) $(OPTABS_H) $(TREE_VECTORIZER_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) \
|
|||
$(EXPR_H) $(OPTABS_H) $(SCEV_H) $(TREE_VECTORIZER_H) \
|
||||
$(DIAGNOSTIC_CORE_H) $(TM_P_H) $(GIMPLE_PRETTY_PRINT_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) \
|
||||
$(TREE_PRETTY_PRINT_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 \
|
|||
version.h $(DEMANGLE_H) $(INPUT_H) intl.h $(BACKTRACE_H) $(DIAGNOSTIC_H) \
|
||||
diagnostic.def
|
||||
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) \
|
||||
$(FLAGS_H) $(PARAMS_H) opts-diagnostic.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) \
|
|||
$(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) \
|
||||
$(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) \
|
||||
$(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) \
|
||||
|
|
|
@ -2535,7 +2535,7 @@ print_ada_declaration (pretty_printer *buffer, tree t, tree type,
|
|||
int is_class = false;
|
||||
tree name = TYPE_NAME (TREE_TYPE (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;
|
||||
|
||||
if (cpp_check && cpp_check (t, IS_TEMPLATE))
|
||||
|
|
|
@ -1,3 +1,8 @@
|
|||
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>
|
||||
|
||||
PR c/54552
|
||||
|
|
|
@ -10079,10 +10079,10 @@ c_write_global_declarations (void)
|
|||
gcc_assert (!current_scope);
|
||||
|
||||
/* 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 */
|
||||
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);
|
||||
else
|
||||
for_each_global_decl (collect_source_ref_cb);
|
||||
|
|
|
@ -141,9 +141,6 @@ bool use_gnu_debug_info_extensions
|
|||
Variable
|
||||
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.
|
||||
Variable
|
||||
enum stack_check_type flag_stack_check = NO_STACK_CHECK
|
||||
|
@ -1536,6 +1533,14 @@ fomit-frame-pointer
|
|||
Common Report Var(flag_omit_frame_pointer) Optimization
|
||||
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
|
||||
Common Report Var(flag_regmove) Optimization
|
||||
Do the full register move optimization pass
|
||||
|
@ -2195,6 +2200,10 @@ ftree-vectorize
|
|||
Common Report Var(flag_tree_vectorize) Optimization
|
||||
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
|
||||
Common Report Var(flag_tree_slp_vectorize) Init(2) Optimization
|
||||
Enable basic block vectorization (SLP) on trees
|
||||
|
@ -2207,10 +2216,6 @@ ftree-vect-loop-version
|
|||
Common Report Var(flag_tree_vect_loop_version) Init(1) Optimization
|
||||
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
|
||||
Common Report Var(flag_tree_scev_cprop) Init(1) Optimization
|
||||
Enable copy propagation of scalar-evolution information.
|
||||
|
|
|
@ -1,3 +1,8 @@
|
|||
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>
|
||||
|
||||
PR c++/54738
|
||||
|
|
|
@ -3698,9 +3698,9 @@ cp_write_global_declarations (void)
|
|||
cgraph_process_same_body_aliases ();
|
||||
|
||||
/* 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);
|
||||
else
|
||||
collect_source_refs (global_namespace);
|
||||
|
|
|
@ -330,6 +330,8 @@ Objective-C and Objective-C++ Dialects}.
|
|||
-fenable-@var{kind}-@var{pass}=@var{range-list} @gol
|
||||
-fdebug-types-section -fmem-report-wpa @gol
|
||||
-fmem-report -fpre-ipa-mem-report -fpost-ipa-mem-report -fprofile-arcs @gol
|
||||
-fopt-info @gol
|
||||
-fopt-info-@var{options}@r{[}=@var{file}@r{]} @gol
|
||||
-frandom-seed=@var{string} -fsched-verbose=@var{n} @gol
|
||||
-fsel-sched-verbose -fsel-sched-dump-cfg -fsel-sched-pipelining-verbose @gol
|
||||
-fstack-usage -ftest-coverage -ftime-report -fvar-tracking @gol
|
||||
|
@ -5350,20 +5352,23 @@ Here are some examples showing uses of these options.
|
|||
|
||||
@item -d@var{letters}
|
||||
@itemx -fdump-rtl-@var{pass}
|
||||
@itemx -fdump-rtl-@var{pass}=@var{filename}
|
||||
@opindex d
|
||||
Says to make debugging dumps during compilation at times specified by
|
||||
@var{letters}. This is used for debugging the RTL-based passes of the
|
||||
compiler. The file names for most of the dumps are made by appending
|
||||
a pass number and a word to the @var{dumpname}, and the files are
|
||||
created in the directory of the output file. Note that the pass
|
||||
number is computed statically as passes get registered into the pass
|
||||
manager. Thus the numbering is not related to the dynamic order of
|
||||
execution of passes. In particular, a pass installed by a plugin
|
||||
could have a number over 200 even if it executed quite early.
|
||||
@var{dumpname} is generated from the name of the output file, if
|
||||
explicitly specified and it is not an executable, otherwise it is the
|
||||
basename of the source file. These switches may have different effects
|
||||
when @option{-E} is used for preprocessing.
|
||||
created in the directory of the output file. In case of
|
||||
@option{=@var{filename}} option, the dump is output on the given file
|
||||
instead of the pass numbered dump files. Note that the pass number is
|
||||
computed statically as passes get registered into the pass manager.
|
||||
Thus the numbering is not related to the dynamic order of execution of
|
||||
passes. In particular, a pass installed by a plugin could have a
|
||||
number over 200 even if it executed quite early. @var{dumpname} is
|
||||
generated from the name of the output file, if explicitly specified
|
||||
and it is not an executable, otherwise it is the basename of the
|
||||
source file. These switches may have different effects when
|
||||
@option{-E} is used for preprocessing.
|
||||
|
||||
Debug dumps can be enabled with a @option{-fdump-rtl} switch or some
|
||||
@option{-d} option @var{letters}. Here are the possible
|
||||
|
@ -5744,15 +5749,18 @@ counters for each function compiled.
|
|||
|
||||
@item -fdump-tree-@var{switch}
|
||||
@itemx -fdump-tree-@var{switch}-@var{options}
|
||||
@itemx -fdump-tree-@var{switch}-@var{options}=@var{filename}
|
||||
@opindex fdump-tree
|
||||
Control the dumping at various stages of processing the intermediate
|
||||
language tree to a file. The file name is generated by appending a
|
||||
switch-specific suffix to the source file name, and the file is
|
||||
created in the same directory as the output file. If the
|
||||
@samp{-@var{options}} form is used, @var{options} is a list of
|
||||
@samp{-} separated options which control the details of the dump. Not
|
||||
all options are applicable to all dumps; those that are not
|
||||
meaningful are ignored. The following options are available
|
||||
created in the same directory as the output file. In case of
|
||||
@option{=@var{filename}} option, the dump is output on the given file
|
||||
instead of the auto named dump files. If the @samp{-@var{options}}
|
||||
form is used, @var{options} is a list of @samp{-} separated options
|
||||
which control the details of the dump. Not all options are applicable
|
||||
to all dumps; those that are not meaningful are ignored. The
|
||||
following options are available
|
||||
|
||||
@table @samp
|
||||
@item address
|
||||
|
@ -5772,7 +5780,8 @@ trees, this option inhibits dumping the bodies of control structures.
|
|||
Print a raw representation of the tree. By default, trees are
|
||||
pretty-printed into a C-like representation.
|
||||
@item details
|
||||
Enable more detailed dumps (not honored by every dump option).
|
||||
Enable more detailed dumps (not honored by every dump option). Also
|
||||
include information from the optimization passes.
|
||||
@item stats
|
||||
Enable dumping various statistics about the pass (not honored by every dump
|
||||
option).
|
||||
|
@ -5790,9 +5799,38 @@ Enable showing the tree dump for each statement.
|
|||
Enable showing the EH region number holding each statement.
|
||||
@item scev
|
||||
Enable showing scalar evolution analysis details.
|
||||
@item optimized
|
||||
Enable showing optimization information (only available in certain
|
||||
passes).
|
||||
@item missed
|
||||
Enable showing missed optimization information (only available in certain
|
||||
passes).
|
||||
@item notes
|
||||
Enable other detailed optimization information (only available in
|
||||
certain passes).
|
||||
@item =@var{filename}
|
||||
Instead of an auto named dump file, output into the given file
|
||||
name. The file names @file{stdout} and @file{stderr} are treated
|
||||
specially and are considered already open standard streams. For
|
||||
example,
|
||||
|
||||
@smallexample
|
||||
gcc -O2 -ftree-vectorize -fdump-tree-vect-blocks=foo.dump
|
||||
-fdump-tree-pre=stderr file.c
|
||||
@end smallexample
|
||||
|
||||
outputs vectorizer dump into @file{foo.dump}, while the PRE dump is
|
||||
output on to @file{stderr}. If two conflicting dump filenames are
|
||||
given for the same pass, then the latter option overrides the earlier
|
||||
one.
|
||||
|
||||
@item all
|
||||
Turn on all options, except @option{raw}, @option{slim}, @option{verbose}
|
||||
and @option{lineno}.
|
||||
|
||||
@item optall
|
||||
Turn on all optimization options, i.e., @option{optimized},
|
||||
@option{missed}, and @option{note}.
|
||||
@end table
|
||||
|
||||
The following tree dumps are possible:
|
||||
|
@ -5940,33 +5978,80 @@ is made by appending @file{.vrp} to the source file name.
|
|||
Enable all the available tree dumps with the flags provided in this option.
|
||||
@end table
|
||||
|
||||
@item -fopt-info
|
||||
@itemx -fopt-info-@var{options}
|
||||
@itemx -fopt-info-@var{options}=@var{filename}
|
||||
@opindex fopt-info
|
||||
Controls optimization dumps from all the passes. If the
|
||||
@samp{-@var{options}} form is used, @var{options} is a list of
|
||||
@samp{-} separated options to control the dump details. If
|
||||
@var{options} is not specified, it defaults to @option{optall}. If the
|
||||
@var{filename} is not specified, it defaults to @file{stderr}. Note
|
||||
that the output @var{filename} will be overwritten in case of multiple
|
||||
translation units. If a combined output from multiple translation
|
||||
units is desired, @file{stderr} should be used instead.
|
||||
|
||||
The following options are available
|
||||
|
||||
@table @samp
|
||||
@item optimized
|
||||
Print information when an optimization is successfully applied. It is
|
||||
up to a pass to decide which information is relevant. For example, the
|
||||
vectorizer pass prints the location of loop which got vectorized.
|
||||
@item missed
|
||||
Print information about missed optimizations. Individual passes
|
||||
control which information to include in the output. For example,
|
||||
|
||||
@smallexample
|
||||
gcc -O2 -ftree-vectorize -fopt-info-missed
|
||||
@end smallexample
|
||||
|
||||
will print information about missed optimization opportunities on
|
||||
stderr.
|
||||
@item note
|
||||
Print verbose information about optimizations, such as certain
|
||||
transformations, more detailed messages about decisions etc.
|
||||
@item optall
|
||||
Print detailed optimization information. This includes
|
||||
@var{optimized}, @var{missed}, and @var{note}. For example,
|
||||
|
||||
@smallexample
|
||||
gcc -O2 -ftree-vectorize -fopt-info-optall=opt.all
|
||||
@end smallexample
|
||||
|
||||
outputs detailed optimization report from all the passes into
|
||||
@file{opt.all}.
|
||||
@end table
|
||||
|
||||
It applies the dump options to all the passes. If the @var{filename}
|
||||
is provided, the dump from all the passes is concatenated, otherwise
|
||||
the dump is output onto @file{stderr}. If @var{options} is omitted, it
|
||||
defaults to @option{optall}.
|
||||
|
||||
@smallexample
|
||||
gcc -O3 -fopt-info-optimized-missed=optdump.txt
|
||||
@end smallexample
|
||||
|
||||
This will output information about missed optimizations as well as
|
||||
optimized locations from all the passes into @file{optdump.txt}.
|
||||
|
||||
@item -ftree-vectorizer-verbose=@var{n}
|
||||
@opindex ftree-vectorizer-verbose
|
||||
This option controls the amount of debugging output the vectorizer prints.
|
||||
This information is written to standard error, unless
|
||||
@option{-fdump-tree-all} or @option{-fdump-tree-vect} is specified,
|
||||
in which case it is output to the usual dump listing file, @file{.vect}.
|
||||
For @var{n}=0 no diagnostic information is reported.
|
||||
If @var{n}=1 the vectorizer reports each loop that got vectorized,
|
||||
and the total number of loops that got vectorized.
|
||||
If @var{n}=2 the vectorizer also reports non-vectorized loops that passed
|
||||
the first analysis phase (vect_analyze_loop_form) - i.e.@: countable,
|
||||
inner-most, single-bb, single-entry/exit loops. This is the same verbosity
|
||||
level that @option{-fdump-tree-vect-stats} uses.
|
||||
Higher verbosity levels mean either more information dumped for each
|
||||
reported loop, or same amount of information reported for more loops:
|
||||
if @var{n}=3, vectorizer cost model information is reported.
|
||||
If @var{n}=4, alignment related information is added to the reports.
|
||||
If @var{n}=5, data-references related information (e.g.@: memory dependences,
|
||||
memory access-patterns) is added to the reports.
|
||||
If @var{n}=6, the vectorizer reports also non-vectorized inner-most loops
|
||||
that did not pass the first analysis phase (i.e., may not be countable, or
|
||||
may have complicated control-flow).
|
||||
If @var{n}=7, the vectorizer reports also non-vectorized nested loops.
|
||||
If @var{n}=8, SLP related information is added to the reports.
|
||||
For @var{n}=9, all the information the vectorizer generates during its
|
||||
analysis and transformation is reported. This is the same verbosity level
|
||||
that @option{-fdump-tree-vect-details} uses.
|
||||
This option is deprecated and is implemented in terms of
|
||||
@option{-fopt-info}. Please use @option{-fopt-info-@var{kind}} form
|
||||
instead, where @var{kind} is one of the valid opt-info options. It
|
||||
prints additional optimization information. For @var{n}=0 no
|
||||
diagnostic information is reported. If @var{n}=1 the vectorizer
|
||||
reports each loop that got vectorized, and the total number of loops
|
||||
that got vectorized. If @var{n}=2 the vectorizer reports locations
|
||||
which could not be vectorized and the reasons for those. For any
|
||||
higher verbosity levels all the analysis and transformation
|
||||
information from the vectorizer is reported.
|
||||
|
||||
Note that the information output by @option{-ftree-vectorizer-verbose}
|
||||
option is sent to @file{stderr}. If the equivalent form
|
||||
@option{-fopt-info-@var{options}=@var{filename}} is used then the
|
||||
output is sent into @var{filename} instead.
|
||||
|
||||
@item -frandom-seed=@var{string}
|
||||
@opindex frandom-seed
|
||||
|
|
|
@ -22,6 +22,8 @@ along with GCC; see the file COPYING3. If not see
|
|||
#ifndef GCC_DUMPFILE_H
|
||||
#define GCC_DUMPFILE_H 1
|
||||
|
||||
#include "line-map.h"
|
||||
|
||||
/* Different tree dump places. When you add new tree dump places,
|
||||
extend the DUMP_FILES array in tree-dump.c. */
|
||||
enum tree_dump_index
|
||||
|
@ -43,9 +45,11 @@ enum tree_dump_index
|
|||
TDI_end
|
||||
};
|
||||
|
||||
/* Bit masks to control dumping. Not all values are applicable to
|
||||
all dumps. Add new ones at the end. When you define new
|
||||
values, extend the DUMP_OPTIONS array in tree-dump.c */
|
||||
/* Bit masks to control dumping. Not all values are applicable to all
|
||||
dumps. Add new ones at the end. When you define new values, extend
|
||||
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_SLIM (1 << 1) /* don't go wild following links */
|
||||
#define TDF_RAW (1 << 2) /* don't unparse the function */
|
||||
|
@ -82,18 +86,59 @@ enum tree_dump_index
|
|||
#define TDF_CSELIB (1 << 23) /* Dump cselib details. */
|
||||
#define TDF_SCEV (1 << 24) /* Dump SCEV details. */
|
||||
#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 int dump_enabled_p (int);
|
||||
extern int dump_initialized_p (int);
|
||||
extern FILE *dump_begin (int, int *);
|
||||
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 int dump_switch_p (const char *);
|
||||
extern int opt_info_switch_p (const char *);
|
||||
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. */
|
||||
extern FILE *dump_file;
|
||||
|
@ -103,16 +148,4 @@ extern const char *dump_file_name;
|
|||
/* Return the dump_file_info for the given phase. */
|
||||
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 */
|
||||
|
|
|
@ -200,20 +200,4 @@ enum fp_contract_mode {
|
|||
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 */
|
||||
|
|
|
@ -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. */
|
||||
static unsigned int initial_lang_mask;
|
||||
|
||||
|
@ -322,6 +356,9 @@ handle_common_deferred_options (void)
|
|||
if (flag_dump_all_passed)
|
||||
enable_rtl_dump_file ();
|
||||
|
||||
if (flag_opt_info)
|
||||
opt_info_switch_p (NULL);
|
||||
|
||||
FOR_EACH_VEC_ELT (cl_deferred_option, vec, i, opt)
|
||||
{
|
||||
switch (opt->opt_index)
|
||||
|
@ -351,6 +388,12 @@ handle_common_deferred_options (void)
|
|||
error ("unrecognized command line option %<-fdump-%s%>", opt->arg);
|
||||
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_fdisable_:
|
||||
if (opt->opt_index == OPT_fenable_)
|
||||
|
@ -410,6 +453,10 @@ handle_common_deferred_options (void)
|
|||
stack_limit_rtx = gen_rtx_SYMBOL_REF (Pmode, ggc_strdup (opt->arg));
|
||||
break;
|
||||
|
||||
case OPT_ftree_vectorizer_verbose_:
|
||||
dump_remap_tree_vectorizer_verbose (opt->arg);
|
||||
break;
|
||||
|
||||
default:
|
||||
gcc_unreachable ();
|
||||
}
|
||||
|
|
22
gcc/opts.c
22
gcc/opts.c
|
@ -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
|
||||
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
|
||||
|
@ -1559,6 +1546,11 @@ common_handle_option (struct gcc_options *opts,
|
|||
diagnostic_set_caret_max_width (dc, value);
|
||||
break;
|
||||
|
||||
case OPT_fopt_info:
|
||||
case OPT_fopt_info_:
|
||||
/* Deferred. */
|
||||
break;
|
||||
|
||||
case OPT_fpack_struct_:
|
||||
if (value <= 0 || (value & (value - 1)) || value > 16)
|
||||
error_at (loc,
|
||||
|
@ -1694,7 +1686,9 @@ common_handle_option (struct gcc_options *opts,
|
|||
break;
|
||||
|
||||
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;
|
||||
|
||||
case OPT_g:
|
||||
|
|
30
gcc/passes.c
30
gcc/passes.c
|
@ -231,27 +231,23 @@ finish_optimization_passes (void)
|
|||
timevar_push (TV_DUMP);
|
||||
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 ();
|
||||
if (dump_file)
|
||||
dump_end (pass_profile.pass.static_pass_number, dump_file);
|
||||
dump_finish (pass_profile.pass.static_pass_number);
|
||||
}
|
||||
|
||||
if (optimize > 0)
|
||||
{
|
||||
dump_file = dump_begin (pass_combine.pass.static_pass_number, NULL);
|
||||
if (dump_file)
|
||||
{
|
||||
dump_combine_total_stats (dump_file);
|
||||
dump_end (pass_combine.pass.static_pass_number, dump_file);
|
||||
}
|
||||
dump_start (pass_profile.pass.static_pass_number, NULL);
|
||||
print_combine_total_stats ();
|
||||
dump_finish (pass_combine.pass.static_pass_number);
|
||||
}
|
||||
|
||||
/* Do whatever is necessary to finish printing the graphs. */
|
||||
if (graph_dump_format != no_graph)
|
||||
for (i = TDI_end; (dfi = get_dump_file_info (i)) != NULL; ++i)
|
||||
if (dump_initialized_p (i)
|
||||
&& (dfi->flags & TDF_GRAPH) != 0
|
||||
&& (dfi->pflags & TDF_GRAPH) != 0
|
||||
&& (name = get_dump_file_name (i)) != NULL)
|
||||
{
|
||||
finish_graph_dump_file (name);
|
||||
|
@ -1238,9 +1234,9 @@ register_pass (struct register_pass_info *pass_info)
|
|||
else
|
||||
tdi = TDI_rtl_all;
|
||||
/* 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)
|
||||
->state = get_dump_file_info (tdi)->state;
|
||||
->pstate = get_dump_file_info (tdi)->pstate;
|
||||
XDELETE (added_pass_nodes);
|
||||
added_pass_nodes = next_node;
|
||||
}
|
||||
|
@ -1945,7 +1941,7 @@ pass_init_dump_file (struct opt_pass *pass)
|
|||
{
|
||||
bool initializing_dump = !dump_initialized_p (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)
|
||||
dump_function_header (dump_file, current_function_decl, dump_flags);
|
||||
return initializing_dump;
|
||||
|
@ -1967,11 +1963,7 @@ pass_fini_dump_file (struct opt_pass *pass)
|
|||
dump_file_name = NULL;
|
||||
}
|
||||
|
||||
if (dump_file)
|
||||
{
|
||||
dump_end (pass->static_pass_number, dump_file);
|
||||
dump_file = NULL;
|
||||
}
|
||||
dump_finish (pass->static_pass_number);
|
||||
}
|
||||
|
||||
/* After executing the pass, apply expected changes to the function
|
||||
|
@ -2213,7 +2205,7 @@ execute_one_pass (struct opt_pass *pass)
|
|||
&& (cfun->curr_properties & (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;
|
||||
clean_graph_dump_file (dump_file_name);
|
||||
}
|
||||
|
|
|
@ -255,7 +255,7 @@ void
|
|||
statistics_init (void)
|
||||
{
|
||||
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
|
||||
|
|
|
@ -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" } } */
|
||||
|
|
382
gcc/tree-dump.c
382
gcc/tree-dump.c
|
@ -26,17 +26,10 @@ along with GCC; see the file COPYING3. If not see
|
|||
#include "tree.h"
|
||||
#include "splay-tree.h"
|
||||
#include "filenames.h"
|
||||
#include "diagnostic-core.h"
|
||||
#include "toplev.h"
|
||||
#include "tree-dump.h"
|
||||
#include "langhooks.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 void dump_index (dump_info_p, unsigned int);
|
||||
static void dequeue_and_dump (dump_info_p);
|
||||
|
@ -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. */
|
||||
|
||||
void
|
||||
|
@ -766,362 +775,3 @@ dump_node (const_tree t, int flags, FILE *stream)
|
|||
}
|
||||
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 *);
|
|||
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 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 unsigned int dump_register (const char *, const char *, const char *,
|
||||
int);
|
||||
|
||||
/* In tree-cfg.c */
|
||||
extern void dump_function_to_file (tree, FILE *, int);
|
||||
|
||||
#endif /* ! GCC_TREE_DUMP_H */
|
||||
|
|
|
@ -1944,7 +1944,6 @@ gather_scalar_reductions (loop_p loop, htab_t reduction_list)
|
|||
gimple_stmt_iterator gsi;
|
||||
loop_vec_info simple_loop_info;
|
||||
|
||||
vect_dump = NULL;
|
||||
simple_loop_info = vect_analyze_loop_form (loop);
|
||||
|
||||
for (gsi = gsi_start_phis (loop->header); !gsi_end_p (gsi); gsi_next (&gsi))
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -23,6 +23,7 @@ along with GCC; see the file COPYING3. If not see
|
|||
#include "config.h"
|
||||
#include "system.h"
|
||||
#include "coretypes.h"
|
||||
#include "dumpfile.h"
|
||||
#include "tm.h"
|
||||
#include "ggc.h"
|
||||
#include "tree.h"
|
||||
|
@ -791,14 +792,12 @@ slpeel_make_loop_iterate_ntimes (struct loop *loop, tree niters)
|
|||
free_stmt_vec_info (orig_cond);
|
||||
|
||||
loop_loc = find_loop_location (loop);
|
||||
if (dump_file && (dump_flags & TDF_DETAILS))
|
||||
if (dump_kind_p (MSG_NOTE))
|
||||
{
|
||||
if (loop_loc != UNKNOWN_LOC)
|
||||
fprintf (dump_file, "\nloop at %s:%d: ",
|
||||
LOC_FILE (loop_loc), LOC_LINE (loop_loc));
|
||||
print_gimple_stmt (dump_file, cond_stmt, 0, TDF_SLIM);
|
||||
dump_printf (MSG_NOTE, "\nloop at %s:%d: ", LOC_FILE (loop_loc),
|
||||
LOC_LINE (loop_loc));
|
||||
dump_gimple_stmt (MSG_NOTE, TDF_SLIM, cond_stmt, 0);
|
||||
}
|
||||
|
||||
loop->nb_iterations = niters;
|
||||
}
|
||||
|
||||
|
@ -1246,13 +1245,8 @@ slpeel_tree_peel_loop_to_edge (struct loop *loop,
|
|||
if (!(new_loop = slpeel_tree_duplicate_loop_to_edge_cfg (loop, e)))
|
||||
{
|
||||
loop_loc = find_loop_location (loop);
|
||||
if (dump_file && (dump_flags & TDF_DETAILS))
|
||||
{
|
||||
if (loop_loc != UNKNOWN_LOC)
|
||||
fprintf (dump_file, "\n%s:%d: note: ",
|
||||
LOC_FILE (loop_loc), LOC_LINE (loop_loc));
|
||||
fprintf (dump_file, "tree_duplicate_loop_to_edge_cfg failed.\n");
|
||||
}
|
||||
dump_printf_loc (MSG_MISSED_OPTIMIZATION, loop_loc,
|
||||
"tree_duplicate_loop_to_edge_cfg failed.\n");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -1688,19 +1682,18 @@ vect_can_advance_ivs_p (loop_vec_info loop_vinfo)
|
|||
|
||||
/* Analyze phi functions of the loop header. */
|
||||
|
||||
if (vect_print_dump_info (REPORT_DETAILS))
|
||||
fprintf (vect_dump, "vect_can_advance_ivs_p:");
|
||||
|
||||
if (dump_kind_p (MSG_NOTE))
|
||||
dump_printf_loc (MSG_NOTE, vect_location, "vect_can_advance_ivs_p:");
|
||||
for (gsi = gsi_start_phis (bb); !gsi_end_p (gsi); gsi_next (&gsi))
|
||||
{
|
||||
tree access_fn = NULL;
|
||||
tree evolution_part;
|
||||
|
||||
phi = gsi_stmt (gsi);
|
||||
if (vect_print_dump_info (REPORT_DETAILS))
|
||||
if (dump_kind_p (MSG_NOTE))
|
||||
{
|
||||
fprintf (vect_dump, "Analyze phi: ");
|
||||
print_gimple_stmt (vect_dump, phi, 0, TDF_SLIM);
|
||||
dump_printf_loc (MSG_NOTE, vect_location, "Analyze phi: ");
|
||||
dump_gimple_stmt (MSG_NOTE, TDF_SLIM, phi, 0);
|
||||
}
|
||||
|
||||
/* Skip virtual phi's. The data dependences that are associated with
|
||||
|
@ -1708,8 +1701,9 @@ vect_can_advance_ivs_p (loop_vec_info loop_vinfo)
|
|||
|
||||
if (virtual_operand_p (PHI_RESULT (phi)))
|
||||
{
|
||||
if (vect_print_dump_info (REPORT_DETAILS))
|
||||
fprintf (vect_dump, "virtual phi. skip.");
|
||||
if (dump_kind_p (MSG_MISSED_OPTIMIZATION))
|
||||
dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
|
||||
"virtual phi. skip.");
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -1717,8 +1711,9 @@ vect_can_advance_ivs_p (loop_vec_info loop_vinfo)
|
|||
|
||||
if (STMT_VINFO_DEF_TYPE (vinfo_for_stmt (phi)) == vect_reduction_def)
|
||||
{
|
||||
if (vect_print_dump_info (REPORT_DETAILS))
|
||||
fprintf (vect_dump, "reduc phi. skip.");
|
||||
if (dump_kind_p (MSG_MISSED_OPTIMIZATION))
|
||||
dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
|
||||
"reduc phi. skip.");
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -1729,23 +1724,25 @@ vect_can_advance_ivs_p (loop_vec_info loop_vinfo)
|
|||
|
||||
if (!access_fn)
|
||||
{
|
||||
if (vect_print_dump_info (REPORT_DETAILS))
|
||||
fprintf (vect_dump, "No Access function.");
|
||||
if (dump_kind_p (MSG_MISSED_OPTIMIZATION))
|
||||
dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
|
||||
"No Access function.");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (vect_print_dump_info (REPORT_DETAILS))
|
||||
if (dump_kind_p (MSG_NOTE))
|
||||
{
|
||||
fprintf (vect_dump, "Access function of PHI: ");
|
||||
print_generic_expr (vect_dump, access_fn, TDF_SLIM);
|
||||
dump_printf_loc (MSG_NOTE, vect_location,
|
||||
"Access function of PHI: ");
|
||||
dump_generic_expr (MSG_NOTE, TDF_SLIM, access_fn);
|
||||
}
|
||||
|
||||
evolution_part = evolution_part_in_loop_num (access_fn, loop->num);
|
||||
|
||||
if (evolution_part == NULL_TREE)
|
||||
{
|
||||
if (vect_print_dump_info (REPORT_DETAILS))
|
||||
fprintf (vect_dump, "No evolution.");
|
||||
if (dump_kind_p (MSG_MISSED_OPTIMIZATION))
|
||||
dump_printf (MSG_MISSED_OPTIMIZATION, "No evolution.");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -1829,17 +1826,19 @@ vect_update_ivs_after_vectorizer (loop_vec_info loop_vinfo, tree niters,
|
|||
|
||||
phi = gsi_stmt (gsi);
|
||||
phi1 = gsi_stmt (gsi1);
|
||||
if (vect_print_dump_info (REPORT_DETAILS))
|
||||
if (dump_kind_p (MSG_NOTE))
|
||||
{
|
||||
fprintf (vect_dump, "vect_update_ivs_after_vectorizer: phi: ");
|
||||
print_gimple_stmt (vect_dump, phi, 0, TDF_SLIM);
|
||||
dump_printf_loc (MSG_NOTE, vect_location,
|
||||
"vect_update_ivs_after_vectorizer: phi: ");
|
||||
dump_gimple_stmt (MSG_NOTE, TDF_SLIM, phi, 0);
|
||||
}
|
||||
|
||||
/* Skip virtual phi's. */
|
||||
if (virtual_operand_p (PHI_RESULT (phi)))
|
||||
{
|
||||
if (vect_print_dump_info (REPORT_DETAILS))
|
||||
fprintf (vect_dump, "virtual phi. skip.");
|
||||
if (dump_kind_p (MSG_MISSED_OPTIMIZATION))
|
||||
dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
|
||||
"virtual phi. skip.");
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -1847,8 +1846,9 @@ vect_update_ivs_after_vectorizer (loop_vec_info loop_vinfo, tree niters,
|
|||
stmt_info = vinfo_for_stmt (phi);
|
||||
if (STMT_VINFO_DEF_TYPE (stmt_info) == vect_reduction_def)
|
||||
{
|
||||
if (vect_print_dump_info (REPORT_DETAILS))
|
||||
fprintf (vect_dump, "reduc phi. skip.");
|
||||
if (dump_kind_p (MSG_MISSED_OPTIMIZATION))
|
||||
dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
|
||||
"reduc phi. skip.");
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -1909,8 +1909,9 @@ vect_do_peeling_for_loop_bound (loop_vec_info loop_vinfo, tree *ratio,
|
|||
tree cond_expr = NULL_TREE;
|
||||
gimple_seq cond_expr_stmt_list = NULL;
|
||||
|
||||
if (vect_print_dump_info (REPORT_DETAILS))
|
||||
fprintf (vect_dump, "=== vect_do_peeling_for_loop_bound ===");
|
||||
if (dump_kind_p (MSG_OPTIMIZED_LOCATIONS))
|
||||
dump_printf_loc (MSG_OPTIMIZED_LOCATIONS, vect_location,
|
||||
"=== vect_do_peeling_for_loop_bound ===");
|
||||
|
||||
initialize_original_copy_tables ();
|
||||
|
||||
|
@ -1956,9 +1957,9 @@ vect_do_peeling_for_loop_bound (loop_vec_info loop_vinfo, tree *ratio,
|
|||
if (check_profitability)
|
||||
max_iter = MAX (max_iter, (int) th);
|
||||
record_niter_bound (new_loop, double_int::from_shwi (max_iter), false, true);
|
||||
if (dump_file && (dump_flags & TDF_DETAILS))
|
||||
fprintf (dump_file, "Setting upper bound of nb iterations for epilogue "
|
||||
"loop to %d\n", max_iter);
|
||||
dump_printf (MSG_OPTIMIZED_LOCATIONS,
|
||||
"Setting upper bound of nb iterations for epilogue "
|
||||
"loop to %d\n", max_iter);
|
||||
|
||||
/* After peeling we have to reset scalar evolution analyzer. */
|
||||
scev_reset ();
|
||||
|
@ -2020,8 +2021,9 @@ vect_gen_niters_for_prolog_loop (loop_vec_info loop_vinfo, tree loop_niters, int
|
|||
{
|
||||
int npeel = LOOP_PEELING_FOR_ALIGNMENT (loop_vinfo);
|
||||
|
||||
if (vect_print_dump_info (REPORT_DETAILS))
|
||||
fprintf (vect_dump, "known peeling = %d.", npeel);
|
||||
if (dump_kind_p (MSG_OPTIMIZED_LOCATIONS))
|
||||
dump_printf_loc (MSG_OPTIMIZED_LOCATIONS, vect_location,
|
||||
"known peeling = %d.", npeel);
|
||||
|
||||
iters = build_int_cst (niters_type, npeel);
|
||||
*bound = LOOP_PEELING_FOR_ALIGNMENT (loop_vinfo);
|
||||
|
@ -2073,10 +2075,11 @@ vect_gen_niters_for_prolog_loop (loop_vec_info loop_vinfo, tree loop_niters, int
|
|||
if (TREE_CODE (loop_niters) != INTEGER_CST)
|
||||
iters = fold_build2 (MIN_EXPR, niters_type, iters, loop_niters);
|
||||
|
||||
if (vect_print_dump_info (REPORT_DETAILS))
|
||||
if (dump_kind_p (MSG_OPTIMIZED_LOCATIONS))
|
||||
{
|
||||
fprintf (vect_dump, "niters for prolog loop: ");
|
||||
print_generic_expr (vect_dump, iters, TDF_SLIM);
|
||||
dump_printf_loc (MSG_OPTIMIZED_LOCATIONS, vect_location,
|
||||
"niters for prolog loop: ");
|
||||
dump_generic_expr (MSG_OPTIMIZED_LOCATIONS, TDF_SLIM, iters);
|
||||
}
|
||||
|
||||
var = create_tmp_var (niters_type, "prolog_loop_niters");
|
||||
|
@ -2129,9 +2132,10 @@ vect_update_inits_of_drs (loop_vec_info loop_vinfo, tree niters)
|
|||
unsigned int i;
|
||||
VEC (data_reference_p, heap) *datarefs = LOOP_VINFO_DATAREFS (loop_vinfo);
|
||||
struct data_reference *dr;
|
||||
|
||||
if (vect_print_dump_info (REPORT_DETAILS))
|
||||
fprintf (vect_dump, "=== vect_update_inits_of_dr ===");
|
||||
|
||||
if (dump_kind_p (MSG_OPTIMIZED_LOCATIONS))
|
||||
dump_printf_loc (MSG_OPTIMIZED_LOCATIONS, vect_location,
|
||||
"=== vect_update_inits_of_dr ===");
|
||||
|
||||
FOR_EACH_VEC_ELT (data_reference_p, datarefs, i, dr)
|
||||
vect_update_init_of_dr (dr, niters);
|
||||
|
@ -2158,8 +2162,9 @@ vect_do_peeling_for_alignment (loop_vec_info loop_vinfo,
|
|||
int max_iter;
|
||||
int bound = 0;
|
||||
|
||||
if (vect_print_dump_info (REPORT_DETAILS))
|
||||
fprintf (vect_dump, "=== vect_do_peeling_for_alignment ===");
|
||||
if (dump_kind_p (MSG_OPTIMIZED_LOCATIONS))
|
||||
dump_printf_loc (MSG_OPTIMIZED_LOCATIONS, vect_location,
|
||||
"=== vect_do_peeling_for_alignment ===");
|
||||
|
||||
initialize_original_copy_tables ();
|
||||
|
||||
|
@ -2184,9 +2189,9 @@ vect_do_peeling_for_alignment (loop_vec_info loop_vinfo,
|
|||
if (check_profitability)
|
||||
max_iter = MAX (max_iter, (int) th);
|
||||
record_niter_bound (new_loop, double_int::from_shwi (max_iter), false, true);
|
||||
if (dump_file && (dump_flags & TDF_DETAILS))
|
||||
fprintf (dump_file, "Setting upper bound of nb iterations for prologue "
|
||||
"loop to %d\n", max_iter);
|
||||
dump_printf (MSG_OPTIMIZED_LOCATIONS,
|
||||
"Setting upper bound of nb iterations for prologue "
|
||||
"loop to %d\n", max_iter);
|
||||
|
||||
/* Update number of times loop executes. */
|
||||
n_iters = LOOP_VINFO_NITERS (loop_vinfo);
|
||||
|
@ -2469,13 +2474,13 @@ vect_create_cond_for_alias_checks (loop_vec_info loop_vinfo,
|
|||
segment_length_a = vect_vfa_segment_size (dr_a, length_factor);
|
||||
segment_length_b = vect_vfa_segment_size (dr_b, length_factor);
|
||||
|
||||
if (vect_print_dump_info (REPORT_DR_DETAILS))
|
||||
if (dump_kind_p (MSG_OPTIMIZED_LOCATIONS))
|
||||
{
|
||||
fprintf (vect_dump,
|
||||
"create runtime check for data references ");
|
||||
print_generic_expr (vect_dump, DR_REF (dr_a), TDF_SLIM);
|
||||
fprintf (vect_dump, " and ");
|
||||
print_generic_expr (vect_dump, DR_REF (dr_b), TDF_SLIM);
|
||||
dump_printf_loc (MSG_OPTIMIZED_LOCATIONS, vect_location,
|
||||
"create runtime check for data references ");
|
||||
dump_generic_expr (MSG_OPTIMIZED_LOCATIONS, TDF_SLIM, DR_REF (dr_a));
|
||||
dump_printf (MSG_OPTIMIZED_LOCATIONS, " and ");
|
||||
dump_generic_expr (MSG_OPTIMIZED_LOCATIONS, TDF_SLIM, DR_REF (dr_b));
|
||||
}
|
||||
|
||||
seg_a_min = addr_base_a;
|
||||
|
@ -2500,9 +2505,10 @@ vect_create_cond_for_alias_checks (loop_vec_info loop_vinfo,
|
|||
*cond_expr = part_cond_expr;
|
||||
}
|
||||
|
||||
if (vect_print_dump_info (REPORT_VECTORIZED_LOCATIONS))
|
||||
fprintf (vect_dump, "created %u versioning for alias checks.\n",
|
||||
VEC_length (ddr_p, may_alias_ddrs));
|
||||
if (dump_kind_p (MSG_OPTIMIZED_LOCATIONS))
|
||||
dump_printf_loc (MSG_OPTIMIZED_LOCATIONS, vect_location,
|
||||
"created %u versioning for alias checks.\n",
|
||||
VEC_length (ddr_p, may_alias_ddrs));
|
||||
}
|
||||
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -23,6 +23,7 @@ along with GCC; see the file COPYING3. If not see
|
|||
#include "config.h"
|
||||
#include "system.h"
|
||||
#include "coretypes.h"
|
||||
#include "dumpfile.h"
|
||||
#include "tm.h"
|
||||
#include "ggc.h"
|
||||
#include "tree.h"
|
||||
|
@ -237,10 +238,11 @@ vect_get_and_check_slp_defs (loop_vec_info loop_vinfo, bb_vec_info bb_vinfo,
|
|||
&def, &dt)
|
||||
|| (!def_stmt && dt != vect_constant_def))
|
||||
{
|
||||
if (vect_print_dump_info (REPORT_SLP))
|
||||
if (dump_kind_p (MSG_MISSED_OPTIMIZATION))
|
||||
{
|
||||
fprintf (vect_dump, "Build SLP failed: can't find def for ");
|
||||
print_generic_expr (vect_dump, oprnd, TDF_SLIM);
|
||||
dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
|
||||
"Build SLP failed: can't find def for ");
|
||||
dump_generic_expr (MSG_MISSED_OPTIMIZATION, TDF_SLIM, oprnd);
|
||||
}
|
||||
|
||||
return false;
|
||||
|
@ -261,11 +263,12 @@ vect_get_and_check_slp_defs (loop_vec_info loop_vinfo, bb_vec_info bb_vinfo,
|
|||
pattern = true;
|
||||
if (!first && !oprnd_info->first_pattern)
|
||||
{
|
||||
if (vect_print_dump_info (REPORT_DETAILS))
|
||||
if (dump_kind_p (MSG_MISSED_OPTIMIZATION))
|
||||
{
|
||||
fprintf (vect_dump, "Build SLP failed: some of the stmts"
|
||||
" are in a pattern, and others are not ");
|
||||
print_generic_expr (vect_dump, oprnd, TDF_SLIM);
|
||||
dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
|
||||
"Build SLP failed: some of the stmts"
|
||||
" are in a pattern, and others are not ");
|
||||
dump_generic_expr (MSG_MISSED_OPTIMIZATION, TDF_SLIM, oprnd);
|
||||
}
|
||||
|
||||
return false;
|
||||
|
@ -276,8 +279,9 @@ vect_get_and_check_slp_defs (loop_vec_info loop_vinfo, bb_vec_info bb_vinfo,
|
|||
|
||||
if (dt == vect_unknown_def_type)
|
||||
{
|
||||
if (vect_print_dump_info (REPORT_DETAILS))
|
||||
fprintf (vect_dump, "Unsupported pattern.");
|
||||
if (dump_kind_p (MSG_MISSED_OPTIMIZATION))
|
||||
dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
|
||||
"Unsupported pattern.");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -292,8 +296,9 @@ vect_get_and_check_slp_defs (loop_vec_info loop_vinfo, bb_vec_info bb_vinfo,
|
|||
break;
|
||||
|
||||
default:
|
||||
if (vect_print_dump_info (REPORT_DETAILS))
|
||||
fprintf (vect_dump, "unsupported defining stmt: ");
|
||||
if (dump_kind_p (MSG_MISSED_OPTIMIZATION))
|
||||
dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
|
||||
"unsupported defining stmt: ");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -356,8 +361,9 @@ vect_get_and_check_slp_defs (loop_vec_info loop_vinfo, bb_vec_info bb_vinfo,
|
|||
{
|
||||
if (number_of_oprnds != 2)
|
||||
{
|
||||
if (vect_print_dump_info (REPORT_SLP))
|
||||
fprintf (vect_dump, "Build SLP failed: different types ");
|
||||
if (dump_kind_p (MSG_MISSED_OPTIMIZATION))
|
||||
dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
|
||||
"Build SLP failed: different types ");
|
||||
|
||||
return false;
|
||||
}
|
||||
|
@ -382,10 +388,11 @@ vect_get_and_check_slp_defs (loop_vec_info loop_vinfo, bb_vec_info bb_vinfo,
|
|||
&& !types_compatible_p (oprnd_info->first_def_type,
|
||||
TREE_TYPE (def_op0))))
|
||||
{
|
||||
if (vect_print_dump_info (REPORT_SLP))
|
||||
if (dump_kind_p (MSG_NOTE))
|
||||
{
|
||||
fprintf (vect_dump, "Swapping operands of ");
|
||||
print_gimple_stmt (vect_dump, stmt, 0, TDF_SLIM);
|
||||
dump_printf_loc (MSG_NOTE, vect_location,
|
||||
"Swapping operands of ");
|
||||
dump_gimple_stmt (MSG_NOTE, TDF_SLIM, stmt, 0);
|
||||
}
|
||||
|
||||
swap_tree_operands (stmt, gimple_assign_rhs1_ptr (stmt),
|
||||
|
@ -393,8 +400,9 @@ vect_get_and_check_slp_defs (loop_vec_info loop_vinfo, bb_vec_info bb_vinfo,
|
|||
}
|
||||
else
|
||||
{
|
||||
if (vect_print_dump_info (REPORT_SLP))
|
||||
fprintf (vect_dump, "Build SLP failed: different types ");
|
||||
if (dump_kind_p (MSG_MISSED_OPTIMIZATION))
|
||||
dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
|
||||
"Build SLP failed: different types ");
|
||||
|
||||
return false;
|
||||
}
|
||||
|
@ -427,10 +435,11 @@ vect_get_and_check_slp_defs (loop_vec_info loop_vinfo, bb_vec_info bb_vinfo,
|
|||
|
||||
default:
|
||||
/* FORNOW: Not supported. */
|
||||
if (vect_print_dump_info (REPORT_SLP))
|
||||
if (dump_kind_p (MSG_MISSED_OPTIMIZATION))
|
||||
{
|
||||
fprintf (vect_dump, "Build SLP failed: illegal type of def ");
|
||||
print_generic_expr (vect_dump, def, TDF_SLIM);
|
||||
dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
|
||||
"Build SLP failed: illegal type of def ");
|
||||
dump_generic_expr (MSG_MISSED_OPTIMIZATION, TDF_SLIM, def);
|
||||
}
|
||||
|
||||
return false;
|
||||
|
@ -495,20 +504,20 @@ vect_build_slp_tree (loop_vec_info loop_vinfo, bb_vec_info bb_vinfo,
|
|||
/* For every stmt in NODE find its def stmt/s. */
|
||||
FOR_EACH_VEC_ELT (gimple, stmts, i, stmt)
|
||||
{
|
||||
if (vect_print_dump_info (REPORT_SLP))
|
||||
if (dump_kind_p (MSG_NOTE))
|
||||
{
|
||||
fprintf (vect_dump, "Build SLP for ");
|
||||
print_gimple_stmt (vect_dump, stmt, 0, TDF_SLIM);
|
||||
dump_printf_loc (MSG_NOTE, vect_location, "Build SLP for ");
|
||||
dump_gimple_stmt (MSG_NOTE, TDF_SLIM, stmt, 0);
|
||||
}
|
||||
|
||||
/* Fail to vectorize statements marked as unvectorizable. */
|
||||
if (!STMT_VINFO_VECTORIZABLE (vinfo_for_stmt (stmt)))
|
||||
{
|
||||
if (vect_print_dump_info (REPORT_SLP))
|
||||
if (dump_kind_p (MSG_MISSED_OPTIMIZATION))
|
||||
{
|
||||
fprintf (vect_dump,
|
||||
"Build SLP failed: unvectorizable statement ");
|
||||
print_gimple_stmt (vect_dump, stmt, 0, TDF_SLIM);
|
||||
dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
|
||||
"Build SLP failed: unvectorizable statement ");
|
||||
dump_gimple_stmt (MSG_MISSED_OPTIMIZATION, TDF_SLIM, stmt, 0);
|
||||
}
|
||||
|
||||
vect_free_oprnd_info (&oprnds_info);
|
||||
|
@ -518,11 +527,12 @@ vect_build_slp_tree (loop_vec_info loop_vinfo, bb_vec_info bb_vinfo,
|
|||
lhs = gimple_get_lhs (stmt);
|
||||
if (lhs == NULL_TREE)
|
||||
{
|
||||
if (vect_print_dump_info (REPORT_SLP))
|
||||
if (dump_kind_p (MSG_MISSED_OPTIMIZATION))
|
||||
{
|
||||
fprintf (vect_dump,
|
||||
"Build SLP failed: not GIMPLE_ASSIGN nor GIMPLE_CALL ");
|
||||
print_gimple_stmt (vect_dump, stmt, 0, TDF_SLIM);
|
||||
dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
|
||||
"Build SLP failed: not GIMPLE_ASSIGN nor "
|
||||
"GIMPLE_CALL ");
|
||||
dump_gimple_stmt (MSG_MISSED_OPTIMIZATION, TDF_SLIM, stmt, 0);
|
||||
}
|
||||
|
||||
vect_free_oprnd_info (&oprnds_info);
|
||||
|
@ -534,11 +544,12 @@ vect_build_slp_tree (loop_vec_info loop_vinfo, bb_vec_info bb_vinfo,
|
|||
&& (cond = gimple_assign_rhs1 (stmt))
|
||||
&& !COMPARISON_CLASS_P (cond))
|
||||
{
|
||||
if (vect_print_dump_info (REPORT_SLP))
|
||||
if (dump_kind_p (MSG_MISSED_OPTIMIZATION))
|
||||
{
|
||||
fprintf (vect_dump,
|
||||
"Build SLP failed: condition is not comparison ");
|
||||
print_gimple_stmt (vect_dump, stmt, 0, TDF_SLIM);
|
||||
dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
|
||||
"Build SLP failed: condition is not "
|
||||
"comparison ");
|
||||
dump_gimple_stmt (MSG_MISSED_OPTIMIZATION, TDF_SLIM, stmt, 0);
|
||||
}
|
||||
|
||||
vect_free_oprnd_info (&oprnds_info);
|
||||
|
@ -549,10 +560,12 @@ vect_build_slp_tree (loop_vec_info loop_vinfo, bb_vec_info bb_vinfo,
|
|||
vectype = get_vectype_for_scalar_type (scalar_type);
|
||||
if (!vectype)
|
||||
{
|
||||
if (vect_print_dump_info (REPORT_SLP))
|
||||
if (dump_kind_p (MSG_MISSED_OPTIMIZATION))
|
||||
{
|
||||
fprintf (vect_dump, "Build SLP failed: unsupported data-type ");
|
||||
print_generic_expr (vect_dump, scalar_type, TDF_SLIM);
|
||||
dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
|
||||
"Build SLP failed: unsupported data-type ");
|
||||
dump_generic_expr (MSG_MISSED_OPTIMIZATION, TDF_SLIM,
|
||||
scalar_type);
|
||||
}
|
||||
|
||||
vect_free_oprnd_info (&oprnds_info);
|
||||
|
@ -578,11 +591,11 @@ vect_build_slp_tree (loop_vec_info loop_vinfo, bb_vec_info bb_vinfo,
|
|||
|| !gimple_call_nothrow_p (stmt)
|
||||
|| gimple_call_chain (stmt))
|
||||
{
|
||||
if (vect_print_dump_info (REPORT_SLP))
|
||||
if (dump_kind_p (MSG_MISSED_OPTIMIZATION))
|
||||
{
|
||||
fprintf (vect_dump,
|
||||
"Build SLP failed: unsupported call type ");
|
||||
print_gimple_stmt (vect_dump, stmt, 0, TDF_SLIM);
|
||||
dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
|
||||
"Build SLP failed: unsupported call type ");
|
||||
dump_gimple_stmt (MSG_MISSED_OPTIMIZATION, TDF_SLIM, stmt, 0);
|
||||
}
|
||||
|
||||
vect_free_oprnd_info (&oprnds_info);
|
||||
|
@ -618,17 +631,19 @@ vect_build_slp_tree (loop_vec_info loop_vinfo, bb_vec_info bb_vinfo,
|
|||
|
||||
if (!optab)
|
||||
{
|
||||
if (vect_print_dump_info (REPORT_SLP))
|
||||
fprintf (vect_dump, "Build SLP failed: no optab.");
|
||||
if (dump_kind_p (MSG_MISSED_OPTIMIZATION))
|
||||
dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
|
||||
"Build SLP failed: no optab.");
|
||||
vect_free_oprnd_info (&oprnds_info);
|
||||
return false;
|
||||
}
|
||||
icode = (int) optab_handler (optab, vec_mode);
|
||||
if (icode == CODE_FOR_nothing)
|
||||
{
|
||||
if (vect_print_dump_info (REPORT_SLP))
|
||||
fprintf (vect_dump, "Build SLP failed: "
|
||||
"op not supported by target.");
|
||||
if (dump_kind_p (MSG_MISSED_OPTIMIZATION))
|
||||
dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
|
||||
"Build SLP failed: "
|
||||
"op not supported by target.");
|
||||
vect_free_oprnd_info (&oprnds_info);
|
||||
return false;
|
||||
}
|
||||
|
@ -659,11 +674,12 @@ vect_build_slp_tree (loop_vec_info loop_vinfo, bb_vec_info bb_vinfo,
|
|||
|| first_stmt_code == COMPONENT_REF
|
||||
|| first_stmt_code == MEM_REF)))
|
||||
{
|
||||
if (vect_print_dump_info (REPORT_SLP))
|
||||
if (dump_kind_p (MSG_MISSED_OPTIMIZATION))
|
||||
{
|
||||
fprintf (vect_dump,
|
||||
"Build SLP failed: different operation in stmt ");
|
||||
print_gimple_stmt (vect_dump, stmt, 0, TDF_SLIM);
|
||||
dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
|
||||
"Build SLP failed: different operation "
|
||||
"in stmt ");
|
||||
dump_gimple_stmt (MSG_MISSED_OPTIMIZATION, TDF_SLIM, stmt, 0);
|
||||
}
|
||||
|
||||
vect_free_oprnd_info (&oprnds_info);
|
||||
|
@ -673,11 +689,12 @@ vect_build_slp_tree (loop_vec_info loop_vinfo, bb_vec_info bb_vinfo,
|
|||
if (need_same_oprnds
|
||||
&& !operand_equal_p (first_op1, gimple_assign_rhs2 (stmt), 0))
|
||||
{
|
||||
if (vect_print_dump_info (REPORT_SLP))
|
||||
if (dump_kind_p (MSG_MISSED_OPTIMIZATION))
|
||||
{
|
||||
fprintf (vect_dump,
|
||||
"Build SLP failed: different shift arguments in ");
|
||||
print_gimple_stmt (vect_dump, stmt, 0, TDF_SLIM);
|
||||
dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
|
||||
"Build SLP failed: different shift "
|
||||
"arguments in ");
|
||||
dump_gimple_stmt (MSG_MISSED_OPTIMIZATION, TDF_SLIM, stmt, 0);
|
||||
}
|
||||
|
||||
vect_free_oprnd_info (&oprnds_info);
|
||||
|
@ -693,11 +710,12 @@ vect_build_slp_tree (loop_vec_info loop_vinfo, bb_vec_info bb_vinfo,
|
|||
|| gimple_call_fntype (first_stmt)
|
||||
!= gimple_call_fntype (stmt))
|
||||
{
|
||||
if (vect_print_dump_info (REPORT_SLP))
|
||||
if (dump_kind_p (MSG_MISSED_OPTIMIZATION))
|
||||
{
|
||||
fprintf (vect_dump,
|
||||
"Build SLP failed: different calls in ");
|
||||
print_gimple_stmt (vect_dump, stmt, 0, TDF_SLIM);
|
||||
dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
|
||||
"Build SLP failed: different calls in ");
|
||||
dump_gimple_stmt (MSG_MISSED_OPTIMIZATION, TDF_SLIM,
|
||||
stmt, 0);
|
||||
}
|
||||
|
||||
vect_free_oprnd_info (&oprnds_info);
|
||||
|
@ -731,11 +749,13 @@ vect_build_slp_tree (loop_vec_info loop_vinfo, bb_vec_info bb_vinfo,
|
|||
|| (GROUP_FIRST_ELEMENT (vinfo_for_stmt (stmt)) != stmt
|
||||
&& GROUP_GAP (vinfo_for_stmt (stmt)) != 1))
|
||||
{
|
||||
if (vect_print_dump_info (REPORT_SLP))
|
||||
if (dump_kind_p (MSG_MISSED_OPTIMIZATION))
|
||||
{
|
||||
fprintf (vect_dump, "Build SLP failed: grouped "
|
||||
"loads have gaps ");
|
||||
print_gimple_stmt (vect_dump, stmt, 0, TDF_SLIM);
|
||||
dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
|
||||
"Build SLP failed: grouped "
|
||||
"loads have gaps ");
|
||||
dump_gimple_stmt (MSG_MISSED_OPTIMIZATION, TDF_SLIM,
|
||||
stmt, 0);
|
||||
}
|
||||
|
||||
vect_free_oprnd_info (&oprnds_info);
|
||||
|
@ -747,12 +767,14 @@ vect_build_slp_tree (loop_vec_info loop_vinfo, bb_vec_info bb_vinfo,
|
|||
if (loop_vinfo
|
||||
&& GROUP_SIZE (vinfo_for_stmt (stmt)) > ncopies * group_size)
|
||||
{
|
||||
if (vect_print_dump_info (REPORT_SLP))
|
||||
if (dump_kind_p (MSG_MISSED_OPTIMIZATION))
|
||||
{
|
||||
fprintf (vect_dump, "Build SLP failed: the number of "
|
||||
"interleaved loads is greater than"
|
||||
" the SLP group size ");
|
||||
print_gimple_stmt (vect_dump, stmt, 0, TDF_SLIM);
|
||||
dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
|
||||
"Build SLP failed: the number "
|
||||
"of interleaved loads is greater than "
|
||||
"the SLP group size ");
|
||||
dump_gimple_stmt (MSG_MISSED_OPTIMIZATION, TDF_SLIM,
|
||||
stmt, 0);
|
||||
}
|
||||
|
||||
vect_free_oprnd_info (&oprnds_info);
|
||||
|
@ -767,16 +789,19 @@ vect_build_slp_tree (loop_vec_info loop_vinfo, bb_vec_info bb_vinfo,
|
|||
chains in the same node. The only exception is complex
|
||||
numbers. */
|
||||
if (prev_first_load != first_load
|
||||
&& rhs_code != REALPART_EXPR
|
||||
&& rhs_code != REALPART_EXPR
|
||||
&& rhs_code != IMAGPART_EXPR)
|
||||
{
|
||||
if (vect_print_dump_info (REPORT_SLP))
|
||||
{
|
||||
if (dump_kind_p (MSG_MISSED_OPTIMIZATION))
|
||||
{
|
||||
fprintf (vect_dump, "Build SLP failed: different "
|
||||
"interleaving chains in one node ");
|
||||
print_gimple_stmt (vect_dump, stmt, 0, TDF_SLIM);
|
||||
dump_printf_loc (MSG_MISSED_OPTIMIZATION,
|
||||
vect_location,
|
||||
"Build SLP failed: different "
|
||||
"interleaving chains in one node ");
|
||||
dump_gimple_stmt (MSG_MISSED_OPTIMIZATION, TDF_SLIM,
|
||||
stmt, 0);
|
||||
}
|
||||
|
||||
|
||||
vect_free_oprnd_info (&oprnds_info);
|
||||
return false;
|
||||
}
|
||||
|
@ -792,11 +817,14 @@ vect_build_slp_tree (loop_vec_info loop_vinfo, bb_vec_info bb_vinfo,
|
|||
if (vect_supportable_dr_alignment (first_dr, false)
|
||||
== dr_unaligned_unsupported)
|
||||
{
|
||||
if (vect_print_dump_info (REPORT_SLP))
|
||||
if (dump_kind_p (MSG_MISSED_OPTIMIZATION))
|
||||
{
|
||||
fprintf (vect_dump, "Build SLP failed: unsupported "
|
||||
"unaligned load ");
|
||||
print_gimple_stmt (vect_dump, stmt, 0, TDF_SLIM);
|
||||
dump_printf_loc (MSG_MISSED_OPTIMIZATION,
|
||||
vect_location,
|
||||
"Build SLP failed: unsupported "
|
||||
"unaligned load ");
|
||||
dump_gimple_stmt (MSG_MISSED_OPTIMIZATION, TDF_SLIM,
|
||||
stmt, 0);
|
||||
}
|
||||
|
||||
vect_free_oprnd_info (&oprnds_info);
|
||||
|
@ -829,10 +857,11 @@ vect_build_slp_tree (loop_vec_info loop_vinfo, bb_vec_info bb_vinfo,
|
|||
if (TREE_CODE_CLASS (rhs_code) == tcc_reference)
|
||||
{
|
||||
/* Not grouped load. */
|
||||
if (vect_print_dump_info (REPORT_SLP))
|
||||
if (dump_kind_p (MSG_MISSED_OPTIMIZATION))
|
||||
{
|
||||
fprintf (vect_dump, "Build SLP failed: not grouped load ");
|
||||
print_gimple_stmt (vect_dump, stmt, 0, TDF_SLIM);
|
||||
dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
|
||||
"Build SLP failed: not grouped load ");
|
||||
dump_gimple_stmt (MSG_MISSED_OPTIMIZATION, TDF_SLIM, stmt, 0);
|
||||
}
|
||||
|
||||
/* FORNOW: Not grouped loads are not supported. */
|
||||
|
@ -846,11 +875,12 @@ vect_build_slp_tree (loop_vec_info loop_vinfo, bb_vec_info bb_vinfo,
|
|||
&& rhs_code != COND_EXPR
|
||||
&& rhs_code != CALL_EXPR)
|
||||
{
|
||||
if (vect_print_dump_info (REPORT_SLP))
|
||||
if (dump_kind_p (MSG_MISSED_OPTIMIZATION))
|
||||
{
|
||||
fprintf (vect_dump, "Build SLP failed: operation");
|
||||
fprintf (vect_dump, " unsupported ");
|
||||
print_gimple_stmt (vect_dump, stmt, 0, TDF_SLIM);
|
||||
dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
|
||||
"Build SLP failed: operation");
|
||||
dump_printf (MSG_MISSED_OPTIMIZATION, " unsupported ");
|
||||
dump_gimple_stmt (MSG_MISSED_OPTIMIZATION, TDF_SLIM, stmt, 0);
|
||||
}
|
||||
|
||||
vect_free_oprnd_info (&oprnds_info);
|
||||
|
@ -865,11 +895,13 @@ vect_build_slp_tree (loop_vec_info loop_vinfo, bb_vec_info bb_vinfo,
|
|||
first_cond_code = TREE_CODE (cond_expr);
|
||||
else if (first_cond_code != TREE_CODE (cond_expr))
|
||||
{
|
||||
if (vect_print_dump_info (REPORT_SLP))
|
||||
if (dump_kind_p (MSG_MISSED_OPTIMIZATION))
|
||||
{
|
||||
fprintf (vect_dump, "Build SLP failed: different"
|
||||
" operation");
|
||||
print_gimple_stmt (vect_dump, stmt, 0, TDF_SLIM);
|
||||
dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
|
||||
"Build SLP failed: different"
|
||||
" operation");
|
||||
dump_gimple_stmt (MSG_MISSED_OPTIMIZATION, TDF_SLIM,
|
||||
stmt, 0);
|
||||
}
|
||||
|
||||
vect_free_oprnd_info (&oprnds_info);
|
||||
|
@ -944,9 +976,10 @@ vect_build_slp_tree (loop_vec_info loop_vinfo, bb_vec_info bb_vinfo,
|
|||
return true;
|
||||
}
|
||||
|
||||
/* Dump a slp tree NODE using flags specified in DUMP_KIND. */
|
||||
|
||||
static void
|
||||
vect_print_slp_tree (slp_tree node)
|
||||
vect_print_slp_tree (int dump_kind, slp_tree node)
|
||||
{
|
||||
int i;
|
||||
gimple stmt;
|
||||
|
@ -955,16 +988,16 @@ vect_print_slp_tree (slp_tree node)
|
|||
if (!node)
|
||||
return;
|
||||
|
||||
fprintf (vect_dump, "node ");
|
||||
dump_printf (dump_kind, "node ");
|
||||
FOR_EACH_VEC_ELT (gimple, SLP_TREE_SCALAR_STMTS (node), i, stmt)
|
||||
{
|
||||
fprintf (vect_dump, "\n\tstmt %d ", i);
|
||||
print_gimple_stmt (vect_dump, stmt, 0, TDF_SLIM);
|
||||
dump_printf (dump_kind, "\n\tstmt %d ", i);
|
||||
dump_gimple_stmt (dump_kind, TDF_SLIM, stmt, 0);
|
||||
}
|
||||
fprintf (vect_dump, "\n");
|
||||
dump_printf (dump_kind, "\n");
|
||||
|
||||
FOR_EACH_VEC_ELT (slp_void_p, SLP_TREE_CHILDREN (node), i, child)
|
||||
vect_print_slp_tree ((slp_tree) child);
|
||||
vect_print_slp_tree (dump_kind, (slp_tree) child);
|
||||
}
|
||||
|
||||
|
||||
|
@ -1047,11 +1080,13 @@ vect_supported_slp_permutation_p (slp_instance instance)
|
|||
/* Check that the loads are all in the same interleaving chain. */
|
||||
if (GROUP_FIRST_ELEMENT (vinfo_for_stmt (scalar_stmt)) != first_load)
|
||||
{
|
||||
if (vect_print_dump_info (REPORT_DETAILS))
|
||||
if (dump_kind_p (MSG_MISSED_OPTIMIZATION))
|
||||
{
|
||||
fprintf (vect_dump, "Build SLP failed: unsupported data "
|
||||
"permutation ");
|
||||
print_gimple_stmt (vect_dump, scalar_stmt, 0, TDF_SLIM);
|
||||
dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
|
||||
"Build SLP failed: unsupported data "
|
||||
"permutation ");
|
||||
dump_gimple_stmt (MSG_MISSED_OPTIMIZATION, TDF_SLIM,
|
||||
scalar_stmt, 0);
|
||||
}
|
||||
|
||||
free (tmp_loads);
|
||||
|
@ -1134,11 +1169,11 @@ vect_supported_load_permutation_p (slp_instance slp_instn, int group_size,
|
|||
if (!slp_instn)
|
||||
return false;
|
||||
|
||||
if (vect_print_dump_info (REPORT_SLP))
|
||||
if (dump_kind_p (MSG_NOTE))
|
||||
{
|
||||
fprintf (vect_dump, "Load permutation ");
|
||||
dump_printf_loc (MSG_NOTE, vect_location, "Load permutation ");
|
||||
FOR_EACH_VEC_ELT (int, load_permutation, i, next)
|
||||
fprintf (vect_dump, "%d ", next);
|
||||
dump_printf (MSG_NOTE, "%d ", next);
|
||||
}
|
||||
|
||||
/* In case of reduction every load permutation is allowed, since the order
|
||||
|
@ -1341,11 +1376,13 @@ vect_supported_load_permutation_p (slp_instance slp_instn, int group_size,
|
|||
if (vect_supportable_dr_alignment (dr, false)
|
||||
== dr_unaligned_unsupported)
|
||||
{
|
||||
if (vect_print_dump_info (REPORT_SLP))
|
||||
if (dump_kind_p (MSG_MISSED_OPTIMIZATION))
|
||||
{
|
||||
fprintf (vect_dump, "unsupported unaligned load ");
|
||||
print_gimple_stmt (vect_dump, first_load, 0,
|
||||
TDF_SLIM);
|
||||
dump_printf_loc (MSG_MISSED_OPTIMIZATION,
|
||||
vect_location,
|
||||
"unsupported unaligned load ");
|
||||
dump_gimple_stmt (MSG_MISSED_OPTIMIZATION, TDF_SLIM,
|
||||
first_load, 0);
|
||||
}
|
||||
bad_permutation = true;
|
||||
break;
|
||||
|
@ -1499,10 +1536,11 @@ vect_analyze_slp_instance (loop_vec_info loop_vinfo, bb_vec_info bb_vinfo,
|
|||
|
||||
if (!vectype)
|
||||
{
|
||||
if (vect_print_dump_info (REPORT_SLP))
|
||||
if (dump_kind_p (MSG_MISSED_OPTIMIZATION))
|
||||
{
|
||||
fprintf (vect_dump, "Build SLP failed: unsupported data-type ");
|
||||
print_generic_expr (vect_dump, scalar_type, TDF_SLIM);
|
||||
dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
|
||||
"Build SLP failed: unsupported data-type ");
|
||||
dump_generic_expr (MSG_MISSED_OPTIMIZATION, TDF_SLIM, scalar_type);
|
||||
}
|
||||
|
||||
return false;
|
||||
|
@ -1518,9 +1556,10 @@ vect_analyze_slp_instance (loop_vec_info loop_vinfo, bb_vec_info bb_vinfo,
|
|||
unrolling_factor = least_common_multiple (nunits, group_size) / group_size;
|
||||
if (unrolling_factor != 1 && !loop_vinfo)
|
||||
{
|
||||
if (vect_print_dump_info (REPORT_SLP))
|
||||
fprintf (vect_dump, "Build SLP failed: unrolling required in basic"
|
||||
" block SLP");
|
||||
if (dump_kind_p (MSG_MISSED_OPTIMIZATION))
|
||||
dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
|
||||
"Build SLP failed: unrolling required in basic"
|
||||
" block SLP");
|
||||
|
||||
return false;
|
||||
}
|
||||
|
@ -1579,9 +1618,10 @@ vect_analyze_slp_instance (loop_vec_info loop_vinfo, bb_vec_info bb_vinfo,
|
|||
|
||||
if (unrolling_factor != 1 && !loop_vinfo)
|
||||
{
|
||||
if (vect_print_dump_info (REPORT_SLP))
|
||||
fprintf (vect_dump, "Build SLP failed: unrolling required in basic"
|
||||
" block SLP");
|
||||
if (dump_kind_p (MSG_MISSED_OPTIMIZATION))
|
||||
dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
|
||||
"Build SLP failed: unrolling required in basic"
|
||||
" block SLP");
|
||||
vect_free_slp_tree (node);
|
||||
VEC_free (stmt_info_for_cost, heap, body_cost_vec);
|
||||
VEC_free (stmt_info_for_cost, heap, prologue_cost_vec);
|
||||
|
@ -1605,11 +1645,12 @@ vect_analyze_slp_instance (loop_vec_info loop_vinfo, bb_vec_info bb_vinfo,
|
|||
if (!vect_supported_load_permutation_p (new_instance, group_size,
|
||||
load_permutation))
|
||||
{
|
||||
if (vect_print_dump_info (REPORT_SLP))
|
||||
if (dump_kind_p (MSG_MISSED_OPTIMIZATION))
|
||||
{
|
||||
fprintf (vect_dump, "Build SLP failed: unsupported load "
|
||||
"permutation ");
|
||||
print_gimple_stmt (vect_dump, stmt, 0, TDF_SLIM);
|
||||
dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
|
||||
"Build SLP failed: unsupported load "
|
||||
"permutation ");
|
||||
dump_gimple_stmt (MSG_MISSED_OPTIMIZATION, TDF_SLIM, stmt, 0);
|
||||
}
|
||||
|
||||
vect_free_slp_instance (new_instance);
|
||||
|
@ -1644,8 +1685,8 @@ vect_analyze_slp_instance (loop_vec_info loop_vinfo, bb_vec_info bb_vinfo,
|
|||
VEC_safe_push (slp_instance, heap, BB_VINFO_SLP_INSTANCES (bb_vinfo),
|
||||
new_instance);
|
||||
|
||||
if (vect_print_dump_info (REPORT_SLP))
|
||||
vect_print_slp_tree (node);
|
||||
if (dump_kind_p (MSG_NOTE))
|
||||
vect_print_slp_tree (MSG_NOTE, node);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -1676,8 +1717,8 @@ vect_analyze_slp (loop_vec_info loop_vinfo, bb_vec_info bb_vinfo)
|
|||
gimple first_element;
|
||||
bool ok = false;
|
||||
|
||||
if (vect_print_dump_info (REPORT_SLP))
|
||||
fprintf (vect_dump, "=== vect_analyze_slp ===");
|
||||
if (dump_kind_p (MSG_NOTE))
|
||||
dump_printf_loc (MSG_NOTE, vect_location, "=== vect_analyze_slp ===");
|
||||
|
||||
if (loop_vinfo)
|
||||
{
|
||||
|
@ -1695,8 +1736,9 @@ vect_analyze_slp (loop_vec_info loop_vinfo, bb_vec_info bb_vinfo)
|
|||
|
||||
if (bb_vinfo && !ok)
|
||||
{
|
||||
if (vect_print_dump_info (REPORT_SLP))
|
||||
fprintf (vect_dump, "Failed to SLP the basic block.");
|
||||
if (dump_kind_p (MSG_MISSED_OPTIMIZATION))
|
||||
dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
|
||||
"Failed to SLP the basic block.");
|
||||
|
||||
return false;
|
||||
}
|
||||
|
@ -1738,8 +1780,8 @@ vect_make_slp_decision (loop_vec_info loop_vinfo)
|
|||
slp_instance instance;
|
||||
int decided_to_slp = 0;
|
||||
|
||||
if (vect_print_dump_info (REPORT_SLP))
|
||||
fprintf (vect_dump, "=== vect_make_slp_decision ===");
|
||||
if (dump_kind_p (MSG_NOTE))
|
||||
dump_printf_loc (MSG_NOTE, vect_location, "=== vect_make_slp_decision ===");
|
||||
|
||||
FOR_EACH_VEC_ELT (slp_instance, slp_instances, i, instance)
|
||||
{
|
||||
|
@ -1756,9 +1798,10 @@ vect_make_slp_decision (loop_vec_info loop_vinfo)
|
|||
|
||||
LOOP_VINFO_SLP_UNROLLING_FACTOR (loop_vinfo) = unrolling_factor;
|
||||
|
||||
if (decided_to_slp && vect_print_dump_info (REPORT_SLP))
|
||||
fprintf (vect_dump, "Decided to SLP %d instances. Unrolling factor %d",
|
||||
decided_to_slp, unrolling_factor);
|
||||
if (decided_to_slp && dump_kind_p (MSG_OPTIMIZED_LOCATIONS))
|
||||
dump_printf_loc (MSG_OPTIMIZED_LOCATIONS, vect_location,
|
||||
"Decided to SLP %d instances. Unrolling factor %d",
|
||||
decided_to_slp, unrolling_factor);
|
||||
|
||||
return (decided_to_slp > 0);
|
||||
}
|
||||
|
@ -1820,8 +1863,8 @@ vect_detect_hybrid_slp (loop_vec_info loop_vinfo)
|
|||
VEC (slp_instance, heap) *slp_instances = LOOP_VINFO_SLP_INSTANCES (loop_vinfo);
|
||||
slp_instance instance;
|
||||
|
||||
if (vect_print_dump_info (REPORT_SLP))
|
||||
fprintf (vect_dump, "=== vect_detect_hybrid_slp ===");
|
||||
if (dump_kind_p (MSG_NOTE))
|
||||
dump_printf_loc (MSG_NOTE, vect_location, "=== vect_detect_hybrid_slp ===");
|
||||
|
||||
FOR_EACH_VEC_ELT (slp_instance, slp_instances, i, instance)
|
||||
vect_detect_hybrid_slp_stmts (SLP_INSTANCE_TREE (instance));
|
||||
|
@ -2017,14 +2060,14 @@ vect_bb_vectorization_profitable_p (bb_vec_info bb_vinfo)
|
|||
|
||||
vec_outside_cost = vec_prologue_cost + vec_epilogue_cost;
|
||||
|
||||
if (vect_print_dump_info (REPORT_COST))
|
||||
if (dump_kind_p (MSG_NOTE))
|
||||
{
|
||||
fprintf (vect_dump, "Cost model analysis: \n");
|
||||
fprintf (vect_dump, " Vector inside of basic block cost: %d\n",
|
||||
vec_inside_cost);
|
||||
fprintf (vect_dump, " Vector prologue cost: %d\n", vec_prologue_cost);
|
||||
fprintf (vect_dump, " Vector epilogue cost: %d\n", vec_epilogue_cost);
|
||||
fprintf (vect_dump, " Scalar cost of basic block: %d", scalar_cost);
|
||||
dump_printf_loc (MSG_NOTE, vect_location, "Cost model analysis: \n");
|
||||
dump_printf (MSG_NOTE, " Vector inside of basic block cost: %d\n",
|
||||
vec_inside_cost);
|
||||
dump_printf (MSG_NOTE, " Vector prologue cost: %d\n", vec_prologue_cost);
|
||||
dump_printf (MSG_NOTE, " Vector epilogue cost: %d\n", vec_epilogue_cost);
|
||||
dump_printf (MSG_NOTE, " Scalar cost of basic block: %d", scalar_cost);
|
||||
}
|
||||
|
||||
/* Vectorization is profitable if its cost is less than the cost of scalar
|
||||
|
@ -2054,9 +2097,10 @@ vect_slp_analyze_bb_1 (basic_block bb)
|
|||
|
||||
if (!vect_analyze_data_refs (NULL, bb_vinfo, &min_vf))
|
||||
{
|
||||
if (vect_print_dump_info (REPORT_UNVECTORIZED_LOCATIONS))
|
||||
fprintf (vect_dump, "not vectorized: unhandled data-ref in basic "
|
||||
"block.\n");
|
||||
if (dump_kind_p (MSG_MISSED_OPTIMIZATION))
|
||||
dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
|
||||
"not vectorized: unhandled data-ref in basic "
|
||||
"block.\n");
|
||||
|
||||
destroy_bb_vec_info (bb_vinfo);
|
||||
return NULL;
|
||||
|
@ -2065,9 +2109,10 @@ vect_slp_analyze_bb_1 (basic_block bb)
|
|||
ddrs = BB_VINFO_DDRS (bb_vinfo);
|
||||
if (!VEC_length (ddr_p, ddrs))
|
||||
{
|
||||
if (vect_print_dump_info (REPORT_UNVECTORIZED_LOCATIONS))
|
||||
fprintf (vect_dump, "not vectorized: not enough data-refs in basic "
|
||||
"block.\n");
|
||||
if (dump_kind_p (MSG_MISSED_OPTIMIZATION))
|
||||
dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
|
||||
"not vectorized: not enough data-refs in "
|
||||
"basic block.\n");
|
||||
|
||||
destroy_bb_vec_info (bb_vinfo);
|
||||
return NULL;
|
||||
|
@ -2078,9 +2123,10 @@ vect_slp_analyze_bb_1 (basic_block bb)
|
|||
if (!vect_analyze_data_ref_dependences (NULL, bb_vinfo, &max_vf)
|
||||
|| min_vf > max_vf)
|
||||
{
|
||||
if (vect_print_dump_info (REPORT_UNVECTORIZED_LOCATIONS))
|
||||
fprintf (vect_dump, "not vectorized: unhandled data dependence "
|
||||
"in basic block.\n");
|
||||
if (dump_kind_p (MSG_MISSED_OPTIMIZATION))
|
||||
dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
|
||||
"not vectorized: unhandled data dependence "
|
||||
"in basic block.\n");
|
||||
|
||||
destroy_bb_vec_info (bb_vinfo);
|
||||
return NULL;
|
||||
|
@ -2088,9 +2134,10 @@ vect_slp_analyze_bb_1 (basic_block bb)
|
|||
|
||||
if (!vect_analyze_data_refs_alignment (NULL, bb_vinfo))
|
||||
{
|
||||
if (vect_print_dump_info (REPORT_UNVECTORIZED_LOCATIONS))
|
||||
fprintf (vect_dump, "not vectorized: bad data alignment in basic "
|
||||
"block.\n");
|
||||
if (dump_kind_p (MSG_MISSED_OPTIMIZATION))
|
||||
dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
|
||||
"not vectorized: bad data alignment in basic "
|
||||
"block.\n");
|
||||
|
||||
destroy_bb_vec_info (bb_vinfo);
|
||||
return NULL;
|
||||
|
@ -2098,9 +2145,10 @@ vect_slp_analyze_bb_1 (basic_block bb)
|
|||
|
||||
if (!vect_analyze_data_ref_accesses (NULL, bb_vinfo))
|
||||
{
|
||||
if (vect_print_dump_info (REPORT_UNVECTORIZED_LOCATIONS))
|
||||
fprintf (vect_dump, "not vectorized: unhandled data access in basic "
|
||||
"block.\n");
|
||||
if (dump_kind_p (MSG_MISSED_OPTIMIZATION))
|
||||
dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
|
||||
"not vectorized: unhandled data access in "
|
||||
"basic block.\n");
|
||||
|
||||
destroy_bb_vec_info (bb_vinfo);
|
||||
return NULL;
|
||||
|
@ -2110,9 +2158,10 @@ vect_slp_analyze_bb_1 (basic_block bb)
|
|||
trees. */
|
||||
if (!vect_analyze_slp (NULL, bb_vinfo))
|
||||
{
|
||||
if (vect_print_dump_info (REPORT_UNVECTORIZED_LOCATIONS))
|
||||
fprintf (vect_dump, "not vectorized: failed to find SLP opportunities "
|
||||
"in basic block.\n");
|
||||
if (dump_kind_p (MSG_MISSED_OPTIMIZATION))
|
||||
dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
|
||||
"not vectorized: failed to find SLP opportunities "
|
||||
"in basic block.\n");
|
||||
|
||||
destroy_bb_vec_info (bb_vinfo);
|
||||
return NULL;
|
||||
|
@ -2130,18 +2179,19 @@ vect_slp_analyze_bb_1 (basic_block bb)
|
|||
|
||||
if (!vect_verify_datarefs_alignment (NULL, bb_vinfo))
|
||||
{
|
||||
if (vect_print_dump_info (REPORT_UNVECTORIZED_LOCATIONS))
|
||||
fprintf (vect_dump, "not vectorized: unsupported alignment in basic "
|
||||
"block.\n");
|
||||
|
||||
if (dump_kind_p (MSG_MISSED_OPTIMIZATION))
|
||||
dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
|
||||
"not vectorized: unsupported alignment in basic "
|
||||
"block.\n");
|
||||
destroy_bb_vec_info (bb_vinfo);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (!vect_slp_analyze_operations (bb_vinfo))
|
||||
{
|
||||
if (vect_print_dump_info (REPORT_UNVECTORIZED_LOCATIONS))
|
||||
fprintf (vect_dump, "not vectorized: bad operation in basic block.\n");
|
||||
if (dump_kind_p (MSG_MISSED_OPTIMIZATION))
|
||||
dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
|
||||
"not vectorized: bad operation in basic block.\n");
|
||||
|
||||
destroy_bb_vec_info (bb_vinfo);
|
||||
return NULL;
|
||||
|
@ -2151,16 +2201,18 @@ vect_slp_analyze_bb_1 (basic_block bb)
|
|||
if (flag_vect_cost_model
|
||||
&& !vect_bb_vectorization_profitable_p (bb_vinfo))
|
||||
{
|
||||
if (vect_print_dump_info (REPORT_UNVECTORIZED_LOCATIONS))
|
||||
fprintf (vect_dump, "not vectorized: vectorization is not "
|
||||
"profitable.\n");
|
||||
if (dump_kind_p (MSG_MISSED_OPTIMIZATION))
|
||||
dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
|
||||
"not vectorized: vectorization is not "
|
||||
"profitable.\n");
|
||||
|
||||
destroy_bb_vec_info (bb_vinfo);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (vect_print_dump_info (REPORT_DETAILS))
|
||||
fprintf (vect_dump, "Basic block will be vectorized using SLP\n");
|
||||
if (dump_kind_p (MSG_NOTE))
|
||||
dump_printf_loc (MSG_NOTE, vect_location,
|
||||
"Basic block will be vectorized using SLP\n");
|
||||
|
||||
return bb_vinfo;
|
||||
}
|
||||
|
@ -2174,8 +2226,8 @@ vect_slp_analyze_bb (basic_block bb)
|
|||
gimple_stmt_iterator gsi;
|
||||
unsigned int vector_sizes;
|
||||
|
||||
if (vect_print_dump_info (REPORT_DETAILS))
|
||||
fprintf (vect_dump, "===vect_slp_analyze_bb===\n");
|
||||
if (dump_kind_p (MSG_NOTE))
|
||||
dump_printf_loc (MSG_NOTE, vect_location, "===vect_slp_analyze_bb===\n");
|
||||
|
||||
for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); gsi_next (&gsi))
|
||||
{
|
||||
|
@ -2188,9 +2240,10 @@ vect_slp_analyze_bb (basic_block bb)
|
|||
|
||||
if (insns > PARAM_VALUE (PARAM_SLP_MAX_INSNS_IN_BB))
|
||||
{
|
||||
if (vect_print_dump_info (REPORT_UNVECTORIZED_LOCATIONS))
|
||||
fprintf (vect_dump, "not vectorized: too many instructions in basic "
|
||||
"block.\n");
|
||||
if (dump_kind_p (MSG_MISSED_OPTIMIZATION))
|
||||
dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
|
||||
"not vectorized: too many instructions in "
|
||||
"basic block.\n");
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
@ -2214,9 +2267,10 @@ vect_slp_analyze_bb (basic_block bb)
|
|||
|
||||
/* Try the next biggest vector size. */
|
||||
current_vector_size = 1 << floor_log2 (vector_sizes);
|
||||
if (vect_print_dump_info (REPORT_DETAILS))
|
||||
fprintf (vect_dump, "***** Re-trying analysis with "
|
||||
"vector size %d\n", current_vector_size);
|
||||
if (dump_kind_p (MSG_NOTE))
|
||||
dump_printf_loc (MSG_NOTE, vect_location,
|
||||
"***** Re-trying analysis with "
|
||||
"vector size %d\n", current_vector_size);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2238,8 +2292,9 @@ vect_update_slp_costs_according_to_vf (loop_vec_info loop_vinfo)
|
|||
stmt_info_for_cost *si;
|
||||
void *data = LOOP_VINFO_TARGET_COST_DATA (loop_vinfo);
|
||||
|
||||
if (vect_print_dump_info (REPORT_SLP))
|
||||
fprintf (vect_dump, "=== vect_update_slp_costs_according_to_vf ===");
|
||||
if (dump_kind_p (MSG_NOTE))
|
||||
dump_printf_loc (MSG_NOTE, vect_location,
|
||||
"=== vect_update_slp_costs_according_to_vf ===");
|
||||
|
||||
FOR_EACH_VEC_ELT (slp_instance, slp_instances, i, instance)
|
||||
{
|
||||
|
@ -2719,10 +2774,11 @@ vect_get_mask_element (gimple stmt, int first_mask_element, int m,
|
|||
the next vector as well. */
|
||||
if (only_one_vec && *current_mask_element >= mask_nunits)
|
||||
{
|
||||
if (vect_print_dump_info (REPORT_DETAILS))
|
||||
if (dump_kind_p (MSG_MISSED_OPTIMIZATION))
|
||||
{
|
||||
fprintf (vect_dump, "permutation requires at least two vectors ");
|
||||
print_gimple_stmt (vect_dump, stmt, 0, TDF_SLIM);
|
||||
dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
|
||||
"permutation requires at least two vectors ");
|
||||
dump_gimple_stmt (MSG_MISSED_OPTIMIZATION, TDF_SLIM, stmt, 0);
|
||||
}
|
||||
|
||||
return false;
|
||||
|
@ -2736,11 +2792,12 @@ vect_get_mask_element (gimple stmt, int first_mask_element, int m,
|
|||
/* We either need the first vector too or have already moved to the
|
||||
next vector. In both cases, this permutation needs three
|
||||
vectors. */
|
||||
if (vect_print_dump_info (REPORT_DETAILS))
|
||||
if (dump_kind_p (MSG_MISSED_OPTIMIZATION))
|
||||
{
|
||||
fprintf (vect_dump, "permutation requires at "
|
||||
"least three vectors ");
|
||||
print_gimple_stmt (vect_dump, stmt, 0, TDF_SLIM);
|
||||
dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
|
||||
"permutation requires at "
|
||||
"least three vectors ");
|
||||
dump_gimple_stmt (MSG_MISSED_OPTIMIZATION, TDF_SLIM, stmt, 0);
|
||||
}
|
||||
|
||||
return false;
|
||||
|
@ -2801,10 +2858,11 @@ vect_transform_slp_perm_load (gimple stmt, VEC (tree, heap) *dr_chain,
|
|||
|
||||
if (!can_vec_perm_p (mode, false, NULL))
|
||||
{
|
||||
if (vect_print_dump_info (REPORT_DETAILS))
|
||||
if (dump_kind_p (MSG_MISSED_OPTIMIZATION))
|
||||
{
|
||||
fprintf (vect_dump, "no vect permute for ");
|
||||
print_gimple_stmt (vect_dump, stmt, 0, TDF_SLIM);
|
||||
dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
|
||||
"no vect permute for ");
|
||||
dump_gimple_stmt (MSG_MISSED_OPTIMIZATION, TDF_SLIM, stmt, 0);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
@ -2880,12 +2938,15 @@ vect_transform_slp_perm_load (gimple stmt, VEC (tree, heap) *dr_chain,
|
|||
|
||||
if (!can_vec_perm_p (mode, false, mask))
|
||||
{
|
||||
if (vect_print_dump_info (REPORT_DETAILS))
|
||||
if (dump_kind_p (MSG_MISSED_OPTIMIZATION))
|
||||
{
|
||||
fprintf (vect_dump, "unsupported vect permute { ");
|
||||
dump_printf_loc (MSG_MISSED_OPTIMIZATION,
|
||||
vect_location,
|
||||
"unsupported vect permute { ");
|
||||
for (i = 0; i < nunits; ++i)
|
||||
fprintf (vect_dump, "%d ", mask[i]);
|
||||
fprintf (vect_dump, "}\n");
|
||||
dump_printf (MSG_MISSED_OPTIMIZATION, "%d ",
|
||||
mask[i]);
|
||||
dump_printf (MSG_MISSED_OPTIMIZATION, "}\n");
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
@ -2981,10 +3042,11 @@ vect_schedule_slp_instance (slp_tree node, slp_instance instance,
|
|||
SLP_TREE_NUMBER_OF_VEC_STMTS (node) = vec_stmts_size;
|
||||
}
|
||||
|
||||
if (vect_print_dump_info (REPORT_DETAILS))
|
||||
if (dump_kind_p (MSG_NOTE))
|
||||
{
|
||||
fprintf (vect_dump, "------>vectorizing SLP node starting from: ");
|
||||
print_gimple_stmt (vect_dump, stmt, 0, TDF_SLIM);
|
||||
dump_printf_loc (MSG_NOTE,vect_location,
|
||||
"------>vectorizing SLP node starting from: ");
|
||||
dump_gimple_stmt (MSG_NOTE, TDF_SLIM, stmt, 0);
|
||||
}
|
||||
|
||||
/* Loads should be inserted before the first load. */
|
||||
|
@ -3089,9 +3151,9 @@ vect_schedule_slp (loop_vec_info loop_vinfo, bb_vec_info bb_vinfo)
|
|||
/* Schedule the tree of INSTANCE. */
|
||||
is_store = vect_schedule_slp_instance (SLP_INSTANCE_TREE (instance),
|
||||
instance, vf);
|
||||
if (vect_print_dump_info (REPORT_VECTORIZED_LOCATIONS)
|
||||
|| vect_print_dump_info (REPORT_UNVECTORIZED_LOCATIONS))
|
||||
fprintf (vect_dump, "vectorizing stmts using SLP.");
|
||||
if (dump_kind_p (MSG_NOTE))
|
||||
dump_printf_loc (MSG_NOTE, vect_location,
|
||||
"vectorizing stmts using SLP.");
|
||||
}
|
||||
|
||||
FOR_EACH_VEC_ELT (slp_instance, slp_instances, i, instance)
|
||||
|
@ -3134,18 +3196,19 @@ vect_slp_transform_bb (basic_block bb)
|
|||
|
||||
gcc_assert (bb_vinfo);
|
||||
|
||||
if (vect_print_dump_info (REPORT_DETAILS))
|
||||
fprintf (vect_dump, "SLPing BB\n");
|
||||
if (dump_kind_p (MSG_NOTE))
|
||||
dump_printf_loc (MSG_NOTE, vect_location, "SLPing BB\n");
|
||||
|
||||
for (si = gsi_start_bb (bb); !gsi_end_p (si); gsi_next (&si))
|
||||
{
|
||||
gimple stmt = gsi_stmt (si);
|
||||
stmt_vec_info stmt_info;
|
||||
|
||||
if (vect_print_dump_info (REPORT_DETAILS))
|
||||
if (dump_kind_p (MSG_NOTE))
|
||||
{
|
||||
fprintf (vect_dump, "------>SLPing statement: ");
|
||||
print_gimple_stmt (vect_dump, stmt, 0, TDF_SLIM);
|
||||
dump_printf_loc (MSG_NOTE, vect_location,
|
||||
"------>SLPing statement: ");
|
||||
dump_gimple_stmt (MSG_NOTE, TDF_SLIM, stmt, 0);
|
||||
}
|
||||
|
||||
stmt_info = vinfo_for_stmt (stmt);
|
||||
|
@ -3159,9 +3222,8 @@ vect_slp_transform_bb (basic_block bb)
|
|||
}
|
||||
}
|
||||
|
||||
if (vect_print_dump_info (REPORT_DETAILS))
|
||||
fprintf (vect_dump, "BASIC BLOCK VECTORIZED\n");
|
||||
if (dump_kind_p (MSG_OPTIMIZED_LOCATIONS))
|
||||
dump_printf (MSG_OPTIMIZED_LOCATIONS, "BASIC BLOCK VECTORIZED\n");
|
||||
|
||||
destroy_bb_vec_info (bb_vinfo);
|
||||
}
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -58,6 +58,7 @@ along with GCC; see the file COPYING3. If not see
|
|||
#include "config.h"
|
||||
#include "system.h"
|
||||
#include "coretypes.h"
|
||||
#include "dumpfile.h"
|
||||
#include "tm.h"
|
||||
#include "ggc.h"
|
||||
#include "tree.h"
|
||||
|
@ -67,13 +68,6 @@ along with GCC; see the file COPYING3. If not see
|
|||
#include "tree-vectorizer.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. */
|
||||
LOC vect_location;
|
||||
|
||||
|
@ -81,82 +75,6 @@ LOC vect_location;
|
|||
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.
|
||||
|
||||
Entry point to loop vectorization phase. */
|
||||
|
@ -176,9 +94,6 @@ vectorize_loops (void)
|
|||
if (vect_loops_num <= 1)
|
||||
return 0;
|
||||
|
||||
/* Fix the verbosity level if not defined explicitly by the user. */
|
||||
vect_set_dump_settings (false);
|
||||
|
||||
init_stmt_vec_info_vec ();
|
||||
|
||||
/* ----------- Analyze loops. ----------- */
|
||||
|
@ -190,12 +105,10 @@ vectorize_loops (void)
|
|||
if (optimize_loop_nest_for_speed_p (loop))
|
||||
{
|
||||
loop_vec_info loop_vinfo;
|
||||
|
||||
vect_location = find_loop_location (loop);
|
||||
if (vect_location != UNKNOWN_LOC
|
||||
&& vect_verbosity_level > REPORT_NONE)
|
||||
fprintf (vect_dump, "\nAnalyzing loop at %s:%d\n",
|
||||
LOC_FILE (vect_location), LOC_LINE (vect_location));
|
||||
if (vect_location != UNKNOWN_LOC && dump_kind_p (MSG_ALL))
|
||||
dump_printf (MSG_ALL, "\nAnalyzing loop at %s:%d\n",
|
||||
LOC_FILE (vect_location), LOC_LINE (vect_location));
|
||||
|
||||
loop_vinfo = vect_analyze_loop (loop);
|
||||
loop->aux = loop_vinfo;
|
||||
|
@ -203,11 +116,9 @@ vectorize_loops (void)
|
|||
if (!loop_vinfo || !LOOP_VINFO_VECTORIZABLE_P (loop_vinfo))
|
||||
continue;
|
||||
|
||||
if (vect_location != UNKNOWN_LOC
|
||||
&& vect_verbosity_level > REPORT_NONE)
|
||||
fprintf (vect_dump, "\n\nVectorizing loop at %s:%d\n",
|
||||
LOC_FILE (vect_location), LOC_LINE (vect_location));
|
||||
|
||||
if (vect_location != UNKNOWN_LOC && dump_kind_p (MSG_ALL))
|
||||
dump_printf (MSG_ALL, "\n\nVectorizing loop at %s:%d\n",
|
||||
LOC_FILE (vect_location), LOC_LINE (vect_location));
|
||||
vect_transform_loop (loop_vinfo);
|
||||
num_vectorized_loops++;
|
||||
}
|
||||
|
@ -215,11 +126,11 @@ vectorize_loops (void)
|
|||
vect_location = UNKNOWN_LOC;
|
||||
|
||||
statistics_counter_event (cfun, "Vectorized loops", num_vectorized_loops);
|
||||
if (vect_print_dump_info (REPORT_UNVECTORIZED_LOCATIONS)
|
||||
|| (num_vectorized_loops > 0
|
||||
&& vect_print_dump_info (REPORT_VECTORIZED_LOCATIONS)))
|
||||
fprintf (vect_dump, "vectorized %u loops in function.\n",
|
||||
num_vectorized_loops);
|
||||
if (dump_kind_p (MSG_ALL)
|
||||
|| (num_vectorized_loops > 0 && dump_kind_p (MSG_ALL)))
|
||||
dump_printf_loc (MSG_ALL, vect_location,
|
||||
"vectorized %u loops in function.\n",
|
||||
num_vectorized_loops);
|
||||
|
||||
/* ----------- Finalize. ----------- */
|
||||
|
||||
|
@ -248,9 +159,6 @@ execute_vect_slp (void)
|
|||
{
|
||||
basic_block bb;
|
||||
|
||||
/* Fix the verbosity level if not defined explicitly by the user. */
|
||||
vect_set_dump_settings (true);
|
||||
|
||||
init_stmt_vec_info_vec ();
|
||||
|
||||
FOR_EACH_BB (bb)
|
||||
|
@ -260,9 +168,9 @@ execute_vect_slp (void)
|
|||
if (vect_slp_analyze_bb (bb))
|
||||
{
|
||||
vect_slp_transform_bb (bb);
|
||||
|
||||
if (vect_print_dump_info (REPORT_VECTORIZED_LOCATIONS))
|
||||
fprintf (vect_dump, "basic block vectorized using SLP\n");
|
||||
if (dump_kind_p (MSG_OPTIMIZED_LOCATIONS))
|
||||
dump_printf_loc (MSG_OPTIMIZED_LOCATIONS, vect_location,
|
||||
"basic block vectorized using SLP\n");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -335,12 +243,9 @@ increase_alignment (void)
|
|||
{
|
||||
DECL_ALIGN (decl) = TYPE_ALIGN (vectype);
|
||||
DECL_USER_ALIGN (decl) = 1;
|
||||
if (dump_file)
|
||||
{
|
||||
fprintf (dump_file, "Increasing alignment of decl: ");
|
||||
print_generic_expr (dump_file, decl, TDF_SLIM);
|
||||
fprintf (dump_file, "\n");
|
||||
}
|
||||
dump_printf (MSG_NOTE, "Increasing alignment of decl: ");
|
||||
dump_generic_expr (MSG_NOTE, TDF_SLIM, decl);
|
||||
dump_printf (MSG_NOTE, "\n");
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
|
|
|
@ -848,9 +848,8 @@ known_alignment_for_access_p (struct data_reference *data_ref_info)
|
|||
return (DR_MISALIGNMENT (data_ref_info) != -1);
|
||||
}
|
||||
|
||||
/* vect_dump will be set to stderr or dump_file if exist. */
|
||||
extern FILE *vect_dump;
|
||||
extern LOC vect_loop_location;
|
||||
/* Source location */
|
||||
extern LOC vect_location;
|
||||
|
||||
/*-----------------------------------------------------------------*/
|
||||
/* Function prototypes. */
|
||||
|
@ -1012,7 +1011,5 @@ void vect_pattern_recog (loop_vec_info, bb_vec_info);
|
|||
|
||||
/* In tree-vectorizer.c. */
|
||||
unsigned vectorize_loops (void);
|
||||
/* Vectorization debug information */
|
||||
extern bool vect_print_dump_info (enum vect_verbosity_levels);
|
||||
|
||||
#endif /* GCC_TREE_VECTORIZER_H */
|
||||
|
|
Loading…
Add table
Reference in a new issue