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

Quan Anh Mai qamai at openjdk.org
Thu Sep 5 16:50:58 UTC 2024


On Thu, 5 Sep 2024 16:45:21 GMT, Quan Anh Mai <qamai at openjdk.org> wrote:

>> src/hotspot/share/opto/type.cpp line 1705:
>> 
>>> 1703: bool TypeInt::empty(void) const {
>>> 1704:   return false;
>>> 1705: }
>> 
>> I would like to see assert(_lo <= _hi) here since you unconditionally return `false`.
>
> `_lo <= _hi` (and other invariants) is checked in `verify_constraints` when creating the `TypeInt` instance.

The call:

https://github.com/openjdk/jdk/blob/5990628a8337b9040128857f34359b169326eb23/src/hotspot/share/opto/type.cpp#L1598

And the implementation:

https://github.com/openjdk/jdk/blob/5990628a8337b9040128857f34359b169326eb23/src/hotspot/share/opto/rangeinference.cpp#L358

Notice that `this->contains(_srange._lo)` implies that `_lo <= _hi`

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

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


More information about the hotspot-compiler-dev mailing list