RFR: 8367341: C2: apply KnownBits and unsigned bounds to And / Or operations [v2]
    Emanuel Peter 
    epeter at openjdk.org
       
    Wed Oct 15 12:57:51 UTC 2025
    
    
  
On Wed, 15 Oct 2025 08:47:45 GMT, Quan Anh Mai <qamai at openjdk.org> wrote:
>> test/hotspot/gtest/opto/test_rangeinference.cpp line 449:
>> 
>>> 447:       if (all_instances<InputType>().size() < 100) {
>>> 448:         // This effectively covers the cases up to uintn_t<2>
>>> 449:         test_binary_instance_monotonicity_exhaustive(infer, input1, input2);
>> 
>> Wow, that's really not much. It's really only a "sign" bit and one "mantissa" bit. Would have been nice if we could have handled at least 3 bits. Is that prohibitively slow?
>
> Yes, testing the monotonicity for those is really slow since we traverse the set of all instances multiple times.
Do you know how slow exactly? Just a few seconds or more than that?
>> test/hotspot/gtest/opto/test_rangeinference.cpp line 524:
>> 
>>> 522:     samples[idx] = TypeIntMirror<S, U>{canonicalized_t._data._srange._lo, canonicalized_t._data._srange._hi,
>>> 523:                                        canonicalized_t._data._urange._lo, canonicalized_t._data._urange._hi,
>>> 524:                                        canonicalized_t._data._bits};
>> 
>> What about using a constructor that creates `TypeIntMirror` directly from a `TypeIntPrototype`? Maybe there is a reason that does not work?
>
> It is only done here so it is questionable whether making another constructor is beneficial. This is also a testing backdoor since we don't want to create a `TypeIntMirror` with arbitrary field values.
Ok, sounds good.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/27618#discussion_r2432457600
PR Review Comment: https://git.openjdk.org/jdk/pull/27618#discussion_r2432458541
    
    
More information about the hotspot-compiler-dev
mailing list