Integrated: 8295842: Generational ZGC: Elide barriers on variable array accesses after array allocations
Roberto Castañeda Lozano
rcastanedalo at openjdk.org
Mon Nov 21 10:06:49 UTC 2022
On Mon, 24 Oct 2022 13:25:22 GMT, Roberto Castañeda Lozano <rcastanedalo at openjdk.org> wrote:
> This changeset extends C2's barrier elision so that variable array accesses (array accesses with unknown offset at compile-time) are elided when they are dominated by the array's allocation and no safepoint is present in between, like in this example:
>
>
> Element[] a = new Element[10]; // allocation
> a[i] = e; // variable array access: the barrier is elided
>
>
> This is achieved by relaxing the dominator-dominated pair test in [zBarrierSetC2.cpp](https://github.com/openjdk/zgc/blob/a460756f08df30af232fc631e94cf37c10c38352/src/hotspot/share/gc/z/c2/zBarrierSetC2.cpp#L714) so that unknown memory access offsets are accepted for array allocation dominators.
>
> This refinement does not yield significant overall throughput changes in standard benchmark suites (DaCapo, SPECjvm2008), but has been observed to at least elide a few additional barriers in individual benchmarks, e.g. DaCapo's H2:
>
>
> Value[] keyValues = new Value[groupIndex.length]; // array allocation
> // update group
> for (int i = 0; i < groupIndex.length; i++) {
> int idx = groupIndex[i];
> Expression expr = expressions.get(idx);
> keyValues[i] = expr.getValue(session); // store barrier is elided by this changeset
> }
>
>
> #### Testing
>
> - tier1-5 (windows-x64, linux-x64, linux-aarch64, macosx-x64, and macosx-aarch64; release and debug mode)
This pull request has now been integrated.
Changeset: 9372b37c
Author: Roberto Castañeda Lozano <rcastanedalo at openjdk.org>
URL: https://git.openjdk.org/zgc/commit/9372b37c8bad543147b4071644edb8b5c2f658f4
Stats: 74 lines in 1 file changed: 71 ins; 0 del; 3 mod
8295842: Generational ZGC: Elide barriers on variable array accesses after array allocations
Reviewed-by: eosterlund
-------------
PR: https://git.openjdk.org/zgc/pull/8
More information about the zgc-dev
mailing list