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

    <tr>
        <th>Summary</th>
        <td>
            [AArch64] unpredicated inst + sel => predicated inst
        </td>
    </tr>

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

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

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

<pre>
    ```
        cmpeq   p1.s, p0/z, z1.s, #0
 mul     z4.s, z2.s, z2.s
        add     z1.s, z2.s, z2.s
 sel     z1.s, p1, z1.s, z4.s
```
=>
```
        cmpeq   p1.s, p0/z, z1.s, #0
        add     z1.s, z2.s, z2.s
        movprfx z1, z2
        mul     z1.s, p1/m, z1.s, z2.s
```
Is there an appropriate backend pass to do this transformation?
This transformation will let MIR leave SSA-form and the first pass call `MRI->leaveSSA();` is `phi-node-elimination`.
I can't find a suitable pass after `phi-node-elimination` and before `register allocation`.

Does anyone have a better opinion?

</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJycU8Fu2zoQ_BrqsrBBLWXZOujgPEdAgJdL_H6AEtcWXymSJamk8dcXklw0cZqiKGGYgmZmZ0bAyhj12RLVbHPHNodMjql3of5Xp2Tokci7rHXqtWYlv_74gfE9XE83ePoKAD5fR4b_gOcMm8v0dLm-YSh-aIbRzKJLsUAXfHO_GyuVWpj5p8xI5h3F529dZ4uZeBOciQMT97-E_qrTnwe-nsE9-3D6BpclL96g48dWzfCuGX7S7CFC6ikQSAvS--B80DIRtLL7QlaBlzFCcqAcpF5HSEHaeHJhkEk7y0SzjPnvIwYv2hgwlODx4QkMyWeC43G_mgggrZp84aRDTItJJ40BVvLHp4cVE_ez4HjcM9wxrJi4YyUHHSeG7_XKOkUrMnrQdklS8vW1EXTSMtwmOGmrQEIcdZKtocVGnhKF30yZo7V0coEmVqCzjpNCGuO6G6vl_-AogrSvzhL0U0sJLaVJ47y2b79SpmqhKlHJjOp8m-NWYI5V1telasudUpUQRV4pLnOkAktRikpW-abqMl0jx4IXOeflZoPVWlUnFC2K3VaKrRQVKzgNUpu1Mc_D2oVzpmMcqd7tUGwzI1sycd5WREsvMIMMcVreUE-aVTueIyu40THFn1OSTmZe8_0-dH1ZsM0BRusDKd3JRAq0jQkY3s2rtewJ3MDZGEzdp-QjE3uGDcPmrFM_tuvODQybyex6rXxw_1OXGDZzxMiwmSt8DwAA__-KfkqR">