On Tue, 23 Jun 2026 09:51:31 GMT, Roland Westrelin <[email protected]> wrote:

>> The bug is caused by a mismatch in the way `LoadFlat` and `StoreFlat`
>> are handled in `ConnectionGraph::find_inst_mem()` and
>> `MemNode::optimize_simple_memory_chain()`. Once EA has run a first
>> time, found some value array allocations as non escaping, and removed
>> their `LoadFlat`/`StoreFlat`, igvn runs and is able to further
>> transform the memory subgraph which introduces inconsistencies that
>> are then caught the next time EA runs.
>> 
>> The fix tries to make sure `ConnectionGraph::find_inst_mem()` and
>> `MemNode::optimize_simple_memory_chain()` handle `LoadFlat` and
>> `StoreFlat` similarly.
>> 
>> ---------
>> - [x] I confirm that I make this contribution in accordance with the 
>> [OpenJDK Interim AI Policy](https://openjdk.org/legal/ai).
>
> Roland Westrelin has updated the pull request with a new target base due to a 
> merge or a rebase. The pull request now contains 14 commits:
> 
>  - comment
>  - Merge branch 'lworld' into JDK-8385328
>  - Merge branch 'lworld' into JDK-8385328
>  - review
>  - Merge branch 'lworld' into JDK-8385328
>  - more
>  - review
>  - review
>  - Merge branch 'lworld' into JDK-8385328
>  - more
>  - ... and 4 more: 
> https://git.openjdk.org/valhalla/compare/5e32888b...cad66106

I'm doing some Mach5 testing with the v08 version of this fix.

I'm seeing some new failures in Tier6:

compiler/valhalla/inlinetypes/TestLWorld.java#id0
compiler/valhalla/inlinetypes/TestLWorld.java#id5
compiler/valhalla/inlinetypes/TestLWorld.java#id6

fail with this C2 crash:


#
# A fatal error has been detected by the Java Runtime Environment:
#
#  Internal Error 
(/opt/mach5/mesos/work_dir/slaves/a9102fc6-1add-4658-abb6-501aa00dd79e-S28240/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/6145271d-45c3-4415-9f21-e7c3a927c3e0/runs/753b04f7-d4eb-4ea7-b728-7cf1952598b7/workspace/open/src/hotspot/share/opto/type.hpp:2574),
 pid=111669, tid=111685
#  assert(_base >= OopPtr && _base <= AryPtr) failed: Not a Java pointer
#
# JRE version: Java(TM) SE Runtime Environment (28.0) (fastdebug build 
28-internal-2026-06-23-1927384.daniel.daugherty.valhallaexp.git)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (fastdebug 
28-internal-2026-06-23-1927384.daniel.daugherty.valhallaexp.git, compiled mode, 
sharing, tiered, compressed oops, compact obj headers, g1 gc, linux-amd64)
# Problematic frame:
# V  [libjvm.so+0xe19ff2]  ConnectionGraph::flat_access_aliases_with(Node*, 
TypeOopPtr const*)+0x3c2
#
# Core dump will be written. Default location: Determined by the following: 
"/opt/core.sh %p" (alternatively, falling back to 
/opt/mach5/mesos/work_dir/slaves/a9102fc6-1add-4658-abb6-501aa00dd79e-S28234/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/68f8f122-f8fb-48e2-9922-f75434682798/runs/0bc758ce-a68b-4838-9540-1552bd82e62c/testoutput/test-support/jtreg_open_test_hotspot_jtreg_hotspot_valhalla/scratch/5/core.111669)
#
Unsupported internal testing APIs have been used.


with this call stack:


---------------  T H R E A D  ---------------

Current thread (0x00007f3090287d70):  JavaThread "C2 CompilerThread0" daemon 
[_thread_in_native, id=111685, stack(0x00007f3075355000,0x00007f3075455000) 
(1024K)]


Current CompileTask:
C2:57558 10443    b  4       compiler.valhalla.inlinetypes.TestLWorld::test119 
(104 bytes)

Stack: [0x00007f3075355000,0x00007f3075455000],  sp=0x00007f307544e940,  free 
space=998k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V  [libjvm.so+0xe19ff2]  ConnectionGraph::flat_access_aliases_with(Node*, 
TypeOopPtr const*)+0x3c2  (type.hpp:2574)
V  [libjvm.so+0xe1bbfc]  ConnectionGraph::find_inst_mem(Node*, int, 
Unique_Node_List&, unsigned int)+0x57c  (escape.cpp:4680)
V  [libjvm.so+0xe1adec]  ConnectionGraph::split_memory_phi(PhiNode*, int, 
Unique_Node_List&, unsigned int)+0x22c  (escape.cpp:4412)
V  [libjvm.so+0xe1c142]  ConnectionGraph::find_inst_mem(Node*, int, 
Unique_Node_List&, unsigned int)+0xac2  (escape.cpp:4758)
V  [libjvm.so+0xe1b99c]  ConnectionGraph::find_inst_mem(Node*, int, 
Unique_Node_List&, unsigned int)+0x31c  (escape.cpp:4690)
V  [libjvm.so+0xe1adec]  ConnectionGraph::split_memory_phi(PhiNode*, int, 
Unique_Node_List&, unsigned int)+0x22c  (escape.cpp:4412)
V  [libjvm.so+0xe1c142]  ConnectionGraph::find_inst_mem(Node*, int, 
Unique_Node_List&, unsigned int)+0xac2  (escape.cpp:4758)
V  [libjvm.so+0xe1b99c]  ConnectionGraph::find_inst_mem(Node*, int, 
Unique_Node_List&, unsigned int)+0x31c  (escape.cpp:4690)
V  [libjvm.so+0xe1adec]  ConnectionGraph::split_memory_phi(PhiNode*, int, 
Unique_Node_List&, unsigned int)+0x22c  (escape.cpp:4412)
V  [libjvm.so+0xe1c142]  ConnectionGraph::find_inst_mem(Node*, int, 
Unique_Node_List&, unsigned int)+0xac2  (escape.cpp:4758)
V  [libjvm.so+0xe1b99c]  ConnectionGraph::find_inst_mem(Node*, int, 
Unique_Node_List&, unsigned int)+0x31c  (escape.cpp:4690)
V  [libjvm.so+0xe1b99c]  ConnectionGraph::find_inst_mem(Node*, int, 
Unique_Node_List&, unsigned int)+0x31c  (escape.cpp:4690)
V  [libjvm.so+0xe1adec]  ConnectionGraph::split_memory_phi(PhiNode*, int, 
Unique_Node_List&, unsigned int)+0x22c  (escape.cpp:4412)
V  [libjvm.so+0xe1c142]  ConnectionGraph::find_inst_mem(Node*, int, 
Unique_Node_List&, unsigned int)+0xac2  (escape.cpp:4758)
V  [libjvm.so+0xe1b99c]  ConnectionGraph::find_inst_mem(Node*, int, 
Unique_Node_List&, unsigned int)+0x31c  (escape.cpp:4690)
V  [libjvm.so+0xe1adec]  ConnectionGraph::split_memory_phi(PhiNode*, int, 
Unique_Node_List&, unsigned int)+0x22c  (escape.cpp:4412)
V  [libjvm.so+0xe1c142]  ConnectionGraph::find_inst_mem(Node*, int, 
Unique_Node_List&, unsigned int)+0xac2  (escape.cpp:4758)
V  [libjvm.so+0xe25694]  
ConnectionGraph::split_unique_types(GrowableArray<Node*>&, 
GrowableArray<ArrayCopyNode*>&, GrowableArray<MergeMemNode*>&, 
Unique_Node_List&)+0x2144  (escape.cpp:5311)
V  [libjvm.so+0xe334c3]  ConnectionGraph::compute_escape()+0x2c33  
(escape.cpp:420)
V  [libjvm.so+0xe33c97]  ConnectionGraph::do_analysis(Compile*, 
PhaseIterGVN*)+0x177  (escape.cpp:121)
V  [libjvm.so+0xc0956c]  Compile::Optimize()+0x66c  (compile.cpp:3154)
V  [libjvm.so+0xc0d04d]  Compile::Compile(ciEnv*, ciMethod*, int, Options, 
DirectiveSet*)+0x1f2d  (compile.cpp:893)
V  [libjvm.so+0x9f3868]  C2Compiler::compile_method(ciEnv*, ciMethod*, int, 
bool, DirectiveSet*)+0x498  (c2compiler.cpp:149)
V  [libjvm.so+0xc1c704]  
CompileBroker::invoke_compiler_on_method(CompileTask*)+0x844  
(compileBroker.cpp:2041)
V  [libjvm.so+0xc1db48]  CompileBroker::compiler_thread_loop()+0x788  
(compileBroker.cpp:1748)
V  [libjvm.so+0x12061bb]  JavaThread::thread_main_inner()+0x13b  
(javaThread.cpp:651)
V  [libjvm.so+0x1c29df6]  Thread::call_run()+0xb6  (thread.cpp:243)
V  [libjvm.so+0x1823138]  thread_native_entry(Thread*)+0x118  (os_linux.cpp:931)

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

PR Comment: https://git.openjdk.org/valhalla/pull/2489#issuecomment-4784572455

Reply via email to