<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 - Assumptions without constant operands are not propagated"
   href="https://bugs.llvm.org/show_bug.cgi?id=40149">40149</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Assumptions without constant operands are not propagated
          </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>nikita.ppv@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>For icmps that don't have a constant operand, assumptions are not propagated.
For example, in the following test case %c1 implies that %c2 is false.

define i1 @test(i32 %x, i32 %y) {
  %c1 = icmp ult i32 %x, %y
  call void @llvm.assume(i1 %c1)
  %c2 = icmp ugt i32 %x, %y
  ret i1 %c2
}
declare void @llvm.assume(i1)

Something like this will only get simplified if either
a) the icmps match exactly, so they are CSEd, or
b) the icmps are inverses of either other and canonicalization is possible
(after which they're CSEd).

I'm not sure which pass should be responsible for this. I think right now it
would be easy and cheap to do in SCCP because it already computes
PredicateInfo, but it's not really the right pass to do this semantically.</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>