<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 - Fix passes that introduce new branches on undef/poison"
   href="https://bugs.llvm.org/show_bug.cgi?id=46144">46144</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Fix passes that introduce new branches on undef/poison
          </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>All
          </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>florian_hahn@apple.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Currently there are some passes that may introduce new branches on
undef/poison, which h potentially introduces UB where there was none before.

While the LangRef was clear about branch on poison being UB, recently it was
also clarified that this applies to branches on undef as well
(<a href="https://reviews.llvm.org/rG05f0e598ab265a80fedb23225cde4176f11774ac">https://reviews.llvm.org/rG05f0e598ab265a80fedb23225cde4176f11774ac</a>).

There has been some discussion about problematic passes
(<a href="https://reviews.llvm.org/D76973">https://reviews.llvm.org/D76973</a>, 
<a href="https://reviews.llvm.org/D80875">https://reviews.llvm.org/D80875</a>.

Nuno mentioned "The passes we are aware that introduce branch on poison are:
IndVarSimplify, LoopUnswitch, SimpleLoopUnswitch, and SimpifyCFG.
(<a href="https://web.ist.utl.pt/nuno.lopes/alive2/index.php?hash=4beb2b117e2fdd2c">https://web.ist.utl.pt/nuno.lopes/alive2/index.php?hash=4beb2b117e2fdd2c</a>)"

Eli mentioned that some passes condition certain transforms on
the`Attribute::SanitizeMemory`attribute, because of MemSAN does not like new
branches on undef/poison values. See also
<a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - MemorySanitizer false positives in optimized code"
   href="show_bug.cgi?id=28054">https://bugs.llvm.org/show_bug.cgi?id=28054</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>