RFR: 8319822: Use a linear-time algorithm for assert_different_registers() [v15]

Andrew Haley aph at openjdk.org
Mon Jun 3 15:26:16 UTC 2024


> At the present time, `assert_different_registers()` uses an O(N**2) algorithm in assert_different_registers(). We can utilize RegSet to do it in O(N) time. This would be a useful optimization for all builds with assertions enabled.
> 
> In addition, it would be useful to be able to static_assert different registers. 
> 
> Also, I've taken the opportunity to expand the maximum size of a RegSet to 64 on 64-bit platforms.
> 
> I also fixed a bug: sometimes `noreg` is passed to `assert_different_registers()`, but it may only be passed once or a spurious assertion is triggered.

Andrew Haley has updated the pull request incrementally with one additional commit since the last revision:

  Review feedback

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/16617/files
  - new: https://git.openjdk.org/jdk/pull/16617/files/80ca17c6..47681709

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=16617&range=14
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=16617&range=13-14

  Stats: 8 lines in 2 files changed: 4 ins; 1 del; 3 mod
  Patch: https://git.openjdk.org/jdk/pull/16617.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/16617/head:pull/16617

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


More information about the hotspot-compiler-dev mailing list