<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 --- - LVI should understand conditional branches where the condition is a conjunction or disjunction"
   href="https://llvm.org/bugs/show_bug.cgi?id=27296">27296</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>LVI should understand conditional branches where the condition is a conjunction or disjunction
          </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>regehr@cs.utah.edu
          </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>LVI is perfectly capable of learning from sequenced simple branches:

  %cmp = icmp sgt i32 %x, 20
  br i1 %cmp, label %cont, label %if.end3
  %cmp1 = icmp sgt i32 %y, 200
  br i1 %cmp1, label %if.then2, label %if.end3
  %add = add nsw i32 %y, %x

However, after SimplifyCFG we're instead looking at code like this:

  %cmp = icmp sgt i32 %x, 20
  %cmp1 = icmp sgt i32 %y, 200
  %or.cond = and i1 %cmp, %cmp1
  br i1 %or.cond, label %if.then2, label %if.end3

And now LVI learns nothing. A mix would be to cause LVI to look for cases where
an i1 that goes to a branch is the result of an and, and recursively accumulate
dataflow facts.

Though it's probably less important, LVI can also learn facts when flags are
or'ed, for example:

  %cmp = icmp eq i32 %x, 10
  %cmp1 = icmp eq i32 %x, 12
  %or.cond = or i1 %cmp, %cmp1
  br i1 %or.cond, label %if.then2, label %if.end3</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>