RFR: 8341976: C2: use_mem_state != load->find_exact_control(load->in(0)) assert failure [v5]

Christian Hagedorn chagedorn at openjdk.org
Mon Mar 24 12:08:25 UTC 2025


On Fri, 21 Mar 2025 14:46:35 GMT, Roland Westrelin <roland at openjdk.org> wrote:

>> src/hotspot/share/opto/macroArrayCopy.cpp line 826:
>> 
>>> 824:   }
>>> 825: 
>>> 826:   if (is_partial_array_copy) {
>> 
>> Why is this check no longer required?
>
> ` ArrayCopyNode::may_modify()` performs some pattern matching and needs to be in sync with the shape of the array copy once expanded. If that shape changes then ` ArrayCopyNode::may_modify()` needs to be adjusted. The code you points to was added when the shape of the expanded array copy was changed to avoid a complicated update to the pattern matching in ` ArrayCopyNode::may_modify()`. What I propose is to get rid of the pattern matching because it's fragile and to instead always use the trick from that change where the final `MemBarNode` is marked, so make it unconditional.

Makes sense, thanks for the explanation!

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

PR Review Comment: https://git.openjdk.org/jdk/pull/23465#discussion_r2010043557


More information about the hotspot-compiler-dev mailing list