<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 - Miscompile due to BasicAA/ValueTracking using wrong DT"
   href="https://bugs.llvm.org/show_bug.cgi?id=48709">48709</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Miscompile due to BasicAA/ValueTracking using wrong DT
          </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>Global Analyses
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>bjorn.a.pettersson@ericsson.com
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>bjorn.a.pettersson@ericsson.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>After merging patches that used DominatorTree information in more places in
BasicAA/ValueTracking (such as
<a href="https://reviews.llvm.org/rGb21840751278128ef6942074ae89ea63c9c6ac58">https://reviews.llvm.org/rGb21840751278128ef6942074ae89ea63c9c6ac58</a>) we started
to see miscompiles downstream for our OOT target.

By adding a DT->verify() check before every use of DT in BasicAliasAnalysis and
VelueTracking it turned out that lots of lit tests would complain also in-tree.
So it is assumed that one could get miscompiles also for other targets, as
using an invalid DominatorTree during analysis could be dangerous.

Early analysis show that problem is related to the calculation of "last user"
in the legacy pass manager. Sometimes the FunctionAliasAnalysis (and BasicAA)
is preserved and kept for a longer time compared to the DominatorTree, possibly
due to not using "addRequiredTransitive" when specifying pass dependencies for
the chained analysis usage.</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>