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

Roberto Castañeda Lozano rcastanedalo at openjdk.org
Tue May 13 16:17:59 UTC 2025


On Thu, 8 May 2025 11:10:05 GMT, Emanuel Peter <epeter at openjdk.org> wrote:

>> src/hotspot/share/opto/lcm.cpp line 428:
>> 
>>> 426:         maybe_hoist_into(val->in(i), block);
>>> 427:       }
>>> 428:       move_into(val, block);
>> 
>> Suggestion:
>> 
>>         // Inputs of val may already be early enough, but if not move them together with val.
>>         ensure_node_is_at_block_or_before(val->in(i), block);
>>       }
>>       move_node_and_its_projections_to_block(val, block);
>
> It's a little hard to see here: did you just refactor this code, or make any changes?

I just refactored the code (extracted and generalized the logic into the `ensure_node_is_at_block_or_above` and `move_node_and_its_projections_to_block` primitives so that it can be reused by the new logic (dealing with `MachTemp` inputs) and also by other existing logic (hoisting the memory candidate and its flag-killing projections).

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

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


More information about the hotspot-gc-dev mailing list