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

Emanuel Peter epeter at openjdk.org
Tue Nov 4 09:42:02 UTC 2025


On Thu, 30 Oct 2025 00:24:26 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 incrementally with one additional commit since the last revision:
> 
>   Add assertion for the helper in CTPComparator
>   
>   Co-authored-by: Emanuel Peter <emanuel.peter at oracle.com>

Still good :)

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

Marked as reviewed by epeter (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/27618#pullrequestreview-3415158637


More information about the hotspot-dev mailing list