RFR: 8367341: C2: apply KnownBits and unsigned bounds to And / Or operations
    Quan Anh Mai 
    qamai at openjdk.org
       
    Mon Oct  6 14:42:51 UTC 2025
    
    
  
On Mon, 6 Oct 2025 13:27:24 GMT, Hannes Greule <hgreule at openjdk.org> wrote:
> I'm not sure how "easily" we can really see the benefit in the example of the interval splitting, but I leave that to others to judge.
Without it, the simple inference function fails `AndLNodeIdealizationTest` because the current version also splits the analysis between the negative part and the non-negative part.
> I was just wondering, do you think it makes sense to move more such code into the RangeInference classes in future (e.g., for shift ops) or how we'll tell what to place where. From what it looks like the main reason currently is to use the TypeIntMirror classes for testability, which other node types definitely could benefit from as well.
Yes that is entirely my intention, that for example, we only need to implement `RangeInference::infer_left_shift` and the unittest can be a simple:
    class OpLeftShift;
    class InferLeftShift:
    TEST(opto, range_inference) {
      test_binary<OpLeftShift, InferLeftShift>();
    }
-------------
PR Comment: https://git.openjdk.org/jdk/pull/27618#issuecomment-3372049054
    
    
More information about the hotspot-compiler-dev
mailing list