[vectorIntrinsics+mask] RFR: 8273057: [vector] New VectorAPI "SelectiveStore"

Joshua Zhu jzhu at openjdk.java.net
Wed Sep 8 08:55:28 UTC 2021


On Tue, 7 Sep 2021 15:39:07 GMT, Jatin Bhateja <jbhateja at openjdk.org> wrote:

> > > In this use case its difficult to infer COMPRESSION through Auto-vectorizer though we made attempts in past to infer complex loop patterns for VNNI instruction.
> > 
> > Could you elaborate on it please? I do not follow this.
> 
> I meant auto-vectorizing following loop which mimic compression semantics could be tricky if its difficult to ascertain the independence between memory references. Like in following case 'j' could be a middle index in array and thus if the distance between memory references is less than chosen vector width it may result into incorrect overwrite.
> 
> ```
> for ( int i = 0; i < n ; i++ ) {
>     if ( mask[i] > 1 ) {
>          a[j++] = a[i];
>      }
> }
> ```

Agree. I think current SWPointer compare (used to detect possible same address) does not apply to this pattern.
In this case, besides SWPointer comparison, "j" cannot be inferred by induction varaible "i" is more critical for auto-vectorization.

Do you have plan to support masked operations in SLP optimization?

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

PR: https://git.openjdk.java.net/panama-vector/pull/115


More information about the panama-dev mailing list