RFR: 8354383: C2: enable sinking of Type nodes out of loop

Christian Hagedorn chagedorn at openjdk.org
Fri May 23 07:15:51 UTC 2025


On Thu, 22 May 2025 15:53:18 GMT, Roland Westrelin <roland at openjdk.org> wrote:

> `PhaseIdealLoop::try_sink_out_of_loop()` excludes `Type` nodes because
> we ran into some issues where a `Type` node is sunk and then becomes
> `top` but the control path of its uses doesn't become unreachable.
> 
> 8349479 should have fixed that so that exception no longer makes
> sense.

Otherwise, looks reasonable to me, too.

src/hotspot/share/opto/loopopts.cpp line 1688:

> 1686:       !n->is_OpaqueInitializedAssertionPredicate() &&
> 1687:       !n->is_OpaqueTemplateAssertionPredicate() &&
> 1688:       !n->is_Type()) {

I cannot remember exactly, how often was it a problem without JDK-8349479? If it was more common, we might want to only allow it when `KillPathsReachableByDeadTypeNode` is set.

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

Marked as reviewed by chagedorn (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/25396#pullrequestreview-2863435232
PR Review Comment: https://git.openjdk.org/jdk/pull/25396#discussion_r2103959595


More information about the hotspot-compiler-dev mailing list