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

Emanuel Peter epeter at openjdk.org
Fri Jun 23 14:59:10 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 317:

> 315: 
> 316: // Find element basic type for each vectorization candidate node
> 317: bool VectorMaskedLoop::find_vector_element_types() {

This is very similar to `SuperWord::compute_vector_element_type`. It would be nice to extract it from both and have some shared utility, right?

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

> 361:           // Otherwise, use signed subword type or the statement's bottom type
> 362:           if (subword_stmt) {
> 363:             set_elem_bt(node, get_signed_subword_bt(stmt_bottom_type));

Why are you taking only the signed subword type, and not unsigned (eg for char you take short)?

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

PR Review Comment: https://git.openjdk.org/jdk/pull/14581#discussion_r1239921307
PR Review Comment: https://git.openjdk.org/jdk/pull/14581#discussion_r1239924175


More information about the hotspot-dev mailing list