RFR: 8367341: C2: apply KnownBits and unsigned bounds to And / Or operations
    Quan Anh Mai 
    qamai at openjdk.org
       
    Wed Oct 15 08:41:16 UTC 2025
    
    
  
On Mon, 13 Oct 2025 13:17:42 GMT, Emanuel Peter <epeter 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.
>
> test/hotspot/gtest/opto/test_rangeinference.cpp line 33:
> 
>> 31: #include <limits>
>> 32: #include <type_traits>
>> 33: #include <unordered_set>
> 
> I don't know the current state of code style guide: but are we allowed to use `std::unordered_set`?
I can't think of a better way, we have `HashTable` but it is terrible since the table size is fixed.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/27618#discussion_r2431640023
    
    
More information about the hotspot-compiler-dev
mailing list