On Fri, 29 May 2026 23:55:23 GMT, Dean Long <[email protected]> wrote:
>> The bug is caused by a mismatch in the way `LoadFlat` and `StoreFlat` >> are handled in `ConnectionGraph::find_inst_mem()` and >> `MemNode::optimize_simple_memory_chain()`. Once EA has run a first >> time, found some value array allocations as non escaping, and removed >> their `LoadFlat`/`StoreFlat`, igvn runs and is able to further >> transform the memory subgraph which introduces inconsistencies that >> are then caught the next time EA runs. >> >> The fix tries to make sure `ConnectionGraph::find_inst_mem()` and >> `MemNode::optimize_simple_memory_chain()` handle `LoadFlat` and >> `StoreFlat` similarly. >> >> --------- >> - [x] I confirm that I make this contribution in accordance with the >> [OpenJDK Interim AI Policy](https://openjdk.org/legal/ai). > > src/hotspot/share/opto/escape.cpp line 4616: > >> 4614: Node* base = proj_in->as_StoreFlat()->base(); >> 4615: const TypeOopPtr* t_store_base =igvn->type(base)->is_oopptr(); >> 4616: if (t_store_base->instance_id() != toop->instance_id()) { > > A comment explaining what is happening here would be helpful. Why does > StoreFlat need this check but LoadFlat does not? I added some comments. Do they look ok to you? ------------- PR Review Comment: https://git.openjdk.org/valhalla/pull/2489#discussion_r3335465232
