RFR: 8373508: C2: sinking CreateEx out of loop breaks the graph [v2]
Roland Westrelin
roland at openjdk.org
Wed Dec 17 14:22:57 UTC 2025
> 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>
-------------
Changes:
- all: https://git.openjdk.org/jdk/pull/28842/files
- new: https://git.openjdk.org/jdk/pull/28842/files/45097770..e4bdff59
Webrevs:
- full: https://webrevs.openjdk.org/?repo=jdk&pr=28842&range=01
- incr: https://webrevs.openjdk.org/?repo=jdk&pr=28842&range=00-01
Stats: 1 line in 1 file changed: 0 ins; 1 del; 0 mod
Patch: https://git.openjdk.org/jdk/pull/28842.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/28842/head:pull/28842
PR: https://git.openjdk.org/jdk/pull/28842
More information about the hotspot-compiler-dev
mailing list