Ok. I think this is a useful patch for trunk too.

Thanks,

David

On Thu, May 30, 2013 at 7:03 PM, Teresa Johnson <tejohn...@google.com> wrote:
> Testing passed. I forgot to include the documentation change in the first 
> patch:
>
> Index: doc/invoke.texi
> ===================================================================
> --- doc/invoke.texi     (revision 199426)
> +++ doc/invoke.texi     (working copy)
> @@ -6219,7 +6219,7 @@ Controls optimization dumps from various optimizat
>  @samp{-@var{options}} form is used, @var{options} is a list of
>  @samp{-} separated options to select the dump details and
>  optimizations.  If @var{options} is not specified, it defaults to
> -@option{all} for details and @option{optall} for optimization
> +@option{optimized} for details and @option{optall} for optimization
>  groups. 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
>
> Teresa
>
> On Thu, May 30, 2013 at 6:49 PM, Teresa Johnson <tejohn...@google.com> wrote:
>> This patch reduces the copious -fopt-info output by making the default for
>> -fopt-info to be -fopt-info=optimized instead of -fopt-info=all. It also
>> changes most of the vectorizer messages to use MSG_NOTE instead of
>> MSG_OPTIMIZED_LOCATION.
>>
>> Reduced the output of -fopt-info for one application by >75%. Testing in
>> progress.
>>
>> Ok for google/4_8 if testing passes?
>>
>> Thanks, Teresa
>>
>> Index: dumpfile.c
>> ===================================================================
>> --- dumpfile.c  (revision 199426)
>> +++ dumpfile.c  (working copy)
>> @@ -867,7 +867,7 @@ opt_info_switch_p (const char *arg)
>>
>>    file_seen = xstrdup (filename);
>>    if (!flags)
>> -    flags = MSG_ALL;
>> +    flags = MSG_OPTIMIZED_LOCATIONS;
>>    if (!optgroup_flags)
>>      optgroup_flags = OPTGROUP_ALL;
>>
>> Index: tree-vect-loop-manip.c
>> ===================================================================
>> --- tree-vect-loop-manip.c      (revision 199426)
>> +++ tree-vect-loop-manip.c      (working copy)
>> @@ -1774,7 +1774,7 @@ vect_do_peeling_for_loop_bound (loop_vec_info loop
>>    gimple_seq cond_expr_stmt_list = NULL;
>>
>>    if (dump_enabled_p ())
>> -    dump_printf_loc (MSG_OPTIMIZED_LOCATIONS, vect_location,
>> +    dump_printf_loc (MSG_NOTE, vect_location,
>>                       "=== vect_do_peeling_for_loop_bound ===");
>>
>>    initialize_original_copy_tables ();
>> @@ -1828,7 +1828,7 @@ vect_do_peeling_for_loop_bound (loop_vec_info loop
>>    if (check_profitability)
>>      max_iter = MAX (max_iter, (int) th - 1);
>>    record_niter_bound (new_loop, double_int::from_shwi (max_iter), false, 
>> true);
>> -  dump_printf (MSG_OPTIMIZED_LOCATIONS,
>> +  dump_printf (MSG_NOTE,
>>                 "Setting upper bound of nb iterations for epilogue "
>>                 "loop to %d\n", max_iter);
>>
>> @@ -1893,7 +1893,7 @@ vect_gen_niters_for_prolog_loop (loop_vec_info loo
>>        int npeel = LOOP_PEELING_FOR_ALIGNMENT (loop_vinfo);
>>
>>        if (dump_enabled_p ())
>> -        dump_printf_loc (MSG_OPTIMIZED_LOCATIONS, vect_location,
>> +        dump_printf_loc (MSG_NOTE, vect_location,
>>                           "known peeling = %d.", npeel);
>>
>>        iters = build_int_cst (niters_type, npeel);
>> @@ -1948,9 +1948,9 @@ vect_gen_niters_for_prolog_loop (loop_vec_info loo
>>
>>    if (dump_enabled_p ())
>>      {
>> -      dump_printf_loc (MSG_OPTIMIZED_LOCATIONS, vect_location,
>> +      dump_printf_loc (MSG_NOTE, vect_location,
>>                         "niters for prolog loop: ");
>> -      dump_generic_expr (MSG_OPTIMIZED_LOCATIONS, TDF_SLIM, iters);
>> +      dump_generic_expr (MSG_NOTE, TDF_SLIM, iters);
>>      }
>>
>>    var = create_tmp_var (niters_type, "prolog_loop_niters");
>> @@ -2005,7 +2005,7 @@ vect_update_inits_of_drs (loop_vec_info loop_vinfo
>>    struct data_reference *dr;
>>
>>   if (dump_enabled_p ())
>> -    dump_printf_loc (MSG_OPTIMIZED_LOCATIONS, vect_location,
>> +    dump_printf_loc (MSG_NOTE, vect_location,
>>                       "=== vect_update_inits_of_dr ===");
>>
>>    FOR_EACH_VEC_ELT (datarefs, i, dr)
>> @@ -2034,7 +2034,7 @@ vect_do_peeling_for_alignment (loop_vec_info loop_
>>    int bound = 0;
>>
>>    if (dump_enabled_p ())
>> -    dump_printf_loc (MSG_OPTIMIZED_LOCATIONS, vect_location,
>> +    dump_printf_loc (MSG_NOTE, vect_location,
>>                       "=== vect_do_peeling_for_alignment ===");
>>
>>    initialize_original_copy_tables ();
>> @@ -2062,7 +2062,7 @@ vect_do_peeling_for_alignment (loop_vec_info loop_
>>    if (check_profitability)
>>      max_iter = MAX (max_iter, (int) th - 1);
>>    record_niter_bound (new_loop, double_int::from_shwi (max_iter), false, 
>> true);
>> -  dump_printf (MSG_OPTIMIZED_LOCATIONS,
>> +  dump_printf (MSG_NOTE,
>>                 "Setting upper bound of nb iterations for prologue "
>>                 "loop to %d\n", max_iter);
>>
>> @@ -2349,11 +2349,11 @@ vect_create_cond_for_alias_checks (loop_vec_info l
>>
>>        if (dump_enabled_p ())
>>         {
>> -         dump_printf_loc (MSG_OPTIMIZED_LOCATIONS, vect_location,
>> +         dump_printf_loc (MSG_NOTE, 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));
>> +         dump_generic_expr (MSG_NOTE, TDF_SLIM, DR_REF (dr_a));
>> +         dump_printf (MSG_NOTE, " and ");
>> +         dump_generic_expr (MSG_NOTE, TDF_SLIM, DR_REF (dr_b));
>>         }
>>
>>        seg_a_min = addr_base_a;
>> @@ -2379,7 +2379,7 @@ vect_create_cond_for_alias_checks (loop_vec_info l
>>      }
>>
>>    if (dump_enabled_p ())
>> -    dump_printf_loc (MSG_OPTIMIZED_LOCATIONS, vect_location,
>> +    dump_printf_loc (MSG_NOTE, vect_location,
>>                      "created %u versioning for alias checks.\n",
>>                      may_alias_ddrs.length ());
>>  }
>> Index: tree-vectorizer.c
>> ===================================================================
>> --- tree-vectorizer.c   (revision 199426)
>> +++ tree-vectorizer.c   (working copy)
>> @@ -107,7 +107,7 @@ vectorize_loops (void)
>>         vect_location = find_loop_location (loop);
>>          if (LOCATION_LOCUS (vect_location) != UNKNOWN_LOC
>>             && dump_enabled_p ())
>> -         dump_printf (MSG_ALL, "\nAnalyzing loop at %s:%d\n",
>> +         dump_printf (MSG_NOTE, "\nAnalyzing loop at %s:%d\n",
>>                         LOC_FILE (vect_location), LOC_LINE (vect_location));
>>
>>         loop_vinfo = vect_analyze_loop (loop);
>> @@ -118,8 +118,7 @@ vectorize_loops (void)
>>
>>          if (LOCATION_LOCUS (vect_location) != UNKNOWN_LOC
>>             && dump_enabled_p ())
>> -          dump_printf (MSG_ALL, "\n\nVectorizing loop at %s:%d\n",
>> -                       LOC_FILE (vect_location), LOC_LINE (vect_location));
>> +          dump_printf_loc (MSG_ALL, vect_location, "Vectorized loop\n");
>>         vect_transform_loop (loop_vinfo);
>>         num_vectorized_loops++;
>>        }
>> @@ -129,7 +128,7 @@ vectorize_loops (void)
>>    statistics_counter_event (cfun, "Vectorized loops", num_vectorized_loops);
>>    if (dump_enabled_p ()
>>        || (num_vectorized_loops > 0 && dump_enabled_p ()))
>> -    dump_printf_loc (MSG_ALL, vect_location,
>> +    dump_printf_loc (MSG_NOTE, vect_location,
>>                       "vectorized %u loops in function.\n",
>>                       num_vectorized_loops);
>>
>> Index: tree-vect-patterns.c
>> ===================================================================
>> --- tree-vect-patterns.c        (revision 199426)
>> +++ tree-vect-patterns.c        (working copy)
>> @@ -417,9 +417,9 @@ vect_recog_dot_prod_pattern (vec<gimple> *stmts, t
>>
>>    if (dump_enabled_p ())
>>      {
>> -      dump_printf_loc (MSG_OPTIMIZED_LOCATIONS, vect_location,
>> +      dump_printf_loc (MSG_NOTE, vect_location,
>>                         "vect_recog_dot_prod_pattern: detected: ");
>> -      dump_gimple_stmt (MSG_OPTIMIZED_LOCATIONS, TDF_SLIM, pattern_stmt, 0);
>> +      dump_gimple_stmt (MSG_NOTE, TDF_SLIM, pattern_stmt, 0);
>>      }
>>
>>    /* We don't allow changing the order of the computation in the inner-loop
>> @@ -676,7 +676,7 @@ vect_recog_widen_mult_pattern (vec<gimple> *stmts,
>>
>>    /* Pattern detected.  */
>>    if (dump_enabled_p ())
>> -    dump_printf_loc (MSG_OPTIMIZED_LOCATIONS, vect_location,
>> +    dump_printf_loc (MSG_NOTE, vect_location,
>>                       "vect_recog_widen_mult_pattern: detected: ");
>>
>>    /* Check target support  */
>> @@ -913,9 +913,9 @@ vect_recog_widen_sum_pattern (vec<gimple> *stmts,
>>
>>    if (dump_enabled_p ())
>>      {
>> -      dump_printf_loc (MSG_OPTIMIZED_LOCATIONS, vect_location,
>> +      dump_printf_loc (MSG_NOTE, vect_location,
>>                         "vect_recog_widen_sum_pattern: detected: ");
>> -      dump_gimple_stmt (MSG_OPTIMIZED_LOCATIONS, TDF_SLIM, pattern_stmt, 0);
>> +      dump_gimple_stmt (MSG_NOTE, TDF_SLIM, pattern_stmt, 0);
>>      }
>>
>>    /* We don't allow changing the order of the computation in the inner-loop
>> @@ -1218,9 +1218,9 @@ vect_recog_over_widening_pattern (vec<gimple> *stm
>>
>>        if (dump_enabled_p ())
>>          {
>> -          dump_printf_loc (MSG_OPTIMIZED_LOCATIONS, vect_location,
>> +          dump_printf_loc (MSG_NOTE, vect_location,
>>                             "created pattern stmt: ");
>> -          dump_gimple_stmt (MSG_OPTIMIZED_LOCATIONS, TDF_SLIM, 
>> pattern_stmt, 0);
>> +          dump_gimple_stmt (MSG_NOTE, TDF_SLIM, pattern_stmt, 0);
>>          }
>>
>>        type = gimple_expr_type (stmt);
>> @@ -1286,9 +1286,9 @@ vect_recog_over_widening_pattern (vec<gimple> *stm
>>    /* Pattern detected.  */
>>    if (dump_enabled_p ())
>>      {
>> -      dump_printf_loc (MSG_OPTIMIZED_LOCATIONS, vect_location,
>> +      dump_printf_loc (MSG_NOTE, vect_location,
>>                         "vect_recog_over_widening_pattern: detected: ");
>> -      dump_gimple_stmt (MSG_OPTIMIZED_LOCATIONS, TDF_SLIM, pattern_stmt, 0);
>> +      dump_gimple_stmt (MSG_NOTE, TDF_SLIM, pattern_stmt, 0);
>>      }
>>
>>    return pattern_stmt;
>> @@ -1421,7 +1421,7 @@ vect_recog_widen_shift_pattern (vec<gimple> *stmts
>>
>>    /* Pattern detected.  */
>>    if (dump_enabled_p ())
>> -    dump_printf_loc (MSG_OPTIMIZED_LOCATIONS, vect_location,
>> +    dump_printf_loc (MSG_NOTE, vect_location,
>>                       "vect_recog_widen_shift_pattern: detected: ");
>>
>>    /* Check target support.  */
>> @@ -1567,7 +1567,7 @@ vect_recog_vector_vector_shift_pattern (vec<gimple
>>
>>    /* Pattern detected.  */
>>    if (dump_enabled_p ())
>> -    dump_printf_loc (MSG_OPTIMIZED_LOCATIONS, vect_location,
>> +    dump_printf_loc (MSG_NOTE, vect_location,
>>                       "vect_recog_vector_vector_shift_pattern: detected: ");
>>
>>    /* Pattern supported.  Create a stmt to be used to replace the pattern.  
>> */
>> @@ -1685,7 +1685,7 @@ vect_recog_divmod_pattern (vec<gimple> *stmts,
>>
>>        /* Pattern detected.  */
>>        if (dump_enabled_p ())
>> -        dump_printf_loc (MSG_OPTIMIZED_LOCATIONS, vect_location,
>> +        dump_printf_loc (MSG_NOTE, vect_location,
>>                           "vect_recog_divmod_pattern: detected: ");
>>
>>        cond = build2 (LT_EXPR, boolean_type_node, oprnd0,
>> @@ -2032,9 +2032,9 @@ vect_recog_divmod_pattern (vec<gimple> *stmts,
>>    /* Pattern detected.  */
>>    if (dump_enabled_p ())
>>      {
>> -      dump_printf_loc (MSG_OPTIMIZED_LOCATIONS, vect_location,
>> +      dump_printf_loc (MSG_NOTE, vect_location,
>>                         "vect_recog_divmod_pattern: detected: ");
>> -      dump_gimple_stmt (MSG_OPTIMIZED_LOCATIONS, TDF_SLIM, pattern_stmt, 0);
>> +      dump_gimple_stmt (MSG_NOTE, TDF_SLIM, pattern_stmt, 0);
>>      }
>>
>>    stmts->safe_push (last_stmt);
>> @@ -2199,7 +2199,7 @@ vect_recog_mixed_size_cond_pattern (vec<gimple> *s
>>    *type_out = vectype;
>>
>>    if (dump_enabled_p ())
>> -    dump_printf_loc (MSG_OPTIMIZED_LOCATIONS, vect_location,
>> +    dump_printf_loc (MSG_NOTE, vect_location,
>>                       "vect_recog_mixed_size_cond_pattern: detected: ");
>>
>>    return pattern_stmt;
>> @@ -2592,7 +2592,7 @@ vect_recog_bool_pattern (vec<gimple> *stmts, tree
>>        *type_in = vectype;
>>        stmts->safe_push (last_stmt);
>>        if (dump_enabled_p ())
>> -       dump_printf_loc (MSG_OPTIMIZED_LOCATIONS, vect_location,
>> +       dump_printf_loc (MSG_NOTE, vect_location,
>>                           "vect_recog_bool_pattern: detected: ");
>>
>>        return pattern_stmt;
>> @@ -2638,7 +2638,7 @@ vect_recog_bool_pattern (vec<gimple> *stmts, tree
>>        *type_in = vectype;
>>        stmts->safe_push (last_stmt);
>>        if (dump_enabled_p ())
>> -       dump_printf_loc (MSG_OPTIMIZED_LOCATIONS, vect_location,
>> +       dump_printf_loc (MSG_NOTE, vect_location,
>>                           "vect_recog_bool_pattern: detected: ");
>>        return pattern_stmt;
>>      }
>> @@ -2789,9 +2789,9 @@ vect_pattern_recog_1 (vect_recog_func_ptr vect_rec
>>    /* Found a vectorizable pattern.  */
>>    if (dump_enabled_p ())
>>      {
>> -      dump_printf_loc (MSG_OPTIMIZED_LOCATIONS, vect_location,
>> +      dump_printf_loc (MSG_NOTE, vect_location,
>>                         "pattern recognized: ");
>> -      dump_gimple_stmt (MSG_OPTIMIZED_LOCATIONS, TDF_SLIM, pattern_stmt, 0);
>> +      dump_gimple_stmt (MSG_NOTE, TDF_SLIM, pattern_stmt, 0);
>>      }
>>
>>    /* Mark the stmts that are involved in the pattern. */
>> @@ -2815,9 +2815,9 @@ vect_pattern_recog_1 (vect_recog_func_ptr vect_rec
>>        pattern_stmt = STMT_VINFO_RELATED_STMT (stmt_info);
>>        if (dump_enabled_p ())
>>          {
>> -          dump_printf_loc (MSG_OPTIMIZED_LOCATIONS, vect_location,
>> +          dump_printf_loc (MSG_NOTE, vect_location,
>>                             "additional pattern stmt: ");
>> -          dump_gimple_stmt (MSG_OPTIMIZED_LOCATIONS, TDF_SLIM, 
>> pattern_stmt, 0);
>> +          dump_gimple_stmt (MSG_NOTE, TDF_SLIM, pattern_stmt, 0);
>>          }
>>
>>        vect_mark_pattern_stmts (stmt, pattern_stmt, NULL_TREE);
>> Index: tree-vect-slp.c
>> ===================================================================
>> --- tree-vect-slp.c     (revision 199426)
>> +++ tree-vect-slp.c     (working copy)
>> @@ -1794,7 +1794,7 @@ vect_make_slp_decision (loop_vec_info loop_vinfo)
>>
>>    if (decided_to_slp && dump_enabled_p ())
>>      dump_printf_loc (MSG_OPTIMIZED_LOCATIONS, vect_location,
>> -                    "Decided to SLP %d instances. Unrolling factor %d",
>> +                    "Vectorized %d SLP instances with unroll factor %d",
>>                      decided_to_slp, unrolling_factor);
>>
>>    return (decided_to_slp > 0);
>> @@ -3249,7 +3249,7 @@ vect_slp_transform_bb (basic_block bb)
>>      }
>>
>>    if (dump_enabled_p ())
>> -    dump_printf (MSG_OPTIMIZED_LOCATIONS, "BASIC BLOCK VECTORIZED\n");
>> +    dump_printf (MSG_NOTE, "BASIC BLOCK VECTORIZED\n");
>>
>>    destroy_bb_vec_info (bb_vinfo);
>>  }
>> Index: tree-vect-loop.c
>> ===================================================================
>> --- tree-vect-loop.c    (revision 199426)
>> +++ tree-vect-loop.c    (working copy)
>> @@ -5779,8 +5779,8 @@ vect_transform_loop (loop_vec_info loop_vinfo)
>>    update_ssa (TODO_update_ssa);
>>
>>    if (dump_enabled_p ())
>> -    dump_printf_loc (MSG_OPTIMIZED_LOCATIONS, vect_location, "LOOP 
>> VECTORIZED.");
>> +    dump_printf_loc (MSG_NOTE, vect_location, "LOOP VECTORIZED.");
>>    if (loop->inner && dump_enabled_p ())
>> -    dump_printf_loc (MSG_OPTIMIZED_LOCATIONS, vect_location,
>> +    dump_printf_loc (MSG_NOTE, vect_location,
>>                      "OUTER LOOP VECTORIZED.");
>>  }
>
>
>
> --
> Teresa Johnson | Software Engineer | tejohn...@google.com | 408-460-2413

Reply via email to