[lworld+vector] RFR: 8314628: [lworld+vector] validation regression fixes and cleanups.

Jatin Bhateja jbhateja at openjdk.org
Mon Aug 21 07:43:08 UTC 2023


Patch fixes following problem seen during validation:-

**CDS:-**
- Problem while restoring value object mirrors. These are needed to perform class level comparisons.

**VM:-**
- Remove payload offset computation logic during VM initialization. It was earlier used during object re-materialization.

**ci Model:-**
- Add a generic routine to handle synthetic ciField population for both static and non-static multifield. This enables returning fully populated ciMultiField structure to compilers during parsing.

**C1 compiler:-**
- Incorrect address displacement computation in HIR while updating multifield bundle using "withfield" bytecode in VectorPayalod constructor. This was causing  failures in Double128Mask tests.

**C2 compiler:-**
1.  Allow vector IR creation under strict check for multifield in default_value creation routine. This was incorrectly creating vector IR for non-vector API tests for Double/Long types.
2. Disable inline expansion of Unsafe.finishPrivateBuffer.  This is fixing the incorrectness problems seen with masked operations loop e.g.

>     vt = newPayload();
>     vt = Unsafe.makePrivateBuffer(vt);
>     for (int i = 0; i < Double128.length; i++) {
>          if (mask[i]) {
>               Unsafe.putDouble(vt, apply(src[i]));
>          }
>     }

   Unsafe.putDouble() only modifies the memory state by storing a new value in payload buffer but does not update any local variable in the JVM state corresponding to latch block. Thus no inductive Phi node is inserted in the loop, it also re-materializes InlineTypeNode from modified memory state. This causes incorrectness if second mask value is false as entire payload is overwritten with default value and earlier lane updates are over-written. In order to be safe, disabling intrinsification of finishPrivateBuffer if incoming argument node is of VectorPayload* type, so that it always receive updated buffer argument.

3. With non-incremental in-lining (-XX:-IncrementalInline) flow user defined routines returning a vector object is incorrectly returning uninitialized VBA connected to oop input of InlineType IR. Defer returning VectorBoxAllocation node, they are expanded and initialized during box expansion and replaces all uses of box.

4. Currently we try to sharpen the object type to a narrower type to optimize object type comparison against a class constant. This is achieved by inserting a CheckCastPP node which casts the object type to a higher speculative type, if cast type is an inlinetype we need to re-materialize InlineTypeNode from newly casted object which was missing.

**Validation Status with patch.**
  - All VectorAPI Jtreg test points except following known issues are passing on x86 at various AVX levels and compilation levels.

**Pending/know issues:-**

1. Failures in some of the mask/shuffle related test points with -XX:+DeoptimizeALot, to be resolved after mainline merge to incorporate major shuffle re-structuring changes in in mainline.
2. Test point using Max-Species are failing, to be fixed with max species support in subsequent patch.
3. Assertion failure in cyclic graph check due to unexpected graph shape seen in box expansion.

Kindly review and share your feedback.

Best Regards,
Jatin

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

Commit messages:
 - 8314628: [lworld+vector] validation regression fixes and cleanups.

Changes: https://git.openjdk.org/valhalla/pull/909/files
 Webrev: https://webrevs.openjdk.org/?repo=valhalla&pr=909&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8314628
  Stats: 170 lines in 18 files changed: 99 ins; 41 del; 30 mod
  Patch: https://git.openjdk.org/valhalla/pull/909.diff
  Fetch: git fetch https://git.openjdk.org/valhalla.git pull/909/head:pull/909

PR: https://git.openjdk.org/valhalla/pull/909



More information about the valhalla-dev mailing list