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

Jan Hubicka <hubicka at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[13/14 Regression]          |[13 regression] 456.hmmer
                   |456.hmmer at -Ofast         |at -Ofast -march=native
                   |-march=native regressed by  |regressed by 19% on zen2
                   |19% on zen2 and zen3 in     |and zen3 in July 2022
                   |July 2022                   |

--- Comment #26 from Jan Hubicka <hubicka at gcc dot gnu.org> ---
We are out of regression finally, but still there are several things to fix.
 1) vectorizer produces corrupt profile
 2) loop-split is not able to work out that it splits last iteration
 3) we work way to hard optimizing loops iterating 0 times.

The loop in question really iterates zero times.  It is created by loop split
from the internal loop:

        for (k = 1; k <= M; k++) {
          mc[k] = mpp[k-1]   + tpmm[k-1];
          if ((sc = ip[k-1]  + tpim[k-1]) > mc[k])  mc[k] = sc;
          if ((sc = dpp[k-1] + tpdm[k-1]) > mc[k])  mc[k] = sc;
          if ((sc = xmb  + bp[k])         > mc[k])  mc[k] = sc;
          mc[k] += ms[k];
          if (mc[k] < -INFTY) mc[k] = -INFTY;

          dc[k] = dc[k-1] + tpdd[k-1];
          if ((sc = mc[k-1] + tpmd[k-1]) > dc[k]) dc[k] = sc;
          if (dc[k] < -INFTY) dc[k] = -INFTY;

          if (k < M) {
            ic[k] = mpp[k] + tpmi[k];
            if ((sc = ip[k] + tpii[k]) > ic[k]) ic[k] = sc;
            ic[k] += is[k];
            if (ic[k] < -INFTY) ic[k] = -INFTY;
          }

it peels off the last iteration. For ocnidtion is
 if (k <= M)
while we plit on
 if (k < M)
M is varianble and nothing seems to be able to optimize out the second loop
after splitting.

My plan is to add the pattern match so loop split gets this right and records
upper bound on iteration count, but first want to show other bugs exposed by
this scenario.

Reply via email to