[LLVMdev] Problem About LoopUnroll

Lei Wang wangcppclei at gmail.com
Mon Jun 15 00:28:43 PDT 2015


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;
>>Passes.add(...)
>>Passes.add(createLoopUnrollPass(-1,-1,-1,-1));
>>...
>>Passes.run(*module);
>>WriteBitcodeToFile(...)

 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?

Thanks.

--Wang Lei(BeiJing University of Posts and Telecommunications)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150615/0407e555/attachment.html>


More information about the llvm-dev mailing list