JDK-8325497 : Investigate C2 issues identified by the "JVM Performance Comparison for JDK 21"
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 23
  • Priority: P2
  • Status: Open
  • Resolution: Unresolved
  • Submitted: 2024-02-08
  • Updated: 2024-11-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 :  
Relates :  
Relates :  
Relates :  
Description
This is an umbrella to keep track of investigating and fixing C2 performance issues identified by the "JVM Performance Comparison for JDK 21":
https://ionutbalosin.com/2024/02/jvm-performance-comparison-for-jdk-21/

The goal is to list benchmarks that identify performance issues in C2, file corresponding RFEs and link them here:
- ArithmeticCanonicalizationBenchmark: JDK-8325495
- MethodArgsBusterBenchmark: JDK-8325467
- IfConditionalBranchBenchmark: JDK-8317424
- ScalarEvolutionAndLoopOptimizationBenchmark: JDK-8317424 (vectorization would do most of the trick, but maybe we want to do it with a special formula?)
- LockCoarseningBenchmark : JDK-8341404

Known issues:
- Escape Analysis:
  - JDK-8276455, JDK-8287061, JDK-8289943, JDK-8155769
  - Partial Escape Analysis in HotSpot C2: https://mail.openjdk.org/pipermail/hotspot-compiler-dev/2022-November/059990.html, https://mail.openjdk.org/pipermail/hotspot-compiler-dev/2023-March/063118.html, https://cr.openjdk.org/~cslucas/escape-analysis/EscapeAnalysis.html
  - https://github.com/microsoft/openjdk-proposals/blob/main/stack_allocation/Stack_Allocation_JEP.md
- Inlining:
  - Missing support for polymorphic guarded inlining in C2, see https://mail.openjdk.org/pipermail/hotspot-compiler-dev/2020-February/036901.html
  - JDK-8280365
- Vectorization:
  - see benchmark: IfConditionalBranchBenchmark, ScalarEvolutionAndLoopOptimizationBenchmark
  - requires if-conversion and improved reduction heuristic
  - see AutoVectorization umbrella JDK-8317424
- Loop Fission / Fusion
  - benchmark: LoopFissionBenchmark, LoopFusionBenchmark
  - generally difficult to get right, would need a good heuristic / cost model
  - also tricky with safepoints: would have to remove all safepoints in the scope of the fused / fissioned loops.