[llvm-bugs] [Bug 45963] New: Failure to eliminate loop that only touches local variables in function that returns nothing

via llvm-bugs llvm-bugs at lists.llvm.org
Sun May 17 12:36:16 PDT 2020


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

            Bug ID: 45963
           Summary: Failure to eliminate loop that only touches local
                    variables in function that returns nothing
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Loop Optimizer
          Assignee: unassignedbugs at nondot.org
          Reporter: gabravier at gmail.com
                CC: llvm-bugs at lists.llvm.org

void f()
{
    unsigned char dest[100] = {};
    for (int j = 0; j < 1000000; j++)
        for (int i = 0; i < 100; i++)
            dest[i] = (dest[i] & 0) | (~dest[i]);
}

This can be optimized to doing nothing. With -O3, GCC does this transformation,
but LLVM does not.

-- 
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/20200517/c7baef15/attachment.html>


More information about the llvm-bugs mailing list