[LLVMbugs] [Bug 8593] New: loop-unroll and unroll-count options do not work unless loop-rotate option is passed

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Nov 11 22:41:01 PST 2010


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

           Summary: loop-unroll and unroll-count options do not work
                    unless loop-rotate option is passed
           Product: tools
           Version: 2.8
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: opt
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: xuanji at gmail.com
                CC: llvmbugs at cs.uiuc.edu


I compiled a simple program to llvm bitcode and attempted to use opt to unroll
the loop. I need to unroll loops 

#include <stdlib.h>

int main() {

  int a = 10;

  int i, count;
  for (i=0; i<a; i++)
    count += i;

  return count;

}

The command 
opt --loop-unroll --unroll-count 5 nl.bc 
does not unroll the loop wheares the command 
opt --loop-rotate --loop-unroll --unroll-count 5 nl.bc

does. Even in llvm-2.8/lib/Transforms/Utils/LoopUnroll.cpp there is a line
saying
// The loop-rotate pass can be helpful to avoid this in many cases.

LoopUnroll.cpp should be fixed so that the loop unrolling functionality works
on the loop in the program above.

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