[llvm-bugs] [Bug 45666] New: [InstCombine] reduce icmp ult with or operand

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Apr 24 14:38:28 PDT 2020


https://bugs.llvm.org/show_bug.cgi?id=45666

            Bug ID: 45666
           Summary: [InstCombine] reduce icmp ult with or operand
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Scalar Optimizations
          Assignee: unassignedbugs at nondot.org
          Reporter: spatel+llvm at rotateright.com
                CC: llvm-bugs at lists.llvm.org

define i1 @cmp_or_limit(i8 %x) {
  %or = or i8 %x, 5
  %cmp = icmp ult i8 %or, 43
  ret i1 %cmp
}

This can reduce to:

define i1 @cmp_or_limit(i8 %x) {
  %R = icmp ult i8 %x, 40
  ret i1 %R
}


http://volta.cs.utah.edu:8080/z/k3sykE

I think there's some leading zeros + masking relationship for those constants
that we're not getting.

The old Alive lets us specify constant preconditions. Is there an equivalent
with Alive2?

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20200424/5002cea7/attachment.html>


More information about the llvm-bugs mailing list