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

        <tr>
          <th>Summary</th>
          <td>opt -passes='loop-bound-split' 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=25210" name="attach_25210" title="bbi-59713.ll reproducer">attachment 25210</a> <a href="attachment.cgi?id=25210&action=edit" title="bbi-59713.ll reproducer">[details]</a></span>
bbi-59713.ll reproducer

llvm commit: d396d09fc2278bfe34b9db2ee27ecfd470149da8

Reproduce with:
 opt -passes='loop-bound-split' -S -o - bbi-59713.ll

Result:
PHINode should have one entry for each predecessor of its parent basic block!
  %call.lcssa.ph = phi i16 
PHI node entries do not match predecessors!
  %call.lcssa = phi i16 [ %call, %cond.end ], [ %call.lcssa.ph, %end.loopexit ]
label %cond.end
label %entry.split.split
LLVM ERROR: Broken module found, compilation aborted!

Looking att -print-after-all we see that loop-bound-split has created this
broken phi instruction:

end.loopexit:                                     ; preds = %cond.end.split
  %call.lcssa.ph = phi i16 

Note:
If we add e.g. -verify-each we actually get less information, because then we
only get
 LLVM ERROR: Broken module found, compilation aborted!
and not the error message about the broken PHI.

It was also a mess reducing the input because bugpoint kept crashing.</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>