RFR: 8319451: PhaseIdealLoop::conditional_move is too conservative [v2]

Quan Anh Mai qamai at openjdk.org
Tue Dec 12 16:39:17 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.

Quan Anh Mai has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains three additional commits since the last revision:

 - change freq to double
 - Merge branch 'master' into cmovethreshold
 - adjust threshold, add benchmark

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/16524/files
  - new: https://git.openjdk.org/jdk/pull/16524/files/4513cbef..e494d6df

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=16524&range=01
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=16524&range=00-01

  Stats: 815599 lines in 4990 files changed: 184434 ins; 547191 del; 83974 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