RFR: 8353551: C2: Constant folding for ReverseBytes nodes

Vladimir Ivanov vlivanov at openjdk.org
Tue Apr 8 01:32:25 UTC 2025


On Sun, 6 Apr 2025 13:40:30 GMT, Johannes Graham <duke at openjdk.org> wrote:

>> It wouldn't change much, but yes. Generally this is an example where #17508 shines, as the code could be generalized to just reverse the bytes of the KnownBits structure. Whether this PR waits until then or we refactor the code afterwards isn't that important to me.
>
> I didn’t intend to advocate for waiting for that PR. `try_cast` is tiny and could be added independently. I have just been looking for things that could generally help with unifying TypeInt/TypeLong implementations.

Personally, I'd prefer to see a unified generic version of `ReverseBytesNode::Value()` rather than multiple specializations (even templated ones).

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

PR Review Comment: https://git.openjdk.org/jdk/pull/24382#discussion_r2032232433


More information about the hotspot-compiler-dev mailing list