RFR: 8303970: C2 can not merge homogeneous adjacent two If [v2]

Yi Yang yyang at openjdk.org
Tue Mar 14 11:53:27 UTC 2023


On Tue, 14 Mar 2023 11:09:29 GMT, Tobias Hartmann <thartmann at openjdk.org> wrote:

>> Yi Yang has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   dont apply Identity for dead bool
>
> src/hotspot/share/opto/subnode.cpp line 1512:
> 
>> 1510:       Node* out = reverse_cmp->fast_out(i);
>> 1511:       if (out->is_Bool() && out->as_Bool()->_test._test == _test._test &&
>> 1512:           phase->type_or_null(out) != nullptr) {
> 
> Why is the `phase->type_or_null` required?

There is a cyclic case, we should avoid it.

Apply PhaseGVN for Bool A -> Generate Bool B in BoolNode::Ideal-> Apply Identity for B -> Find A while type of A is not set.

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

PR: https://git.openjdk.org/jdk/pull/12978


More information about the hotspot-compiler-dev mailing list