https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118527
--- Comment #5 from rguenther at suse dot de <rguenther at suse dot de> --- On Thu, 23 Jan 2025, dizhao at os dot amperecomputing.com wrote: > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118527 > > --- Comment #4 from Di Zhao <dizhao at os dot amperecomputing.com> --- > The problem is found in 548.exchange2 of SPEC2017. As the profile counts are > not adjusted after PRE, bbro produced sub-optimized order of basic blocks. In > my test results on x86 (i0-10700) and aarch64 (Graviton), with the above > change > in sccvn, there is about 1% improvement in 548.exchange2. > > I think when sccvn finds a loop won't iterate, it replaces a guessed iteration > count with a known count (=1). So although there are chances that the profile > counts for extra exits are still wrong, considering other optimizations like > bbro, it is still beneficial than harmful? I think the argument is that short of re-doing profile guessing for the whole function "local" fixups are just doing garbage-in (the original guess, proved wrong) garbage-out ("adjusting" the original wrong guess). Maybe we _should_ re-do local profile guessing at some point?