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

Alexandre Oliva <aoliva at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |aoliva at gcc dot gnu.org

--- Comment #5 from Alexandre Oliva <aoliva at gcc dot gnu.org> ---
On x86 the failure is only hit with -m32, and it's also present in mainline, as
of r16-5976.  The profiling inconsistency starts (being reported?) in fre5, so
it's (presumably) not the vectorizer's fault.

slsr has:

;;   basic block 5, loop depth 0, count 84095460 (estimated locally, freq
0.7120), maybe hot
[...]
  if (_66 <= 2)
    goto <bb 9>; [10.00%]
  else
    goto <bb 6>; [90.00%]
;;    succ:       6 [90.0% (guessed)]  count:75685914 (estimated locally, freq
0.6408) (FALSE_VALUE)
;;                9 [10.0% (guessed)]  count:8409546 (estimated locally, freq
0.0712) (TRUE_VALUE)

;;   basic block 6, loop depth 0, count 75685914 (estimated locally, freq
0.6408), maybe hot
;;    prev block 5, next block 7, flags: (NEW, VISITED)
;;    pred:       5 [90.0% (guessed)]  count:75685914 (estimated locally, freq
0.6408) (FALSE_VALUE)
[...]
;;   basic block 9, loop depth 0, count 65173981 (estimated locally, freq
0.5518), maybe hot
;;    prev block 8, next block 10, flags: (NEW)
;;    pred:       8 [75.0% (guessed)]  count:56764436 (estimated locally, freq
0.4806) (FALSE_VALUE)
;;                5 [10.0% (guessed)]  count:8409546 (estimated locally, freq
0.0712) (TRUE_VALUE)

but the conditional is resolved in fre5, the edge 5->9 is dropped in cfgcleanup
(the probability of 5->6 is adjusted), blocks 5 and 6 get merged (their counts
are merged), and block 9 gets renumbered to 8, but nothing adjusts estimate
profile counts of 9/8 so that they match:

;;   basic block 8, loop depth 0, count 65173981 (estimated locally, freq
0.5518), maybe hot
;;   Invalid sum of incoming counts 56764436 (estimated locally, freq 0.4806),
should be 65173981 (estimated locally, freq 0.5518)
;;    prev block 7, next block 9, flags: (NEW, VISITED)
;;    pred:       7 [75.0% (guessed)]  count:56764436 (estimated locally, freq
0.4806) (FALSE_VALUE,EXECUTABLE)

Reply via email to