[jdk20] RFR: 8298353: C2 fails with assert(opaq->outcnt() == 1 && opaq->in(1) == limit) failed

Christian Hagedorn chagedorn at openjdk.org
Fri Dec 9 08:57:18 UTC 2022


On Fri, 9 Dec 2022 08:43:20 GMT, Roland Westrelin <roland at openjdk.org> wrote:

> After some unrolling, when C2 runs loop opts with split if enabled
> after CCP, the limit of the main loop of the counted loop (the second
> loop in the test) is: limit - 3
> 
> That commons with the limit - 3 returned from the first loop. limit -
> 3 is thus in the first loop's body but only used outside of the
> loop. It has 3 uses: The return in the first loop, the
> OpaqueZeroTripGuard and loop exit conditionof the main loop. In the
> same pass of loop opts, limit-3 is cloned out of the loop 3 times for
> its 3 uses and unrolling is attempted. Because the OpaqueZeroTripGuard
> and the loop exit condition now use 2 different nodes (until they
> common at next igvn), the assert fires.
> 
> The fix I propose restores the behavior before the introduction of
> OpaqueZeroTripGuard which is to not sink a node if it has an Opaque1
> use.

Marked as reviewed by chagedorn (Reviewer).

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

PR: https://git.openjdk.org/jdk20/pull/6


More information about the hotspot-compiler-dev mailing list