RFR: 8319451: PhaseIdealLoop::conditional_move is too conservative

Quan Anh Mai qamai at openjdk.org
Mon Nov 6 19:17:02 UTC 2023


Hi,

When transforming a Phi into a CMove, the threshold is set to be approximately BlockLayoutMinDiamondPercentage, the reason is given:

// BlockLayoutByFrequency optimization moves infrequent branch
// from hot path. No point in CMOV'ing in such case

This sets the default value of the threshold to be around 18%, which is too conservative. The reason also does not make a lot of sense since the important property which makes jumping expensive is not code layout. We should remove this.

Please kindly review, thank you very much.

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

Commit messages:
 - adjust threshold, add benchmark

Changes: https://git.openjdk.org/jdk/pull/16524/files
 Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=16524&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8319451
  Stats: 74 lines in 2 files changed: 61 ins; 9 del; 4 mod
  Patch: https://git.openjdk.org/jdk/pull/16524.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/16524/head:pull/16524

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


More information about the hotspot-compiler-dev mailing list