<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 - Improve generic expansion of expandload and compressstore intrinsics"
   href="https://bugs.llvm.org/show_bug.cgi?id=39666">39666</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Improve generic expansion of expandload and compressstore intrinsics
          </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, llvm-bugs@lists.llvm.org, llvm-dev@redking.me.uk, spatel+llvm@rotateright.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>These generic intrinsics fail without a legal lowering.

define <2 x i64> @test5(i64* %base, <2 x i64> %src0) {
 %res = call <2 x i64> @llvm.masked.expandload.v2i64(i64* %base, <2 x i1> <i1
false, i1 true>, <2 x i64> %src0)
 ret <2 x i64>%res
}
declare <2 x i64> @llvm.masked.expandload.v2i64(i64*, <2 x i1>, <2 x i64>)

define void @test11(i64* %base, <2 x i64> %V, <2 x i1> %mask) {
 call void @llvm.masked.compressstore.v2i64(<2 x i64> %V, i64* %base, <2 x i1>
%mask)
 ret void
}
declare void @llvm.masked.compressstore.v2i64(<2 x i64>, i64* , <2 x i1>)

llc -mcpu=btver2

LLVM ERROR: Cannot select: 0x557bba23b478: v2i64,ch = masked_load<(load 16 from
%ir.base)> 0x557bba1c8b68, 0x557bba23b208, 0x557bba23b6e8, 0x557bba23b2d8

  0x557bba23b208: i64,ch = CopyFromReg 0x557bba1c8b68, Register:i64 %0

    0x557bba23b1a0: i64 = Register %0

  0x557bba23b6e8: v2i64 = bitcast 0x557bba23b680

    0x557bba23b680: v16i8 = X86ISD::VSHLDQ 0x557bba23b3a8, Constant:i8<8>

      0x557bba23b3a8: v16i8 = bitcast 0x557bba23b340

        0x557bba23b340: v2i64 = scalar_to_vector Constant:i64<-1>

          0x557bba23b888: i64 = Constant<-1>

      0x557bba23b410: i8 = Constant<8>

  0x557bba23b2d8: v2i64,ch = CopyFromReg 0x557bba1c8b68, Register:v2i64 %1

    0x557bba23b270: v2i64 = Register %1

In function: test5</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>