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

    <tr>
        <th>Summary</th>
        <td>
            Consider running inliner over module before function simplification to improve compile times
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

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

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

<pre>
    Idea by @nikic: we end up reoptimizing code that gets inlined in many places. If we can inline and remove functions before the expensive function simplification pipeline, we'll end up saving some runs of the simplification pipeline.

[A naive attempt shows promise](https://llvm-compile-time-tracker.com/compare.php?from=6e7375031a1a3172d5e369cf2c108da2bcf65c8a&to=a41f2273fc60a25b9b584e0307974255db79284b&stat=instructions:u). Some big wins, but some even bigger regressions. [Restricting the initial inliner pass further helps](https://llvm-compile-time-tracker.com/compare.php?from=a41f2273fc60a25b9b584e0307974255db79284b&to=1b0a5c9b86cd1e40aeb99befef6831f73d0b5a73&stat=instructions:u).

Ultimately, we'd like to remove as many discardable (`internal`/`linkonce_odr`) functions from the module by inlining them, but there's not a good way to know which discardable functions will get inlined into all callers. We may need some more heuristics.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyslM2O4zYMgJ9GuRATyJJ_Dz7MbBBgry2KHgtKomM1smRIctL06Qt5Mruzhy1QoJcAMW2K_PSRmJK9eKKRNW-sOR1wy3OII9Km0F_TQQXzGL8aQlAPYDX39mo1k69wJyBvYFshUlizXezf1l9AB0OQZ8xwoZzAemc9GbAeFvQPWB1qSkf4OpUEGv3zDUBvINISbgTT5nW2wSdQNIVY0hHQXyv5ZD-FIdlldXayGve_q12ppGLiC9yJic65jwoT3kptKSwEcfMJwrQn_UmGI-Mnxl-fv83bK3gsJ2POtKwZ0hzuCdYYFpuINScm-jnnNTH5ysSZibNzt-VFh2W1jl6yXeglR9RXikcdFibOJYSRjuu8MnmeYliYPLXUya7hssIKZdUJ05BsBz0JXfHeoFB6ahvdIxNtDkyesK4mITo56ZajaNSgmr4mLnk3dLVoGqO6QfS1YqJNGTOTJ-tTjts7WyZfNyaGI_xaoCh7gbv1qbBTW34nRTfyJXKhCJEukVIqXx6BNW-_UMrR6lywFpLW22zRPW8zwoopwbTFPFOEmdya_jdO_6HvnVOlODZ6UH2rTUU1R1LDoGiiqe1lNXXScNVgJ_-d02clfnPZLpjJPb65ZsDZK0EOHxJjehfe2KQxGlSOgImetdz6TNGjYy0vFFrurL8Gr-mPYOL-cPg0AqXpnfASzOaoTOHO-Al--bixAroUksCHDAiXEAzc8VFKuvpwh_ts9fxDOd8PuVvnyrx-GtccAJ0Djc5RTEf4nWDBB3gi827HUiZzpi3alK1Ox4MZpRnkgAcaq05yUdd91x3mkXTfDW3XtNgh133XCt1NdYst1TUpKQ92FFzUFReDkLKW7bHR1cRrXmFlGj4NmtWcFrTuWHw5hng52JQ2Gquqrprq4FCRS_sCE8LTHfYoE6LsszjukqntkljNnU05fU-TbXY0fgk-WVMk3_zO9UPicKP4jfv7KvrZ8skB7LLGcvNPn6H4nA5bdOOP0l9snjf1NLyU8jEIawx_ks5MnPcGEhPnZ4e3UfwTAAD__xMR5CI">