RFR: 8301584: Generational ZGC: Add barrier elision tests
Erik Österlund
eosterlund at openjdk.org
Mon Feb 6 08:34:23 UTC 2023
On Fri, 3 Feb 2023 15:19:48 GMT, Roberto Castañeda Lozano <rcastanedalo at openjdk.org> wrote:
> This changeset adds test cases exercising C2's barrier elision on combinations of different
>
> - pairs of dominating / dominated accesses (allocations, loads, stores, atomic operations),
> - control structures (local, conditions, loops),
> - object types (arrays, class instances), and
> - levels of information available during C2's analysis (known vs. unknown array indices).
>
> The changeset exposes node barrier data to the [IR test framework](https://github.com/openjdk/jdk/blob/master/test/hotspot/jtreg/compiler/lib/ir_framework/README.md) by including it in the node's dump output. This extension is useful not just for testing but also for debugging purposes, for example when exploring C2's intermediate representation with IGV:
>
> 
>
> The following tests illustrate a missing optimization in C2's barrier elision (reported in [JDK-8301769](https://bugs.openjdk.org/browse/JDK-8301769)), where barriers that should be elided are not:
>
> - `testStoreThenAtomic`
> - `testAtomicThenLoad`
> - `testAtomicThenStore`
> - `testAtomicThenAtomic`
>
> The changeset does not contain IR checks expecting elision in these cases, to reduce CI pipeline noise. The tests are restricted by now to x64, since volatile loads and stores in other platforms suffer from the same issue (see [JDK-8301769](https://bugs.openjdk.org/browse/JDK-8301769)).
>
> **Testing:** tier1-7 (windows-x64, linux-x64, macosx-x64; release and debug mode)
Nice test! Looks good.
-------------
Marked as reviewed by eosterlund (Reviewer).
PR: https://git.openjdk.org/zgc/pull/12
More information about the zgc-dev
mailing list