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

Roland Westrelin roland at openjdk.org
Fri Mar 28 10:52:45 UTC 2025


On Thu, 20 Mar 2025 09:01:06 GMT, Emanuel Peter <epeter 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/node.cpp line 3110:
> 
>> 3108: 
>> 3109: Node* TypeNode::Ideal(PhaseGVN* phase, bool can_reshape) {
>> 3110:   if (can_reshape && Value(phase) == Type::TOP) {
> 
> Why not use `phase->type(this)`?

`Value` is called after `Ideal` so `phase->type(this)` is the previous type for this and if it was `top`, then we wouldn't be running this `Ideal`. What we want is the next type for the node to take action before it constant folds.

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

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


More information about the hotspot-compiler-dev mailing list