<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/55648>55648</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            LLVM stuck in "X86 DAG->DAG Instruction Selection" after InstCombine change
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            backend:X86,
            llvm:instcombine
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          OCHyams
      </td>
    </tr>
</table>

<pre>
    `$ cat 1.c`
```C
int a;
short b[101];
void c(int d[][1]) {
  int e;
  long f;
  for (; a < 1; a++)
    b[0] = 0;
  for (; a < 101; a++) {
    for (e = 0; e < 101; e++)
      if (b[e] != 1)
        if (d[a][e] < f)
          f = d[a][e];
  }
  for (; e; e++)
    d[0][e] = f;
}
```

Compiling with the following command takes over an hour:
`$ clang 1.c -O3 -c  --target=x86_64-unknown-linux -march=btver2`

Looking at the "-print-before-all" output it looks like LLVM gets stuck in "X86 DAG->DAG Instruction Selection".

This long compile time appears to start occurring with commit a266af721153fab6452094207b09ed265ab0be7b "[InstCombine] Canonicalize SPF to min/max intrinsic".

</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJydVE2PmzAQ_TVwGREZEyAcOOwm3bbSVlupVdVbZZshuDE4wmY_-us7JtkkSrc9VLKwx36eefNmsLTNSx0VLOJLUMJDulDBYpuI3YTFPNYHWw8eRJTdHizX2dGDjPLblKVRvjkdPFrdgIr4KuAbOg-HhAoTryAqjziAAMDTPQBjhy20FxutHYEc0Q4IiLI1pPMy4rfzqF5xMPNgFIFQG2D_dMGunFwyOuHx5Ajw8hq-EZsSacOdwAFnDjwNt9Mr1CsuaCIOohzg5L79A0tUZg5X6IvUonLzRpb4N5rNUaJz2M2F2Cdnp6ofzfm7tv1eG03ledK-A98hhTTGPoUtZfteDA14sUMH9hFHEAN0dhqj7ObsNHSYEYSnHoPkIYNEASSJF-MWPZF5XhU_imUyDbvBPg0JRZueIenFqDo6lZ788ita99buAgNq3EAp4jzZj9RViURSBBNhDO2Bnfx-8qA9dZjdOTB6h3B__-0TUGQHzk9qR80Y7n9fFbC5eZ9E2Tua4OPg_Dgpr-0AX9DgvCLY4pLF1067Q--qWSYEr3sEsd-jGB14SxEE_StWqWkcTyIG2YiS4EUh2pKnaZ61QhbLnLNqyVkpWYUNL3IhmcRSBnZUusCIqiH1MBdxLQY7aCWM_oXw5fNdiNZronjXi-fwg1E8p9WZctzUWVNllYi99gbrWYb_UABE66nQF3RAdVRdjKfR1J33exeqz-9obCndSS4oYTKMeXydqFj2J3kkUzs3oaNFnhfLVdzVHDFXy4rLSmSyUHleprwsV1leVmklVxgbIdG4OrwvnEuhdjg0FJHoB6H4OuQyx8ro4XJeHTULIm5iXXPGOct5xlY54-UCFVu1mcgrIWVeyipaMuyFNovgYmHHbTzWM2U5bR0dGu28Ox8K5_R2QKwPz10sJk_PY_2w_vAiehfP2dVzar8BRT2GnA">