<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 - "opt -enable-loop-distribute -loop-distribute" failing with "PHINode should have one entry for each predecessor of its parent basic block!""
   href="https://bugs.llvm.org/show_bug.cgi?id=49379">49379</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>"opt -enable-loop-distribute -loop-distribute" failing with "PHINode should have one entry for each predecessor of its parent basic block!"
          </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>enhancement
          </td>
        </tr>

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

        <tr>
          <th>Component</th>
          <td>Scalar Optimizations
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>mikael.holmen@ericsson.com
          </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=24578" name="attach_24578" title="bbi-53389.ll">attachment 24578</a> <a href="attachment.cgi?id=24578&action=edit" title="bbi-53389.ll">[details]</a></span>
bbi-53389.ll

llvm commit 7b319df29bf
Reproduce with:
 opt -enable-loop-distribute -loop-distribute -S -o - bbi-53389.ll

Result:
PHINode should have one entry for each predecessor of its parent basic block!
  %1 = phi i16 [ undef, %for.end.lver.orig ], [ 0, %cleanup4.loopexit ]
LLVM ERROR: Broken module found, compilation aborted!

The offending basic block looks like:

cleanup4.lver.orig:                               ; preds = %for.end.lver.orig
  %1 = phi i16 [ undef, %for.end.lver.orig ], [ 0, %cleanup4.loopexit ]
  br i1 false, label %lbl1.lver.orig, label %return.us-lcssa.loopexit

and there is no branch from %cleanup4.loopexit to cleanup4.lver.orig.

cleanup4.loopexit looks like:

cleanup4.loopexit:                                ; No predecessors!
  br label %cleanup4

There are blocks in the input that are unreachable from entry. I suppose that
confuses loop-distribute.</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>