<html>
    <head>
      <base href="https://llvm.org/bugs/" />
    </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 --- - BasicBlock::removePredecessor generates self-referencing instructions"
   href="https://llvm.org/bugs/show_bug.cgi?id=27065">27065</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>BasicBlock::removePredecessor generates self-referencing instructions
          </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>Transformation Utilities
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>tobias@grosser.es
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=16088" name="attach_16088" title="Infinitely running test case">attachment 16088</a> <a href="attachment.cgi?id=16088&action=edit" title="Infinitely running test case">[details]</a></span>
Infinitely running test case

BasicBlock::removePredecessor will eliminate PHI nodes entirely if they always
evaluate to a single constant value and instead replace all uses of the PHINode
with this constant.

This is only correct if we know that the actual constant actually dominates the
PHI node, which is not verified in this code. As a result, we may generate self
referencing instructions which is not only incorrect but also causes an
infinite loop in -load-combine, which does not expect such IR.

This command does not terminate for me, as jump-treading uses removePredecessor
and introduces the incorrect IR that load-combine can not handle:

opt /tmp/infinite.ll -jump-threading -load-combine</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>