<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 - vector IR (insertelement/shufflevector) fails to select for wasm32 with -mattr=+simd128"
   href="https://bugs.llvm.org/show_bug.cgi?id=38519">38519</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>vector IR (insertelement/shufflevector) fails to select for wasm32 with -mattr=+simd128
          </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>All
          </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: WebAssembly
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>gonzalobg88@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>define hidden void @i8x16_splat(<1 x i128>*, i8 %v) {
start:
%_3.0.vec.insert.i = insertelement <16 x i8> undef, i8 %v, i32 0
%_3.15.vec.insert.i = shufflevector <16 x i8> %_3.0.vec.insert.i, <16 x i8>
undef, <16 x i32> zeroinitializer
%1 = bitcast <16 x i8> %_3.15.vec.insert.i to i128
%_2.sroa.0.0.vec.insert.i = insertelement <1 x i128> undef, i128 %1, i32 0
store <1 x i128> %_2.sroa.0.0.vec.insert.i, <1 x i128>* %0, align 16
ret void
}

compiles fine with `llc -march=wasm32` but produces the following error with
`llc -march=wasm32 -mattr=+simd128` (<a href="https://godbolt.org/g/X5dqST">https://godbolt.org/g/X5dqST</a>): 

LLVM ERROR: Cannot select: 0x5569fcdf5790: ch = store<(store 16 into %ir.0)>
0x5569fcdb6408, 0x5569fcdf55f0, 0x5569fcdf53e8, undef:i32

  0x5569fcdf55f0: v16i8 = BUILD_VECTOR 0x5569fcdf54b8, 0x5569fcdf54b8,
0x5569fcdf54b8, 0x5569fcdf54b8, 0x5569fcdf54b8, 0x5569fcdf54b8, 0x5569fcdf54b8,
0x5569fcdf54b8, 0x5569fcdf54b8, 0x5569fcdf54b8, 0x5569fcdf54b8, 0x5569fcdf54b8,
0x5569fcdf54b8, 0x5569fcdf54b8, 0x5569fcdf54b8, 0x5569fcdf54b8

    0x5569fcdf54b8: i32 = WebAssemblyISD::ARGUMENT TargetConstant:i32<1>

      0x5569fcdf5450: i32 = TargetConstant<1>

    0x5569fcdf54b8: i32 = WebAssemblyISD::ARGUMENT TargetConstant:i32<1>

      0x5569fcdf5450: i32 = TargetConstant<1>

    0x5569fcdf54b8: i32 = WebAssemblyISD::ARGUMENT TargetConstant:i32<1>

      0x5569fcdf5450: i32 = TargetConstant<1>

    0x5569fcdf54b8: i32 = WebAssemblyISD::ARGUMENT TargetConstant:i32<1>

      0x5569fcdf5450: i32 = TargetConstant<1>

    0x5569fcdf54b8: i32 = WebAssemblyISD::ARGUMENT TargetConstant:i32<1>

      0x5569fcdf5450: i32 = TargetConstant<1>

    0x5569fcdf54b8: i32 = WebAssemblyISD::ARGUMENT TargetConstant:i32<1>

      0x5569fcdf5450: i32 = TargetConstant<1>

    0x5569fcdf54b8: i32 = WebAssemblyISD::ARGUMENT TargetConstant:i32<1>

      0x5569fcdf5450: i32 = TargetConstant<1>

    0x5569fcdf54b8: i32 = WebAssemblyISD::ARGUMENT TargetConstant:i32<1>

      0x5569fcdf5450: i32 = TargetConstant<1>

    0x5569fcdf54b8: i32 = WebAssemblyISD::ARGUMENT TargetConstant:i32<1>

      0x5569fcdf5450: i32 = TargetConstant<1>

    0x5569fcdf54b8: i32 = WebAssemblyISD::ARGUMENT TargetConstant:i32<1>

      0x5569fcdf5450: i32 = TargetConstant<1>

    0x5569fcdf54b8: i32 = WebAssemblyISD::ARGUMENT TargetConstant:i32<1>

      0x5569fcdf5450: i32 = TargetConstant<1>

    0x5569fcdf54b8: i32 = WebAssemblyISD::ARGUMENT TargetConstant:i32<1>

      0x5569fcdf5450: i32 = TargetConstant<1>

    0x5569fcdf54b8: i32 = WebAssemblyISD::ARGUMENT TargetConstant:i32<1>

      0x5569fcdf5450: i32 = TargetConstant<1>

    0x5569fcdf54b8: i32 = WebAssemblyISD::ARGUMENT TargetConstant:i32<1>

      0x5569fcdf5450: i32 = TargetConstant<1>

    0x5569fcdf54b8: i32 = WebAssemblyISD::ARGUMENT TargetConstant:i32<1>

      0x5569fcdf5450: i32 = TargetConstant<1>

    0x5569fcdf54b8: i32 = WebAssemblyISD::ARGUMENT TargetConstant:i32<1>

      0x5569fcdf5450: i32 = TargetConstant<1>

  0x5569fcdf53e8: i32 = WebAssemblyISD::ARGUMENT TargetConstant:i32<0>

    0x5569fcdf5380: i32 = TargetConstant<0>

  0x5569fcdf5860: i32 = undef

In function: i8x16_splat

Compiler returned: 1</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>