[vectorIntrinsics+mask] RFR: 8273057: [vector] New VectorAPI "SelectiveStore"
Jatin Bhateja
jbhateja at openjdk.java.net
Thu Sep 9 06:43:13 UTC 2021
On Wed, 8 Sep 2021 08:51:53 GMT, Joshua Zhu <jzhu 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.
A PhiNode will be created for j for sure, and it's indeed an induction variable since with each iteration its value is getting incremented. Yes, its not a secondary induction variable in this case and which makes any dependency analysis between array references indexed by different subscripts 'i' or 'j' difficult.
>
> Do you have plan to support masked operations in SLP optimization?
Given that SLP algorithm does not works across basic blocks a simplified approach will be to add ideal transformation post SLP to replace VectorBlend + VectorOperation to a masked operation where ever applicable
-------------
PR: https://git.openjdk.java.net/panama-vector/pull/115
More information about the panama-dev
mailing list