JDK-8300257 : C2: vectorization fails on some simple Memory Segment loops
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 11,17,21
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2023-01-17
  • Updated: 2024-03-04
  • Resolved: 2023-04-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 21
21 b18Fixed
Related Reports
Relates :  
Relates :  
Relates :  
Description
This showed up with some panama benchmarks:
The following code snippet is not vectorized:

    public static void testByteLong1(byte[] dest, long[] src) {
        for (int i = 0; i < src.length; i++) {
            long j = Objects.checkIndex(i * 8, (long)(src.length * 8));
            UNSAFE.putLongUnaligned(dest, baseOffset + j, src[i]);
        }
    }
Comments
Changeset: 6b2a86a6 Author: Roland Westrelin <roland@openjdk.org> Date: 2023-04-07 12:51:44 +0000 URL: https://git.openjdk.org/jdk/commit/6b2a86a65ef530002aea35ded45d75e04c223802
07-04-2023

A pull request was submitted for review. URL: https://git.openjdk.org/jdk/pull/12942 Date: 2023-03-09 10:48:06 +0000
09-03-2023

ILW = Missed vectorization opportunity in C2, rare?, no workaround = MLH = P4
17-01-2023