RFR: 8318446: C2: optimize stores into primitive arrays by combining values into larger store

Roland Westrelin roland at openjdk.org
Thu Mar 21 14:34:26 UTC 2024


On Thu, 21 Mar 2024 14:01:37 GMT, Emanuel Peter <epeter at openjdk.org> wrote:

>     * No RangeCheck smearing, or other CFG between the stores: `RC[0], store[0], RC[1], store[1], RC[2], store[2], RC[3], store[3]`. Not so simple. We can merge the 4 stores on the normal path, where all RC's pass. But we have to remove all old stores from that path. But the `RC[1], RC[2], RC[3]` false paths need some of those stores. So the only way I see is to duplicate all stores for the branches, so that we are sure that they sink out into the trap-paths.

I also think you need to duplicate stores. My opinion is that we want to stick with the simpler cases (your first and second bullets) unless it's obvious it doesn't cover all use cases. It's always possible to revisit the optimization down the road if it's observed that there are cases that are not covered.

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

PR Comment: https://git.openjdk.org/jdk/pull/16245#issuecomment-2012457389


More information about the hotspot-compiler-dev mailing list