RFR: 8353041: NeverBranchNode causes incorrect block frequency calculation

Roberto Castañeda Lozano rcastanedalo at openjdk.org
Tue Apr 8 09:48:20 UTC 2025


On Wed, 2 Apr 2025 19:51:37 GMT, Dean Long <dlong at openjdk.org> wrote:

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

The only idea I can think of would be matching and asserting on the output of `-XX:+PrintCFGBlockFreq`, e.g. for the first test in `compiler/loopopts/TestPhaseCFGNeverBranchToGotoMain.java` I get the line

   Loop: 1  trip_count: 1000000 freq:      0

before this fix, and the line

   Loop: 1  trip_count: 1000000 freq: 900000

after the fix. You could assert that you expect a `freq` greater than 0 for every encountered loop, or something similar. But I guess such a test would be quite fragile.

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

PR Comment: https://git.openjdk.org/jdk/pull/24390#issuecomment-2785860930


More information about the hotspot-compiler-dev mailing list