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

    <tr>
        <th>Summary</th>
        <td>
            [Headers][X86] Allow AVX512 integer reduction intrinsics to be used in constexpr
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            backend:X86,
            clang:headers,
            constexpr
      </td>
    </tr>

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

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

<pre>
    The AVX512 `_mm512_reduce_*_epi*` intrinsic wrap the builtin reduction intrinsics which can already be used in constexpr:
```
_mm512_reduce_add_epi32 _mm512_reduce_add_epi64
_mm512_reduce_mul_epi32 _mm512_reduce_mul_epi64

_mm512_reduce_and_epi32 _mm512_reduce_and_epi64
_mm512_reduce_or_epi32 _mm512_reduce_or_epi64

_mm512_reduce_max_epi32 _mm512_reduce_max_epi64
_mm512_reduce_min_epi32 _mm512_reduce_min_epi64
_mm512_reduce_max_epu32 _mm512_reduce_max_epu64
_mm512_reduce_min_epu32 _mm512_reduce_min_epu64
```
(ignore the AVX512 mask/maskz variants for now)

You can use https://github.com/llvm/llvm-project/pull/152305 as reference.
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJyUU02L2zAQ_TXyRTTIY8tJDj54u4RCb20p21PQx8RWV5aCPja7_fXFdrbbss6hIBA89ObN6M0TMZreIbaE3xF-X4icBh_aL5-_mtG7Qnr90n4bkHbfH3gJlDTsOI68hGNAnRUeCXRHPBsCHWkYNS4F46JR9BLEmaYBqczGJuPo_D4Z794eRXoZjBqoEo4KG1DoFyqR5oiaGkeVdzHh8zmQqiNsqn89rPu3B6H11EMFdBVv6neMMdtVxhWfGe9l3A0Zd0vGh1XCAq-LjOJ5vbMFX5vFuHXGgq8x5lr5hka-qbHCWPBllL_8IbAzvfMB5xW47s4o4iOBw3T9ok8iGOFSpCcfqPMXAvvlO374PC9EjkiHlM5xch8OBA69SUOWG-VHAgdrn16vD-fgf6JKBA7nbC2BQ8mhYpyKSAOeMKBTuCl0W-l9tRcFtuWW1_W-ZiUrhnZ_kuWp1qWUO2wUsi1yyaXeVlAqFGVdmBYYcLZjTcmh4WxTnyRnvDyVuy3ba1mRmuEojN1M3Wx86AsTY8Z2agPqwgqJNs4BA5BCPaLTpOoedg0BIPCRACgrXE-qbkChMcQ3_E8EAKZ0hnYeWOY-kppZE1N8E00m2TnHn65V-D3hd5MMv6edtf7y6oRxCXsM65lMfjWERQ62_W9D5o-IV0ugLp5a-B0AAP__9o109Q">