This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[patch] PR18441: vectorizer dump reports improvement


Following PR18441 
Here is a patch for making the dump information more flexible and user
friendly.
This patch enables the following dump information scheme:
The user can choose between 6 verbosity levels using the flag 
-ftree-vectorizer-verbose=<number>:
Level 0: No output at all.
Level 1: Report vectorized loops.
Level 2: Also report unvectorized "well-formed" loops and respective 
reason.
Level 3: Also report alignment information (for "well-formed" loops).
Level 4: Like level 3 + report for non-well-formed inner-loops.
Level 5: Like level 3 + report for all loops.
Level 6: Print all vectorizer dump information (equivalent to former 
vect-debug-details).

Where "well formed" loops are inner-most loops that comply with several 
restrictions (loops that pass the first analysis pass - analyze_loop_form 
- successfully).

The information is printed to the standard error unless -fdump-tree-vect 
or -fdump-tree-all are set.

Here is an example of the new output scheme:

1. > gcc -O2 -ftree-vectorize -maltivec -ftree-vectorizer-verbose=0 -S 
vect-70.c

        <Empty output>

2. > gcc -O2 -ftree-vectorize -maltivec -ftree-vectorizer-verbose=1 -S 
vect-70.c

        loop at vect-70.c:26: LOOP VECTORIZED.

        vectorized 1 loops in function.

3. > gcc -O2 -ftree-vectorize -maltivec -ftree-vectorizer-verbose=2 -S 
vect-70.c
        loop at vect-70.c:26: LOOP VECTORIZED.
        loop at vect-70.c:41: not vectorized: complicated access pattern.

        vectorized 1 loops in function.

4. > gcc -O2 -ftree-vectorize -maltivec -ftree-vectorizer-verbose=3 -S 
vect-70.c
        loop at vect-70.c:26: Alignment of access forced using peeling.
        loop at vect-70.c:26: LOOP VECTORIZED.
        loop at vect-70.c:41: not vectorized: complicated access pattern.

        vectorized 1 loops in function.

5. > gcc -O2 -ftree-vectorize -maltivec -ftree-vectorizer-verbose=4 -S 
vect-70.c
        loop at vect-70.c:26: Alignment of access forced using peeling.
        loop at vect-70.c:26: LOOP VECTORIZED.
        loop at vect-70.c:35: not vectorized: multiple exits.
        loop at vect-70.c:41: not vectorized: complicated access pattern.
        loop at vect-70.c:50: not vectorized: multiple exits.

        vectorized 1 loops in function.

6. > gcc -O2 -ftree-vectorize -maltivec -ftree-vectorizer-verbose=5 -S 

        loop at vect-70.c:25: not vectorized: nested loop.
        loop at vect-70.c:26: Alignment of access forced using peeling.
        loop at vect-70.c:26: LOOP VECTORIZED.
        not vectorized: nested loop.
        loop at vect-70.c:35: not vectorized: multiple exits.
        loop at vect-70.c:40: not vectorized: nested loop.
        loop at vect-70.c:41: not vectorized: complicated access pattern.
        not vectorized: nested loop.
        loop at vect-70.c:50: not vectorized: multiple exits.

        vectorized 1 loops in function.

This patch consists of:
1. Two new functions for setting the verbosity level of the vectorizer 
according to the above scheme: vect_set_dump_settings and 
vect_set_verbosity_level.
2. New function vect_print_dump_info replaces the functions 
vect_debug_stats and vect_debug_details.
3. The rest is a technical replacement of all calls to 
vect_debug_details/stats with calls to vect_print_dump_info with 
appropriate verbosity level.
4. Minor cleanups to the dump information.

The patch depends on the patch for improving loop location reports (parts 
1 and 2):
http://gcc.gnu.org/ml/gcc-patches/2005-01/msg00664.html
http://gcc.gnu.org/ml/gcc-patches/2005-01/msg00665.html

Reviewed by Dorit. Bootstrapped and tested on powerpc-suse-linux.

ok for mainline?

Thanks,
Leehod


ChangeLog:

        * testsuite/gcc.dg/vect/vect.exp: Add -ftree-vectorizer-verbose=3.
        * doc/invoke.texi (ftree-vectorizer-verbose): New.
        * opts.c (OPT_ftree_vectorizer_verbose_): New case for switch.
        * common.opt (ftree-vectorizer-verbose): New Flag for the 
vectorizer
        was added.
        * tree.h (vect_set_verbosity_level): New extern function 
declaration
        added.
        * tree-vectorizer.h (verbosity_levels): New enum type.
        * tree-vectorizer.c (vect_debug_stats): Function removed.
        (vect_debug_details): Likewise.
        (vect_verbosity_level): Global variable was defined and 
initialized.
        (vect_dump): Global variable definition.
        (vect_print_dump_info): New function.
        (vect_set_dump_settings): New function.
        (vect_set_verbosity_level): New function.
        (vectorize_loops): Add call to vect_set_dump_settings.

        (slpeel_make_loop_iterate_ntimes): Dump condition was changed.
        (slpeel_tree_duplicate_loop_to_edge_cfg): Likewise.
        (slpeel_tree_peel_loop_to_edge): Likewise.

        (vect_analyze_offset_expr): Call to vect_print_dump_info with
        appropriate verbosity level instead of call to vect_debug_details 
        or vect_debug_stats. 
        (vect_get_base_and_offset):
        (vect_create_addr_base_for_vector_ref):
        (get_vectype_for_scalar_type):
        (vect_create_data_ref_ptr):
        (vect_init_vector):
        (vect_get_vec_def_for_operand):
        (vect_finish_stmt_generation):
        (vectorizable_assignment):
        (vectorizable_operation):
        (vectorizable_store):
        (vectorizable_load):
        (vect_transform_stmt):
        (vect_update_ivs_after_vectorizer):
        (vect_do_peeling_for_loop_bound):
        (vect_update_inits_of_drs):
        (vect_do_peeling_for_alignment):
        (vect_transform_loop):
        (vect_is_simple_use):
        (vect_analyze_operations):
        (vect_is_simple_iv_evolution):
        (vect_analyze_scalar_cycles):
        (vect_analyze_data_ref_dependence):
        (vect_analyze_data_ref_dependences):
        (vect_compute_data_ref_alignment):
        (vect_enhance_data_refs_alignment):
        (vect_analyze_data_refs_alignment):
        (vect_analyze_data_ref_access):
        (vect_analyze_data_ref_accesses):
        (vect_analyze_pointer_ref_access):
        (vect_get_memtag_and_dr):
        (vect_analyze_data_refs):
        (vect_mark_relevant):
        (vect_stmt_relevant_p):
        (vect_mark_stmts_to_be_vectorized):
        (vect_can_advance_ivs_p):
        (vect_get_loop_niters):
        (vect_analyze_loop_form):
        (vect_analyze_loop):
        (vectorize_loops): Likewise.

        (vect_do_peeling_for_loop_bound): Dump format slightly changed.
        (vect_update_inits_of_drs):
        (vect_do_peeling_for_alignment):
        (vect_transform_loop):
        (vect_analyze_operations):
        (vect_analyze_scalar_cycles):
        (vect_analyze_data_ref_dependences):
        (vect_analyze_data_refs_alignment):
        (vect_analyze_data_ref_accesses):
        (vect_analyze_data_refs):
        (vect_mark_stmts_to_be_vectorized):
        (vect_get_loop_niters):
        (vect_analyze_loop_form):
        (vect_analyze_loop): Likewise. 
        (vect_mark_stmts_to_be_vectorized): Add call to 
print_generic_expr.
 
Patch:

Attachment: verbosity_levels.patch
Description: Binary data


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]