RFR: 8312440: assert(cast != nullptr) failed: must have added a cast to pin the node
Christian Hagedorn
chagedorn at openjdk.org
Tue Jul 25 09:34:43 UTC 2023
On Mon, 24 Jul 2023 14:26:48 GMT, Roland Westrelin <roland at openjdk.org> wrote:
> The test has a loop nest with 2 loops. A node is sunk out of the inner
> loop. A cast is created to pin the node out of loop. The logic added
> by 8308103 looks for an existing cast with the same inputs. It finds
> one and uses that one. That existing cast was created before the
> current round of loop opts. Eventhough it has the right out of inner
> loop (but in outer loop) control input, it was assigned a control out
> of both loops (the control is legal, it just happens that no use keeps
> the cast in the outer loop). Next, the same node is sunk out of the
> outer loop. The logic for sinking nodes looks for an input in the
> outer loop (otherwise why would the node be in the outer loop) and
> find none even though there should be one. The assert fires. The
> reason is that the cast input has control out of loop. The fix I
> propose is to not use an existing cast if it doesn't have the expected
> control.
Looks good to me.
-------------
Marked as reviewed by chagedorn (Reviewer).
PR Review: https://git.openjdk.org/jdk/pull/14999#pullrequestreview-1545036309
More information about the hotspot-compiler-dev
mailing list