Message ID | 6d0bed4c-22ce-9d7f-9352-0d5b6391db76@suse.cz |
---|---|
State | New |
Headers | show |
Series | Sort debug counter names. | expand |
On Mon, Nov 11, 2019 at 9:23 AM Martin Liška <mliska@suse.cz> wrote: > > Hi. > > The small patch is about sorting of debug counter > values. > > Ready to be installed? OK > Thanks, > Martin
On 11/11/19 3:20 PM, Richard Biener wrote: > On Mon, Nov 11, 2019 at 9:23 AM Martin Liška <mliska@suse.cz> wrote: >> >> Hi. >> >> The small patch is about sorting of debug counter >> values. >> >> Ready to be installed? > > OK > >> Thanks, >> Martin Hi. There's a small follow up where I enforce the sorting via a selftest. Ready for trunk? Thanks, Martin
On Tue, Nov 12, 2019 at 8:50 AM Martin Liška <mliska@suse.cz> wrote: > > On 11/11/19 3:20 PM, Richard Biener wrote: > > On Mon, Nov 11, 2019 at 9:23 AM Martin Liška <mliska@suse.cz> wrote: > >> > >> Hi. > >> > >> The small patch is about sorting of debug counter > >> values. > >> > >> Ready to be installed? > > > > OK > > > >> Thanks, > >> Martin > > Hi. > > There's a small follow up where I enforce the sorting via a selftest. Well, it's either a bit over-engineering unless you also make use of this and optimize int i; for (i = debug_counter_number_of_counters - 1; i >= 0; i--) if (strcmp (map[i].name, name) == 0) break; no? > Ready for trunk? > Thanks, > Martin
On 11/12/19 9:39 AM, Richard Biener wrote: > On Tue, Nov 12, 2019 at 8:50 AM Martin Liška <mliska@suse.cz> wrote: >> >> On 11/11/19 3:20 PM, Richard Biener wrote: >>> On Mon, Nov 11, 2019 at 9:23 AM Martin Liška <mliska@suse.cz> wrote: >>>> >>>> Hi. >>>> >>>> The small patch is about sorting of debug counter >>>> values. >>>> >>>> Ready to be installed? >>> >>> OK >>> >>>> Thanks, >>>> Martin >> >> Hi. >> >> There's a small follow up where I enforce the sorting via a selftest. > > Well, it's either a bit over-engineering unless you also make use of this and > optimize My motivation was to preserve sorted list in -dbg-cnt-list. > > int i; > for (i = debug_counter_number_of_counters - 1; i >= 0; i--) > if (strcmp (map[i].name, name) == 0) > break; > > no? Heh, that can be rewritten to vec::bsearch, but would need to convert 'map' to a 'vec' type. Or ideally to use a hash_map, but it will probably not pay back. I don't insist on the patch :) Martin > >> Ready for trunk? >> Thanks, >> Martin
On Tue, Nov 12, 2019 at 10:01 AM Martin Liška <mliska@suse.cz> wrote: > > On 11/12/19 9:39 AM, Richard Biener wrote: > > On Tue, Nov 12, 2019 at 8:50 AM Martin Liška <mliska@suse.cz> wrote: > >> > >> On 11/11/19 3:20 PM, Richard Biener wrote: > >>> On Mon, Nov 11, 2019 at 9:23 AM Martin Liška <mliska@suse.cz> wrote: > >>>> > >>>> Hi. > >>>> > >>>> The small patch is about sorting of debug counter > >>>> values. > >>>> > >>>> Ready to be installed? > >>> > >>> OK > >>> > >>>> Thanks, > >>>> Martin > >> > >> Hi. > >> > >> There's a small follow up where I enforce the sorting via a selftest. > > > > Well, it's either a bit over-engineering unless you also make use of this and > > optimize > > My motivation was to preserve sorted list in -dbg-cnt-list. Ah, OK, that makes sense. OTOH the function printing could just sort it itself. > > > > int i; > > for (i = debug_counter_number_of_counters - 1; i >= 0; i--) > > if (strcmp (map[i].name, name) == 0) > > break; > > > > no? > > Heh, that can be rewritten to vec::bsearch, but would need to convert 'map' > to a 'vec' type. Or ideally to use a hash_map, but it will probably not pay back. > > I don't insist on the patch :) Well, the above motivation is a good one so I guess ... OK. Richard. > Martin > > > > >> Ready for trunk? > >> Thanks, > >> Martin >
From f9e1387c8e03d73d00d701fa9754af850424215f Mon Sep 17 00:00:00 2001 From: Martin Liska <mliska@suse.cz> Date: Mon, 11 Nov 2019 09:03:24 +0100 Subject: [PATCH] Sort debug counter names. gcc/ChangeLog: 2019-11-11 Martin Liska <mliska@suse.cz> * dbgcnt.def (DEBUG_COUNTER): Sort counters alphabetically. --- gcc/dbgcnt.def | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/gcc/dbgcnt.def b/gcc/dbgcnt.def index cbd437ea594..5b96a7eaf9d 100644 --- a/gcc/dbgcnt.def +++ b/gcc/dbgcnt.def @@ -140,7 +140,8 @@ echo ubound: $ub */ -/* Debug counter definitions. */ +/* Debug counter definitions. + Please keep the list sorted in alphabetic order. */ DEBUG_COUNTER (asan_use_after_scope) DEBUG_COUNTER (auto_inc_dec) DEBUG_COUNTER (ccp) @@ -153,10 +154,12 @@ DEBUG_COUNTER (dce_ud) DEBUG_COUNTER (delete_trivial_dead) DEBUG_COUNTER (devirt) DEBUG_COUNTER (df_byte_scan) +DEBUG_COUNTER (dom_unreachable_edges) DEBUG_COUNTER (dse) DEBUG_COUNTER (dse1) DEBUG_COUNTER (dse2) DEBUG_COUNTER (gcse2_delete) +DEBUG_COUNTER (gimple_unroll) DEBUG_COUNTER (global_alloc_at_func) DEBUG_COUNTER (global_alloc_at_reg) DEBUG_COUNTER (graphite_scop) @@ -170,7 +173,9 @@ DEBUG_COUNTER (if_conversion_tree) DEBUG_COUNTER (ipa_sra_params) DEBUG_COUNTER (ipa_sra_retvalues) DEBUG_COUNTER (ira_move) +DEBUG_COUNTER (ivopts_loop) DEBUG_COUNTER (local_alloc_for_sched) +DEBUG_COUNTER (match) DEBUG_COUNTER (merged_ipa_icf) DEBUG_COUNTER (postreload_cse) DEBUG_COUNTER (pre) @@ -188,15 +193,11 @@ DEBUG_COUNTER (sel_sched_insn_cnt) DEBUG_COUNTER (sel_sched_region_cnt) DEBUG_COUNTER (sms_sched_loop) DEBUG_COUNTER (split_for_sched2) +DEBUG_COUNTER (store_merging) DEBUG_COUNTER (store_motion) DEBUG_COUNTER (stv_conversion) DEBUG_COUNTER (tail_call) -DEBUG_COUNTER (treepre_insert) DEBUG_COUNTER (tree_sra) +DEBUG_COUNTER (treepre_insert) DEBUG_COUNTER (vect_loop) DEBUG_COUNTER (vect_slp) -DEBUG_COUNTER (dom_unreachable_edges) -DEBUG_COUNTER (match) -DEBUG_COUNTER (store_merging) -DEBUG_COUNTER (gimple_unroll) -DEBUG_COUNTER (ivopts_loop) -- 2.24.0