Loop unrolling of vector operations by JIT

Andrii Lomakin andrii0lomakin at gmail.com
Wed May 15 10:46:08 UTC 2024


Hi guys.
Thank you for your feedback. I appreciate it.

On Wed, May 15, 2024 at 11:07 AM Chris Hegarty <chegar999 at gmail.com> wrote:

> Hi,
>
> On 14/05/2024 16:41, Paul Sandoz wrote:
> > 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.
>
> This is exactly what we observe too, e.g.
>
>
> https://github.com/apache/lucene/blob/main/lucene/core/src/java21/org/apache/lucene/internal/vectorization/PanamaVectorUtilSupport.java#L124-L128
>
> -Chris.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/panama-dev/attachments/20240515/3ef92ecb/attachment.htm>


More information about the panama-dev mailing list