[lworld+vector] RFR: 8311675: [lworld+vector] Max Species support.

Jatin Bhateja jbhateja at openjdk.org
Mon Oct 9 02:31:19 UTC 2023


On Sun, 8 Oct 2023 01:58:22 GMT, Xiaohong Gong <xgong at openjdk.org> wrote:

> I met a new JVM crash issues on ARM Neon platform with this PR. Log is:
> 
> ```
> test IntMaxVectorLoadStoreTests.loadArrayMaskIOOBE(int[i * 5], l + speciesl + 1, mask[false]): success
> #
> # A fatal error has been detected by the Java Runtime Environment:
> #
> #  Internal Error (valhalla/src/hotspot/share/opto/type.cpp:4177), pid=1739617, tid=1739655
> #  assert(!flat_array || can_be_inline_type()) failed: Only inline types can be flat in array
> #
> # JRE version: OpenJDK Runtime Environment (22.0) (fastdebug build 22-internal-git-b575ef0fa)
> # Java VM: OpenJDK 64-Bit Server VM (fastdebug 22-internal-git-b575ef0fa, mixed mode, compressed oops, compressed class ptrs, g1 gc, linux-aarch64)
> # Problematic frame:
> # V  [libjvm.so+0x18697d0]  TypeInstPtr::TypeInstPtr(TypePtr::PTR, ciKlass*, TypePtr::InterfaceSet const&, bool, ciObject*, Type::Offset, bool, int, TypePtr const*, int)+0x15c
> ```
> 
> And a regression in `DoubleMaxVectorTests` such as:
> 
> ```
> test DoubleMaxVectorTests.IS_FINITEMaskedDoubleMaxVectorTests(double[cornerCaseValue(i)], mask[i % 2]): failure
> java.lang.AssertionError: expected [true] but found [false]
>         at org.testng.Assert.fail(Assert.java:99)
>         at org.testng.Assert.failNotEquals(Assert.java:1037)
>         at org.testng.Assert.assertEqualsImpl(Assert.java:140)
>         at org.testng.Assert.assertEquals(Assert.java:122)
>         at org.testng.Assert.assertEquals(Assert.java:819)
>         at org.testng.Assert.assertEquals(Assert.java:829)
>         at DoubleMaxVectorTests.IS_FINITEMaskedDoubleMaxVectorTests(DoubleMaxVectorTests.java:2716)
>         ...
> ```

Correct, we do have some assertions which I also observed, initial root causes shows these are due to incorrect graph shape, was planning to address it in follow up patch. Let me know after more analysis.

![image](https://github.com/openjdk/valhalla/assets/59989778/32a8e2d2-78ef-4ab1-9c7a-21e26ef522fa)

> src/hotspot/share/prims/vectorSupport.cpp line 493:
> 
>> 491: int VectorSupport::max_vector_size(BasicType bt) {
>> 492:   if (is_java_primitive(bt)) {
>> 493:     return VM_Version::max_vector_size(bt);
> 
> `VM_Version::max_vector_size(bt)` is a platform specific method, and currently only x86 contains it. So this makes the jdk image build failure on other platforms like aarch64. Could we define a public/common method and implement it on each platform like matcher?

Correct, we need handle it for aarch64.  Matcher routines will not be accessible by C1 only builds. That was a limitation in existing [_VectorSupport_GetMaxLaneCount_](https://github.com/openjdk/valhalla/blob/lworld/src/hotspot/share/prims/vectorSupport.cpp#L583) functionality. Max vector size is tightly bound to targets.

> Could we define a public/common method and implement it on each platform like matcher

Yes, x86 already does that currently, we need to have a target specific handling one way or other, We need need max vector size to estimate bundle size during field parsing and wanted to avoid its dependency on opto compiler.

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

PR Comment: https://git.openjdk.org/valhalla/pull/931#issuecomment-1752267166
PR Review Comment: https://git.openjdk.org/valhalla/pull/931#discussion_r1349823885



More information about the valhalla-dev mailing list