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

Dean Long dlong at openjdk.org
Wed Nov 15 22:56:32 UTC 2023


On Mon, 13 Nov 2023 09:55:21 GMT, Andrew Haley <aph at openjdk.org> wrote:

>> 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:
> 
>   Cleanup, fix warning on Windows.

I ran into a case where I was doing assert_different_registers() on base() and index() from an Address.  How hard would it be to have assert_different_registers() support an Address as an argument?

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

PR Comment: https://git.openjdk.org/jdk/pull/16617#issuecomment-1813394814


More information about the hotspot-compiler-dev mailing list