http://llvm.org/bugs/show_bug.cgi?id=12377

             Bug #: 12377
           Summary: Loop trip count not calculated.
           Product: libraries
           Version: trunk
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Loop Optimizer
        AssignedTo: unassignedb...@nondot.org
        ReportedBy: benny....@gmail.com
                CC: llvmbugs@cs.uiuc.edu
    Classification: Unclassified


>From GCC PR30730:

unsigned foo(unsigned int n)
{
  unsigned x = 0;;

  while (n > 10)
    {
      n -= 2;
      x++;
    }

  return x;
}

gcc turns this into the following, but clang -O3 doesn't

unsigned foo(unsigned int n) {
  if (n > 10)
    return ((n - 11)/2)+1;

  return 0;
}

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
LLVMbugs@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to