RFR: 8370454: C2 SuperWord: unsigned comparison information is lost for VectorMaskCmp [v2]

Hamlin Li mli at openjdk.org
Thu Oct 23 10:16:41 UTC 2025


On Thu, 23 Oct 2025 05:38:01 GMT, Emanuel Peter <epeter at openjdk.org> wrote:

>> Hamlin Li has updated the pull request incrementally with two additional commits since the last revision:
>> 
>>  - tests
>>  - switch
>
> src/hotspot/share/opto/superword.cpp line 1751:
> 
>> 1749:     }
>> 1750:   } else if (is_unsigned) {
>> 1751:     mask = BoolTest::unsigned_mask(mask);
> 
> This means more cases could now vectorize. Do we have good test cases for this? We should be able to get IR tests for this, right? Do x86 or aarch64 backends (or other platforms) not already have vector instructions for this?

Good question!

At first, I think this pr is just a preparation for my other prs, but seems it's not just an improvement, it can also fix some existing issue, and this issue is not covered by existing compiler test.
I just found out that without this patch, there could failure when comparing unsigned int/long in SLP on x86, and I think the same issue should also exist on arm.
I'll add extra test to reflect this.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/27942#discussion_r2454610981


More information about the hotspot-compiler-dev mailing list