[llvm-bugs] [Bug 42490] New: Suboptimal LEA codegen

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Jul 2 09:43:42 PDT 2019


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

            Bug ID: 42490
           Summary: Suboptimal LEA codegen
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Backend: X86
          Assignee: unassignedbugs at nondot.org
          Reporter: david.bolvansky at gmail.com
                CC: craig.topper at gmail.com, llvm-bugs at lists.llvm.org,
                    llvm-dev at redking.me.uk, spatel+llvm at rotateright.com

Haswell X86-64

int extra_lea(int *p, int xp) {
    *p = xp + 21;
    return *p * 2;
}

Clang -O3 trunk:

extra_lea(int*, int):                        # @extra_lea(int*, int)
        lea     eax, [rsi + 21]
        mov     dword ptr [rdi], eax
        lea     eax, [rsi + rsi]
        add     eax, 42
        ret

GCC -O3 trunk:
extra_lea(int*, int):
        lea     eax, [rsi+21]
        mov     DWORD PTR [rdi], eax
        add     eax, eax
        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/20190702/e1553b2a/attachment.html>


More information about the llvm-bugs mailing list