RFR: 8305189: C2 failed "assert(_outcnt==1) failed: not unique" [v2]

Tobias Hartmann thartmann at openjdk.org
Mon May 15 13:41:56 UTC 2023


On Thu, 11 May 2023 08:05:49 GMT, Roland Westrelin <roland at openjdk.org> wrote:

>> pre/main/post loops are created for an inner loop of a loop nest but
>> assert predicates cause the main and post loops to be removed. The
>> OpaqueZeroTripGuard nodes for the loops are not removed: there's no
>> logic to trigger removal of the opaque nodes once the loops are no
>> longer there. With the inner loops gone, the outer loop becomes
>> candidate for optimizations and is unrolled which causes the zero trip
>> guards of the now removed loops to be duplicated and the opaque nodes
>> to have more than one use.
>> 
>> The fix I propose is, using logic similar to
>> `PhaseIdealLoop::eliminate_useless_predicates()`, to check during loop
>> opts if every OpaqueZeroTripGuard node guards a loop and if not,
>> remove it.
>
> Roland Westrelin has updated the pull request incrementally with one additional commit since the last revision:
> 
>   review

I see the following failure with `TestMissingMulLOptimization` from JDK-8299546 and `-XX:StressLongCountedLoop=2000000`:


# A fatal error has been detected by the Java Runtime Environment:
#
#  Internal Error (c:\sb\prod\1684151031\workspace\open\src\hotspot\share\opto\loopnode.cpp:4157), pid=5368, tid=836
#  Error: assert(loop == nullptr) failed

Current CompileTask:
C2:    267   15    b  4       compiler.ccp.TestMissingMulLOptimization::test (101 bytes)

Stack: [0x0000002f4f600000,0x0000002f4f700000]
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V  [jvm.dll+0xc53091]  os::win32::platform_print_native_stack+0xf1  (os_windows_x86.cpp:236)
V  [jvm.dll+0xee2a99]  VMError::report+0x1019  (vmError.cpp:815)
V  [jvm.dll+0xee4775]  VMError::report_and_die+0x645  (vmError.cpp:1596)
V  [jvm.dll+0xee4e84]  VMError::report_and_die+0x64  (vmError.cpp:1361)
V  [jvm.dll+0x55053b]  report_vm_error+0x5b  (debug.cpp:191)
V  [jvm.dll+0xadcab2]  PhaseIdealLoop::eliminate_useless_zero_trip_guard+0x2f2  (loopnode.cpp:4157)
V  [jvm.dll+0xad0fb1]  PhaseIdealLoop::build_and_optimize+0x971  (loopnode.cpp:4455)
V  [jvm.dll+0x4ebc51]  Compile::optimize_loops+0x1d1  (compile.cpp:2155)
V  [jvm.dll+0x4de2e8]  Compile::Optimize+0xef8  (compile.cpp:2391)
V  [jvm.dll+0x4db378]  Compile::Compile+0x1458  (compile.cpp:840)
V  [jvm.dll+0x3f05ba]  C2Compiler::compile_method+0x11a  (c2compiler.cpp:121)
V  [jvm.dll+0x4f6a81]  CompileBroker::invoke_compiler_on_method+0x881  (compileBroker.cpp:2268)
V  [jvm.dll+0x4f3ea6]  CompileBroker::compiler_thread_loop+0x396  (compileBroker.cpp:1945)
V  [jvm.dll+0x7f2ff9]  JavaThread::thread_main_inner+0x279  (javaThread.cpp:720)
V  [jvm.dll+0xe5434d]  Thread::call_run+0x1cd  (thread.cpp:222)
V  [jvm.dll+0xc519c2]  os::win32::thread_native_entry+0xa2  (os_windows.cpp:551)

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

PR Comment: https://git.openjdk.org/jdk/pull/13901#issuecomment-1547878541


More information about the hotspot-compiler-dev mailing list