[LLVMdev] Loop unrolling opportunity in SPEC's libquantum with profile info

Nadav Rotem nrotem at apple.com
Wed Jan 15 17:30:53 PST 2014


Hi Diego! 

Thanks for looking at this!

> Chandler also pointed me at the vectorizer, which has its own
> unroller. However, the vectorizer only unrolls enough to serve the
> target, it's not as general as the runtime-triggered unroller. From
> what I've seen, it will get a maximum unroll factor of 2 on x86 (4 on
> avx targets). Additionally, the vectorizer only unrolls to aid
> reduction variables.

The vectorizer has a heuristics that is used to decide when to unroll.  One of the rules that the heuristics has is that reductions are profitable to unroll. The other rule is that small loops should also be unrolled.   

> When I forced the vectorizer to unroll these
> loops, the performance effects were nil.

Was the vectorizer successful in unrolling the loop in quantum_sigma_x?  I wonder if 'size’ is typically high or low. 

Thanks,
Nadav
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140115/bf23ce03/attachment.html>


More information about the llvm-dev mailing list