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

            Bug ID: 40102
           Summary: icmp eq/ne (and X, (neg X)), 0 not optimized to just
                    icmp eq/ne X, 0
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Scalar Optimizations
          Assignee: unassignedb...@nondot.org
          Reporter: craig.top...@gmail.com
                CC: llvm-bugs@lists.llvm.org

As mentioned in D55870, this can be optimized to just a compare of X with 0.

Test case taken from test/CodeGen/bmi.ll

define i32 @blsi32_z2(i32 %a, i32 %b, i32 %c) nounwind {
  %t0 = sub i32 0, %a
  %t1 = and i32 %t0, %a
  %t2 = icmp eq i32 %t1, 0
  %t3 = select i1 %t2, i32 %b, i32 %c
  ret i32 %t3
}

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to