RFR: 8350896: Integer/Long.compress gets wrong type from CompressBitsNode::Value [v9]

Emanuel Peter epeter at openjdk.org
Tue Jun 3 13:35:10 UTC 2025


On Tue, 3 Jun 2025 13:28:36 GMT, Emanuel Peter <epeter at openjdk.org> wrote:

>> Jatin Bhateja has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Fix aarch64 failure
>
> src/hotspot/share/opto/intrinsicnode.cpp line 241:
> 
>> 239:   jlong lo = bt == T_INT ? min_jint : min_jlong;
>> 240: 
>> 241:   if(mask_type->is_con() && mask_type->get_con_as_long(bt) != -1L) {
> 
> Now you removed the condition `mask_type->get_con_as_long(bt) != -1L`. Do you know why it was there in the first place?
> 
> It seems to me that if `mask_type->get_con_as_long(bt) == -1L`, then we can just return the type of `src`, right?

This is a bug-fix for `CompressBitsNode::Value`, but this change also has an effect on `ExpandBitsNode::Value`, and that makes me a little nervous. For example: do we have enough test coverage for `expand`? It seems we did not have enough tests for `compress`, so probably also not for `expand`...

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

PR Review Comment: https://git.openjdk.org/jdk/pull/23947#discussion_r2123824471


More information about the hotspot-compiler-dev mailing list