Problem About LoopUnroll

Hello, everyone.
I have a problem about LoopUnroll: I want to do analysis and transformation on LLVM IR,
so I defined a PassManager, and add some Passes to it. I use a LoopUnrollPass likes blow:

Pass Manager Passes;

The problem is that when I test it using a loop program(compiled it to a *.bc file) it
didn’t uroll. Why? The createLoopUnrollPass defined as blow:

Pass *llvm::createLoopUnrollPass(int Threshold, int Count, int AllowPartial, int Runtime);

If I want to uroll a loop fixed number: 3 times, how to set the four parameters?


–Wang Lei(BeiJing University of Posts and Telecommunications)

You can probably turn on debug information of unroll pass and see why your loop is not getting unrolled.

Try to refer unroll pass options, you may find it useful.