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

Emanuel Peter epeter at openjdk.org
Fri Jan 31 06:15:54 UTC 2025


On Thu, 30 Jan 2025 19:14:13 GMT, Matthias Ernst <duke at openjdk.org> wrote:

>> Matthias Ernst has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   "should never vectorize" only holds for long[] input.
>
> test/hotspot/jtreg/compiler/vectorization/TestPopulateIndex.java line 84:
> 
>> 82:     public void exprWithIndex1() {
>> 83:         for (int i = 0; i < count; i++) {
>> 84:             dst[i] = src[i] * (i | 7);
> 
> This doesn't want to vectorize.

As @merykitty said, the issue is probably that we split the `OrI` through the `phi`, and that breaks the pattern matching. Remove the IR rule for now, and add a comment like this:

`// Does not vectorize, possibly because the OrI is pushed through the Phi, see also JDK-8348096.`

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

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


More information about the hotspot-compiler-dev mailing list