RFR: 8315066: Add unsigned bounds and known bits to TypeInt/Long [v22]
Quan Anh Mai
qamai at openjdk.org
Fri Sep 20 15:44:04 UTC 2024
On Thu, 19 Sep 2024 18:37:22 GMT, Emanuel Peter <epeter at openjdk.org> wrote:
>> Quan Anh Mai has updated the pull request incrementally with one additional commit since the last revision:
>>
>> formality
>
> src/hotspot/share/opto/rangeinference.cpp line 65:
>
>> 63: };
>> 64:
>> 65: // Find the minimum value that is not less than lo and satisfies bits.
>
> What happens if this is impossible? Imagine lo is `max_uint = FFFFFFFF`, but the known bits know that some specific bit must be zero? Or is there some guarantee that this will never happen? Can we have an assert for that?
It will overflow and return `bits._ones` which will `< lo`. I have added that to the function comment and more asserts to ensure that is correct.
> src/hotspot/share/opto/rangeinference.cpp line 90:
>
>> 88: }
>> 89:
>> 90: /*
>
> Everywhere else you use `//`, and that seems to be generally our style, so I'd keep it consistent ;)
>From https://github.com/openjdk/jdk/pull/9947, I learnt that for such a long paragraph with dense mathematics, reducing `//` noise would make reading it easier.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/17508#discussion_r1768831332
PR Review Comment: https://git.openjdk.org/jdk/pull/17508#discussion_r1768830185
More information about the hotspot-compiler-dev
mailing list