[llvm-bugs] [Bug 52054] New: Failure to optimize out simple incrementation loop

via llvm-bugs llvm-bugs at lists.llvm.org
Sun Oct 3 12:52:02 PDT 2021


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

            Bug ID: 52054
           Summary: Failure to optimize out simple incrementation loop
           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

int foo()
{
  int u;
  for (int i = 0; i < 510; i++)
    u = i;
  return u;
}

This can be optimized to `return 509;`. GCC does this optimization, 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/20211003/83e772ae/attachment.html>


More information about the llvm-bugs mailing list