[llvm-bugs] [Bug 48508] New: Failure to optimize code converted to memset call into tail call

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Dec 14 14:50:58 PST 2020


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

            Bug ID: 48508
           Summary: Failure to optimize code converted to memset call into
                    tail call
           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 f(char *d, size_t c)
{
    while (c-- > 0)
        *d++ = 0;
}

This code can be optimized to using `memset`. It can also be further optimize
to optimize out the call to `memset` to a tail call. This transformation is
done by GCC, but not by LLVM.

Comparison here : https://godbolt.org/z/sjP8P8

-- 
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/20201214/f0fb7459/attachment.html>


More information about the llvm-bugs mailing list