RFR: 8332369: C2: assert(false) failed: graph should be schedulable after JDK-8324517
Christian Hagedorn
chagedorn at openjdk.org
Fri May 17 14:28:02 UTC 2024
On Fri, 17 May 2024 07:50:08 GMT, Roland Westrelin <roland at openjdk.org> wrote:
> The issue occurs when a `Mod` node is processed during
> final_graph_reshaping: if a `Div` node is found with the same inputs,
> the `Mod` is replaced either by a `DivMod` node or a subgraph that has
> the `Div` node as input. Finding the `Div` node is done
> `find_similar()` which ignores the precedence edges. What happens is
> that the `Div` node returned by `find_similar()` could have a
> precedence edge that pins it at a control that doesn't dominate the
> control of some of the uses of the `Mod` node.
>
> The fix I propose is to simply not perfom the transformation if one of
> the nodes has precedence edges (which should be a rare corner case).
src/hotspot/share/opto/compile.cpp line 3626:
> 3624: // Check if a%b and a/b both exist
> 3625: Node* d = n->find_similar(Op_DivI);
> 3626: if (d && !d->has_prec_edges()) {
Could be replaced with
Suggestion:
if (d != nullptr && !d->has_prec_edges()) {
Same at other places below.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/19277#discussion_r1605101465
More information about the hotspot-compiler-dev
mailing list