RFR: JDK-8308994: C2: Re-implement experimental post loop vectorization

Emanuel Peter epeter at openjdk.org
Fri Jun 23 14:48:09 UTC 2023


On Wed, 21 Jun 2023 08:24:19 GMT, Pengfei Li <pli at openjdk.org> wrote:

> ## TL;DR
> 
> This patch completely re-implements C2's experimental post loop vectorization for better stability, maintainability and performance. Compared with the original implementation, this new implementation adds a standalone loop phase in C2's ideal loop phases and can vectorize more post loops. The original implementation and all code related to multi-versioned post loops are deleted in this patch. More details about this patch can be found in the document replied in this pull request.

src/hotspot/share/opto/vmaskloop.cpp line 223:

> 221:       return true;
> 222:     } else {
> 223:       trace_msg(in, "Found unsupported memory load input");

This is a bit generic. Would be nice to have more specific info why it is "unsupported". See my example that hit it.

src/hotspot/share/opto/vmaskloop.cpp line 548:

> 546:   // Check supported memory access via SWPointer. It's not supported if
> 547:   //  1) The constructed SWPointer is invalid
> 548:   //  2) Address is growing down (index scale * loop stride < 0)

Is that a limitation that could be removed in the future?

src/hotspot/share/opto/vmaskloop.cpp line 549:

> 547:   //  1) The constructed SWPointer is invalid
> 548:   //  2) Address is growing down (index scale * loop stride < 0)
> 549:   //  3) Memory access scale is different from data size

I guess this could also be relaxed for strided accesses in the future?

src/hotspot/share/opto/vmaskloop.cpp line 550:

> 548:   //  2) Address is growing down (index scale * loop stride < 0)
> 549:   //  3) Memory access scale is different from data size
> 550:   //  4) The loop increment node is on the SWPointer's node stack

Why should the `incr` not be on the node stack?

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/14581#discussion_r1239908943
PR Review Comment: https://git.openjdk.org/jdk/pull/14581#discussion_r1239911117
PR Review Comment: https://git.openjdk.org/jdk/pull/14581#discussion_r1239911846
PR Review Comment: https://git.openjdk.org/jdk/pull/14581#discussion_r1239910656


More information about the hotspot-dev mailing list