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

    <tr>
        <th>Summary</th>
        <td>
            [AMDGPU] Use existing TargetTransformInfo instances in AMDGPUSplitModule
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            backend:AMDGPU,
            code-quality,
            LTO
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
            Pierre-vh
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          Pierre-vh
      </td>
    </tr>
</table>

<pre>
    As AMDGPUSplitModule sits outside the PassManager, it can't access TTI normally and it has to build a new instance.
It works as a short term hack for the pass MVP, but it really shouldn't do that.

A better solution would be to make AMDGPUSplitModule a proper pass (and likely the original SplitModule too) that runs last, so it can easily access all the analysis it needs. This in turns opens the door to using more powerful analysis in the future if needed.

The pass can take a callback so the driver can allocate new contexts/modules and write them out without the pass having any idea of how that works.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJxsU8GO4zYM_Rr5QkzgyE7SHHxId5BigA46QLO90xYTqyOLqUglm78v5KTpFt2LBQvUe4-PfCjiT5GoM6ufjbUfnlKil8torDWr1wqzjpy653XVs7t1O4Hd--svH19_Pwev7-xyIBCvApxVvCPQkeADRd4x4omSsV_AKwwYjd0o4DCQCBwObxA5TRjCDTC6UjKigDL02QcHCJGu4KMoxoEWpn419e5N4crpUwAFEGTkpKCUJhhx-IQjp5n8jCLw_sdHYe6zFuhEM5GMnIO7C3EMOqI-kO_fHfSkSgmEQ1bPEa7lAfRUhE34ST9oHuGc-EzpzmvsT6Wd4D8p3GY5nPzJRwzw_SNlNnY7K4CUo0BA0SJY-OEWEIov5twNwxBmNIwYbuKlVEUiJws4jOU3guYUBfhMUeZSx8UQhiw-nmDiRHDmK6VjDt_BxLn2mDUnAn-cQcn9x5bDP6YWWVpcQBgwhL64LnwnS_5Caa7AEHhApXmCA0elbyrG7qe5dZnHfU1e51WZyt7A1etYzuf4RrwU0Rhv4B0h8BFGvt79mldgUbmucdtmixV1y81y3a7r5aapxm5wje3tsB3arXW2Xa9dszq2m8Y5iz1tXeU7W9u2XtlmWdtt0yyGlWs3NS1rolXrWmfamib0YRHCZVpwOlVeJFO3bZbrdRWwpyCP0BQLKDrT7O6LUbJjvxhrB3b08lfG4PX2vPz18NsjXKkr2C99Polp6-BF5V829RrmVD4wV6_wVQjomxctrhwwnUgPCaMcOU1v8cjPpMwT_d-SVjmFblQ9i2l2xu6N3Z-8jrlfDDwZuy_Uj-PlnPhPGtTY_dx1mdy98Utn_w4AAP__5Xlrvw">