RFR: 8353551: C2: Constant folding for ReverseBytes nodes [v3]
Hannes Greule
hgreule at openjdk.org
Thu Apr 10 09:04:40 UTC 2025
On Wed, 9 Apr 2025 17:56:06 GMT, Vladimir Ivanov <vlivanov at openjdk.org> wrote:
>>> And I assume that should be a TypeNode then?
>>
>> Why do you think it benefits from becoming a `TypeNode`?
>>
>>> In that case, as ReverseBytes*Nodes are InvolutionNodes, would InvolutionNode need to be a TypeNode? Or can I use multiple inheritance?
>>
>> We try to avoid multiple inheritance in JVM and C2 doesn't use any AFAIK.
>>
>> Actually, I had an afterthought about `InvolutionNode` after approving it. It looks a bit weird to model "involution" property through inheritance. (Primarily, because it's hard to mix multiple properties.) Node flags would be a better fit IMO.
>
> For now, I suggest to just add a superclass`ReverseBytesNode` which extends `InvolutionNode` and place `Value` there.
@iwanowww I applied your suggestion now. Please let me know if this is good now.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/24382#discussion_r2036870081
More information about the hotspot-compiler-dev
mailing list