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

Quan Anh Mai qamai at openjdk.org
Thu Jan 25 02:59:28 UTC 2024


On Wed, 24 Jan 2024 04:57:10 GMT, Jasmine Karthikeyan <jkarthikeyan at openjdk.org> wrote:

>> Quan Anh Mai has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   fix release build
>
> I took a quick look through the patch, this is really impressive :)
> 
> Early last year I had [an attempt at the same idea](https://github.com/openjdk/jdk/compare/master...jaskarth:jdk:bit-tracking) (extremely rough patch, sorry), where I went with the approach of using a 2-bit value for each bit position to represent `0`, `1`, `BOTTOM`, and `TOP`. My general idea was to create a boolean lattice so that the meet() and dual() operations were easier to implement, before I realized how difficult reasoning about multiple constraints in the meet and dual operations was. I think your idea of marking the dual makes more sense and is cleaner, especially with how the constraints interact.

@jaskarth Thanks for looking into this patch. I have tried not having an explicit `_dual` field but in the end it is too hard and cumbersome without any benefits so I end up with this approach. I will address your suggestions in the next iteration. Regarding `contains` vs `higher_equal`, it is mainly due to the fact that `contains` being a much cheaper operation while `higher_equal` will do a `meet` followed by a hash table indexing.

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

PR Comment: https://git.openjdk.org/jdk/pull/17508#issuecomment-1909262717


More information about the hotspot-compiler-dev mailing list