RFR: 8349479: C2: when a Type node becomes dead, make CFG path that uses it unreachable [v7]

Roland Westrelin roland at openjdk.org
Thu Apr 3 14:12:52 UTC 2025


On Tue, 1 Apr 2025 08:47:37 GMT, Christian Hagedorn <chagedorn at openjdk.org> wrote:

>> Roland Westrelin has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   review
>
> src/hotspot/share/opto/phaseX.cpp line 1836:
> 
>> 1834:       _type_nodes.push(n);
>> 1835:     }
>> 1836:     const Type* new_type = n->Value(this);
> 
> Could we also only add `n` to `_type_nodes` if `new_type` is top? Then we could also rename `_type_nodes` to `_maybe_top_type_nodes` or something like that.

if `new_type` is top?
As node's types are widen by CCP, a node `n` will initially be `top`, then one input changes and becomes not `top` but if the node has another input (say control), that other input will still be `top` so the type will be `top` again. Only once both inputs are not `top` is the type not `top`. So isn't there a good chance that most type nodes will initially be `top` and be enqueued anyway so filtering nodes when they are popped is still required and we don't gain much by doing what you suggest?

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

PR Review Comment: https://git.openjdk.org/jdk/pull/23468#discussion_r2027086883


More information about the hotspot-compiler-dev mailing list