RFR: 8376220: C2: Refactor the logic to in MemNode::find_previous_store [v5]
Quan Anh Mai
qamai at openjdk.org
Sat Jan 31 15:51:09 UTC 2026
On Sat, 31 Jan 2026 15:43:57 GMT, Quan Anh Mai <qamai at openjdk.org> wrote:
>> src/hotspot/share/opto/memnode.cpp line 1910:
>>
>>> 1908: ctrl = ctrl->in(0);
>>> 1909: set_req(MemNode::Control,ctrl);
>>> 1910: return this;
>>
>> Is there a reason to return early in this changeset, or is it something that only makes sense in the context of the subsequent local EA changes? Same for the early return below and the IGVN recording at the end of the function.
>
> I think it is more readable. The variable `progress` is defined at the start, set only here and the following early return, then used all the way at the end of the function. It is better for comprehension to return right after making changes to the node.
For the recording to IGVN, this is because there are some transformations in this method that only happen during IGVN, and there is no guarantee that this node will be processed again by IGVN.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/29390#discussion_r2749691126
More information about the hotspot-compiler-dev
mailing list