RFR: 8322490: CastNode constructors accepts control node as input

Joshua Cao duke at openjdk.org
Thu Dec 21 00:54:55 UTC 2023


On Wed, 20 Dec 2023 07:41:44 GMT, Christian Hagedorn <chagedorn at openjdk.org> wrote:

>> src/hotspot/share/opto/castnode.cpp line 126:
>> 
>>> 124: }
>>> 125: 
>>> 126: Node* ConstraintCastNode::make_cast(int opcode, Node* c, Node* n, const Type* t, DependencyType dependency,
>> 
>> I'm wondering if this method is still worth keeping as it would simply replace a "new CastXXNode" line which is just as expressive/readable. As far as I can see, it's currently only used with statically known Opcodes. So, we could replace them.
>
> On a separate note and might be worth to do in this change as well, we have `ConstraintCastNode::make_cast_for_type()` and `ConstraintCastNode::make()`. The intent of the former is clear but the latter switches on the provided basic type. Maybe we can rename the latter to `make_cast_for_basic_type()` to better align it with `make_cast_for_type()`.

Agree that `make_cast` probably is not needed. And your renaming suggestion makes sense.

Can we have this in a separate PR? I generally prefer to keep PRs as small of a unit as possible.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/17162#discussion_r1433317682


More information about the hotspot-compiler-dev mailing list