JDK-8286941 : Add mask IR for partial vector operations for ARM SVE
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 19
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: linux
  • CPU: aarch64
  • Submitted: 2022-05-18
  • Updated: 2025-11-28
  • Resolved: 2022-07-07
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 20
20 b06Fixed
Related Reports
Causes :  
Relates :  
Description
SVE supports vector operations whose vector length is lower than the hardware supported max vector length. We call them partial vector operations. For some operations like vector load/store and the reductions, we need to generate a mask based on the vector length and use it to control the operations to make sure the result is correct. Currently the mask is generated in the backend  that is together with each match rules. This will generate many duplicate instructions inside the loop for the vector operations that have the same vector length, which is not friendly to performance. To improve it, we'd better to remove the duplicate instructions and hoist it out. Adding a mask IR for these ops in the mid-end can resolve it.
Comments
A pull request was submitted for review. Branch: master URL: https://git.openjdk.org/jdk/pull/9037 Date: 2022-06-06 09:42:02 +0000
27-11-2025

Changeset: a79ce4e7 Author: Xiaohong Gong <xgong@openjdk.org> Date: 2022-07-07 08:14:21 +0000 URL: https://git.openjdk.org/jdk/commit/a79ce4e74858e78acc83c12d500303f667dc3f6b
07-07-2022

compiler/loopopts/superword/TestPickFirstMemoryState.java tests failed in tier2 on x86 (ran with -XX:UseAVX=3) # # Internal Error (/opt/mach5/mesos/work_dir/slaves/0c72054a-24ab-4dbb-944f-97f9341a1b96-S8454/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/7e085854-2d47-489a-9d08-6f6afe5dcf24/runs/3597519a-698f-4fc3-94ab-acd5caf9e0a4/workspace/open/src/hotspot/share/opto/type.hpp:1896), pid=25562, tid=25608 # assert(_base >= VectorMask && _base <= VectorZ) failed: Not a Vector # # JRE version: Java(TM) SE Runtime Environment (20.0) (fastdebug build 20-internal-2022-06-30-1424526.vladimir.kozlov.jdkgit) # Java VM: Java HotSpot(TM) 64-Bit Server VM (fastdebug 20-internal-2022-06-30-1424526.vladimir.kozlov.jdkgit, compiled mode, sharing, tiered, compressed oops, compressed class ptrs, g1 gc, linux-amd64) # Problematic frame: # V [libjvm.so+0x1b057d4] ReductionNode::Ideal(PhaseGVN*, bool)+0xa4 # urrent CompileTask: C2: 193 21 b 4 compiler.loopopts.superword.TestPickFirstMemoryState::test (53 bytes) Stack: [0x00007f5c9ee41000,0x00007f5c9ef42000], sp=0x00007f5c9ef3c5b0, free space=1005k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) V [libjvm.so+0x1b057d4] ReductionNode::Ideal(PhaseGVN*, bool)+0xa4 V [libjvm.so+0x17bb018] PhaseIterGVN::transform_old(Node*)+0xb8 V [libjvm.so+0x17b426e] PhaseIterGVN::optimize()+0x6e V [libjvm.so+0xb0b3fa] PhaseIdealLoop::optimize(PhaseIterGVN&, LoopOptsMode)+0x65a V [libjvm.so+0xb07847] Compile::Optimize()+0x1027 V [libjvm.so+0xb099d0] Compile::Compile(ciEnv*, ciMethod*, int, Options, DirectiveSet*)+0x1520 V [libjvm.so+0x91a8fa] C2Compiler::compile_method(ciEnv*, ciMethod*, int, bool, DirectiveSet*)+0x62a V [libjvm.so+0xb18478] CompileBroker::invoke_compiler_on_method(CompileTask*)+0xbb8 V [libjvm.so+0xb19438] CompileBroker::compiler_thread_loop()+0x6c8 V [libjvm.so+0x104fecc] JavaThread::thread_main_inner()+0x23c V [libjvm.so+0x1a6efd0] Thread::call_run()+0x100 V [libjvm.so+0x1732b64] thread_native_entry(Thread*)+0x104
30-06-2022

test/hotspot/jtreg/gtest/GTestWrapper.java failed in tier1 on aarch64 systems: [----------] 1 test from AssemblerAArch64 [ RUN ] AssemblerAArch64.validate_vm [2.051s][warning][os] Loading hsdis library failed open/test/hotspot/gtest/aarch64/test_assembler_aarch64.cpp:48: Failure Expected equality of these values: insns[i] Which is: 624694305 insns1[i] Which is: 624690209 Ours: [MachCode] 0x0000ffff3614f568: 2104 3c25 [/MachCode] Theirs: [MachCode] 0x0000ffff247fc048: 2114 3c25 [/MachCode] open/test/hotspot/gtest/aarch64/test_assembler_aarch64.cpp:48: Failure Expected equality of these values: insns[i] Which is: 627578226 insns1[i] Which is: 627574130 Ours: [MachCode] 0x0000ffff3614f56c: 7205 6825 [/MachCode] Theirs: [MachCode] 0x0000ffff247fc04c: 7215 6825 [/MachCode] open/test/hotspot/gtest/aarch64/test_assembler_aarch64.cpp:48: Failure Expected equality of these values: insns[i] Which is: 631381219 insns1[i] Which is: 631377123 Ours: [MachCode] 0x0000ffff3614f570: e30c a225 [/MachCode] Theirs: [MachCode] 0x0000ffff247fc050: e31c a225 [/MachCode] open/test/hotspot/gtest/aarch64/test_assembler_aarch64.cpp:48: Failure Expected equality of these values: insns[i] Which is: 636100148 insns1[i] Which is: 636096052 Ours: [MachCode] 0x0000ffff3614f574: 340e ea25 [/MachCode] Theirs: [MachCode] 0x0000ffff247fc054: 341e ea25 [/MachCode] [ FAILED ] AssemblerAArch64.validate_vm (1 ms)
30-06-2022

A pull request was submitted for review. URL: https://git.openjdk.java.net/jdk/pull/9037 Date: 2022-06-06 09:42:02 +0000
06-06-2022