[LLVMbugs] [Bug 1597] New: scalar evolution can't handle unsigned exit conditions

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Sat Aug 4 11:27:11 PDT 2007


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

           Summary: scalar evolution can't handle unsigned exit conditions
           Product: libraries
           Version: trunk
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: Loop Optimizer
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: nicholas at mxc.ca
                CC: llvmbugs at cs.uiuc.edu


The program

  int f(int x, int y)
  {
    while (x < y) ++x;
    return x;
  }

gets optimized to one comparison to do check which is signed less-than and one
to return it. The same program with unsigned

  unsigned f(unsigned x, unsigned y)
  {
    while (x < y) ++x;
    return x;
  }

produces a full loop that scalar-evolution can't determine the bounds of.

The problem is that both ComputeIterationCount and HowManyLessThans only look
for SGT and SLT comparisons, ignoring UGT and ULT. I'm not clear on why, but
ComputeIterationCountExhaustively doesn't catch it either.


-- 
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.



More information about the llvm-bugs mailing list