[jdk18] RFR: 8278420: C2: assert(!n->is_Store() && !n->is_LoadStore()) failed: no node with a side effect

Roland Westrelin roland at openjdk.java.net
Fri Dec 10 16:13:14 UTC 2021


On Fri, 10 Dec 2021 15:43:52 GMT, Christian Hagedorn <chagedorn at openjdk.org> wrote:

> The test case fails with the assertion when an actual unreachable store node with only uses outside of the loop is tried to be sunk out of a dead loop in split-if. This is quite an edge case in which C2 is not able to remove the inner loop but the store for `iFldArr2` inside this loop dies due to improved type information after peeling. This removes some memory phis as well and leaves the store `iFldArr1` with only outside the loop uses. A more detailed explanation how we end up in this situation is shown in the comments of the test case.
> 
> This suggests that the assertion is too strong. I propose to relax the assertion and bail out if we are trying to sink a store node. However, I don't think that we will reach this code with `LoadStore` nodes as they have other memory outputs inside a loop, preventing to reach this assertion code.
> 
> Thanks,
> Christian

That doesn't seem right to me. The fact that a CastII dies on a path that doesn't die is a sign, in my opinion, that the graph is broken.
So:
iArrFld2[j] = 8;
has a CastII that becomes top because the loop j <= -1. And the range check for that array access is a predicate. So the loop in which the store to iArrFld2 is is unreachable. That's why the CastII dies. Do I understand correctly?
Isn't the problem that we would need skeleton predicates between the peel iteration and the loop body to catch that the loop is unreachable?

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

PR: https://git.openjdk.java.net/jdk18/pull/11


More information about the hotspot-compiler-dev mailing list