[LLVMdev] Problem About LoopUnroll

Nema, Ashutosh Ashutosh.Nema at amd.com
Mon Jun 15 02:10:51 PDT 2015


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.

Regards,
Ashutosh

From: llvmdev-bounces at cs.uiuc.edu [mailto:llvmdev-bounces at cs.uiuc.edu] On Behalf Of Lei Wang
Sent: Monday, June 15, 2015 12:59 PM
To: llvmdev at cs.uiuc.edu
Subject: [LLVMdev] 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;
>>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/853f6f86/attachment.html>


More information about the llvm-dev mailing list