<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - [X86][AVX512VL] Infinite loop in bool vector sign extension"
   href="https://bugs.llvm.org/show_bug.cgi?id=34553">34553</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>[X86][AVX512VL] Infinite loop in bool vector sign extension
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>libraries
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Windows NT
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>enhancement
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Backend: X86
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>llvm-dev@redking.me.uk
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>craig.topper@gmail.com, elena.demikhovsky@intel.com, llvm-bugs@lists.llvm.org, zvi.rackover@intel.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Found while working on D37680

-mtriple=x86_64-unknown -mattr=+avx512f,+avx512vl

define <16 x i8> @vselect_packss_v16i32(<16 x i32> %a0, <16 x i32> %a1, <16 x
i8> %a2, <16 x i8> %a3) {
  %1 = icmp eq <16 x i32> %a0, %a1
  %2 = sext <16 x i1> %1 to <16 x i8>
  %3 = and <16 x i8> %2, %a2
  %4 = xor <16 x i8> %2, <i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8
-1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1>
  %5 = and <16 x i8> %4, %a3
  %6 = or <16 x i8> %3, %5
  ret <16 x i8> %6
}

-mtriple=x86_64-unknown -mattr=+avx512f works OK:

vselect_packss_v16i32:
        vpcmpeqd        %zmm1, %zmm0, %k1
        vpternlogd      $255, %zmm0, %zmm0, %zmm0 {%k1} {z}
        vpmovdb %zmm0, %xmm0
        vpand   %xmm2, %xmm0, %xmm1
        vpandn  %xmm3, %xmm0, %xmm0
        vpor    %xmm0, %xmm1, %xmm0
        vzeroupper
        retq

As does -mtriple=x86_64-unknown -mcpu=skx

vselect_packss_v16i32:
        vpcmpeqd        %zmm1, %zmm0, %k0
        vpmovm2b        %k0, %xmm0
        vpblendvb       %xmm0, %xmm2, %xmm3, %xmm0
        vzeroupper
        retq</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>