RFR: 8351414: C2: MergeStores must happen after RangeCheck smearing [v2]

Emanuel Peter epeter at openjdk.org
Mon Mar 10 15:00:49 UTC 2025


On Mon, 10 Mar 2025 14:57:45 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.
>
> Emanuel Peter has updated the pull request incrementally with one additional commit since the last revision:
> 
>   For Christian, add comment

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         ]

Suggestion:

//   [         StoreL       ] [       StoreL         ]
//
// Note: we allow stores to merge in this dedicated IGVN round, and any later IGVN round,
//       since we never unset _merge_stores_phase.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/23944#discussion_r1987469946


More information about the hotspot-compiler-dev mailing list