RFR: 8334060: Implementation of Late Barrier Expansion for G1 [v9]

Roberto Castañeda Lozano rcastanedalo at openjdk.org
Tue Sep 3 07:26:01 UTC 2024


On Fri, 30 Aug 2024 13:40:24 GMT, Roberto Castañeda Lozano <rcastanedalo at openjdk.org> wrote:

>  A perhaps more principled solution might be extending store-capturing analysis to reject stores with late-expanded barriers. I will give it a try.

This option proved to be infeasible because other GCs (ZGC) rely on store capturing for barrier elision. Furthermore, this would prevent eliding G1 barriers that are found to be elidable only after the program is simplified by C2's intermediate optimizations, even if `ReduceInitialCardMarks` is enabled (I found a few such cases, e.g. where range check elimination is the enabling simplification).

Instead, I have opted to remove the `ReduceInitialCardMarks` condition from `StoreNode::Ideal` and introduce a GC-specific test to determine whether a store can be captured and used for object initialization (commit 6b9954979). For G1, this is true iff the store does not have any barrier or it does have barriers but `ReduceInitialCardMarks` is enabled. For all other GCs the test is always true, which preserves the original mainline behavior. To summarize, this option makes the logic clearer, improves analysis precision, and isolates the changes to G1.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/19746#discussion_r1741554994


More information about the hotspot-dev mailing list