<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 --- - Assert in LegacyPassManager when adding PostDominatorTree to analysis pass"
   href="https://llvm.org/bugs/show_bug.cgi?id=30370">30370</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Assert in LegacyPassManager when adding PostDominatorTree to analysis pass
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>new-bugs
          </td>
        </tr>

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

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </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>new bugs
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>Christof.Douma@arm.com
          </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=17255" name="attach_17255" title="reproducer - created against svn revision 281213.">attachment 17255</a> <a href="attachment.cgi?id=17255&action=edit" title="reproducer - created against svn revision 281213.">[details]</a></span>
reproducer - created against svn revision 281213.

When I add PostDominatorTree analysis pass to scalar-evolution (as a transitive
requirement) the LegacyPassManager run into an assert:
opt: ../lib/IR/LegacyPassManager.cpp:520: void
llvm::PMTopLevelManager::setLastUser(llvm::ArrayRef<llvm::Pass*>, llvm::Pass*):
Assertion `AnalysisPass && "Expected analysis pass to exist."' failed.

This looks like a bad interaction between the new PassManager and the
LegacyPassManager.

To reproduce, use the attached patch on ScalarEvolution.cpp that only adds
PostDominatorTree as a required pass and run using:

true | opt -loop-idiom -loop-unroll

This currently blocks my attempt to solve <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - Scalar Evolution fails to find constant trip count"
   href="show_bug.cgi?id=28429">bug 28429</a>.</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>