RFR: 8342498: Add test for Allocation elimination after use as alignment reference by SuperWord [v2]

Emanuel Peter epeter at openjdk.org
Mon Nov 4 14:00:14 UTC 2024


> There used to be a bug where this happens:
> - SuperWord vectorizes, and picks a field-store as he alignment reference, using a CastP2X on he object pointer.
> - Later, all field loads disappear, and the Allocation of the object is eliminated.
> - The GC code then thinks the CastP2X is part of the GC barrier code... and crashes with wrong assumptions about that part of the IR.
> 
> We should obviously not use field-accesses as alignment references for SuperWord. A few other changes have fixed this issue:
> - [JDK-8328544](https://bugs.openjdk.org/browse/JDK-8328544): it disallows any non-array accesses that do not have an int-index. This code was backported and so should on its own fix the issue everywhere. But maybe somebody has  the idea and wants to be more smart... allowing such memory accesses without int-indices. For that we should add this regression test.
> 
> // We did not find the int_index. Just to be safe, reject this VPointer.
> if (!_has_int_index_after_convI2L) {
>   return false;
> }
> 
> - Recently, we now only allow memory access to be alignment references if they are actually vectorized... which cannot happen with field stores.
> - Roberto's change with GC barriers also removed the asserting/crashing code. Though I'm not sure if that means the IR is then ok.
> 
> **At any rate**: the bug seems **fixed**, but we should add and possibly backport this **regression test** anyway.

Emanuel Peter has updated the pull request incrementally with one additional commit since the last revision:

  unlock diagnostics

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/21875/files
  - new: https://git.openjdk.org/jdk/pull/21875/files/4ddc14cc..4ff0aa27

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=21875&range=01
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=21875&range=00-01

  Stats: 2 lines in 1 file changed: 1 ins; 0 del; 1 mod
  Patch: https://git.openjdk.org/jdk/pull/21875.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/21875/head:pull/21875

PR: https://git.openjdk.org/jdk/pull/21875


More information about the hotspot-compiler-dev mailing list