RFR: 8276162: Optimise unsigned comparison pattern [v4]
Tobias Hartmann
thartmann at openjdk.java.net
Tue Nov 16 12:54:40 UTC 2021
On Sat, 13 Nov 2021 05:22:07 GMT, Mai Đặng Quân Anh <duke at openjdk.java.net> wrote:
>> This patch changes operations in the form `x +- Integer.MIN_VALUE <=> y +- Integer.MIN_VALUE`, which is a pattern used to do unsigned comparisons, into `x u<=> y`.
>>
>> In addition to being basic operations, they may be utilised to implement range checks such as the methods in `jdk.internal.util.Preconditions`, or in places where the compiler cannot deduce the non-negativeness of the bound as in `java.util.ArrayList`.
>>
>> Thank you very much.
>
> Mai Đặng Quân Anh has updated the pull request incrementally with two additional commits since the last revision:
>
> - add tests cover constant comparison and calling library
> - add eq/ne, add correction test, refine micro
Nice IR verification test. Your changes look good to me and all testing passed.
-------------
Marked as reviewed by thartmann (Reviewer).
PR: https://git.openjdk.java.net/jdk/pull/6101
More information about the hotspot-compiler-dev
mailing list