diff mbox series

Compare guessed profile frequencies to actual profile feedback in profile dump file

Message ID 20211128185208.GL71018@kam.mff.cuni.cz
State Committed
Commit 2899d49e3701a4df18a336a680a7095cc99a2229
Headers show
Series Compare guessed profile frequencies to actual profile feedback in profile dump file | expand

Commit Message

Jan Hubicka Nov. 28, 2021, 6:52 p.m. UTC
Hi,
this patch adds simple code to dump and compare frequencies of basic blocks
read from the profile feedback and frequencies guessed statically.
It dumps basic blocks in the order of decreasing frequencies from feedback
along with guessed frequencies and histograms.

It makes it to possible spot basic blocks in hot regions that are considered
cold by guessed profile or vice versa.

I am trying to figure out how realistic our profile estimate is compared to
read one on exchange2 (looking again into PR98782.  There IRA now places spills
into hot regions of code while with older (and worse) profile it did not.
Catch is that the function is very large and has 9 nested loops, so it is hard
to figure out how to improve the profile estimate and/or IRA.

So here I get:
 Basic block  136 guessed freq:       17.548 cummulative:  0.60%  feedback freq:       51.848 cummulative:   1.94% cnt: 101811269914
 Basic block  137 guessed freq:       15.618 cummulative:  1.14%  feedback freq:       46.471 cummulative:   3.69% cnt: 101623431810
 Basic block  258 guessed freq:       15.256 cummulative:  1.67%  feedback freq:       46.467 cummulative:   5.43% cnt: 101623295779
 Basic block  155 guessed freq:       25.458 cummulative:  2.54%  feedback freq:       39.772 cummulative:   6.92% cnt: 101389409933
 Basic block   98 guessed freq:        9.773 cummulative:  2.88%  feedback freq:       36.496 cummulative:   8.29% cnt: 101274937256
 Basic block  156 guessed freq:       22.658 cummulative:  3.66%  feedback freq:       35.642 cummulative:   9.62% cnt: 101245112573
 Basic block  242 guessed freq:       22.296 cummulative:  4.42%  feedback freq:       35.638 cummulative:  10.96% cnt: 101244976542
 Basic block   99 guessed freq:        8.698 cummulative:  4.72%  feedback freq:       32.558 cummulative:  12.18% cnt: 101137388587
 Basic block  290 guessed freq:        8.336 cummulative:  5.01%  feedback freq:       32.554 cummulative:  13.40% cnt: 101137252556
 Basic block   79 guessed freq:        7.975 cummulative:  5.28%  feedback freq:       31.622 cummulative:  14.58% cnt: 101104687116
 Basic block   80 guessed freq:        7.098 cummulative:  5.53%  feedback freq:       28.448 cummulative:  15.65% cnt: 10993797250
 Basic block  306 guessed freq:        6.735 cummulative:  5.76%  feedback freq:       28.444 cummulative:  16.72% cnt: 10993661219
 Basic block  101 guessed freq:        8.807 cummulative:  6.06%  feedback freq:       26.463 cummulative:  17.71% cnt: 10924453185
 Basic block  276 guessed freq:        6.996 cummulative:  6.30%  feedback freq:       26.443 cummulative:  18.70% cnt: 10923773030
 Basic block   82 guessed freq:        8.622 cummulative:  6.60%  feedback freq:       23.648 cummulative:  19.59% cnt: 10826108200
 Basic block  292 guessed freq:        6.449 cummulative:  6.82%  feedback freq:       23.624 cummulative:  20.47% cnt: 10825292014
 Basic block  117 guessed freq:       12.720 cummulative:  7.26%  feedback freq:       23.190 cummulative:  21.34% cnt: 10810135530
 Basic block   63 guessed freq:        8.673 cummulative:  7.56%  feedback freq:       22.247 cummulative:  22.17% cnt: 10777181279
 Basic block  308 guessed freq:        6.139 cummulative:  7.77%  feedback freq:       22.220 cummulative:  23.01% cnt: 10776229062
 Basic block  120 guessed freq:        9.170 cummulative:  8.09%  feedback freq:       21.523 cummulative:  23.81% cnt: 10751896540
 Basic block  260 guessed freq:        7.721 cummulative:  8.35%  feedback freq:       21.508 cummulative:  24.62% cnt: 10751352416
 Basic block   44 guessed freq:        8.949 cummulative:  8.66%  feedback freq:       21.257 cummulative:  25.42% cnt: 10742592992
 Basic block  324 guessed freq:        6.052 cummulative:  8.87%  feedback freq:       21.226 cummulative:  26.21% cnt: 10741504744
 Basic block  102 guessed freq:        7.046 cummulative:  9.11%  feedback freq:       21.170 cummulative:  27.01% cnt: 10739562548
 Basic block  277 guessed freq:        5.597 cummulative:  9.30%  feedback freq:       21.155 cummulative:  27.80% cnt: 10739018424
 Basic block  123 guessed freq:       20.841 cummulative: 10.02%  feedback freq:       20.405 cummulative:  28.56% cnt: 10712829670
 Basic block  262 guessed freq:       17.548 cummulative: 10.62%  feedback freq:       20.386 cummulative:  29.33% cnt: 10712168948
 Basic block  104 guessed freq:       16.013 cummulative: 11.17%  feedback freq:       20.014 cummulative:  30.08% cnt: 10699178597
 Basic block  278 guessed freq:       12.720 cummulative: 11.61%  feedback freq:       19.995 cummulative:  30.83% cnt: 10698517875
 Basic block   83 guessed freq:        7.185 cummulative: 11.86%  feedback freq:       19.706 cummulative:  31.57% cnt: 10688423500
 Basic block  293 guessed freq:        5.374 cummulative: 12.04%  feedback freq:       19.687 cummulative:  32.30% cnt: 10687743345
 Basic block   64 guessed freq:        7.434 cummulative: 12.30%  feedback freq:       19.069 cummulative:  33.02% cnt: 10666155382
 Basic block  309 guessed freq:        5.262 cummulative: 12.48%  feedback freq:       19.046 cummulative:  33.73% cnt: 10665339196
 Basic block   45 guessed freq:        7.831 cummulative: 12.75%  feedback freq:       18.600 cummulative:  34.43% cnt: 10649768868
 Basic block  325 guessed freq:        5.295 cummulative: 12.93%  feedback freq:       18.573 cummulative:  35.13% cnt: 10648816651
 Basic block  118 guessed freq:       11.321 cummulative: 13.32%  feedback freq:       17.902 cummulative:  35.80% cnt: 10625380924
 Basic block  274 guessed freq:       10.959 cummulative: 13.70%  feedback freq:       17.898 cummulative:  36.47% cnt: 10625244893
 Basic block  121 guessed freq:        6.877 cummulative: 13.94%  feedback freq:       16.142 cummulative:  37.07% cnt: 10563922405
 Basic block  261 guessed freq:        5.791 cummulative: 14.13%  feedback freq:       16.131 cummulative:  37.68% cnt: 10563514312
 Basic block  142 guessed freq:       28.751 cummulative: 15.12%  feedback freq:       16.130 cummulative:  38.28% cnt: 10563486180
 Basic block  246 guessed freq:       25.458 cummulative: 16.00%  feedback freq:       16.111 cummulative:  38.89% cnt: 10562825458
 Basic block  129 guessed freq:        6.878 cummulative: 16.24%  feedback freq:       15.973 cummulative:  39.49% cnt: 10558017550
 Basic block  268 guessed freq:        5.791 cummulative: 16.44%  feedback freq:       15.958 cummulative:  40.08% cnt: 10557492859
 Basic block   41 guessed freq:        6.207 cummulative: 16.65%  feedback freq:       15.193 cummulative:  40.65% cnt: 10530755205
 Basic block  124 guessed freq:       18.548 cummulative: 17.29%  feedback freq:       15.024 cummulative:  41.22% cnt: 10524855535
 Basic block  263 guessed freq:       15.618 cummulative: 17.82%  feedback freq:       15.009 cummulative:  41.78% cnt: 10524330844
 Basic block   85 guessed freq:       13.066 cummulative: 18.27%  feedback freq:       14.865 cummulative:  42.34% cnt: 10519294678
 Basic block  294 guessed freq:        9.773 cummulative: 18.61%  feedback freq:       14.846 cummulative:  42.89% cnt: 10518633956
 Basic block  105 guessed freq:       14.251 cummulative: 19.10%  feedback freq:       14.722 cummulative:  43.44% cnt: 10514287960
 Basic block  279 guessed freq:       11.321 cummulative: 19.49%  feedback freq:       14.707 cummulative:  44.00% cnt: 10513763269
 Basic block  110 guessed freq:        5.285 cummulative: 19.67%  feedback freq:       14.525 cummulative:  44.54% cnt: 10507429072
 Basic block  284 guessed freq:        4.198 cummulative: 19.82%  feedback freq:       14.510 cummulative:  45.08% cnt: 10506904381
 Basic block   25 guessed freq:        9.406 cummulative: 20.14%  feedback freq:       14.426 cummulative:  45.62% cnt: 10503959932
 Basic block  340 guessed freq:        6.146 cummulative: 20.35%  feedback freq:       14.391 cummulative:  46.16% cnt: 10502735653
 Basic block  191 guessed freq:       27.250 cummulative: 21.29%  feedback freq:       14.284 cummulative:  46.70% cnt: 10499015182
 Basic block  192 guessed freq:       24.525 cummulative: 22.13%  feedback freq:       13.845 cummulative:  47.22% cnt: 10483670189
 Basic block  114 guessed freq:        2.349 cummulative: 22.21%  feedback freq:       13.747 cummulative:  47.73% cnt: 10480243908
 Basic block  288 guessed freq:        1.866 cummulative: 22.28%  feedback freq:       13.743 cummulative:  48.25% cnt: 10480088444
 Basic block  133 guessed freq:        3.057 cummulative: 22.38%  feedback freq:       13.734 cummulative:  48.76% cnt: 10479791828
 Basic block  272 guessed freq:        2.574 cummulative: 22.47%  feedback freq:       13.730 cummulative:  49.28% cnt: 10479636364
 Basic block  148 guessed freq:        9.489 cummulative: 22.80%  feedback freq:       13.636 cummulative:  49.79% cnt: 10476359209
 Basic block  252 guessed freq:        8.402 cummulative: 23.09%  feedback freq:       13.621 cummulative:  50.30% cnt: 10475834518
 Basic block   42 guessed freq:        5.524 cummulative: 23.28%  feedback freq:       13.594 cummulative:  50.81% cnt: 10474895688
 Basic block  338 guessed freq:        5.162 cummulative: 23.45%  feedback freq:       13.590 cummulative:  51.32% cnt: 10474759657
 Basic block   26 guessed freq:        8.361 cummulative: 23.74%  feedback freq:       12.823 cummulative:  51.80% cnt: 10447964384
 Basic block  341 guessed freq:        5.463 cummulative: 23.93%  feedback freq:       12.792 cummulative:  52.28% cnt: 10446876136
 Basic block  139 guessed freq:        9.489 cummulative: 24.26%  feedback freq:       12.403 cummulative:  52.74% cnt: 10433300173
 Basic block  244 guessed freq:        8.402 cummulative: 24.55%  feedback freq:       12.392 cummulative:  53.21% cnt: 10432892080
 Basic block  143 guessed freq:       25.588 cummulative: 25.43%  feedback freq:       11.996 cummulative:  53.66% cnt: 10419052789
 Basic block  247 guessed freq:       22.658 cummulative: 26.21%  feedback freq:       11.981 cummulative:  54.11% cnt: 10418528098
 Basic block  193 guessed freq:       23.176 cummulative: 27.00%  feedback freq:       11.400 cummulative:  54.53% cnt: 10398251930
 Basic block   66 guessed freq:       11.268 cummulative: 27.39%  feedback freq:       10.951 cummulative:  54.95% cnt: 10382565503
 Basic block  310 guessed freq:        7.975 cummulative: 27.66%  feedback freq:       10.932 cummulative:  55.36% cnt: 10381904781
 Basic block   86 guessed freq:       11.629 cummulative: 28.06%  feedback freq:       10.924 cummulative:  55.76% cnt: 10381609978
 Basic block  295 guessed freq:        8.698 cummulative: 28.36%  feedback freq:       10.909 cummulative:  56.17% cnt: 10381085287
 Basic block   95 guessed freq:        1.916 cummulative: 28.43%  feedback freq:       10.871 cummulative:  56.58% cnt: 10379768520
 Basic block  304 guessed freq:        1.433 cummulative: 28.48%  feedback freq:       10.867 cummulative:  56.99% cnt: 10379613056
 Basic block  130 guessed freq:        4.586 cummulative: 28.64%  feedback freq:       10.649 cummulative:  57.39% cnt: 10372011700
 Basic block  269 guessed freq:        3.861 cummulative: 28.77%  feedback freq:       10.639 cummulative:  57.79% cnt: 10371661906
 Basic block   60 guessed freq:        6.877 cummulative: 29.01%  feedback freq:       10.522 cummulative:  58.18% cnt: 10367567529
 Basic block  115 guessed freq:        1.761 cummulative: 29.07%  feedback freq:       10.310 cummulative:  58.57% cnt: 10360182931
 Basic block  289 guessed freq:        1.399 cummulative: 29.12%  feedback freq:       10.307 cummulative:  58.95% cnt: 10360066333
 Basic block  134 guessed freq:        2.292 cummulative: 29.19%  feedback freq:       10.301 cummulative:  59.34% cnt: 10359843871
 Basic block  273 guessed freq:        1.930 cummulative: 29.26%  feedback freq:       10.297 cummulative:  59.73% cnt: 10359727273
 Basic block    5 guessed freq:       10.000 cummulative: 29.60%  feedback freq:       10.000 cummulative:  60.10% cnt: 10349340900
 Basic block    3 guessed freq:       10.000 cummulative: 29.95%  feedback freq:       10.000 cummulative:  60.48% cnt: 10349340900
 Basic block    9 guessed freq:       10.000 cummulative: 30.29%  feedback freq:       10.000 cummulative:  60.85% cnt: 10349340900
 Basic block   13 guessed freq:       10.000 cummulative: 30.64%  feedback freq:       10.000 cummulative:  61.22% cnt: 10349340900
 Basic block   17 guessed freq:       10.000 cummulative: 30.98%  feedback freq:       10.000 cummulative:  61.60% cnt: 10349340900
 Basic block   47 guessed freq:       10.170 cummulative: 31.33%  feedback freq:        9.927 cummulative:  61.97% cnt: 10346794104
 Basic block  326 guessed freq:        6.877 cummulative: 31.57%  feedback freq:        9.908 cummulative:  62.34% cnt: 10346133382
 Basic block  152 guessed freq:        4.217 cummulative: 31.71%  feedback freq:        9.724 cummulative:  62.71% cnt: 10339708748
 Basic block  256 guessed freq:        3.734 cummulative: 31.84%  feedback freq:        9.720 cummulative:  63.07% cnt: 10339553284
 Basic block  111 guessed freq:        3.523 cummulative: 31.96%  feedback freq:        9.684 cummulative:  63.43% cnt: 10338286048
 Basic block  285 guessed freq:        2.799 cummulative: 32.06%  feedback freq:        9.674 cummulative:  63.80% cnt: 10337936254
 Basic block   22 guessed freq:        5.798 cummulative: 32.26%  feedback freq:        9.513 cummulative:  64.15% cnt: 10332343631
 Basic block  158 guessed freq:       41.711 cummulative: 33.69%  feedback freq:        9.094 cummulative:  64.50% cnt: 10317705732
 Basic block  149 guessed freq:        6.326 cummulative: 33.91%  feedback freq:        9.091 cummulative:  64.84% cnt: 10317572806
 Basic block  253 guessed freq:        5.602 cummulative: 34.10%  feedback freq:        9.081 cummulative:  65.18% cnt: 10317223012
 Basic block  230 guessed freq:       38.418 cummulative: 35.42%  feedback freq:        9.076 cummulative:  65.52% cnt: 10317045010
 Basic block    4 guessed freq:        9.000 cummulative: 35.73%  feedback freq:        9.000 cummulative:  65.85% cnt: 10314406810
 Basic block    6 guessed freq:        9.000 cummulative: 36.04%  feedback freq:        9.000 cummulative:  66.19% cnt: 10314406810
 Basic block    8 guessed freq:        9.000 cummulative: 36.35%  feedback freq:        9.000 cummulative:  66.53% cnt: 10314406810
 Basic block   10 guessed freq:        9.000 cummulative: 36.66%  feedback freq:        9.000 cummulative:  66.87% cnt: 10314406810
 Basic block   12 guessed freq:        9.000 cummulative: 36.97%  feedback freq:        9.000 cummulative:  67.20% cnt: 10314406810
 Basic block   14 guessed freq:        9.000 cummulative: 37.28%  feedback freq:        9.000 cummulative:  67.54% cnt: 10314406810
 Basic block   16 guessed freq:        9.000 cummulative: 37.59%  feedback freq:        9.000 cummulative:  67.88% cnt: 10314406810
 Basic block   18 guessed freq:        9.000 cummulative: 37.90%  feedback freq:        9.000 cummulative:  68.22% cnt: 10314406810
 Basic block   20 guessed freq:        9.000 cummulative: 38.21%  feedback freq:        9.000 cummulative:  68.55% cnt: 10314406810
 Basic block   91 guessed freq:        4.312 cummulative: 38.36%  feedback freq:        8.845 cummulative:  68.88% cnt: 10308982825
 Basic block  300 guessed freq:        3.226 cummulative: 38.47%  feedback freq:        8.830 cummulative:  69.22% cnt: 10308458134
 Basic block   76 guessed freq:        1.653 cummulative: 38.53%  feedback freq:        8.667 cummulative:  69.54% cnt: 10302771196
 Basic block  320 guessed freq:        1.170 cummulative: 38.57%  feedback freq:        8.662 cummulative:  69.86% cnt: 10302615732
 Basic block   23 guessed freq:        5.160 cummulative: 38.75%  feedback freq:        8.517 cummulative:  70.18% cnt: 10297545572
 Basic block  354 guessed freq:        4.798 cummulative: 38.91%  feedback freq:        8.513 cummulative:  70.50% cnt: 10297409541
 Basic block   57 guessed freq:        1.492 cummulative: 38.96%  feedback freq:        8.359 cummulative:  70.82% cnt: 10292001876
 Basic block  336 guessed freq:        1.009 cummulative: 39.00%  feedback freq:        8.354 cummulative:  71.13% cnt: 10291846412
 Basic block  140 guessed freq:        6.326 cummulative: 39.21%  feedback freq:        8.269 cummulative:  71.44% cnt: 10288866782
 Basic block  245 guessed freq:        5.602 cummulative: 39.41%  feedback freq:        8.261 cummulative:  71.75% cnt: 10288594720
 Basic block   96 guessed freq:        1.437 cummulative: 39.46%  feedback freq:        8.153 cummulative:  72.05% cnt: 10284826390
 Basic block  305 guessed freq:        1.075 cummulative: 39.49%  feedback freq:        8.150 cummulative:  72.36% cnt: 10284709792
 Basic block   61 guessed freq:        6.121 cummulative: 39.70%  feedback freq:        7.869 cummulative:  72.66% cnt: 10274879436
 Basic block  322 guessed freq:        5.758 cummulative: 39.90%  feedback freq:        7.865 cummulative:  72.95% cnt: 10274743405
 Basic block   67 guessed freq:       10.028 cummulative: 40.25%  feedback freq:        7.773 cummulative:  73.24% cnt: 10271539606
 Basic block  311 guessed freq:        7.098 cummulative: 40.49%  feedback freq:        7.758 cummulative:  73.53% cnt: 10271014915
 Basic block  153 guessed freq:        3.163 cummulative: 40.60%  feedback freq:        7.293 cummulative:  73.81% cnt: 10254781561
 Basic block  257 guessed freq:        2.800 cummulative: 40.70%  feedback freq:        7.290 cummulative:  74.08% cnt: 10254664963
 Basic block   48 guessed freq:        9.051 cummulative: 41.01%  feedback freq:        7.270 cummulative:  74.35% cnt: 10253969980
 Basic block   72 guessed freq:        3.719 cummulative: 41.14%  feedback freq:        7.266 cummulative:  74.62% cnt: 10253823445
 Basic block  327 guessed freq:        6.121 cummulative: 41.35%  feedback freq:        7.255 cummulative:  74.90% cnt: 10253445289
 Basic block  316 guessed freq:        2.632 cummulative: 41.44%  feedback freq:        7.251 cummulative:  75.17% cnt: 10253298754
 Basic block  127 guessed freq:        3.057 cummulative: 41.54%  feedback freq:        7.099 cummulative:  75.43% cnt: 10248007800
 Basic block  266 guessed freq:        2.574 cummulative: 41.63%  feedback freq:        7.093 cummulative:  75.70% cnt: 10247774604
 Basic block   15 guessed freq:        4.500 cummulative: 41.79%  feedback freq:        6.861 cummulative:  75.96% cnt: 10239695938
 Basic block   19 guessed freq:        4.500 cummulative: 41.94%  feedback freq:        6.861 cummulative:  76.21% cnt: 10239695938
 Basic block  159 guessed freq:       37.123 cummulative: 43.22%  feedback freq:        6.745 cummulative:  76.47% cnt: 10235614009
 Basic block  231 guessed freq:       34.192 cummulative: 44.39%  feedback freq:        6.730 cummulative:  76.72% cnt: 10235089318
 Basic block   77 guessed freq:        1.239 cummulative: 44.44%  feedback freq:        6.500 cummulative:  76.96% cnt: 10227078397
 Basic block  321 guessed freq:        0.877 cummulative: 44.47%  feedback freq:        6.497 cummulative:  77.21% cnt: 10226961799
 Basic block  108 guessed freq:        2.349 cummulative: 44.55%  feedback freq:        6.456 cummulative:  77.45% cnt: 10225524032
 Basic block  282 guessed freq:        1.866 cummulative: 44.61%  feedback freq:        6.449 cummulative:  77.69% cnt: 10225290836
 Basic block  164 guessed freq:       13.766 cummulative: 45.08%  feedback freq:        6.338 cummulative:  77.93% cnt: 10221407587
 Basic block  236 guessed freq:       12.679 cummulative: 45.52%  feedback freq:        6.323 cummulative:  78.16% cnt: 10220882896
 Basic block   58 guessed freq:        1.119 cummulative: 45.56%  feedback freq:        6.269 cummulative:  78.40% cnt: 10219001407
 Basic block  337 guessed freq:        0.756 cummulative: 45.59%  feedback freq:        6.266 cummulative:  78.63% cnt: 10218884809
 Basic block  146 guessed freq:        4.217 cummulative: 45.73%  feedback freq:        6.060 cummulative:  78.86% cnt: 10211715204
 Basic block  250 guessed freq:        3.734 cummulative: 45.86%  feedback freq:        6.054 cummulative:  79.09% cnt: 10211482008
 Basic block   92 guessed freq:        2.875 cummulative: 45.96%  feedback freq:        5.896 cummulative:  79.31% cnt: 10205988550
 Basic block  301 guessed freq:        2.150 cummulative: 46.03%  feedback freq:        5.886 cummulative:  79.53% cnt: 10205638756
 Basic block   28 guessed freq:        9.500 cummulative: 46.36%  feedback freq:        5.726 cummulative:  79.74% cnt: 10200021363
 Basic block  342 guessed freq:        6.207 cummulative: 46.57%  feedback freq:        5.707 cummulative:  79.96% cnt: 10199360641
 Basic block  174 guessed freq:      107.986 cummulative: 50.29%  feedback freq:        5.688 cummulative:  80.17% cnt: 10198703830
 Basic block  215 guessed freq:       90.180 cummulative: 53.39%  feedback freq:        5.669 cummulative:  80.38% cnt: 10198043108
 Basic block  168 guessed freq:        6.118 cummulative: 53.60%  feedback freq:        5.602 cummulative:  80.59% cnt: 10195717216
 Basic block  240 guessed freq:        5.635 cummulative: 53.79%  feedback freq:        5.598 cummulative:  80.80% cnt: 10195561752
 Basic block  180 guessed freq:       35.639 cummulative: 55.02%  feedback freq:        5.531 cummulative:  81.01% cnt: 10193220991
 Basic block  221 guessed freq:       29.762 cummulative: 56.04%  feedback freq:        5.516 cummulative:  81.22% cnt: 10192696300
 Basic block  119 guessed freq:        2.292 cummulative: 56.12%  feedback freq:        5.381 cummulative:  81.42% cnt: 10187974135
 Basic block  122 guessed freq:        2.292 cummulative: 56.20%  feedback freq:        5.381 cummulative:  81.62% cnt: 10187974135
 Basic block  125 guessed freq:        2.292 cummulative: 56.28%  feedback freq:        5.381 cummulative:  81.82% cnt: 10187974135
 Basic block  135 guessed freq:        2.292 cummulative: 56.36%  feedback freq:        5.381 cummulative:  82.02% cnt: 10187974135
 Basic block  259 guessed freq:        1.930 cummulative: 56.43%  feedback freq:        5.377 cummulative:  82.23% cnt: 10187838104
 Basic block  264 guessed freq:        1.930 cummulative: 56.49%  feedback freq:        5.377 cummulative:  82.43% cnt: 10187838104
 Basic block  128 guessed freq:        2.292 cummulative: 56.57%  feedback freq:        5.324 cummulative:  82.63% cnt: 10186005850
 Basic block  131 guessed freq:        2.292 cummulative: 56.65%  feedback freq:        5.324 cummulative:  82.83% cnt: 10186005850
 Basic block  267 guessed freq:        1.930 cummulative: 56.72%  feedback freq:        5.319 cummulative:  83.03% cnt: 10185830953
 Basic block  270 guessed freq:        1.930 cummulative: 56.78%  feedback freq:        5.319 cummulative:  83.23% cnt: 10185830953
 Basic block  100 guessed freq:        1.761 cummulative: 56.84%  feedback freq:        5.293 cummulative:  83.42% cnt: 10184890637
 Basic block  103 guessed freq:        1.761 cummulative: 56.90%  feedback freq:        5.293 cummulative:  83.62% cnt: 10184890637
 Basic block  106 guessed freq:        1.761 cummulative: 56.97%  feedback freq:        5.293 cummulative:  83.82% cnt: 10184890637
 Basic block  116 guessed freq:        1.761 cummulative: 57.03%  feedback freq:        5.293 cummulative:  84.02% cnt: 10184890637
 Basic block  275 guessed freq:        1.399 cummulative: 57.07%  feedback freq:        5.289 cummulative:  84.22% cnt: 10184754606
 Basic block  280 guessed freq:        1.399 cummulative: 57.12%  feedback freq:        5.289 cummulative:  84.42% cnt: 10184754606
 Basic block   73 guessed freq:        2.479 cummulative: 57.21%  feedback freq:        4.844 cummulative:  84.60% cnt: 10169215630
 Basic block  109 guessed freq:        1.761 cummulative: 57.27%  feedback freq:        4.842 cummulative:  84.78% cnt: 10169143024
 Basic block  112 guessed freq:        1.761 cummulative: 57.33%  feedback freq:        4.842 cummulative:  84.96% cnt: 10169143024
 Basic block  283 guessed freq:        1.399 cummulative: 57.38%  feedback freq:        4.837 cummulative:  85.14% cnt: 10168968127
 Basic block  286 guessed freq:        1.399 cummulative: 57.42%  feedback freq:        4.837 cummulative:  85.32% cnt: 10168968127
 Basic block  317 guessed freq:        1.755 cummulative: 57.49%  feedback freq:        4.834 cummulative:  85.50% cnt: 10168865836
 Basic block  171 guessed freq:       38.418 cummulative: 58.81%  feedback freq:        4.696 cummulative:  85.68% cnt: 10164047415
 Basic block  147 guessed freq:        3.163 cummulative: 58.92%  feedback freq:        4.545 cummulative:  85.85% cnt: 10158786403
 Basic block  150 guessed freq:        3.163 cummulative: 59.02%  feedback freq:        4.545 cummulative:  86.02% cnt: 10158786403
 Basic block  251 guessed freq:        2.800 cummulative: 59.12%  feedback freq:        4.540 cummulative:  86.19% cnt: 10158611506
 Basic block  254 guessed freq:        2.800 cummulative: 59.22%  feedback freq:        4.540 cummulative:  86.36% cnt: 10158611506
 Basic block   38 guessed freq:        1.393 cummulative: 59.27%  feedback freq:        4.480 cummulative:  86.53% cnt: 10156497152
 Basic block  352 guessed freq:        0.910 cummulative: 59.30%  feedback freq:        4.475 cummulative:  86.70% cnt: 10156341688
 Basic block  175 guessed freq:       96.107 cummulative: 62.60%  feedback freq:        4.249 cummulative:  86.86% cnt: 10148419945
 Basic block  216 guessed freq:       80.260 cummulative: 65.36%  feedback freq:        4.234 cummulative:  87.01% cnt: 10147895254
 Basic block  165 guessed freq:        9.178 cummulative: 65.68%  feedback freq:        4.225 cummulative:  87.17% cnt: 10147605058
 Basic block  237 guessed freq:        8.453 cummulative: 65.97%  feedback freq:        4.215 cummulative:  87.33% cnt: 10147255264
 Basic block  169 guessed freq:        4.588 cummulative: 66.13%  feedback freq:        4.202 cummulative:  87.49% cnt: 10146787912
 Basic block  241 guessed freq:        4.226 cummulative: 66.27%  feedback freq:        4.199 cummulative:  87.65% cnt: 10146671314
 Basic block  138 guessed freq:        3.163 cummulative: 66.38%  feedback freq:        4.134 cummulative:  87.80% cnt: 10144433391
 Basic block  141 guessed freq:        3.163 cummulative: 66.49%  feedback freq:        4.134 cummulative:  87.96% cnt: 10144433391
 Basic block  144 guessed freq:        3.163 cummulative: 66.60%  feedback freq:        4.134 cummulative:  88.11% cnt: 10144433391
 Basic block  154 guessed freq:        3.163 cummulative: 66.71%  feedback freq:        4.134 cummulative:  88.27% cnt: 10144433391
 Basic block  243 guessed freq:        2.800 cummulative: 66.81%  feedback freq:        4.131 cummulative:  88.42% cnt: 10144297360
 Basic block  248 guessed freq:        2.800 cummulative: 66.90%  feedback freq:        4.131 cummulative:  88.58% cnt: 10144297360
 Basic block   29 guessed freq:        8.455 cummulative: 67.19%  feedback freq:        4.123 cummulative:  88.73% cnt: 10144025815
 Basic block  343 guessed freq:        5.524 cummulative: 67.38%  feedback freq:        4.108 cummulative:  88.88% cnt: 10143501124
 Basic block   81 guessed freq:        1.437 cummulative: 67.43%  feedback freq:        3.941 cummulative:  89.03% cnt: 10137684700
 Basic block   84 guessed freq:        1.437 cummulative: 67.48%  feedback freq:        3.941 cummulative:  89.18% cnt: 10137684700
 Basic block   87 guessed freq:        1.437 cummulative: 67.53%  feedback freq:        3.941 cummulative:  89.33% cnt: 10137684700
 Basic block   97 guessed freq:        1.437 cummulative: 67.58%  feedback freq:        3.941 cummulative:  89.48% cnt: 10137684700
 Basic block  291 guessed freq:        1.075 cummulative: 67.62%  feedback freq:        3.937 cummulative:  89.62% cnt: 10137548669
 Basic block  296 guessed freq:        1.075 cummulative: 67.65%  feedback freq:        3.937 cummulative:  89.77% cnt: 10137548669
 Basic block   89 guessed freq:        1.916 cummulative: 67.72%  feedback freq:        3.931 cummulative:  89.92% cnt: 10137325700
 Basic block  298 guessed freq:        1.433 cummulative: 67.77%  feedback freq:        3.924 cummulative:  90.06% cnt: 10137092504
 Basic block  181 guessed freq:       23.760 cummulative: 68.59%  feedback freq:        3.687 cummulative:  90.20% cnt: 10128813994
 Basic block  222 guessed freq:       19.843 cummulative: 69.27%  feedback freq:        3.677 cummulative:  90.34% cnt: 10128464200
 Basic block  187 guessed freq:       16.765 cummulative: 69.85%  feedback freq:        3.633 cummulative:  90.48% cnt: 10126914208
 Basic block  188 guessed freq:       15.088 cummulative: 70.37%  feedback freq:        3.463 cummulative:  90.61% cnt: 10120975013
 Basic block  113 guessed freq:        0.587 cummulative: 70.39%  feedback freq:        3.437 cummulative:  90.74% cnt: 10120060977
 Basic block  287 guessed freq:        0.466 cummulative: 70.40%  feedback freq:        3.436 cummulative:  90.86% cnt: 10120022111
 Basic block  132 guessed freq:        0.764 cummulative: 70.43%  feedback freq:        3.434 cummulative:  90.99% cnt: 10119947957
 Basic block  271 guessed freq:        0.643 cummulative: 70.45%  feedback freq:        3.432 cummulative:  91.12% cnt: 10119909091
 Basic block   39 guessed freq:        1.045 cummulative: 70.49%  feedback freq:        3.360 cummulative:  91.25% cnt: 10117372864
 Basic block  353 guessed freq:        0.683 cummulative: 70.51%  feedback freq:        3.356 cummulative:  91.37% cnt: 10117256266
 Basic block   70 guessed freq:        1.653 cummulative: 70.57%  feedback freq:        3.229 cummulative:  91.49% cnt: 10112810420
 Basic block  314 guessed freq:        1.170 cummulative: 70.61%  feedback freq:        3.223 cummulative:  91.62% cnt: 10112577224
 Basic block   62 guessed freq:        1.239 cummulative: 70.65%  feedback freq:        3.178 cummulative:  91.73% cnt: 10111025897
 Basic block   65 guessed freq:        1.239 cummulative: 70.69%  feedback freq:        3.178 cummulative:  91.85% cnt: 10111025897
 Basic block   68 guessed freq:        1.239 cummulative: 70.73%  feedback freq:        3.178 cummulative:  91.97% cnt: 10111025897
 Basic block   78 guessed freq:        1.239 cummulative: 70.78%  feedback freq:        3.178 cummulative:  92.09% cnt: 10111025897
 Basic block  307 guessed freq:        0.877 cummulative: 70.81%  feedback freq:        3.174 cummulative:  92.21% cnt: 10110889866
 Basic block  312 guessed freq:        0.877 cummulative: 70.84%  feedback freq:        3.174 cummulative:  92.33% cnt: 10110889866
 Basic block  196 guessed freq:       14.864 cummulative: 71.35%  feedback freq:        3.024 cummulative:  92.44% cnt: 10105630020
 Basic block   90 guessed freq:        1.437 cummulative: 71.40%  feedback freq:        2.948 cummulative:  92.55% cnt: 10102994275
 Basic block   93 guessed freq:        1.437 cummulative: 71.45%  feedback freq:        2.948 cummulative:  92.66% cnt: 10102994275
 Basic block  299 guessed freq:        1.075 cummulative: 71.49%  feedback freq:        2.943 cummulative:  92.77% cnt: 10102819378
 Basic block  302 guessed freq:        1.075 cummulative: 71.52%  feedback freq:        2.943 cummulative:  92.88% cnt: 10102819378
 Basic block  190 guessed freq:        4.074 cummulative: 71.66%  feedback freq:        2.884 cummulative:  92.99% cnt: 10100763252
 Basic block  194 guessed freq:        4.074 cummulative: 71.80%  feedback freq:        2.884 cummulative:  93.10% cnt: 10100763252
 Basic block  162 guessed freq:        6.118 cummulative: 72.01%  feedback freq:        2.817 cummulative:  93.21% cnt: 1098403372
 Basic block  234 guessed freq:        5.635 cummulative: 72.21%  feedback freq:        2.810 cummulative:  93.31% cnt: 1098170176
 Basic block   53 guessed freq:        3.356 cummulative: 72.32%  feedback freq:        2.776 cummulative:  93.42% cnt: 1096983055
 Basic block  332 guessed freq:        2.270 cummulative: 72.40%  feedback freq:        2.761 cummulative:  93.52% cnt: 1096458364
 Basic block   94 guessed freq:        0.479 cummulative: 72.42%  feedback freq:        2.718 cummulative:  93.62% cnt: 1094942130
 Basic block  303 guessed freq:        0.358 cummulative: 72.43%  feedback freq:        2.717 cummulative:  93.72% cnt: 1094903264
 Basic block   43 guessed freq:        1.119 cummulative: 72.47%  feedback freq:        2.657 cummulative:  93.82% cnt: 1092824124
 Basic block   46 guessed freq:        1.119 cummulative: 72.51%  feedback freq:        2.657 cummulative:  93.92% cnt: 1092824124
 Basic block   49 guessed freq:        1.119 cummulative: 72.54%  feedback freq:        2.657 cummulative:  94.02% cnt: 1092824124
 Basic block   59 guessed freq:        1.119 cummulative: 72.58%  feedback freq:        2.657 cummulative:  94.12% cnt: 1092824124
 Basic block  323 guessed freq:        0.756 cummulative: 72.61%  feedback freq:        2.653 cummulative:  94.22% cnt: 1092688093
 Basic block  328 guessed freq:        0.756 cummulative: 72.64%  feedback freq:        2.653 cummulative:  94.32% cnt: 1092688093
 Basic block  184 guessed freq:       15.838 cummulative: 73.18%  feedback freq:        2.489 cummulative:  94.41% cnt: 1086939972
 Basic block  225 guessed freq:       13.226 cummulative: 73.64%  feedback freq:        2.484 cummulative:  94.51% cnt: 1086784508
 Basic block  178 guessed freq:       15.838 cummulative: 74.18%  feedback freq:        2.458 cummulative:  94.60% cnt: 1085875996
 Basic block  219 guessed freq:       13.226 cummulative: 74.64%  feedback freq:        2.452 cummulative:  94.69% cnt: 1085642800
 Basic block  195 guessed freq:        3.850 cummulative: 74.77%  feedback freq:        2.445 cummulative:  94.78% cnt: 1085418259
 Basic block  151 guessed freq:        1.054 cummulative: 74.80%  feedback freq:        2.431 cummulative:  94.87% cnt: 1084927187
 Basic block  255 guessed freq:        0.933 cummulative: 74.84%  feedback freq:        2.430 cummulative:  94.96% cnt: 1084888321
 Basic block   71 guessed freq:        1.239 cummulative: 74.88%  feedback freq:        2.422 cummulative:  95.06% cnt: 1084607815
 Basic block   74 guessed freq:        1.239 cummulative: 74.92%  feedback freq:        2.422 cummulative:  95.15% cnt: 1084607815
 Basic block  315 guessed freq:        0.877 cummulative: 74.95%  feedback freq:        2.417 cummulative:  95.24% cnt: 1084432918
 Basic block  318 guessed freq:        0.877 cummulative: 74.98%  feedback freq:        2.417 cummulative:  95.33% cnt: 1084432918
 Basic block  157 guessed freq:        4.588 cummulative: 75.14%  feedback freq:        2.350 cummulative:  95.42% cnt: 1082091723
 Basic block  160 guessed freq:        4.588 cummulative: 75.30%  feedback freq:        2.350 cummulative:  95.50% cnt: 1082091723
 Basic block  170 guessed freq:        4.588 cummulative: 75.46%  feedback freq:        2.350 cummulative:  95.59% cnt: 1082091723
 Basic block  172 guessed freq:       34.192 cummulative: 76.63%  feedback freq:        2.350 cummulative:  95.68% cnt: 1082091723
 Basic block  227 guessed freq:       33.830 cummulative: 77.80%  feedback freq:        2.346 cummulative:  95.77% cnt: 1081955692
 Basic block  228 guessed freq:        4.226 cummulative: 77.94%  feedback freq:        2.346 cummulative:  95.86% cnt: 1081955692
 Basic block  229 guessed freq:        4.226 cummulative: 78.09%  feedback freq:        2.346 cummulative:  95.94% cnt: 1081955692
 Basic block  232 guessed freq:        4.226 cummulative: 78.23%  feedback freq:        2.346 cummulative:  96.03% cnt: 1081955692
 Basic block   75 guessed freq:        0.413 cummulative: 78.25%  feedback freq:        2.167 cummulative:  96.11% cnt: 1075692799
 Basic block  319 guessed freq:        0.292 cummulative: 78.26%  feedback freq:        2.166 cummulative:  96.19% cnt: 1075653933
 Basic block    7 guessed freq:        4.500 cummulative: 78.41%  feedback freq:        2.139 cummulative:  96.27% cnt: 1074710872
 Basic block   11 guessed freq:        4.500 cummulative: 78.57%  feedback freq:        2.139 cummulative:  96.35% cnt: 1074710872
 Basic block  163 guessed freq:        4.588 cummulative: 78.72%  feedback freq:        2.113 cummulative:  96.43% cnt: 1073802529
 Basic block  166 guessed freq:        4.588 cummulative: 78.88%  feedback freq:        2.113 cummulative:  96.51% cnt: 1073802529
 Basic block  235 guessed freq:        4.226 cummulative: 79.03%  feedback freq:        2.108 cummulative:  96.59% cnt: 1073627632
 Basic block  238 guessed freq:        4.226 cummulative: 79.17%  feedback freq:        2.108 cummulative:  96.67% cnt: 1073627632
 Basic block   56 guessed freq:        0.373 cummulative: 79.18%  feedback freq:        2.090 cummulative:  96.75% cnt: 1073000469
 Basic block  335 guessed freq:        0.252 cummulative: 79.19%  feedback freq:        2.089 cummulative:  96.83% cnt: 1072961603
 Basic block   34 guessed freq:        3.135 cummulative: 79.30%  feedback freq:        1.951 cummulative:  96.90% cnt: 1068146965
 Basic block  348 guessed freq:        2.049 cummulative: 79.37%  feedback freq:        1.936 cummulative:  96.97% cnt: 1067622274
 Basic block  185 guessed freq:       11.878 cummulative: 79.78%  feedback freq:        1.867 cummulative:  97.04% cnt: 1065204979
 Basic block  226 guessed freq:        9.920 cummulative: 80.12%  feedback freq:        1.863 cummulative:  97.11% cnt: 1065088381
 Basic block   54 guessed freq:        2.238 cummulative: 80.20%  feedback freq:        1.851 cummulative:  97.18% cnt: 1064655370
 Basic block  179 guessed freq:       11.878 cummulative: 80.61%  feedback freq:        1.844 cummulative:  97.25% cnt: 1064406997
 Basic block  182 guessed freq:       11.878 cummulative: 81.02%  feedback freq:        1.844 cummulative:  97.32% cnt: 1064406997
 Basic block  333 guessed freq:        1.513 cummulative: 81.07%  feedback freq:        1.841 cummulative:  97.39% cnt: 1064305576
 Basic block  220 guessed freq:        9.920 cummulative: 81.41%  feedback freq:        1.839 cummulative:  97.46% cnt: 1064232100
 Basic block  223 guessed freq:        9.920 cummulative: 81.75%  feedback freq:        1.839 cummulative:  97.53% cnt: 1064232100
 Basic block  126 guessed freq:        0.764 cummulative: 81.78%  feedback freq:        1.775 cummulative:  97.59% cnt: 1062001950
 Basic block  265 guessed freq:        0.643 cummulative: 81.80%  feedback freq:        1.773 cummulative:  97.66% cnt: 1061943651
 Basic block  107 guessed freq:        0.587 cummulative: 81.82%  feedback freq:        1.614 cummulative:  97.72% cnt: 1056381008
 Basic block  281 guessed freq:        0.466 cummulative: 81.84%  feedback freq:        1.612 cummulative:  97.78% cnt: 1056322709
 Basic block   24 guessed freq:        1.045 cummulative: 81.87%  feedback freq:        1.603 cummulative:  97.84% cnt: 1055995548
 Basic block   27 guessed freq:        1.045 cummulative: 81.91%  feedback freq:        1.603 cummulative:  97.90% cnt: 1055995548
 Basic block   30 guessed freq:        1.045 cummulative: 81.94%  feedback freq:        1.603 cummulative:  97.96% cnt: 1055995548
 Basic block   40 guessed freq:        1.045 cummulative: 81.98%  feedback freq:        1.603 cummulative:  98.02% cnt: 1055995548
 Basic block  339 guessed freq:        0.683 cummulative: 82.00%  feedback freq:        1.599 cummulative:  98.08% cnt: 1055859517
 Basic block  344 guessed freq:        0.683 cummulative: 82.03%  feedback freq:        1.599 cummulative:  98.14% cnt: 1055859517
 Basic block  145 guessed freq:        1.054 cummulative: 82.06%  feedback freq:        1.515 cummulative:  98.20% cnt: 1052928801
 Basic block  249 guessed freq:        0.933 cummulative: 82.09%  feedback freq:        1.513 cummulative:  98.25% cnt: 1052870502
 Basic block  173 guessed freq:       11.878 cummulative: 82.50%  feedback freq:        1.439 cummulative:  98.31% cnt: 1050283885
 Basic block  176 guessed freq:       11.878 cummulative: 82.91%  feedback freq:        1.439 cummulative:  98.36% cnt: 1050283885
 Basic block  186 guessed freq:       11.878 cummulative: 83.32%  feedback freq:        1.439 cummulative:  98.42% cnt: 1050283885
 Basic block  198 guessed freq:       11.878 cummulative: 83.73%  feedback freq:        1.439 cummulative:  98.47% cnt: 1050283885
 Basic block  211 guessed freq:        9.978 cummulative: 84.07%  feedback freq:        1.439 cummulative:  98.52% cnt: 1050259532
 Basic block  210 guessed freq:        9.920 cummulative: 84.41%  feedback freq:        1.435 cummulative:  98.58% cnt: 1050147854
 Basic block  217 guessed freq:        9.920 cummulative: 84.75%  feedback freq:        1.435 cummulative:  98.63% cnt: 1050147854
 Basic block  167 guessed freq:        1.529 cummulative: 84.81%  feedback freq:        1.401 cummulative:  98.68% cnt: 1048929304
 Basic block  239 guessed freq:        1.409 cummulative: 84.86%  feedback freq:        1.400 cummulative:  98.74% cnt: 1048890438
 Basic block   35 guessed freq:        2.090 cummulative: 84.93%  feedback freq:        1.300 cummulative:  98.79% cnt: 1045431310
 Basic block  349 guessed freq:        1.366 cummulative: 84.97%  feedback freq:        1.290 cummulative:  98.83% cnt: 1045081516
 Basic block   51 guessed freq:        1.492 cummulative: 85.03%  feedback freq:        1.234 cummulative:  98.88% cnt: 1043103580
 Basic block  330 guessed freq:        1.009 cummulative: 85.06%  feedback freq:        1.227 cummulative:  98.93% cnt: 1042870384
 Basic block   37 guessed freq:        0.348 cummulative: 85.07%  feedback freq:        1.120 cummulative:  98.97% cnt: 1039124288
 Basic block  351 guessed freq:        0.228 cummulative: 85.08%  feedback freq:        1.119 cummulative:  99.01% cnt: 1039085422
 Basic block    0 guessed freq:        1.000 cummulative: 85.12%  feedback freq:        1.000 cummulative:  99.05% cnt: 1034934090
 Basic block    2 guessed freq:        1.000 cummulative: 85.15%  feedback freq:        1.000 cummulative:  99.09% cnt: 1034934090
 Basic block   21 guessed freq:        1.000 cummulative: 85.18%  feedback freq:        1.000 cummulative:  99.12% cnt: 1034934090
 Basic block  357 guessed freq:        1.000 cummulative: 85.22%  feedback freq:        1.000 cummulative:  99.16% cnt: 1034934090
 Basic block    1 guessed freq:        1.000 cummulative: 85.25%  feedback freq:        1.000 cummulative:  99.20% cnt: 1034934090
 Basic block  212 guessed freq:        0.900 cummulative: 85.28%  feedback freq:        0.999 cummulative:  99.24% cnt: 1034914539
 Basic block  213 guessed freq:        0.900 cummulative: 85.31%  feedback freq:        0.999 cummulative:  99.27% cnt: 1034914539
 Basic block  355 guessed freq:        0.638 cummulative: 85.34%  feedback freq:        0.996 cummulative:  99.31% cnt: 1034798059
 Basic block  356 guessed freq:        0.638 cummulative: 85.36%  feedback freq:        0.996 cummulative:  99.35% cnt: 1034798059
 Basic block   88 guessed freq:        0.479 cummulative: 85.38%  feedback freq:        0.983 cummulative:  99.38% cnt: 1034331425
 Basic block  297 guessed freq:        0.358 cummulative: 85.39%  feedback freq:        0.981 cummulative:  99.42% cnt: 1034273126
 Basic block   52 guessed freq:        1.119 cummulative: 85.43%  feedback freq:        0.925 cummulative:  99.46% cnt: 1032327685
 Basic block   55 guessed freq:        1.119 cummulative: 85.46%  feedback freq:        0.925 cummulative:  99.49% cnt: 1032327685
 Basic block  331 guessed freq:        0.756 cummulative: 85.49%  feedback freq:        0.920 cummulative:  99.53% cnt: 1032152788
 Basic block  334 guessed freq:        0.756 cummulative: 85.52%  feedback freq:        0.920 cummulative:  99.56% cnt: 1032152788
 Basic block   32 guessed freq:        1.393 cummulative: 85.56%  feedback freq:        0.867 cummulative:  99.59% cnt: 1030287540
 Basic block  346 guessed freq:        0.910 cummulative: 85.60%  feedback freq:        0.860 cummulative:  99.62% cnt: 1030054344
 Basic block   69 guessed freq:        0.413 cummulative: 85.61%  feedback freq:        0.807 cummulative:  99.65% cnt: 1028202605
 Basic block  313 guessed freq:        0.292 cummulative: 85.62%  feedback freq:        0.806 cummulative:  99.68% cnt: 1028144306
 Basic block  161 guessed freq:        1.529 cummulative: 85.67%  feedback freq:        0.704 cummulative:  99.71% cnt: 1024600843
 Basic block  233 guessed freq:        1.409 cummulative: 85.72%  feedback freq:        0.703 cummulative:  99.74% cnt: 1024542544
 Basic block   33 guessed freq:        1.045 cummulative: 85.76%  feedback freq:        0.650 cummulative:  99.76% cnt: 1022715655
 Basic block   36 guessed freq:        1.045 cummulative: 85.79%  feedback freq:        0.650 cummulative:  99.79% cnt: 1022715655
 Basic block  347 guessed freq:        0.683 cummulative: 85.82%  feedback freq:        0.645 cummulative:  99.81% cnt: 1022540758
 Basic block  350 guessed freq:        0.683 cummulative: 85.84%  feedback freq:        0.645 cummulative:  99.83% cnt: 1022540758
 Basic block  183 guessed freq:        3.959 cummulative: 85.98%  feedback freq:        0.622 cummulative:  99.86% cnt: 1021734993
 Basic block  224 guessed freq:        3.307 cummulative: 86.09%  feedback freq:        0.621 cummulative:  99.88% cnt: 1021696127
 Basic block  177 guessed freq:        3.959 cummulative: 86.23%  feedback freq:        0.615 cummulative:  99.90% cnt: 1021468999
 Basic block  218 guessed freq:        3.307 cummulative: 86.34%  feedback freq:        0.613 cummulative:  99.93% cnt: 1021410700
 Basic block  189 guessed freq:       11.015 cummulative: 86.72%  feedback freq:        0.579 cummulative:  99.95% cnt: 1020211761
 Basic block   50 guessed freq:        0.373 cummulative: 86.73%  feedback freq:        0.308 cummulative:  99.96% cnt: 1010775895
 Basic block  329 guessed freq:        0.252 cummulative: 86.74%  feedback freq:        0.307 cummulative:  99.97% cnt: 1010717596
 Basic block   31 guessed freq:        0.348 cummulative: 86.75%  feedback freq:        0.217 cummulative:  99.98% cnt: 107571885
 Basic block  345 guessed freq:        0.228 cummulative: 86.76%  feedback freq:        0.215 cummulative:  99.99% cnt: 107513586
 Basic block  197 guessed freq:        1.676 cummulative: 86.82%  feedback freq:        0.170 cummulative:  99.99% cnt: 105939195
 Basic block  201 guessed freq:      153.960 cummulative: 92.11%  feedback freq:        0.056 cummulative: 100.00% cnt: 101972593
 Basic block  202 guessed freq:      136.855 cummulative: 96.82%  feedback freq:        0.050 cummulative: 100.00% cnt: 101753416
 Basic block  199 guessed freq:       19.006 cummulative: 97.48%  feedback freq:        0.007 cummulative: 100.00% cnt: 10243530
 Basic block  204 guessed freq:       19.006 cummulative: 98.13%  feedback freq:        0.007 cummulative: 100.00% cnt: 10243530
 Basic block  200 guessed freq:       17.105 cummulative: 98.72%  feedback freq:        0.006 cummulative: 100.00% cnt: 10219177
 Basic block  203 guessed freq:       17.105 cummulative: 99.31%  feedback freq:        0.006 cummulative: 100.00% cnt: 10219177
 Basic block  205 guessed freq:       17.105 cummulative: 99.90%  feedback freq:        0.006 cummulative: 100.00% cnt: 10219177
 Basic block  214 guessed freq:        0.362 cummulative: 99.91%  feedback freq:        0.004 cummulative: 100.00% cnt: 10136031
 Basic block  206 guessed freq:        1.901 cummulative: 99.97%  feedback freq:        0.001 cummulative: 100.00% cnt: 1024353
 Basic block  207 guessed freq:        0.304 cummulative: 99.98%  feedback freq:        0.001 cummulative: 100.00% cnt: 1024353
 Basic block  209 guessed freq:        0.304 cummulative: 99.99%  feedback freq:        0.001 cummulative: 100.00% cnt: 1024353
 Basic block  208 guessed freq:        0.152 cummulative:100.00%  feedback freq:        0.001 cummulative: 100.00% cnt: 1021066

So the corelation between guessed and real profile is not terribly good.  90% of frequencies from the summary
covers only 70% of the guessed BBs. While the real profile is relatively flat (hottest block is executed 51 times
per function call) the gussed profile is more diverse with hot blocks:

 Basic block  174 guessed freq:      107.986 cummulative: 50.29%  feedback freq:        5.688 cummulative:  80.17% cnt: 10198703830
 Basic block  201 guessed freq:      153.960 cummulative: 92.11%  feedback freq:        0.056 cummulative: 100.00% cnt: 101972593
 Basic block  202 guessed freq:      136.855 cummulative: 96.82%  feedback freq:        0.050 cummulative: 100.00% cnt: 101753416

Especially the later two are almost never executed in practice...

gcc/ChangeLog:

2021-11-28  Jan Hubicka  <hubicka@ucw.cz>

	* profile.c: Include sreal.h
	(struct bb_stats): New.
	(cmp_stats): New function.
	(compute_branch_probabilities): Output bb stats.

Comments

Bernhard Reutner-Fischer Dec. 3, 2021, 8:38 a.m. UTC | #1
On Sun, 28 Nov 2021 19:52:08 +0100
Jan Hubicka via Gcc-patches <gcc-patches@gcc.gnu.org> wrote:

>  Basic block  136 guessed freq:       17.548 cummulative:  0.60%  feedback freq:       51.848 cummulative:   1.94% cnt: 101811269914

> diff --git a/gcc/profile.c b/gcc/profile.c
> index d07002d265e..dbf42ff7b2b 100644
> --- a/gcc/profile.c
> +++ b/gcc/profile.c

> +	      fprintf (dump_file,
> +		       " Basic block %4i guessed freq: %12.3f"
> +		       " cummulative:%6.2f%% "
> +		       " feedback freq: %12.3f cummulative:%7.2f%%"

s/cummulative/cumulative/g with just one "m"

thanks,
diff mbox series

Patch

diff --git a/gcc/profile.c b/gcc/profile.c
index d07002d265e..dbf42ff7b2b 100644
--- a/gcc/profile.c
+++ b/gcc/profile.c
@@ -64,6 +64,7 @@  along with GCC; see the file COPYING3.  If not see
 #include "tree-cfg.h"
 #include "dumpfile.h"
 #include "cfgloop.h"
+#include "sreal.h"
 
 #include "profile.h"
 
@@ -385,6 +386,30 @@  read_profile_edge_counts (gcov_type *exec_counts)
     return num_edges;
 }
 
+/* BB statistics comparing guessed frequency of BB with feedback.  */
+
+struct bb_stats
+{
+  basic_block bb;
+  double guessed, feedback;
+  int64_t count;
+};
+
+/* Compare limit_tuple intervals by first item in descending order.  */
+
+static int
+cmp_stats (const void *ptr1, const void *ptr2)
+{
+  const bb_stats *p1 = (const bb_stats *)ptr1;
+  const bb_stats *p2 = (const bb_stats *)ptr2;
+
+  if (p1->feedback < p2->feedback)
+    return 1;
+  else if (p1->feedback > p2->feedback)
+    return -1;
+  return 0;
+}
+
 
 /* Compute the branch probabilities for the various branches.
    Annotate them accordingly.  
@@ -716,11 +741,52 @@  compute_branch_probabilities (unsigned cfg_checksum, unsigned lineno_checksum)
   /* If we have real data, use them!  */
   if (bb_gcov_count (ENTRY_BLOCK_PTR_FOR_FN (cfun))
       || !flag_guess_branch_prob)
-    FOR_ALL_BB_FN (bb, cfun)
-      if (bb_gcov_count (bb) || !flag_profile_partial_training)
-        bb->count = profile_count::from_gcov_type (bb_gcov_count (bb));
-      else
-	bb->count = profile_count::guessed_zero ();
+    {
+      profile_count old_entry_cnt = ENTRY_BLOCK_PTR_FOR_FN (cfun)->count;
+      auto_vec <bb_stats> stats;
+      double sum1 = 0, sum2 = 0;
+
+      FOR_ALL_BB_FN (bb, cfun)
+	{
+	  profile_count cnt = bb->count;
+	  if (bb_gcov_count (bb) || !flag_profile_partial_training)
+	    bb->count = profile_count::from_gcov_type (bb_gcov_count (bb));
+	  else
+	    bb->count = profile_count::guessed_zero ();
+	  if (dump_file && bb->index >= 0)
+	    {
+	      double freq1 = cnt.to_sreal_scale (old_entry_cnt).to_double ();
+	      double freq2 = bb->count.to_sreal_scale
+					(ENTRY_BLOCK_PTR_FOR_FN (cfun)->count).
+				  to_double ();
+	      bb_stats stat = {bb, freq1, freq2,
+			       (int64_t) bb_gcov_count (bb)};
+	      stats.safe_push (stat);
+	      sum1 += freq1;
+	      sum2 += freq2;
+	    }
+	}
+      if (dump_file)
+	{
+	  double nsum1 = 0, nsum2 = 0;
+	  stats.qsort (cmp_stats);
+	  for (auto stat : stats)
+	    {
+	      nsum1 += stat.guessed;
+	      nsum2 += stat.feedback;
+	      fprintf (dump_file,
+		       " Basic block %4i guessed freq: %12.3f"
+		       " cummulative:%6.2f%% "
+		       " feedback freq: %12.3f cummulative:%7.2f%%"
+		       " cnt: 10%" PRId64 "\n", stat.bb->index,
+		       stat.guessed,
+		       nsum1 * 100 / sum1,
+		       stat.feedback,
+		       nsum2 * 100 / sum2,
+		       stat.count);
+	    }
+	}
+    }
   /* If function was not trained, preserve local estimates including statically
      determined zero counts.  */
   else if (profile_status_for_fn (cfun) == PROFILE_READ
@@ -755,6 +821,8 @@  compute_branch_probabilities (unsigned cfg_checksum, unsigned lineno_checksum)
 
       fputc ('\n', dump_file);
       fputc ('\n', dump_file);
+
+      gimple_dump_cfg (dump_file, TDF_BLOCKS);
     }
 
   free_aux_for_blocks ();