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

            Bug ID: 38781
           Summary: Missed pattern (A >= 0) & (B >= 0)
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Scalar Optimizations
          Assignee: unassignedb...@nondot.org
          Reporter: david.bolvan...@gmail.com
                CC: llvm-bugs@lists.llvm.org

int pat1 (int a, int b)
{
  return (a >= 0) & (b >= 0); // can be transformed to (a | b) >= 0)
}


Clang:
pat1(int, int): # @pat1(int, int)
  shr edi, 31
  xor edi, 1
  shr esi, 31
  not esi
  and esi, edi
  mov eax, esi
  ret

GCC:
pat1(int, int):
  mov eax, esi
  or eax, edi
  not eax
  shr eax, 31
  ret

-- 
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