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

    <tr>
        <th>Summary</th>
        <td>
            Alwaysinliner time explosion with new pass manager
        </td>
    </tr>

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

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

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

<pre>
    There have been problems with the inliner taking a long time in the new pass manager before, discussed in https://reviews.llvm.org/D98481, https://reviews.llvm.org/D120584, and the finally landed https://reviews.llvm.org/D121084.

Unfortunately the fix that landed is a cost-model tweak to suppress exponential inlining so doesn't apply to the `alwaysinline` case. I've had some success with going the D98481 route internally, but that has the significant(!) disadvantage of actually disabling inlining of some `alwaysinline` functions (no-one seems to have noticed though).

Just before Clang removed support for the legacy pass-manager entirely, the soon-to-be-attached reduced case took ~9s with the new one, and 0.04s with the old one. ToT is (as expected) also 9s.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyNU02PmzAQ_TVwsUBACIEDh-1uK7WHntIfMJgB3DU28key-fcdm812t6rUKgkOnvHMm_eeBz3e-vOCBtkCF2QDomKb0YPE1bKrcAtzCzKhpFBomINnoWYGTGpanFhDKGYovLINrGUrKJgpdcBJG0yqRzYKy721OIbcxbnNJoeHpPpCX4MXgVebS3lZc21m2nrq2rotw7l_p5ZVcWzrkAtqjDAmoUDKG5O0QQ3_p0RZtHWeFE9J8bA_fyhC7rwCh1Rpr_pCK7h7WWGJAq6ty1Y9omTuivDMnGbWb5tBYgFfNq1QOQFyJy_QZjUbNVqVVCfHYNtCdR0bJE0B8go3uxNNr4yDxZx9pdxL0Gak08S29ZyH-lGZWYeq4fxOGjPau6CIQxNpCMwM3u3YF7Ax14pZiUlwUC6p2qQirrugEYwX2iLtmJ4YcOcjkSEwyNDnbQwKRyx_AT15xZ3QyjIqrXRGHDCLwUo0aDSY0k5wDGJpPy_U-gP137x1r85hj0T2zAyu-kL5gVlShVEoTiFxBn6Llsvulgt8G9zHjpNqrTKnswEzcA74QnUMjj70D_QSKP3MktPn7p3Vg5EJ9t1URV7U76JajiGas7M-BxvQmBDVRu5wDEyCJJk7m6fYl03TlVVTN0U69oexO3SQOuEk9g_veDP7PaIaUlvibm_2531KvZH9RzvPlOeHnOuVXoKnX5eM7u9PwkOvwlqPlv4cA5B06bE61Ye2wcPE21N3qEs-tMWxaSoYAMoCUgkDStsnx0_J8SkVfVVUVVnSr6ZPlzecw9RUXXdsy4ZOJ3WBKwj5dqdS00cMg58tBaWw7veFS2kgch_ivT548oHpz99J2oV0NmlE3Ee4vwDQGo8O">