RFR: 8315066: Add unsigned bounds and known bits to TypeInt/Long [v53]
Quan Anh Mai
qamai at openjdk.org
Thu May 1 10:48:44 UTC 2025
On Thu, 1 May 2025 07:34:22 GMT, Emanuel Peter <epeter at openjdk.org> wrote:
>> Quan Anh Mai has updated the pull request incrementally with two additional commits since the last revision:
>>
>> - wording
>> - grammar, more details for non-existence
>
> Can you do the analogue with the else (one violation) case?
> That one is probably a bit harder, but I have faith in you ;)
@eme64 I have addressed all of your comments.
> src/hotspot/share/opto/rangeinference.cpp line 443:
>
>> 441: template <class U>
>> 442: static AdjustResult<KnownBits<U>>
>> 443: adjust_bits_from_bounds(const KnownBits<U>& bits, const RangeInt<U>& bounds) {
>
> Ok, so this only deals with the unsigned bounds. Is there an analogue for the signed bits?
> Ah, you could make the name more precise.
> Suggestion:
>
> template <class U>
> static AdjustResult<KnownBits<U>>
> adjust_bits_from_unsigned_bounds(const KnownBits<U>& bits, const RangeInt<U>& bounds) {
>
> Hmm, maybe you only deal with simple intervals, and there the signed and unsigned bounds end up giving you the equivalent info... is this correct?
Conceptually, these deal with unsigned bounds, I thought that would be obvious from the type of `bounds`, but I have changed the name of this function to `unsigned_bounds` to be clearer.
> src/hotspot/share/opto/rangeinference.cpp line 456:
>
>> 454: U new_ones = bits._ones | (match_mask & bounds._lo);
>> 455: bool progress = (new_zeros != bits._zeros) || (new_ones != bits._ones);
>> 456: bool present = ((new_zeros & new_ones) == U(0));
>
> Hmm. It sounds like `present` could also be named `is_non_empty`?
I think that there is no difference.
> src/hotspot/share/opto/rangeinference.cpp line 466:
>
>> 464: // not be larger than 64.
>> 465: // This function is called simple because it deals with a simple intervals (see
>> 466: // TypeInt at type.hpp).
>
> Could we somehow assert that the input bounds are indeed a simple interval?
Done, we can assert that the highest bits of them are the same.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/17508#issuecomment-2844629691
PR Review Comment: https://git.openjdk.org/jdk/pull/17508#discussion_r2070137714
PR Review Comment: https://git.openjdk.org/jdk/pull/17508#discussion_r2070144032
PR Review Comment: https://git.openjdk.org/jdk/pull/17508#discussion_r2070138294
More information about the hotspot-compiler-dev
mailing list