RFR: 8351414: C2: MergeStores must happen after RangeCheck smearing
Christian Hagedorn
chagedorn at openjdk.org
Mon Mar 10 13:47:58 UTC 2025
On Fri, 7 Mar 2025 15:07:37 GMT, Emanuel Peter <epeter at openjdk.org> wrote:
> With [JDK-8348959](https://bugs.openjdk.org/browse/JDK-8348959) we see that there can be some issues when RangeCheck smearing happens in the same IGVN phase as MergeStores. It means that some RangeChecks are still around as we do MergeStores, and then we cannot merge as many stores as we would like. We should ensure that RangeCheck smearing happens during post-loop-opts, and then MergeStores happens in a separate dedicated IGVN round afterwards.
Looks good!
src/hotspot/share/opto/compile.cpp line 1904:
> 1902: // StoreI [ StoreL ] StoreI
> 1903: // But now it would have been better to do this instead:
> 1904: // [ StoreL ] [ StoreL ]
Maybe you also can add a note here that RC smearing is not limited to just this one IGVN phase but that it's done in all subsequent IGVN phases (since we don't unset `_merge_stores_phase`).
-------------
Marked as reviewed by chagedorn (Reviewer).
PR Review: https://git.openjdk.org/jdk/pull/23944#pullrequestreview-2671009124
PR Review Comment: https://git.openjdk.org/jdk/pull/23944#discussion_r1987316597
More information about the hotspot-compiler-dev
mailing list