RFR: 8296389: C2: PhaseCFG::convert_NeverBranch_to_Goto must handle both orders of successors [v2]
Emanuel Peter
epeter at openjdk.org
Fri Dec 9 07:07:16 UTC 2022
On Tue, 6 Dec 2022 11:33:12 GMT, Tobias Hartmann <thartmann at openjdk.org> wrote:
>> Emanuel Peter has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains four additional commits since the last revision:
>>
>> - Refactoring a bit after review suggestions
>> - Merge branch 'master' into JDK-8296389
>> - replace tabs with spaces
>> - 8296389: C2: PhaseCFG::convert_NeverBranch_to_Goto must handle both orders of successors
>
> src/hotspot/share/opto/block.cpp line 626:
>
>> 624: int end_idx = b->end_idx();
>> 625: int taken_idx = b->get_node(end_idx+1)->as_Proj()->_con;
>> 626: ProjNode* alwaysTaken = b->get_node(end_idx + 1 + taken_idx)->as_Proj();
>
> I find this code rather confusing. Since it's guaranteed that `alwaysTaken->_con == 0`, can't we simply do something like this?
>
> ProjNode* alwaysTaken = b->get_node(end_idx)->as_MultiBranch()->proj_out(0);
> Block* succ == get_block_for_node(alwaysTaken->unique_ctrl_out_or_null());
👍
-------------
PR: https://git.openjdk.org/jdk/pull/11481
More information about the hotspot-compiler-dev
mailing list