[lworld] Integrated: 8353182: [lworld] C2: Multiple IR test failures in compiler/gcbarriers/TestZGCBarrierElision.java after JDK-8351569
Damon Fenacci
dfenacci at openjdk.org
Thu Jul 3 05:21:54 UTC 2025
On Wed, 2 Jul 2025 12:56:47 GMT, Damon Fenacci <dfenacci at openjdk.org> wrote:
> This is a very similar issue to [JDK-8343420](https://bugs.openjdk.org/browse/JDK-8343420).
>
> A few `TestZGCBarrierElision` tests fail after [JDK-8351569](https://bugs.openjdk.org/browse/JDK-8351569). These tests check that ZGC barrier elision optimization does not elide necessary barriers and partially do so using `VarHandle::getAndSet` and checking that `GetAndSetP` nodes with barriers are created.
> As found out in [JDK-8343420](https://bugs.openjdk.org/browse/JDK-8343420), [JDK-8351569](https://bugs.openjdk.org/browse/JDK-8351569) refactored `Unsafe::getAndSet` (which is used by `VarHandle::getAndSet`) to take value-classes into account, which implies that checks must be introduced to see if the target and argument objects are value-classes. This is done with a new overloaded `getAndSet` method that is now called instead of the old one. This method is not intrinsified (only inlined) and doesn't result in a `GetAndSet` node. It instead relies on the `compareAndSet` method (which gets intrinsified) and results in a `CompareAndSwap` node.
>
> Here as well, as the goal of the test is mainly to check for ZGC barrier presence, the sensible fix for now seems to be to modify the `TestZGCBarrierElision` tests to make them check for `CompareAndSwap` instead of `GetAndSet` nodes.
>
> Tests: Tier 1-3+
This pull request has now been integrated.
Changeset: ed2a03e0
Author: Damon Fenacci <dfenacci at openjdk.org>
Committer: Tobias Hartmann <thartmann at openjdk.org>
URL: https://git.openjdk.org/valhalla/commit/ed2a03e0f3001f7c5540e187328da7b07d71a957
Stats: 24 lines in 1 file changed: 0 ins; 11 del; 13 mod
8353182: [lworld] C2: Multiple IR test failures in compiler/gcbarriers/TestZGCBarrierElision.java after JDK-8351569
Reviewed-by: thartmann
-------------
PR: https://git.openjdk.org/valhalla/pull/1497
More information about the valhalla-dev
mailing list