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

Emanuel Peter epeter at openjdk.org
Fri Sep 12 13:21:41 UTC 2025


On Wed, 10 Sep 2025 21:39:02 GMT, Vladimir Ivanov <vlivanov at openjdk.org> wrote:

>> Ah, you could mention that later `ReachabilityFenceNode::Identity` removes the rf.
>
>> Is this rf guaranteed to belong to the Allocation somehow?
> 
> I don't get your question. The code iterates over users of an allocation which is being eliminated.  Semantically, RF is a no-op on a scalarizable referent and has to be removed in order to let the scalarization happen.
> 
>> Ah, you could mention that later ReachabilityFenceNode::Identity removes the rf.
> 
> Done.

But are we sure that the `ReachabilityFence` really belongs to the `Allocation` that is eliminated?
Can we check if the referent matches?
Because what if there are multiple allocations:

x = allocation;
y = allocation; // -> eliminate
ReachabilityFence(x); // is only ctrl use of Allocation for y, but belongs to Allocation of x.

Could there be such cases?

@iwanowww

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

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


More information about the hotspot-compiler-dev mailing list