JDK-8280320 : C2: Loop opts are missing during OSR compilation
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 18,19
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: linux
  • CPU: x86
  • Submitted: 2022-01-20
  • Updated: 2025-08-15
  • Resolved: 2022-07-01
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 19 JDK 20
19 b30Fixed 20Fixed
Related Reports
Causes :  
Relates :  
Relates :  
Description
While benchmarking AVX related tests on x86 server machines, it was observed that the test throughput of the release build is ~35x slower than that of the fastdebug build. A sample test case named TestShortRShift.java is also attached.

Preliminarily performance analysis revealed that the fastdebug version is running AVX instructions whereas the debug version is falling back to the scalar instruction.

--------------------------------------------------------------------------
Below we list the main function that is being tested in TestShortRShift.java

    public static void mainTest(long numIterations) {
        while (numIterations > 0) {
            for (int i = 0; i < BUFFER_SIZE; i++) {
               // Code below would be run using x86 AVX instructions
                outputBuffer[i] = (short)(inputBuffer[i] >> 3);
            }
            numIterations--;
        }
    }
Comments
Changeset: 99250140 Author: Vladimir Ivanov <vlivanov@openjdk.org> Date: 2022-07-01 22:56:48 +0000 URL: https://git.openjdk.org/jdk19/commit/9925014035ed203ba42cce80a23730328bbe8a50
01-07-2022

A pull request was submitted for review. URL: https://git.openjdk.org/jdk19/pull/38 Date: 2022-06-17 21:29:41 +0000
17-06-2022

Yes, ran it on AVX512-capable servers Skylake and also IceLake. Observed this regression on both of them.
21-01-2022

[~sparasa] what hardware are you running on? Is it AVX512-capable? Skylake or newer?
21-01-2022

[~sparasa] No problem, thanks for updating it!
21-01-2022

ILW = performance regression on AVX tests = MMH = P3
20-01-2022

This issue occurs in the latest JDK 18 (openjdk 18-internal 2022-03-22) as well. However, it does not occur in JDK 17(openjdk 17.0.1 2021-10-19)
20-01-2022

Hi Christian, sorry for the confusion. It's actually the latest JDK (openjdk 19-internal 2022-09-20). Updated the version in the bug report.
20-01-2022

Hi [~sparasa], did you mean OpenJDK 11.0.17 (label 11.0.17)?
20-01-2022