RFR: 8373508: C2: sinking CreateEx out of loop breaks the graph [v3]

Christian Hagedorn chagedorn at openjdk.org
Mon Jan 5 13:51:45 UTC 2026


On Mon, 5 Jan 2026 08:45:27 GMT, Roland Westrelin <roland at openjdk.org> wrote:

>> A `CreateEx` gets sunk out of loop by
>> `PhaseIdealLoop::try_sink_out_of_loop()` and, as a consequence, the
>> following logic:
>> 
>> 
>>   return (in(0)->is_CatchProj() && in(0)->in(0)->is_Catch() &&
>>           in(0)->in(0)->in(1) == in(1)) ? this : call->in(TypeFunc::Parms);
>> 
>> 
>> in `CreateExNode::Identity()` triggers which leads to the crash
>> because `call->in(TypeFunc::Parms)` is not even an object in this
>> particular case.
>> 
>> It's actually not clear to me what that logic in
>> `CreateExNode::Identity()` is expected to do and I wonder if it's
>> still needed.
>> 
>> Anyway, the fix I propose is to skip `CreateEx` in
>> `PhaseIdealLoop::try_sink_out_of_loop()`.
>
> 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 six additional commits since the last revision:
> 
>  - Merge branch 'master' into JDK-8373508
>  - Update test/hotspot/jtreg/compiler/loopopts/TestCreateExSunkOutOfLoop.java
>    
>    Co-authored-by: Christian Hagedorn <christian.hagedorn at oracle.com>
>  - whitespaces
>  - tests
>  - more
>  - fix

Marked as reviewed by chagedorn (Reviewer).

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

PR Review: https://git.openjdk.org/jdk/pull/28842#pullrequestreview-3626912910


More information about the hotspot-compiler-dev mailing list