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

    <tr>
        <th>Summary</th>
        <td>
            SLPVectorizer does not respect isFPVectorizationPotentiallyUnsafe()
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            miscompilation,
            llvm:SLPVectorizer
      </td>
    </tr>

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

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

<pre>
    SLPVectorizer currently incorrectly vectorizes FP instructions using ARM NEON (https://llvm.godbolt.org/z/c9866Yv13), which has non-IEEE compliant denormal flushing (https://github.com/llvm/llvm-project/issues/16648).

There is a isFPVectorizationPotentiallyUnsafe() TTI hook for this, which is checked by LoopVectorize, but not SLPVectorizer.

(Technically at fault here is the ARM backend for using NEON instructions for vector floating point ops, but LLVM currently handles this by preventing their implicit formation.)
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJykU09vmzAU_zTm8tQIHgkJBw5ZG6RKaVdtWaUdjTH4LcZGtsmUfvrJpH-W7TJpF0B6D__-mntPvZGyYqtPbHWX8Cko6ypDRxJJY9tz9XX_9CxFsI5epAMxOSdN0GcgI6xzUsTv09uCh_oJyPjgJhHIGg-TJ9PD9ssDPO4-PwLDjQph9CzfMqwZ1lqfhkVv28bqsLCuZ1i_MKxFuSmK76csZ1gyvIWfioQCxT0Ya27ud7sdCDuMmrgJ0Epj3cA1dHryKuL9BdNTUFOzEHZ4xXx93YzO_pAiMKzJ-0l6hnVWFMsNw3LB0juWbi_Pg5JOAnngQL5-t4RHlU82SBOIa33-ZjzvJMP4PxwO96CsPUJnHQRF_kMJeRBKiqNsoTnD3trx3eS41EwBjA1wZf4VH4abgxTKkIiwwAN0fNIB3mgGJWfXGy6O0rQzhUsWcw5XGcXZJULotOUhbo2WTAA7-jc6-_3zw2_xK25aLf0sK0oYnTxFE0wfockBxXQEhXj6MNu0YFgmbZW3ZV7yRFbZGldZWZSIiaqWXSG6rkHRZA0WRdbybp01KbZNviyxKBKqMMVlWqZZliOmuFgXaY64WXJssFvnJVumcuCkF3OlrOuTOdEqS4syLRPNG6n93HPEgXysD-mZGENkeMsQ52Lk2yvX43B1l7hqrksz9Z4tU00--A-gQEHLP25Ka6WfM3TSj1KEf65NMjld_Ud7L3JPFf4KAAD__-LnS-0">