RFR: JDK-8308994: C2: Re-implement experimental post loop vectorization
Emanuel Peter
epeter at openjdk.org
Fri Jun 23 09:51:03 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/loopnode.cpp line 2280:
> 2278: if (!stride_is_con()) {
> 2279: // Stride could be non-constant if a loop is vector masked
> 2280: return 0;
Could this break the assumption anywhere else that `stride_con != 0`?
I fear that it may just silently succeed everywhere, or do checks like:
if (stride_con() > 0) {
// assume positive
} else {
// assume negative (now wrong!)
}
Might it be better to have an assert here, and do the `stride_is_con` checks at the call sites of `stride_con`?
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/14581#discussion_r1239617763
More information about the hotspot-compiler-dev
mailing list