RFR: 8353551: C2: Constant folding for ReverseBytes nodes [v2]
Hannes Greule
hgreule at openjdk.org
Tue Apr 8 08:15:56 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.
@j3graham I mainly want to avoid conflicts or duplicated solutions. I meant that after #17508 this code can be further generalized anyway, allowing to use the `try_cast` function then. This can obviously happen in a separate PR, if this one is integrated before.
@iwanowww I'm not sure if that's possible without more duplication. We need to choose the correct byteswap implementation depending on the node's type. Please let me know if I'm missing something.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/24382#discussion_r2032646418
More information about the hotspot-compiler-dev
mailing list