RFR: 8373508: C2: sinking CreateEx out of loop breaks the graph [v2]
Dean Long
dlong at openjdk.org
Sat Dec 20 01:42:56 UTC 2025
On Wed, 17 Dec 2025 14:22:57 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 incrementally with one additional commit since the last revision:
>
> Update test/hotspot/jtreg/compiler/loopopts/TestCreateExSunkOutOfLoop.java
>
> Co-authored-by: Christian Hagedorn <christian.hagedorn at oracle.com>
I'll running Oracle testing before approving.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/28842#issuecomment-3677195281
More information about the hotspot-compiler-dev
mailing list