RFR: 8254269: simplify Node::disconnect_inputs [v2]

Xin Liu xliu at openjdk.java.net
Mon Oct 12 00:55:10 UTC 2020


On Sun, 11 Oct 2020 20:06:49 GMT, Vladimir Kozlov <kvn at openjdk.org> wrote:

>> Xin Liu has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   8254269: simplify Node::disconnect_inputs
>>   
>>   Optimize it for the precedence loop. because there's no null between
>>   2 non-null precedences, disconnect_inputs can break at a null value.
>
> src/hotspot/share/opto/node.cpp line 916:
> 
>> 914:   for (; i < len() && in(i) != nullptr; ++i) {
>> 915:     set_prec(i, nullptr);
>> 916:   }
> 
> Something like next:
>    for (uint i = req(); i < len(); ++i) {
>      if (in(i) != nullptr) {
>        set_prec(i, nullptr);
>      }
>    }

This is trickier than I thought. `set_prec(i, nullptr)` will refill _in[i] with the last non-null value, or NULL.
https://github.com/openjdk/jdk/blob/master/src/hotspot/share/opto/node.cpp#L1030

It means iteration from req() to len() skip a node if there are more than one non-null precedences.

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

PR: https://git.openjdk.java.net/jdk/pull/589


More information about the hotspot-compiler-dev mailing list