RFR: 8263577: C2: reachable nodes shouldn't have dead uses at the end of optimizations

Xin Liu xliu at openjdk.java.net
Fri Mar 19 10:35:38 UTC 2021


On Thu, 18 Mar 2021 09:40:46 GMT, Roland Westrelin <roland at openjdk.org> wrote:

>> It's not uncommon for c2 to leave dead uses hanging from reachable
>> nodes. It's usually harmless but can cause confusion (such as in
>> valhalla JDK-8262289, not reproducible with non valhalla code AFAICT).
>> 
>> Most of the time, these are caused by calls to set_req() during igvn
>> that should be set_req_X() calls. I added a verification pass at the
>> end of optimization and fixed all the ones I found.
>
>> hi, @rwestrel
>> 
>> Is Node::set_req_X() same as PhaseIterGVN::replace_input_of()?
>> This even supports delayed hash. can I use them interchangeably?
> 
> They are not quite the same as replace_input_of() has the rehash_node_delayed() call. When modifying an existing node, it's a requirement to call has_delete() which rehash_node_delayed() does for you. If you're in Ideal() modifying the "this" node, the hash_delete() call happened before the ideal call.
> 
> So I guess roughly: in Ideal modifying this's input -> set_req_X(), otherwise replace_input_of()

@rwestrel 
I see.  Thanks for the explanation.
verify that your patch invokes "set_req_X" in Node::ideal() and its overrides.

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

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


More information about the hotspot-compiler-dev mailing list