RFR: 8349563: Improve AbsNode::Value() for integer types [v3]

Jasmine Karthikeyan jkarthikeyan at openjdk.org
Mon May 12 02:35:50 UTC 2025


> 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 four commits:

 - Replace uabs usage with ABS
 - Merge branch 'master' into abs-value
 - Merge
 - Improve AbsNode::Value

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

Changes: https://git.openjdk.org/jdk/pull/23685/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=23685&range=02
  Stats: 155 lines in 2 files changed: 140 ins; 4 del; 11 mod
  Patch: https://git.openjdk.org/jdk/pull/23685.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/23685/head:pull/23685

PR: https://git.openjdk.org/jdk/pull/23685


More information about the hotspot-compiler-dev mailing list