<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 --- - Teach the SCCP solver about `undef`"
   href="https://llvm.org/bugs/show_bug.cgi?id=30966">30966</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Teach the SCCP solver about `undef`
          </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>Windows NT
          </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>Scalar Optimizations
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>davide@freebsd.org
          </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>Currently `undef` are not solved strictly as part of the solver.
Instead, after the solver runs, we assume that everything which has lattice
value Unknown means "undef" and we try to match the correct lattice values in
resolveUndefsIn.

Some of the problems of this approach:
1) There are two parallel pieces of code which have a lockstep ordering of
propagation, and this makes hard to reason about them.
2) It breaks subtly in some cases. See, for example
<a href="http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20161107/403212.html">http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20161107/403212.html</a>
Dan's comment or <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - wrong code at -O3 on x86_64-linux-gnu (in both 32-bit and 64-bit modes)"
   href="show_bug.cgi?id=30448">https://llvm.org/bugs/show_bug.cgi?id=30448</a>

A solution could be that of making `undef` actually a lattice value, and
integrate in the solver. Eli pointed out ConstantFolding knows about undef
(although there are some cases that need special attention, e.g. phi nodes).</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>