RFR: 8329273: C2 SuperWord: Some basic MemorySegment IR tests [v2]

Emanuel Peter epeter at openjdk.org
Mon May 13 07:30:10 UTC 2024


On Mon, 13 May 2024 06:39:05 GMT, Christian Hagedorn <chagedorn at openjdk.org> wrote:

>> Emanuel Peter has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains 25 additional commits since the last revision:
>> 
>>  - Merge branch 'master' into JDK-8329273-memory-segment-ir-tests
>>  - fix tabs
>>  - speed up test
>>  - small cosmetic fix
>>  - make things static
>>  - long loop tests
>>  - handle AlignVector
>>  - int cases
>>  - int-index case
>>  - disable mixed tests
>>  - ... and 15 more: https://git.openjdk.org/jdk/compare/06854a6b...6f760dfd
>
> test/hotspot/jtreg/compiler/loopopts/superword/TestMemorySegment.java line 166:
> 
>> 164:         String providerName = System.getProperty("memorySegmentProviderNameForTestVM");
>> 165:         provider = switch (providerName) {
>> 166:             case "ByteArray"        -> ( () -> { return newMemorySegmentOfByteArray(); } );
> 
> You can directly use an expression lambda without return: 
> 
> case "ByteArray"        -> (() -> newMemorySegmentOfByteArray());
> 
> But I think you can go even further and directly use a method reference:
> Suggestion:
> 
>             case "ByteArray"        -> (TestMemorySegmentImpl::newMemorySegmentOfByteArray);
> 
> Same for others.

Oh, great idea!

> test/hotspot/jtreg/compiler/loopopts/superword/TestMemorySegment.java line 181:
> 
>> 179:             default -> throw new RuntimeException("Test argument not recognized: " + providerName);
>> 180:         };
>> 181:     }
> 
> As discussed offline, this is an interesting workaround. Maybe the IR framework could be extended at some point to simplify this.

That would be nice!

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

PR Review Comment: https://git.openjdk.org/jdk/pull/18535#discussion_r1597996513
PR Review Comment: https://git.openjdk.org/jdk/pull/18535#discussion_r1597996770


More information about the hotspot-compiler-dev mailing list