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

    <tr>
        <th>Summary</th>
        <td>
            [mlir][inlining] Infinite inlining loop
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            mlir
      </td>
    </tr>

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

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

<pre>
    The MLIR inliner pass seems to go into an infinite loop on this test:
```
subroutine s3
call s1
call s2
end subroutine s3
subroutine s2
call s1
call s3
end subroutine s2
subroutine s1
call s2
call s3
end subroutine s1
```

Compile with: `flang-new -O2 inline.f90 -mllvm -inline-all`

The `-mllvm -inline-all` option just instructs the `FIRInlinerInterface` that all `fir.call` ops are legal to inline.  It seems to be the MLIR inliner pass' job to prevent the infinite inlining.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJx8k21rnEAQxz_N-mZQ1vXh7l74IulxILQUQr_AqqNuuu7Kznih_fRFvSYhuRZEmeE_P-dRE5nBIVaieBTFOdILjz5U19_656iDiRrf_ap-jAjfvtZPYJw1DgPMmggIcSJgD4MH49iDdmBcb5xhBOv9DN4Bj4aAkVhkD0KehXwQpbw9m0lLE_zCxiFQtrtabS1Q-t5Qu4GugzsB713qn4zsPkN9Ztz79X8Z6d3S9vcXP83GIrwYHkX2AKKUvdVuiB2-QPxd3Zqa9CcJ8WTtdYJ4d8Xa2g-wdRKilHd14Gc23sHzQgzGEYelZQLeQy71U71Pr3aModctrjE8aoa1tDUtE5L2lUWgA4LFQdt1yLcsAWp-m3yDG_7Tbgh1gGffrJI54BUdb7rX7di0xg1J1FVZd8pOOsIqPchjXuRlkUVjlTYn1GWJbZ_LrNSFPGVdp9Km6I79oUjbyFRKqlwqJdNjnqdZksv-mGe6l8cU0_agRS5x0sYma6sSH4bIEC1YHVUu08jqBi1tW6_UZE0QSq37H6pVHjfLQCKX1hDTG4AN2-1StoDiLIrHv5WI4gz1x_K2K4iWYKuReab1BNRFqMtgeFyapPWTUJeVfvvEc_DP2LJQly1XEuqypfsnAAD__1p9KTE">