RFR: 8349563: Improve AbsNode::Value() for integer types [v2]
Jasmine Karthikeyan
jkarthikeyan at openjdk.org
Mon May 12 02:35:53 UTC 2025
On Wed, 2 Apr 2025 14:48:20 GMT, Jasmine Karthikeyan <jkarthikeyan at openjdk.org> wrote:
>> Hi all,
>> This is a small patch that improves the implementation of Value() for `AbsINode` and `AbsLNode` by returning the absolute value of the input range. Most of the logic is trivial except for the special case where `_lo == jint_min/jlong_min` which must return the entire type range when encountered, for which I've added a small proof in the comments. I've also added some unit tests and updated the file to limit IR check platforms with more granularity.
>>
>> Thoughts and reviews would be appreciated!
>
> Jasmine Karthikeyan has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains two commits:
>
> - Merge
> - Improve AbsNode::Value
Thank you all for the comments! I've pushed an update that refactors the method to check for `min_value` ahead of doing abs, so that we can safely use `ABS()` instead of `uabs()`. I've refactored the behavior for constants to avoid using `uabs` there as well. A re-review would be appreciated!
-------------
PR Comment: https://git.openjdk.org/jdk/pull/23685#issuecomment-2870549896
More information about the hotspot-compiler-dev
mailing list