Loop unrolling of vector operations by JIT
Paul Sandoz
paul.sandoz at oracle.com
Tue May 14 15:41:55 UTC 2024
C2 can unroll loops with explicit vector operations using the Vector API. I don’t know the exact details but I presume if a loop is auto-vectorized the result can then be unrolled similarly as if explicit vector operations are present.
To compare you can switch off loop unrolling with the HotSpot option -XX:LoopUnrollLimit=0.
I have found that most of the benefit with explicit unrolling of vector operations is to break data dependencies e.g. when reducing/accumulating.
Paul.
> On May 13, 2024, at 11:39 PM, Andrii Lomakin <andrii0lomakin at gmail.com> wrote:
>
> Good day.
>
> Could you clarify what is the state of the loop unrolling optimization by JIT in the case of vector operations?
> Is it beneficial to do that manually?
>
> I obviously will make my benches, but knowledge of the general state in this area will certainly not harm me.
More information about the panama-dev
mailing list