<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 - wasm64: Crash with register use before def"
   href="https://bugs.llvm.org/show_bug.cgi?id=52352">52352</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>wasm64: Crash with register use before def
          </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>Created <span class=""><a href="attachment.cgi?id=25399" name="attach_25399" title="bugpoint-reduced IR">attachment 25399</a> <a href="attachment.cgi?id=25399&action=edit" title="bugpoint-reduced IR">[details]</a></span>
bugpoint-reduced IR

I apologize in advance for the bad title here. In an effort to test out Rust on
the wasm64 backend I was curious to test out the performance of a
wasm32-vs-wasm64 program and the first thing I was going to test was a wasm
program that itself implements a wasm text parser. In compiling this program
though (Rust source code) I got a crash in LLVM:


llc:
/home/acrichto/code/rust/src/llvm-project/llvm/lib/CodeGen/MachineLoopInfo.cpp:199:
bool llvm::MachineLoop::isLoopInvariant(llvm::MachineInstr&) const: Assertion
`MRI->getVRegDef(Reg) && "Machine instr not mapped for this vreg?!"' failed.


Using bugpoint on the suspect LLVM module I was able to reduce the original
test case but it unfortunately gives a different crash now:


llc:
/home/acrichto/code/rust/src/llvm-project/llvm/lib/CodeGen/LiveVariables.cpp:129:
void llvm::LiveVariables::HandleVirtRegUse(llvm::Register,
llvm::MachineBasicBlock*, llvm::MachineInstr&): Assertion `MRI->getVRegDef(Reg)
&& "Register use before def!"' failed.


In any case this seemed like a good point to open up a bug. I've attached both
the un-minimized module as well as the bugpoint-reduced module here in case
fixing the bugpoint issue is distinct from the original issue.</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>