RFR: 8336702: C2 compilation fails with "all memory state should have been processed" assert [v2]
Tobias Hartmann
thartmann at openjdk.org
Wed Oct 2 10:44:39 UTC 2024
On Tue, 1 Oct 2024 09:40:14 GMT, Roland Westrelin <roland at openjdk.org> wrote:
>> src/hotspot/share/opto/loopnode.cpp line 708:
>>
>>> 706: for (MergeMemStream mms(mem->as_MergeMem()); mms.next_non_empty(); ) {
>>> 707: // Loop invariant memory state won't be reset by no_side_effect_since_safepoint(). Do it here.
>>> 708: // Escape Analysis can add state to mm that it doesn't add to the backedge memory Phis, breaking verification
>>
>> Where exactly does that happen in EA?
>
> When an allocation is non escaping and made scalar replaceable, new slices are allocated for the fields of the allocation and the memory graph is updated so allocation/stores/loads to the new slices are connected together. In the process, `MergeMem` nodes need to be updated as well. In this case, I'm not sure this particular `MergeMem` node needs to be updated by EA but it's harmless in any case. The verification code doesn't expect "more" state to be recorded at the safepoint because of the `MergeMem` than at the backedge.
Okay, thanks for the details!
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/21009#discussion_r1784285660
More information about the hotspot-compiler-dev
mailing list