<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 - [Simple Register Coalescing] Assertion `VNI && "No live value at use."' failed."
   href="https://bugs.llvm.org/show_bug.cgi?id=46247">46247</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>[Simple Register Coalescing]  Assertion `VNI && "No live value at use."' failed.
          </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>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Register Allocator
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>paulsson@linux.vnet.ibm.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org, quentin.colombet@gmail.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=23592" name="attach_23592" title="reduced testcase">attachment 23592</a> <a href="attachment.cgi?id=23592&action=edit" title="reduced testcase">[details]</a></span>
reduced testcase

I found a test case which which triggered this assert with machine DCE
disabled. In the reduced test case, it seems that the whole block is in fact
dead and it would normally become an empty block after Machine DCE. However, if
run with 

llc -mtriple=s390x-linux-gnu -mcpu=z15 -O3 -o out.s tc_nolivevalatuse.ll
-disable-machine-dce -misched=shuffle

, the RegisterCoalescer deletes a lot of dead defs, but not all of them. Three
instructions remain, and the mischeduler will then be run and trigger the
assert.

It seems that the RegisterCoalescer is not updating data structures correctly
while deleting instructions.

llvm-project/llvm/lib/CodeGen/MachineScheduler.cpp:1144: void
llvm::ScheduleDAGMILive::updatePressureDiffs(llvm::ArrayRef<llvm::RegisterMaskPair>):
Assertion `VNI && "No live value at use."' failed.
...
#8 0x000002aa24927b36 llvm::ScheduleDAGMILive::updatePressureDiffs
...</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>