Auto-Vectorization in HotSpot
summary
C2 uses the SuperWord algorithm to pack isomorphic, unrolled iterations into SIMD vectors and builds a dependency graph that separates data and memory edges so loads can be reordered before stores. It adds runtime aliasing checks for MemorySegment and speculative compilation with deopt/recompile when overlaps occur. Reduction handling moves partial sums out of the loop or uses recursive folding; some floating reductions still fall back to scalar for correctness. Alignment and cache-line splits cause real 20–50% regressions; work continues on cost modeling, if-conversion, and broader pointer support.
AI-written summary · about
chapters (8)
- 0:00Introduction
- 1:01Why vectorize
- 3:57AutoVectorization
- 11:50Reductions
- 18:53pointers
- 26:16alignment
- 32:32future
- 34:51outro
related talks
44mHotspot JVM Auto Vectorization and Vector API
01h 02mVM Design Choices
34mWhat happens to your code when you don't look?
46mJIT Compiler From the Ground Up
01h 09mFrom Bytecode to Native Code in HotSpot JVM
01h 01mIntroduction to Vector Parallelism
54mJava performance techniques The cost of HotSpot runtime optimizations
48mJust-In-Time Compilation for Java Performance: Recent and Ongoing Improvements
