RFR: 8327963: C2: fix construction of memory graph around Initialize node to prevent incorrect execution if allocation is removed [v12]

Dean Long dlong at openjdk.org
Fri Sep 12 22:44:26 UTC 2025


On Fri, 12 Sep 2025 07:26:20 GMT, Roland Westrelin <roland at openjdk.org> wrote:

>> src/hotspot/share/opto/loopTransform.cpp line 3992:
>> 
>>> 3990:   Node* frame = new ParmNode(C->start(), TypeFunc::FramePtr);
>>> 3991:   _igvn.register_new_node_with_optimizer(frame);
>>> 3992:   call->init_req(TypeFunc::FramePtr,  frame);
>> 
>> This seems unrelated.  Is it needed?
>
> It's one of the things mentioned in that comment:
> https://github.com/openjdk/jdk/pull/24570#issuecomment-2883651987
> 
> "I added asserts to catch cases where proj_out is called but the node has more than one matching projection. With those asserts, I caught some false positive/cases where we got lucky and worked around them by reworking the code so it doesn't use proj_out. That's the case in PhaseIdealLoop::intrinsify_fill(): we can end up there with more than one FramePtr projection because the code pattern used elsewhere is to add one more projection and let identical projections common during igvn. "

Are we just lucky that we don't have the same problem with ReturnAdr here?

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

PR Review Comment: https://git.openjdk.org/jdk/pull/24570#discussion_r2345548490


More information about the hotspot-compiler-dev mailing list