JDK-8370685 : C2 SuperWord: investigate why longMulBig does not vectorize
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 26
  • Priority: P4
  • Status: Open
  • Resolution: Unresolved
  • Submitted: 2025-10-27
  • Updated: 2025-10-27
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.
Other
tbdUnresolved
Related Reports
Relates :  
Description
found during JDK-8340093, and specifically its test TestReductions.longMulBig, and the related benchmark.

We already saw that it was not vectorizing here:
https://github.com/openjdk/jdk/pull/25387

See also the attached test.

It seems that -XX:LoopUnrollLimit=1000 helps. Maybe the loop is too large? But there are other tests in TestReductions that seem to have similar many instructions... so not sure.

./java -Xbatch -XX:CompileCommand=compileonly,Reduction3::test* -XX:CompileCommand=printcompilation,Reduction3::test* -XX:+TraceNewVectors -XX:UseAVX=3 -XX:CompileCommand=TraceAutoVectorization,Reduction3::test*,SW_INFO -XX:+TraceLoopOpts -XX:+TraceSuperWordLoopUnrollAnalysis -XX:LoopUnrollLimit=1000 Reduction3.java



Without the flag, it compiles only during OSR, but not regular compilation.
With the flag, it compiles for OSR and regular compilation.
Comments
Let me know if you want to work on this.
27-10-2025