RFR: 8315066: Add unsigned bounds and known bits to TypeInt/Long [v53]
Quan Anh Mai
qamai at openjdk.org
Thu May 1 07:07:01 UTC 2025
On Thu, 1 May 2025 06:57:29 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
>
> src/hotspot/share/opto/rangeinference.cpp line 362:
>
>> 360: // if there is no bit up to first_violation that is 0 in both lo and zeros,
>> 361: // i.e. tmp == 0. In such cases, alignment == 0 && lo == bits._ones. It is
>> 362: // the only case when this function does not return a valid answer.
>
> Wow, that sounds like your algorithm is broken. Or is it still valid, it just overflows, and gets you a result smaller than `lo`, but that is actually expected?
It is the latter. From the overview, we can see that this function returns an invalid answer if and only if there exists no valid answer (no value not less than `lo` and satisfies `bits`). This clarifies further that in such cases, the algorithm will always return `bits._ones`.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/17508#discussion_r2069919824
More information about the hotspot-compiler-dev
mailing list