RFR: 8319822: Use a linear-time algorithm for assert_different_registers() [v17]
Thomas Stuefe
stuefe at openjdk.org
Mon Jun 3 17:38:09 UTC 2024
On Mon, 3 Jun 2024 17:27:17 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:
>
> Kludge to fix build on Arm 32
Looks good to me. Thanks for working in my remarks.
src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp line 71:
> 69: #include <sys/types.h>
> 70:
> 71: static_assert(different_registers(zr, sp), "fucked");
Debugging remnant?
-------------
Marked as reviewed by stuefe (Reviewer).
PR Review: https://git.openjdk.org/jdk/pull/16617#pullrequestreview-2094492446
PR Review Comment: https://git.openjdk.org/jdk/pull/16617#discussion_r1624826751
More information about the hotspot-compiler-dev
mailing list