RFR: 8315066: Add unsigned bounds and known bits to TypeInt/Long [v32]

Quan Anh Mai qamai at openjdk.org
Mon Jan 27 17:03:54 UTC 2025


On Mon, 27 Jan 2025 16:55:11 GMT, Quan Anh Mai <qamai at openjdk.org> wrote:

>> src/hotspot/share/opto/rangeinference.hpp line 162:
>> 
>>> 160:     return super->_lo <= sub->_lo && super->_hi >= sub->_hi &&
>>> 161:            super->_ulo <= sub->_ulo && super->_uhi >= sub->_uhi &&
>>> 162:            (super->_bits._zeros &~ sub->_bits._zeros) == 0 && (super->_bits._ones &~ sub->_bits._ones) == 0;
>> 
>> Can you add a comment here what this does? Because it looks like a `&~` operator :)
>> 
>> I also wonder if it would make sense to delegate the `_bits` checks to its own class, for `equal` and `subset`.
>
> Yes it is indeed a `&~` operator because it is a set subtraction operation on the bitsets.

> I also wonder if it would make sense to delegate the _bits checks to its own class, for equal and subset.

These are one liner and only used here so I don't think moving it away will improve readability.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/17508#discussion_r1930861783


More information about the hotspot-compiler-dev mailing list