RFR: 8346664: C2: Optimize mask check with constant offset [v10]

Matthias Ernst duke at openjdk.org
Thu Jan 30 19:30:53 UTC 2025


On Thu, 30 Jan 2025 15:21:52 GMT, Emanuel Peter <epeter at openjdk.org> wrote:

>> Matthias Ernst has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   expect vectorization of i|7 instead of i&7
>>   i&7 variant expect "= 0".
>
> test/hotspot/jtreg/compiler/vectorization/TestPopulateIndex.java line 123:
> 
>> 121:         }
>> 122:         checkResultExprWithIndex3();
>> 123:     }
> 
> I'm afraid this will now vectorize on some platforms and not on others:
> If the number of elements in the vector is <=8 then your optimization probably does not kick in, but with larger vectors, we would get `(i + 8) & 7` folded to `i & 7`, and only at this point does it not vectorize as expected...
> 
> In this case, I'm ok with just removing the IR rule. Splitting the IR rule is going to be a pain.
> 
> But let's leave a comment here that we might want to fix this in a future RFE.

Done.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/22856#discussion_r1936158044


More information about the hotspot-compiler-dev mailing list