https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92924

--- Comment #18 from Martin Liška <marxin at gcc dot gnu.org> ---
I've got more detailed stats for current GCC master with 4 TOPN counters
(default) and 8 TOPN counters:

$ gcov-dump-analysis.py gcc-4 4
== Stats for gcc-4 ==
stats for indirect_call:
  total: 9210 freq: 5945890924
  not executed at all: 6248
  invalid: 669 (7.26%) freq:2216493157 (37.28%)
  only one target: 1788 (19.41%) freq:2259048939 (37.99%)
  useful values (with not one target):
    0 values:       23 times (0.25%) freq:    48188389 (0.81%)
    1 values:      271 times (2.94%) freq:  1144170389 (19.24%)
    2 values:      179 times (1.94%) freq:   200108367 (3.37%)
    3 values:       32 times (0.35%) freq:    77881683 (1.31%)
    4 values:        0 times (0.00%) freq:           0 (0.00%)

Top 10 invalid counters:
  freq: 10.18%: [605586849, 0, -1, 0, 0, 0, 0, 0, 0]
  freq: 5.45%: [324297046, 0, -1, 0, 0, 0, 0, 0, 0]
  freq: 2.91%: [173094875, 0, -1, 0, 0, 0, 0, 0, 0]
  freq: 1.71%: [101484459, 0, -1, 0, 0, 0, 0, 0, 0]
  freq: 1.35%: [80265242, 0, -1, 0, 0, 0, 0, 0, 0]
  freq: 0.94%: [55609315, 0, -1, 0, 0, 0, 0, 0, 0]
  freq: 0.93%: [55570274, 0, -1, 0, 0, 0, 0, 0, 0]
  freq: 0.93%: [55570274, 0, -1, 0, 0, 0, 0, 0, 0]
  freq: 0.83%: [49637863, 0, -1, 0, 0, 0, 0, 0, 0]
  freq: 0.83%: [49463167, 0, -1, 0, 0, 0, 0, 0, 0]


stats for topn:
  total: 1513 freq: 1760102743
  not executed at all: 1028
  invalid: 192 (12.69%) freq:1012619038 (57.53%)
  only one target: 147 (9.72%) freq:362167225 (20.58%)
  useful values (with not one target):
    0 values:        9 times (0.59%) freq:     4449793 (0.25%)
    1 values:       80 times (5.29%) freq:   287605028 (16.34%)
    2 values:       50 times (3.30%) freq:    91203061 (5.18%)
    3 values:        7 times (0.46%) freq:     2058598 (0.12%)
    4 values:        0 times (0.00%) freq:           0 (0.00%)

Top 10 invalid counters:
  freq: 27.71%: [487664454, 0, -1, 0, 0, 0, 0, 0, 0]
  freq: 3.84%: [67602541, 0, -1, 0, 0, 0, 0, 0, 0]
  freq: 3.35%: [58977259, 0, -1, 0, 0, 0, 0, 168, 10778]
  freq: 2.49%: [43823851, 0, -1, 0, 0, 0, 0, 0, 0]
  freq: 2.41%: [42335473, 0, -1, 0, 0, 0, 0, 0, 0]
  freq: 1.31%: [23140803, 0, -1, 0, 0, 0, 0, 0, 0]
  freq: 1.27%: [22339515, 0, -1, 0, 0, 0, 0, 0, 0]
  freq: 1.06%: [18680508, 0, -1, 0, 0, 0, 0, 0, 0]
  freq: 1.05%: [18468596, 0, -1, 0, 0, 0, 0, 0, 0]
  freq: 0.97%: [17042811, 0, -1, 0, 0, 8, 8986, 0, 0]

$ gcov-dump-analysis.py gcc-8 8
== Stats for gcc-8 ==
stats for indirect_call:
  total: 9210 freq: 5945896994
  not executed at all: 6248
  invalid: 86 (0.93%) freq:1411998192 (23.75%)
  only one target: 1788 (19.41%) freq:2259051432 (37.99%)
  useful values (with not one target):
    0 values:        1 times (0.01%) freq:       23730 (0.00%)
    1 values:      213 times (2.31%) freq:  1069863050 (17.99%)
    2 values:      234 times (2.54%) freq:   559000644 (9.40%)
    3 values:      253 times (2.75%) freq:   566516561 (9.53%)
    4 values:      282 times (3.06%) freq:    68094936 (1.15%)
    5 values:       99 times (1.07%) freq:    10628476 (0.18%)
    6 values:        6 times (0.07%) freq:      719973 (0.01%)
    7 values:        0 times (0.00%) freq:           0 (0.00%)
    8 values:        0 times (0.00%) freq:           0 (0.00%)

Top 10 invalid counters:
  freq: 10.18%: [605586911, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 723230572,
84092, 1139593113, 84612]
  freq: 5.45%: [324297850, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
  freq: 2.91%: [173094959, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
  freq: 1.35%: [80265372, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
  freq: 0.83%: [49637931, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
  freq: 0.39%: [22933816, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
  freq: 0.30%: [17614204, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
  freq: 0.24%: [13977669, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
  freq: 0.23%: [13907686, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
  freq: 0.21%: [12233528, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]

stats for topn:
  total: 1513 freq: 1760099471
  not executed at all: 1028
  invalid: 133 (8.79%) freq:888710548 (50.49%)
  only one target: 147 (9.72%) freq:362167643 (20.58%)
  useful values (with not one target):
    0 values:        8 times (0.53%) freq:    23626986 (1.34%)
    1 values:       72 times (4.76%) freq:   171882763 (9.77%)
    2 values:       74 times (4.89%) freq:   243855009 (13.85%)
    3 values:       34 times (2.25%) freq:    44981550 (2.56%)
    4 values:       13 times (0.86%) freq:    24863705 (1.41%)
    5 values:        2 times (0.13%) freq:         287 (0.00%)
    6 values:        1 times (0.07%) freq:          10 (0.00%)
    7 values:        1 times (0.07%) freq:       10970 (0.00%)
    8 values:        0 times (0.00%) freq:           0 (0.00%)

Top 10 invalid counters:
  freq: 27.71%: [487664555, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 40, 75356, 64,
99276, 0, 0]
  freq: 3.84%: [67601993, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
  freq: 3.35%: [58977256, 0, -1, 0, 0, 0, 0, 32, 6857, 0, 0, 0, 0, 0, 0, 168,
23937]
  freq: 2.49%: [43823851, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
  freq: 2.41%: [42335497, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
  freq: 1.31%: [23140803, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
  freq: 1.27%: [22338585, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
  freq: 1.05%: [18468605, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
  freq: 0.97%: [17042805, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 18248, 0, 0]
  freq: 0.62%: [10938516, 168, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]

So the frequency of invalid goes down 37.28% -> 23.75% (57.53% -> 50.49%
respectively).

Looking at the biggest invalid offenders for 8 counters:

ggc_internal_cleared_alloc (size_t size, void (*<Tf1>) (void *) f, size_t s,
size_t n)
{
...
  memset (buf_7, 0, size_2(D));
Top N value counter all: 487664555, values: [0:-1], [0:0], [0:0], [0:0], [0:0],
[40:75356], [64:99276], [0:0].
}

walk_tree_1 (union tree_node * * tp, union tree_node * (*walk_tree_fn) (union
tree_node * *, int *, void *) func, void * data, struct hash_set * pset, union
tree_node * (*walk_tree_lh) (union tree_node * *, int *, union tree_node *
(*<T4bb8>) (union tree_node * *, int *, void *), void *, struct hash_set *) lh)
{
...
  result_157 = func_154(D) (tp_118, &walk_subtrees, data_155(D));
Indirect call counter all: 605586911, values: [0:-1], [0:0], [0:0], [0:0],
[0:0], [0:0], [723230572:84092], [1139593113:84612].
...
}

note_pattern_stores (const struct rtx_def * x, void (*<T54f2>) (struct rtx_def
*, const struct rtx_def *, void *) fun, void * data)
{
...
  fun_30(D) (dest_12, x_17, data_31(D));
Indirect call counter all: 324297850, values: [0:-1], [0:0], [0:0], [0:0],
[0:0], [0:0], [0:0], [0:0].
...
}

All these seem to me situations where we have very many different values that
we track.

Reply via email to