RFR: 8320649: C2: Optimize scoped values [v4]

Emanuel Peter epeter at openjdk.org
Thu Apr 18 12:31:20 UTC 2024


On Tue, 30 Jan 2024 09:22:08 GMT, Roland Westrelin <roland at openjdk.org> wrote:

>> src/hotspot/share/opto/node.cpp line 977:
>> 
>>> 975: }
>>> 976: 
>>> 977: Node* Node::find_unique_out_with(int opcode) const {
>> 
>> Random idea:
>> Would it not be nice if this method automatically casted the node to that node-class?
>> Suggestions:
>> - using templates: give the class name and the opcode. A bit annoying to use
>> - using macros: give it the node-type name: i.e. `Add` for `AddNode`. The macro then uses the template, filling in `AddNode` and `Op_Add`. What do you think?
>
> Yes, it would but that out of scope for this PR.

Automatic cast would be really nice.
I mean you could do it in a separate prior PR. But I think now it is a bit nasty with the extra cast you require at the use-site.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/16966#discussion_r1570439734


More information about the hotspot-compiler-dev mailing list