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: [email protected]
          Reporter: [email protected]
                CC: [email protected]
    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.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to