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: [email protected]
        ReportedBy: [email protected]
                CC: [email protected]


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.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to