RFR: 8315066: Add unsigned bounds and known bits to TypeInt/Long [v3]
Quan Anh Mai
qamai at openjdk.org
Mon Nov 20 14:30:19 UTC 2023
On Thu, 19 Oct 2023 18:33:22 GMT, Quan Anh Mai <qamai at openjdk.org> wrote:
>> Hi,
>>
>> This patch adds unsigned bounds and known bits constraints to `TypeInt` and `TypeLong`. This opens more transformation opportunities in an elegant manner as well as helps avoid some ad-hoc rules in Hotspot. The new constraints are applied to identity and value calls of the common nodes (Add, Sub, L/R/URShift, And, Or, Xor, bit counting, Cmp, Bool, ConvI2L/L2I), the detailed ideas for each node will be presented below.
>>
>> In general, a `TypeInt/Long` represents a set of values `x` that satisfies: `x s>= lo && x s<= hi && x u>= ulo && x u<= uhi && (x & zeros) == 0 && (~x & ones) == 0`. These constraints are not independent, e.g. an int that lies in [0, 3] in signed domain must also lie in [0, 3] in unsigned domain and have all bits but the last 2 being unset. As a result, we must normalize the constraints (tighten the constraints so that they are optimal) before constructing a `TypeInt/Long` instance.
>>
>> Please kindly review, thanks very much.
>>
>> Testing
>>
>> - [x] GHA
>> - [x] Linux x64, tier 1-4
>
> Quan Anh Mai has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 25 commits:
>
> - improve add/sub implementation
> - Merge branch 'master' into improvevalue
> - typo
> - whitespace
> - fix tests for x86_32
> - fix widen of ConvI2L
> - problem lists
> - format
> - comment
> - use properly_contains
> - ... and 15 more: https://git.openjdk.org/jdk/compare/4c5b66dc...d2d96405
May someone take a look at this patch, please?
-------------
PR Comment: https://git.openjdk.org/jdk/pull/15440#issuecomment-1819166409
More information about the hotspot-compiler-dev
mailing list