[llvm-bugs] [Bug 38781] New: Missed pattern (A >= 0) & (B >= 0)

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Aug 30 11:03:54 PDT 2018


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: unassignedbugs at nondot.org
          Reporter: david.bolvansky at gmail.com
                CC: llvm-bugs at 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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20180830/d31acc22/attachment.html>


More information about the llvm-bugs mailing list