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

    <tr>
        <th>Summary</th>
        <td>
            [AArch64] Missed optimization converting vector fmul(sitofp(x), 0.5) -> scvtf(x, 2)
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            good first issue,
            backend:AArch64
      </td>
    </tr>

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

    <tr>
      <th>Reporter</th>
      <td>
          efriedma-quic
      </td>
    </tr>
</table>

<pre>
    In #91924, we removed the existing combine for vector `fdiv(sitofp(x), 2) -> scvtf(x, 2)` etc. because it would almost never trigger: instcombine converts all fdiv operations by powers of two to fmul.  However, the idea behind the optimization is still useful: for the given conversion operations, we can eliminate the multiply.   We should try to restore this optimization so it works on vector inputs.  (This optimization is already implemented for scalar inputs.)

Marking this good-first-issue because the code that was removed can be used as a starting point for this.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJx0U0uPpDYQ_jXmUmoE5tHDgUNnJ6PksLdIORtT0JUxNnEV9HZ-fWS6Z1arZC-AqNf3qDLMNHvEXjW_qOY1M5tcQ-xxioTjYk5_b2SzIYz3_ncPSldd2ela6S9wQ4i4hB1HkCsCfiMW8jPYsAzkEaYQYUcrIYJqi2mkXekXJgnTqvTLN6W71EUr3cFJVb8C212mR-TxW7UFoNgcBrRmYwQSuIXNjWDcEljA444RJNI8Y1TVBcizfIy3we8YhcE4B2k6hBWjEQqeYbjDGm4YGcIEcgsgAaZlcznAb-GW2iYQiRaNaGDAK_kHzbAKLfTP0QeIgYWcg41x2lyCkFinvJl29E8QnHK_T3-KZ40HdLSQN4JHzbI5odXdcwD4E4GvB1mJ9wQvIkuIKZH4RxQcHsrEd4bgPzQnv27COYDSL3_8p4aSLhHNeAdaVocLesHxQM_WOPNZn3woXlVxeTy_mvieTD5QzCGMp4kiy4mYN_w0KpGxYUwfRuBm-HNTEukBk14jGAYDLCYea7MG8vKUjzjPxr4au6ozGfbluTx3bdU0TXbtzw3WprQaG1uOU4m1bofiXJbYlJWd2jKjXhe6Ltqi00XRNE2ui_bcmHPdTaXGVleqLnAx5HLn9iUPcc4O9H1Xd0WXOTOg4-MatE4M4WAIR47SWukvSuvB2Hf0o6oul0u017ZOkeY1i31qehq2mVVdOGLh72OExB139lHTvMJX4qTFD-Y8Vzep8jQz7eb_XU-RNz-_n2yLrr-KrKyqi9JvSr_NJNdtyG1YlH5LuJ6v0xrDX2hF6beDJyv99pBj7_W_AQAA__8FxWI3">