[LLVMbugs] [Bug 1755] New: loop trip counts don't fully consider modulo arithmetic

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Mon Oct 29 14:30:12 PDT 2007


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

           Summary: loop trip counts don't fully consider modulo arithmetic
           Product: libraries
           Version: trunk
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: minor
          Priority: P2
         Component: Loop Optimizer
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: djg at cray.com
                CC: llvmbugs at cs.uiuc.edu


For this testcase:  void consume(unsigned);  void foo(unsigned a, unsigned b) {
  unsigned i;   for (i = a; i != b; ++i) {     consume(i);   } }  llvm-gcc
emits LLVM IR which doesn't record that the integer types are unsigned and that
modulo arithmetic is required. Both Loop::getTripCount and
ScalarEvolution::getIterationCount say that the tripcount is b-a (with
adjustments for quirkiness in the latter). This is correct when a <= b but is
not correct when a > b.


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