RFR: 8315066: Add unsigned bounds and known bits to TypeInt/Long [v59]
Quan Anh Mai
qamai at openjdk.org
Fri May 2 16:42:13 UTC 2025
On Fri, 2 May 2025 16:29:59 GMT, Quan Anh Mai <qamai at openjdk.org> wrote:
>> The "no candidate" case should now have an argument why this is an ok value to return.
>> It does satisfy bits, since `ones` satisfy bits.
>> But do we know that `ones < lo`? We need that to get the "overflow" we promised at the very top of the method.
>
> You are diverting too much from the base assumption of this function. Formally, this function assumes that a result exists, which means that `i` exists, which leads to `tmp != 0`. The converse is also true, if `tmp != 0`, an index value `i` exists, which leads to a value not smaller than `lo` and satisfies `bits`. This implies that there does not exist one such value if and only if `tmp == 0`. In that case we know exactly that what we return satisfies bits. That's all we need to know in this section.
I changed the comment at the return point of this function to highlight this fact more clearly.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/17508#discussion_r2071877164
More information about the hotspot-compiler-dev
mailing list