RFR: 8349523: Unused runtime calls to drem/frem should be removed [v5]

Vladimir Kozlov kvn at openjdk.org
Thu Feb 27 17:36:11 UTC 2025


On Tue, 25 Feb 2025 21:13:36 GMT, Marc Chevalier <duke at openjdk.org> wrote:

>> Remove frem and drem macros nodes when the result is not used. These nodes have other outputs (like memory), which is not meaningful, but preventing them to be dropped so easily. This patch removes the useless frem/drem nodes, and by rewiring the inputs to the outputs.
>> 
>> Thanks,
>> Marc
>
> Marc Chevalier has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Factor testing whether a node is a data proj of a pure function

Good.

src/hotspot/share/opto/node.cpp line 2952:

> 2950: // the local in the caller.
> 2951: bool Node::is_data_proj_of_pure_function(const Node* maybe_pure_function) const {
> 2952:   return Opcode() == Op_Proj && static_cast<const ProjNode*>(this)->_con == TypeFunc::Parms && maybe_pure_function->is_pure_function();

I wish we had an other Node's accessor to check exact class to avoid calling `Opcode()` which is virtual.
Currently `is_Proj()` will be `true` for all subclasses too and we don't want it here (and in some other places).

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

Marked as reviewed by kvn (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/23694#pullrequestreview-2648569878
PR Review Comment: https://git.openjdk.org/jdk/pull/23694#discussion_r1974052823


More information about the hotspot-compiler-dev mailing list