[llvm-bugs] [Bug 45968] New: Failure to optimize generated tail call to memset

via llvm-bugs llvm-bugs at lists.llvm.org
Mon May 18 00:51:25 PDT 2020


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

            Bug ID: 45968
           Summary: Failure to optimize generated tail call to memset
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Scalar Optimizations
          Assignee: unassignedbugs at nondot.org
          Reporter: gabravier at gmail.com
                CC: llvm-bugs at lists.llvm.org

void test(char *A)
{
    for (int i = 0; i < 10000; ++i)
        A[i] = 0;
}

With -O3, LLVM generates this :

test(char*):
  push rax
  mov edx, 10000
  xor esi, esi
  call memset
  pop rax
  ret

GCC manages to generate this :

test(char*):
  mov edx, 10000
  xor esi, esi
  jmp memset

-- 
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/20200518/0718e339/attachment.html>


More information about the llvm-bugs mailing list