[LLVMbugs] [Bug 19671] New: InstCombine should canonicalize two identical icmps

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed May 7 00:18:33 PDT 2014


http://llvm.org/bugs/show_bug.cgi?id=19671

            Bug ID: 19671
           Summary: InstCombine should canonicalize two identical icmps
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Scalar Optimizations
          Assignee: unassignedbugs at nondot.org
          Reporter: david.majnemer at gmail.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

define i1 @t1(i64 %x) {
  %1 = and i64 %x, 1
  %2 = icmp eq i64 %1, 0
  ret i1 %2
}
define i1 @t2(i64 %x) {
  %1 = trunc i64 %x to i32
  %r = icmp ne i32 %1, 1
  ret i1 %r
}

These are the same, there can only be one.

VisitICmp probably needs to grow some larger brains and sniff out that icmp
<equality> trunc/zext/sext, <0 or 1> is and-able. This lets us stay in the same
type.

-- 
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/20140507/73fbc50c/attachment.html>


More information about the llvm-bugs mailing list