RFR: 8346184: C2: assert(has_node(i)) failed during split thru phi
Christian Hagedorn
chagedorn at openjdk.org
Thu Dec 19 15:16:41 UTC 2024
On Wed, 18 Dec 2024 16:57:45 GMT, Roland Westrelin <roland at openjdk.org> wrote:
> The assert fires during split thru phi because a call to `Identity`
> returns a new node (a constant null pointer). That happens because a
> `Load`, once pushed thru phi, can be constant folded because it loads
> from a newly allocated array. `Identity` shouldn't return new
> nodes. When split thru phi runs, in this case, `Value` should be the
> one returning constant null, not `Identity`. There is logic for that
> in `LoadNode::Value` but it's after some other checks that cause
> `Value` to return too early.
>
> To fix this, I propose reordering checks in `LoadNode::Value`.
The new test is failing with the following flags on linux-x64-debug:
-XX:-TieredCompilation -XX:+StressReflectiveCode -XX:-ReduceInitialCardMarks -XX:-ReduceBulkZeroing -XX:-ReduceFieldZeroing
Failure:
#
# A fatal error has been detected by the Java Runtime Environment:
#
# Internal Error (/opt/mach5/mesos/work_dir/slaves/49f0d299-805f-43f1-8a74-e67c7385a574-S24/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/7236421f-9d14-4db4-8d55-50f4b96324bd/runs/a8cf3c0e-8858-4049-aa6b-7542a0f8b292/workspace/open/src/hotspot/share/opto/loopnode.hpp:1003), pid=763505, tid=763528
# Error: assert(has_node(i)) failed
..........
C2:196 46 % b TestLoadSplitThruPhiNull::test1 @ 18 (108 bytes)
Stack: [0x00007f92584f2000,0x00007f92585f2000], sp=0x00007f92585ecd90, free space=1003k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V [libjvm.so+0x12f7d54] PhaseIdealLoop::get_ctrl(Node const*)+0x3e4 (loopnode.hpp:1003)
V [libjvm.so+0x1340cc4] PhaseIdealLoop::split_thru_phi(Node*, Node*, int)+0x524 (loopopts.cpp:192)
V [libjvm.so+0x1345cb4] PhaseIdealLoop::split_if_with_blocks_pre(Node*)+0x2a4 (loopopts.cpp:1226)
V [libjvm.so+0x134abf5] PhaseIdealLoop::split_if_with_blocks(VectorSet&, Node_Stack&)+0x1f5 (loopopts.cpp:1982)
V [libjvm.so+0x133c5d6] PhaseIdealLoop::build_and_optimize()+0x10a6 (loopnode.cpp:4889)
V [libjvm.so+0xa58e58] PhaseIdealLoop::optimize(PhaseIterGVN&, LoopOptsMode)+0x3a8 (loopnode.hpp:1113)
-------------
PR Comment: https://git.openjdk.org/jdk/pull/22818#issuecomment-2554546719
More information about the hotspot-compiler-dev
mailing list