[LLVMbugs] [Bug 12545] New: suboptimal codegen for if (x == -y)

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri Apr 13 03:52:17 PDT 2012


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: unassignedbugs at nondot.org
        ReportedBy: jay.foad at gmail.com
                CC: llvmbugs at cs.uiuc.edu
    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.



More information about the llvm-bugs mailing list