RFR: 8315066: Add unsigned bounds and known bits to TypeInt/Long [v55]

Quan Anh Mai qamai at openjdk.org
Fri May 2 00:50:32 UTC 2025


On Thu, 1 May 2025 15:58:00 GMT, Emanuel Peter <epeter at openjdk.org> wrote:

>> src/hotspot/share/opto/type.cpp line 1848:
>> 
>>> 1846:     // The widen bits must be allowed to run freely through the graph.
>>> 1847:     return (new TypeInt(TypeIntPrototype<jint, juint>{{ft->_lo, ft->_hi}, {ft->_ulo, ft->_uhi}, ft->_bits},
>>> 1848:                         this->_widen, false))->hashcons();
>> 
>> Why not use `TypeInt::make`?
>
> Also: when do you have to do `hashcons` and when is it ok without?

> Why not use `TypeInt::make`?

Since we know that the bounds are canonical here, just use the constructor directly saves us the need to do canonicalization.

> Also: when do you have to do `hashcons` and when is it ok without?

We have to use `hashcons` everywhere except at `xdual`.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/17508#discussion_r2070967658


More information about the hotspot-compiler-dev mailing list