RFR: 8342095: Add autovectorizer support for subword vector casts [v15]
Emanuel Peter
epeter at openjdk.org
Fri Jan 23 09:23:53 UTC 2026
On Fri, 23 Jan 2026 08:54:37 GMT, Emanuel Peter <epeter at openjdk.org> wrote:
>> Jasmine Karthikeyan has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 19 commits:
>>
>> - Fix whitespace
>> - Update tests after merge, apply changes from review
>> - Merge from master
>> - Update tests, cleanup logic
>> - Merge branch 'master' into vectorize-subword
>> - Check for AVX2 for byte/long conversions
>> - Whitespace and benchmark tweak
>> - Address more comments, make test and benchmark more exhaustive
>> - Merge from master
>> - Fix copyright after merge
>> - ... and 9 more: https://git.openjdk.org/jdk/compare/de6f35ef...13378368
>
> test/hotspot/jtreg/compiler/loopopts/superword/TestReductions.java line 464:
>
>> 462: applyIf = {"AutoVectorizationOverrideProfitability", "> 0"})
>> 463: @IR(failOn = IRNode.LOAD_VECTOR_B,
>> 464: applyIf = {"AutoVectorizationOverrideProfitability", "= 0"})
>
> Wow, I think I had not noticed this before! This is actually a great win already. Though we could still do better by not casting to int, and rather staying in byte.
>
> I now filed
> [JDK-8376176](https://bugs.openjdk.org/browse/JDK-8376176): C2 SuperWord: implement/improve subword reductions
Related:
[JDK-8376179](https://bugs.openjdk.org/browse/JDK-8376179): C2 SuperWord: improve subword vectorization, avoid cast to-and-from int
> test/hotspot/jtreg/compiler/vectorization/TestSubwordTruncation.java line 77:
>
>> 75: @Test
>> 76: @IR(counts = { IRNode.LOAD_VECTOR_S, IRNode.VECTOR_SIZE + "min(max_int, max_short)", "> 0" },
>> 77: applyIfCPUFeatureOr = { "avx2", "true", "asimd", "true" })
>
> And how about here? Could we optimize and remove the casts?
Filed:
[JDK-8376179](https://bugs.openjdk.org/browse/JDK-8376179): C2 SuperWord: improve subword vectorization, avoid cast to-and-from int
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/23413#discussion_r2720383260
PR Review Comment: https://git.openjdk.org/jdk/pull/23413#discussion_r2720381664
More information about the hotspot-compiler-dev
mailing list