RFR: 8292660: C2: blocks made unreachable by NeverBranch-to-Goto conversion are removed incorrectly [v2]
Roberto Castañeda Lozano
rcastanedalo at openjdk.org
Fri Sep 2 06:36:52 UTC 2022
On Wed, 31 Aug 2022 07:12:39 GMT, Roland Westrelin <roland at openjdk.org> wrote:
>> Roberto Castañeda Lozano has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Postpone unreachable block removal to after PhaseCFG::fixup_flow()
>
> src/hotspot/share/opto/block.cpp line 961:
>
>> 959: while (unreachable.size() > 0) {
>> 960: Block* dead = unreachable.pop();
>> 961: for (uint i = 0; i < _number_of_blocks; i++) {
>
> Wouldn't we want to iterate backward here and adjust block->_pre_order until we hit dead?
Thanks for the suggestion, Roland! Yes, since `get_block(i)->_pre_order == i` holds at this stage, it is enough with iterating over the elements that succeed `dead` in the block list. I have updated the changeset accordingly.
-------------
PR: https://git.openjdk.org/jdk/pull/9976
More information about the hotspot-compiler-dev
mailing list