RFR: 8345067: C2: enable implicit null checks for ZGC reads [v3]

Emanuel Peter epeter at openjdk.org
Fri May 16 08:06:02 UTC 2025


On Fri, 16 May 2025 07:49:01 GMT, Roberto Castañeda Lozano <rcastanedalo at openjdk.org> wrote:

>> src/hotspot/share/opto/lcm.cpp line 80:
>> 
>>> 78: 
>>> 79: void PhaseCFG::move_node_and_its_projections_to_block(Node* n, Block* b) {
>>> 80:   assert(n->bottom_type() != Type::CONTROL, "cannot move control node");
>> 
>> I usually check `n->is_CFG()`.
>> 
>> What is the bottom type of an `IfNode`?
>> `virtual const Type *bottom_type() const { return TypeTuple::IFBOTH; }`
>> Are you aware of that?
>
> Note that the analysis operates at the Mach level, where `Node::is_CFG()` is not complete anymore and `If` nodes have been replaced by their platform-dependent implementations. I replaced the `n->bottom_type() != Type::CONTROL` test with `!PhaseCFG::is_CFG(n)`, which is analogous to `Node::is_CFG()` at the Mach level (and covers some additional nodes without control type that should not be moved anyway), see commit b92500a2.

Ah, makes sense, did not know that 😊 Thanks for the update!

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

PR Review Comment: https://git.openjdk.org/jdk/pull/25066#discussion_r2092546157


More information about the hotspot-gc-dev mailing list