RFR: 8301584: Generational ZGC: Add barrier elision tests
Roberto Castañeda Lozano
rcastanedalo at openjdk.org
Fri Feb 3 15:38:27 UTC 2023
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)
-------------
Commit messages:
- Restrict tests to x64 by now
- Match also aarch64 memory access node names
- Remove unnecessary keywords
- Remove failing IR checks to avoid CI pipeline noise
- Update copyright years
- Remove unused arguments
- Simplify tests
- Complete atomic operation tests
- Replace uses of Unsafe with var handles
- Add atomic operation tests
- ... and 10 more: https://git.openjdk.org/zgc/compare/18e1e84c...3a5ef481
Changes: https://git.openjdk.org/zgc/pull/12/files
Webrev: https://webrevs.openjdk.org/?repo=zgc&pr=12&range=00
Issue: https://bugs.openjdk.org/browse/JDK-8301584
Stats: 420 lines in 6 files changed: 417 ins; 0 del; 3 mod
Patch: https://git.openjdk.org/zgc/pull/12.diff
Fetch: git fetch https://git.openjdk.org/zgc pull/12/head:pull/12
PR: https://git.openjdk.org/zgc/pull/12
More information about the zgc-dev
mailing list