RFR: 8349563: Improve AbsNode::Value() for integer types

Jasmine Karthikeyan jkarthikeyan at openjdk.org
Wed Feb 19 05:14:31 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!

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

Commit messages:
 - Improve AbsNode::Value

Changes: https://git.openjdk.org/jdk/pull/23685/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=23685&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8349563
  Stats: 145 lines in 2 files changed: 136 ins; 0 del; 9 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