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). ------------- Commit messages: - whitespaces - more - test & fix Changes: https://git.openjdk.org/valhalla/pull/2489/files Webrev: https://webrevs.openjdk.org/?repo=valhalla&pr=2489&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8385328 Stats: 113 lines in 4 files changed: 111 ins; 0 del; 2 mod Patch: https://git.openjdk.org/valhalla/pull/2489.diff Fetch: git fetch https://git.openjdk.org/valhalla.git pull/2489/head:pull/2489 PR: https://git.openjdk.org/valhalla/pull/2489
