<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 - Incorrect liveness information after updating MBB live-ins through RDF"
   href="https://bugs.llvm.org/show_bug.cgi?id=39960">39960</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Incorrect liveness information after updating MBB live-ins through RDF
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>libraries
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Keywords</th>
          <td>crash-on-invalid
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>enhancement
          </td>
        </tr>

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

        <tr>
          <th>Component</th>
          <td>Backend: Hexagon
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>alexey.zhikhar@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>kparzysz@codeaurora.org, llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Consider a case of an imaginary register R1 that is declared live-in in BB#1:

  BB#0:
    %R1 = define
    ...

  BB#1:
    Live Ins: %R1
    … = use %R1

Then, the code went through an RDF-based transformation, which lead to updating
live-ins of each basic block:

  BB#0:
    %R1 = define
    ...

  BB#1:
    Live Ins: %R0
    … = use %R1

But why do we have %R0 instead of %R1? One thing I didn't mention about this
imaginary processor is that R0 and R1 completely overlap with each other.
Nevertheless, the live-in information at this point is incorrect, which is
discovered by the machine instruction verifier.

My understanding of the reason behind this is that the data structure used by
rdf::Liveness:computeLiveIns() has a shortcoming: RegisterAggr stores register
units rather than registers, so loosing information is inevitable. Since R0 and
R1 share the same register unit, RDF picks the first register that corresponds
to the stored register unit.                                                    

Unfortunately, I cannot share the test case since it is written for our
out-of-tree backend; however, the bug should be relevant for each backend that
makes use of RDF.</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>