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

            Bug ID: 45755
           Summary: Failure to recognize andn-like pattern
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Scalar Optimizations
          Assignee: unassignedb...@nondot.org
          Reporter: gabrav...@gmail.com
                CC: llvm-bugs@lists.llvm.org

int f(int x)
{
    return ~(x | -x);
}

With -O3, GCC outputs this :

f(int):
  lea eax, [rdi-1]
  andn eax, edi, eax
  ret

LLVM outputs this : 

f(int): # @f(int)
  mov eax, edi
  neg eax
  or eax, edi
  not eax
  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
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to