RFR: 8353041: NeverBranchNode causes incorrect block frequency calculation

Dean Long dlong at openjdk.org
Wed Apr 2 19:57:03 UTC 2025


This fixes a quality of implementation issue for infinite loops using a NeverBranch node.  We need Block::succ_prob() to return 1.0f for the 100% successful back-edge so that block frequencies are computed correctly.  I also fixed Block_Stack::most_frequent_successor() to choose the correct successor.  I verified that this corrects the huge frequency ratio that was detected and clamped by JDK-8346888.

Currently this bug is labeled noreg-hard with no new regression test, as it's not obvious how to write such as test.

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

Commit messages:
 - choose correct NeverBranch successor

Changes: https://git.openjdk.org/jdk/pull/24390/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=24390&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8353041
  Stats: 19 lines in 2 files changed: 17 ins; 1 del; 1 mod
  Patch: https://git.openjdk.org/jdk/pull/24390.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/24390/head:pull/24390

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


More information about the hotspot-compiler-dev mailing list