RFR: 8319813: Remove upper limit on number of compiler phases in phasetype.hpp [v4]
Roberto Castañeda Lozano
rcastanedalo at openjdk.org
Tue Nov 21 19:12:12 UTC 2023
On Tue, 21 Nov 2023 09:39:19 GMT, Daniel Lundén <duke at openjdk.org> wrote:
>> This changeset removes the implicit upper limit on the number of compiler phases in `phasetype.hpp`. The limit was due to the 64-bit mask used in `Compile::should_print_phase`, causing the `assert(cpt < 64, "out of bounds");` in `phasetype.hpp` to trigger when increasing the number of phases to more than 64.
>>
>> Changes:
>> - Replace the 64-bit mask with a bit map (`utilities/bitMap.hpp`).
>> - Clean up the `PhaseNameValidator` interface by allocating the mask internally.
>> - Move the check for whether a mask is non-zero ("is set") into `PhaseNameValidator`.
>> - Add a method `should_print_phase` to `DirectiveSet`, simplifying the `if`-condition in `Compile::should_print_phase`.
>>
>> ### Testing
>> Platforms: windows-x64, linux-x64, linux-aarch64, macosx-x64, macosx-aarch64.
>> - `tier1`
>> - HotSpot parts of `tier2` and `tier3`
>
> Daniel Lundén has updated the pull request incrementally with one additional commit since the last revision:
>
> Address comments
Thanks for doing the renaming, Daniel. I tried this out by creating more than 64 compiler phases and running `-XX:CompileCommand=PrintIdealPhase,...` with a few random phase sets and it worked just fine. Please have a look at my (hopefully) final comments.
src/hotspot/share/compiler/compilerDirectives.cpp line 437:
> 435: #ifdef COMPILER2
> 436: if (!_modified[PrintIdealPhaseIndex]) {
> 437: // Parse ccstr and create mask
Could you update (or remove) this comment as part of the renaming?
Please also update the comment on line 430:
` // Parse PrintIdealPhaseName and create an efficient lookup mask`
src/hotspot/share/opto/phasetype.hpp line 163:
> 161: char* _bad;
> 162:
> 163:
Please remove this empty line.
-------------
Changes requested by rcastanedalo (Reviewer).
PR Review: https://git.openjdk.org/jdk/pull/16729#pullrequestreview-1742844059
PR Review Comment: https://git.openjdk.org/jdk/pull/16729#discussion_r1401042983
PR Review Comment: https://git.openjdk.org/jdk/pull/16729#discussion_r1401024354
More information about the hotspot-compiler-dev
mailing list