<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 - select statement crashes wasm64 backend"
   href="https://bugs.llvm.org/show_bug.cgi?id=41926">41926</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>select statement crashes wasm64 backend
          </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>release blocker
          </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>husseydevin@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>On LLVM versions 7.0 and later, this code causes a crash on the wasm64
backend.:

define i32 @foo(i32){
  %2 = icmp sgt i32 %0, 15
  %3 = select i1 %2, i32 0, i32 3
  ret i32 %3
}

llc --mtriple=wasm64 test.ll

LLVM ERROR: Cannot select: 0x4f1608: i32 = select 0x4f1810, Constant:i32<0>,
Constant:i32<3>
  0x4f1810: i64 = and 0x4f1740, Constant:i64<1>
    0x4f1740: i64 = any_extend 0x4f1468
      0x4f1468: i32 = WebAssemblyISD::ARGUMENT TargetConstant:i32<0>
        0x4f1400: i32 = TargetConstant<0>
    0x4f17a8: i64 = Constant<1>
  0x4f1538: i32 = Constant<0>
  0x4f15a0: i32 = Constant<3>
In function: foo

Ubuntu 18.04 LTS amd64 on WSL
Windows 10 Home 1903 x64
Dell Precision T3400
2.80 GHz Intel Core 2 Duo E7400
4 GB RAM

Known affected versions:

version 7.1.0~svn353565-1~exp1~20190406090509.61 from the
llvm-toolchain-bionic-7 apt repo
version 8.0.0 from releases.llvm.org
version 9.0.0-svn360862-1~exp1+0~20190516072237.984~1.gbp398e29 from the
llvm-toolchain-bionic apt repo</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>