<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 select SIMD instructions for wasm64-unknown-unknown"
   href="https://bugs.llvm.org/show_bug.cgi?id=52350">52350</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Failure to select SIMD instructions for wasm64-unknown-unknown
          </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>alex@crichton.co
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>I was curious to poke around at wasm64-unknown-unknown support for Rust
recently and I ran into a crash with SIMD test cases which I was able to reduce
to:



target triple = "wasm64-unknown-unknown"

define void @foo(<4 x i32> * %a, i32* %b) #0 {
  store <4 x i32> zeroinitializer, <4 x i32>* %a, align 16
  %1 = load <4 x i32>, <4 x i32>* %a, align 16
  %2 = extractelement <4 x i32> %1, i32 0
  store i32 %2, i32* %b, align 4
  ret void
}

attributes #0 = { "target-features"="+simd128" }




which crashes with:

$ llc -filetype=obj -O2 -o foo.o ./bugpoint-reduced-simplified.ll
LLVM ERROR: Cannot select: t11: i32 = extract_vector_elt t6, Constant:i64<0>
  t6: v4i32 = BUILD_VECTOR Constant:i32<0>, Constant:i32<0>, Constant:i32<0>,
Constant:i32<0>
    t5: i32 = Constant<0>
    t5: i32 = Constant<0>
    t5: i32 = Constant<0>
    t5: i32 = Constant<0>
  t7: i64 = Constant<0>
In function: foo
PLEASE submit a bug report to <a href="https://bugs.llvm.org/">https://bugs.llvm.org/</a> and include the crash
backtrace.
Stack dump:
0.      Program arguments: ../rust/build/aarch64-unknown-linux-gnu/llvm/bin/llc
-filetype=obj -O2 -o foo.o ./bugpoint-reduced-simplified.ll
1.      Running pass 'Function Pass Manager' on module
'./bugpoint-reduced-simplified.ll'.
2.      Running pass 'WebAssembly Instruction Selection' on function '@foo'</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>