[llvm-bugs] [Bug 52052] New: [X86] Failure to optimize out function prologue/epilogue in certain vector cases even though function body is empty

via llvm-bugs llvm-bugs at lists.llvm.org
Sun Oct 3 10:37:16 PDT 2021


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

            Bug ID: 52052
           Summary: [X86] Failure to optimize out function
                    prologue/epilogue in certain vector cases even though
                    function body is empty
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Backend: X86
          Assignee: unassignedbugs at nondot.org
          Reporter: gabravier at gmail.com
                CC: craig.topper at gmail.com, llvm-bugs at lists.llvm.org,
                    llvm-dev at redking.me.uk, pengfei.wang at intel.com,
                    spatel+llvm at rotateright.com

typedef unsigned __int128 D __attribute__((vector_size(32)));

void foo(D b)
{
}

With -O3, LLVM outputs this:

foo(unsigned __int128 __vector(2)):
        push    rbp
        mov     rbp, rsp
        and     rsp, -32
        mov     rsp, rbp
        pop     rbp
        ret

GCC outputs this:

foo(unsigned __int128 __vector(2)):
        ret

It seems obvious to me that GCC's code generation is better here.

-- 
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/20211003/8fc31e36/attachment-0001.html>


More information about the llvm-bugs mailing list