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

Roland Westrelin roland at openjdk.org
Mon Mar 31 10:21:20 UTC 2025


On Mon, 31 Mar 2025 07:30:47 GMT, Christian Hagedorn <chagedorn at openjdk.org> wrote:

>> Roland Westrelin has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains five additional commits since the last revision:
>> 
>>  - review
>>  - Merge branch 'master' into JDK-8349479
>>  - review
>>  - whitespace
>>  - fix & test
>
> src/hotspot/share/opto/castnode.cpp line 103:
> 
>> 101:     return this;
>> 102:   }
>> 103:   if (in(1) != nullptr && phase->type(in(1)) != Type::TOP) {
> 
> Can `in(1)` ever be null?

There's a good chance that it can never be null. I think it's been considered good practice over the year to be particularly defensive about this (there must be other Ideal transformations where inputs can be cleared as the graph is transformed) and I tend to add checks for null inputs systematically.

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

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


More information about the hotspot-compiler-dev mailing list