http://llvm.org/bugs/show_bug.cgi?id=12545

             Bug #: 12545
           Summary: suboptimal codegen for if (x == -y)
           Product: libraries
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Common Code Generator Code
        AssignedTo: [email protected]
        ReportedBy: [email protected]
                CC: [email protected]
    Classification: Unclassified


Created attachment 8383
  --> http://llvm.org/bugs/attachment.cgi?id=8383
c source

With the attached source, clang (trunk r154661) codegens the comparison as:

$ clang -S -O3 -o - f.c
...
    negl    %esi
    cmpl    %esi, %edi
    je    .LBB0_2

GCC (Ubuntu/Linaro 4.6.1-9ubuntu3) does better:

$ gcc -S -O3 -o - f.c
...
    addl    %esi, %edi
    je    .L4

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- 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