RFR: 8375653: C2: CmpUNode::sub is not monotonic [v2]
Quan Anh Mai
qamai at openjdk.org
Thu Jan 22 07:49:33 UTC 2026
On Thu, 22 Jan 2026 07:04:35 GMT, Emanuel Peter <epeter at openjdk.org> wrote:
> It would indeed be nice if eventually we refactored the code such that gtests are possible. Is that not generally the plan?
It is actually possible to do that with the `RangeInference` infrastructure. But unfortunately, it is unavailable in jdk26, and given it is simple and very similar to the existing `CmpINode::sub`, I think such need is less important.
> I was also wondering: do we already have some good IR tests for `compareUnsigned`? It would be a shame if this led to a performance regression just because we don't have the coverage.
Given this is a strict improvement, I don't think there can be any performance regression. If you look at the old code, it just tried to compute `_ulo` and `_uhi` and used them like we are having here.
> And: you should probably not just test `Integer.compareUnsigned`, but also `Long.compareUnsigned`, right?
Good catch, I have added another test for `Long`.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/29308#issuecomment-3783006696
More information about the hotspot-compiler-dev
mailing list