RFR: 8367341: C2: apply KnownBits and unsigned bounds to And / Or operations [v5]

Quan Anh Mai qamai at openjdk.org
Wed Nov 12 10:37:11 UTC 2025


On Tue, 4 Nov 2025 10:09:07 GMT, Quan Anh Mai <qamai at openjdk.org> wrote:

>> Hi,
>> 
>> This PR improves the implementation of `AndNode/OrNode/XorNode::Value` by taking advantages of the additional information in `TypeInt`. The implementation is pretty straightforward. A clever trick is that by analyzing the negative and positive ranges of a `TypeInt` separately, we have better info for the leading bits. I also implement gtest unit tests to verify the correctness and monotonicity of the inference functions.
>> 
>> Please take a look and leave your reviews, thanks a lot.
>
> Quan Anh Mai has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains six commits:
> 
>  - Merge branch 'master' into andorxor
>  - Add assertion for the helper in CTPComparator
>    
>    Co-authored-by: Emanuel Peter <emanuel.peter at oracle.com>
>  - remove std::hash
>  - remove unordered_map, add some comments for all_instances_size
>  - Emanuel's reviews
>  - Improve Value inferences of And, Or, Xor and implement gtest for general Value inferences

May I have a second review, please?

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

PR Comment: https://git.openjdk.org/jdk/pull/27618#issuecomment-3521239764


More information about the hotspot-dev mailing list