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

    <tr>
        <th>Summary</th>
        <td>
            [slp-vectorizer] Vectorization bug
        </td>
    </tr>

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

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

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

<pre>
    Bug on vectorization. 
It seems to me that this bug is related to vectorization of multiplication and poison values.

Ir with bug:
```llvm
define void @bar() {
  %tmp = add i64 poison, poison
  %tmp2 = add i64 poison, poison
  %tmp3 = mul i64 %tmp2, %tmp
  %tmp4 = mul i64 %tmp3, %tmp2
  %tmp5 = mul i64 %tmp4, %tmp2
  %tmp7 = add i64 %tmp, %tmp5
  %tmp8 = sitofp i64 %tmp7 to double
  call void @wibble(i32 poison, double %tmp8, i64 poison)
  unreachable
}

declare void @wibble(i32, double, i64)

```

Run: opt -passes=slp-vectorizer -S ir.ll

The ir can be seen/tested here: https://godbolt.org/z/PcanWMbb5
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyVU0uPmzAQ_jXmMgoiBvM4cOg2WqmHSlVbtWeDJ8GtwQibrLq_vmNIsmGVHioZPB5_883DM41Vf-qn-QR2gDO23k76VXpthxhYcmDJh08eHGLvwFvoEXwnPf20g4aMaJvQSI8qXG_swR6hn43Xo9HtqpGDgtFqF1xJM6OLVxcXRxO8aN8FXpZedCxP1mXMuV9VCo96QDhbrYBlSSMnxkvGK2DF04oAYFz4fgSWHkAqBTrPLn4Z_3iVNlD-H9h0wVJqC_ZiH8CruAVnD8DpG5hv0eIBOvsnutgEffF-A4stuFzATnt7HO_wRXg3ZefG4BXfSmNu5X3RTbjipU75XV1Wiyt10NzXrbpSzcOEsu3kjZ0Vh_snV9gaOeFDb29uLvQ33netca_8Og_UO2BHD7tROoeOsnZm3F1bEyfYfQM9xcbc233vkJSU-gANhn6nLJ49utDYHU4YSDvvRxc6kz_TOlnVWONjO53o9ErfF7L--blpRIT1Ps-zTOxFwiNVp6pKKxl57Q3WTDxt42HiAD82g0MDEM2Tqd85pNmYm7i1PR2WcVi33TjZX2RPR-0cDRUJokxEFnX1EZXkap8fE5QCy7zCopVZQXJK4akqMrJB40JQjPMBX2ChIJmiinTNE86Tilf7fVpyHossrxJMjmWel0KJgl4Me6lNHOIIlYimegmJMnB0abTz7u2S3kOfBlxqEPjl7Ds71aqRv-cBz7rtosV9vYT_F6bUYcs">