[llvm-dev] Loop unrolling parameters

Michael Zolotukhin via llvm-dev llvm-dev at lists.llvm.org
Wed Jul 6 13:33:43 PDT 2016

> On Jun 27, 2016, at 2:19 PM, Phil Tomson via llvm-dev <llvm-dev at lists.llvm.org> wrote:
> We've notice that when loops are unrolled there seems to be a limit of 64 subexpressions that can be assigned to registers. In our architecture we've got a lot more registers available than just 64. Is there some parameter we can change to the loop unroller that allows more subexpressions to be assigned to a number of registers beyond 64?
Hi Phil,

I’m not sure I understood your question correctly, but loop-unroller does have parameters that you can try. The most interesting and easy to use is probably ‘-unroll-threshold’. You can try
$ clang $YOUR_FLAGS -mllvm -unroll-threshold=500 test.c

With this parameter you can control how many loops get completely unrolled.

You also can find other flags to control loop-unrolling with the following command:
$ opt --help-hidden | grep unroll

Best regards,
> Phil
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev

More information about the llvm-dev mailing list