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

    <tr>
        <th>Summary</th>
        <td>
            AMDGPU Benchmark Regression: Increased Assembler Length After Commit 54ec8bcaf85e
        </td>
    </tr>

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

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

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

<pre>
    **Summary**
After the commit 54ec8bcaf85e3a3341c97640331d58e24ac0d2cd one of the AMDGPU benchmarks regressed because the assembler became longer.

**Reduced Input IR**
See input.ll in the attached archive

**Steps to Reproduce**
* Run opt with these parameters:
opt -mtriple=amdgcn-amd-amdhsa -mcpu=gfx908 -O3 -vectorize-loops -vectorize-slp -amdgpu-early-inline-all=true -amdgpu-function-calls=false -S -o output.ll input.ll

* Then run llc with these parameters:
llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx908 -O3 -vectorize-loops -vectorize-slp -amdgpu-early-inline-all=true -amdgpu-function-calls=false -o output.s output.ll

**Additional Information**
The input IR includes a complicated set of binary operations. The commit tries to fold the instructions but instead produces extra code, leading to the regression.

Please find the attachments for detailed comparison and further analysis.

[input and output.zip](https://github.com/llvm/llvm-project/files/15388366/input.and.output.zip)

</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzMVM2O2zYQfhr6MpAhkZItH3TwxnCxQIsG3vQBRuRIYkuRAn822Tx9QdnrON1D0VsPsqXhzMf5-ebDEPRoiTrWPLHmtMEUJ-e7WcsJyQQyNLnXTe_UW8f4kfHjS5pn9G_XD1aeWHk8DpE8xIlAunnWEZqaZNtLHNqGBApRV_Kw39WlEJVqWuI1ylJxqcBZAjesocffTr98_gN6snKa0f8VwNPoKQRS0JPEFGj1wxBo7g351ToTGGdH8ttrKrffNbkLqSRJwbNdUoTny2PKL0Sgs31rDGh7RY4R5UQK0MtJv9JHxJdIS4Do4EKLdxn9EZPxI1ySBbdE-KrjlEEDwYIeZ4rkAxM3z-xRzNHrxRATJ5zVKG2Bs8rPFBCKWS6JidM4fDuULRS_CyheSUbn9XcqjHNLeDQEs0AOHZdUEHrzVmhrtKUCjWHiFH2i-_mQrIza2UKiMYGJ04AmEBQvUDhwKd57cn35RxPgy0QWfLJgjPyXKrPH_63Ke4nhR60f53xUSudoNPBsB-dnzF-Ps_4y3fgDzxfQVpqkKADmBViMlhhJQaCYyd1ri_4N3EJ-hQnb3MT3VYle00qpwRm10lDbEH1asw_Qp7gaCBXcKBeAvkWfr1LE-CcwhErbMWPk8NvWaGd_WonPhjAQDNqqB7LPZGOAwXlQFFEbUmsF6HVwFtAqGJKPE3lAi-Yt6PDznjVP1yZkz1s_v-uFNSfG2ynGZSUDPzN-HnWcUr-Vbmb8bMzr-1-xePcnycj4edCGAuPnqhFtK3Y7xs9XFqJV2wd0frjevlGdUAdxwA111b7a8XbX7svN1KldLXeloKaqDn3bDNW-qSpRclWrvWhludEdL3ldNryqyvxsy0HV6kCi5T2W_X7H6pJm1GabU9w6P250CIm6A28P1cZgTyasism5pa-wHjLOs4D6bi2rT2NgdWl0iOEHStTRUHeTuqd3qYPLfWZMHOHZSp-HpeB417pfyY5xgqvSfvqospvkTfefO77mnVu-1vV3AAAA__8HlwB0">