RFR: 8308994: C2: Re-implement experimental post loop vectorization [v2]

Pengfei Li pli at openjdk.org
Tue Jul 4 02:22:23 UTC 2023


On Tue, 27 Jun 2023 17:34:42 GMT, Emanuel Peter <epeter at openjdk.org> wrote:

>> Pengfei Li has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Address part of comments from Emanuel
>
> src/hotspot/share/opto/vmaskloop.cpp line 735:
> 
>> 733:           vnode = new StoreVectorMaskedNode(ctrl, mem, addr, val, at, mask);
>> 734:         }
>> 735:       } else if (VectorNode::is_convert_opcode(opc)) {
> 
> Ok, this does work for same size conversions:
> `./java -Xcomp -XX:-TieredCompilation -XX:+TraceNewVectors -XX:+TraceLoopOpts -XX:+UnlockExperimentalVMOptions -XX:+UseMaskedLoop -XX:+TraceMaskedLoop -XX:CompileCommand=compileonly,Test::test0 -XX:+TraceSuperWord Test.java`
> 
> public class Test {
>     static int RANGE = 1024;
> 
>     public static void main(String[] strArr) {
>         double a[] = new double[RANGE];
>         long b[] = new long[RANGE];
>         test0(a, b);
>     }
> 
>     static void test0(double[] a, long[] b) {
>         for (int i = 0; i < RANGE; i++) {
>             b[i] = (long)a[i];
>         }
>     }
> }
> 
> Good to see some conversion is possible. But if I replace double with float, I get `Vector element size does not match`. Can that limitation be lifted?

We tried to do that but found some obstacles (perhaps you are aware of).

> If you started implementing type conversion for different size types, you'd have to extract_lo/hi or pack the vectors. That would be an invasive change to the current implementation.

As you said in your overall feedback, conversions between types of different data sizes requires vector pack/unpack which has conflict with existing semantics of current C2 type conversion nodes. We are still considering how to do it. It would be good if you have better suggestions or can help us with this.

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

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


More information about the hotspot-compiler-dev mailing list