<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 - Failure to optimize vpmovsxwd+vpslld properly"
   href="https://bugs.llvm.org/show_bug.cgi?id=46393">46393</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Failure to optimize vpmovsxwd+vpslld properly
          </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>Linux
          </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>gabravier@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>craig.topper@gmail.com, llvm-bugs@lists.llvm.org, llvm-dev@redking.me.uk, spatel+llvm@rotateright.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>typedef int32_t v8i32 __attribute__((vector_size(32)));

v8i32 f(__m128i a, uint8_t u)
{
    return __builtin_ia32_pslldi256((v8i32)_mm256_maskz_cvtepi16_epi32(u, a),
16);
}

With -O3 -march=tigerlake, GCC outputs this :

f(long long __vector(2), unsigned char):
  kmovb k1, edi
  vpmovsxwd ymm0{k1}{z}, xmm0
  vpslld ymm0, ymm0, 16
  ret

LLVM outputs this :

.LCPI0_0:
  .short 16 # 0x10
  .short 0 # 0x0
  .short 18 # 0x12
  .short 1 # 0x1
  .short 20 # 0x14
  .short 2 # 0x2
  .short 22 # 0x16
  .short 3 # 0x3
  .short 24 # 0x18
  .short 4 # 0x4
  .short 26 # 0x1a
  .short 5 # 0x5
  .short 28 # 0x1c
  .short 6 # 0x6
  .short 30 # 0x1e
  .short 7 # 0x7
f(long long __vector(2), unsigned char):
  vmovdqa ymm1, ymmword ptr [rip + .LCPI0_0] # ymm1 =
[16,0,18,1,20,2,22,3,24,4,26,5,28,6,30,7]
  kmovd k1, edi
  vpxor xmm2, xmm2, xmm2
  vpermi2w ymm1, ymm0, ymm2
  vmovdqa32 ymm0 {k1} {z}, ymm1
  ret

I've been incapable of narrowing this down to any specific flag other than
-march=tigerlake.</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>