RFR: 8290892: C2: Intrinsify Reference.reachabilityFence [v22]

Vladimir Ivanov vlivanov at openjdk.org
Sat Nov 8 00:39:15 UTC 2025


On Fri, 7 Nov 2025 10:06:17 GMT, Emanuel Peter <epeter at openjdk.org> wrote:

> Can you say why until after loop opts are over only RF are considered?

It is intended to ensure a RF is superseded by another RF. We can't guarantee that non-RF users won't go away any time before loop opts are over, so there won't be anything keeping the referent alive. 

But now I don't see why a similar problem doesn't affect RFs as well. While RFs don't go away on their own, they can be pruned as part of dead code elimination.

I'll rethink how RF redundancy is defined.

> How does this play with allocation elimination etc? 

This method works on RF nodes and, hence, it is applicable until RF nodes are eliminated after loop opts are over. 

RF nodes are ignored during scalarization attempts, so are reachability edges. When an allocation is scalarized, either all RFs having it as a referent or all of it's reachability edges are removed.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/25315#discussion_r2505914924


More information about the hotspot-compiler-dev mailing list