[LLVMdev] Loop Unroll a constant number of times?

Andrew Trick atrick at apple.com
Wed Feb 1 08:38:38 PST 2012

On Jan 31, 2012, at 5:16 PM, Ryan Taylor <ryta1203 at gmail.com> wrote:

> Is it possible to unroll a loop (forcibly if necessary) with llvm (possibly the -loop-unroll pass) a constant number of times. 
> I believe that I read that the -unroll-count=x option was removed, correct? So is there some other way to do this or is this just not possible in llvm?

See clang -mllvm -help-hidden. If that doesn't work, llc -help-hidden.

Probably want something like -mllvm -unroll-runtime -mllvm -unroll-count=N. 

As with any experimental options, look at the source, and -mllvm -debug-only=loop-unroll output to understand what it's doing. 


More information about the llvm-dev mailing list