RFR: 8360557: CTW: Inline cold methods to reach more code

Aleksey Shipilev shade at openjdk.org
Tue Jul 1 12:33:51 UTC 2025


We use CTW testing for making sure compilers behave well. But we compile the code that is not executed at all, and since our inlining heuristics often looks back at profiles, we end up not actually inlining all too much! This means CTW testing likely misses lots of bugs that normal code is exposed to, especially e.g. in loop optimizations.

There is an intrinsic tradeoff with accepting more inilned methods in CTW: the compilation time gets significantly worse. With just accepting the cold methods we have reasonable CTW times, eating the improvements we have committed in mainline recently. And it still finds bugs. See the RFE for sample data.

After this lands and CTW starts to compile cold methods, one can greatly expand the scope of the CTW testing by overriding the static inlining limits. Doing e.g. `TEST_VM_OPTS="-XX:MaxInlineSize=70 -XX:MaxInlineSize=70"` finds even more bugs. Unfortunately, the compilation times suffer so much, they are impractical to run in standard configurations, see data in RFE. We will enable some of that testing in special testing pipelines.

Additional testing:
 - [ ] GHA
 - [x] Linux x86_64 server fastdebug, `applications/ctw/modules`
 - [ ] Linux x86_64 server fastdebug, large CTW corpus (now failing in interesting ways)

-------------

Commit messages:
 - Revert separate patch
 - Final
 - Proper option name and bump the limits
 - Fix

Changes: https://git.openjdk.org/jdk/pull/26068/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=26068&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8360557
  Stats: 15 lines in 3 files changed: 15 ins; 0 del; 0 mod
  Patch: https://git.openjdk.org/jdk/pull/26068.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/26068/head:pull/26068

PR: https://git.openjdk.org/jdk/pull/26068


More information about the hotspot-compiler-dev mailing list