RFR: 8256655: rework long counted loop handling [v3]

Tobias Hartmann thartmann at openjdk.java.net
Thu Nov 26 07:29:54 UTC 2020


On Fri, 20 Nov 2020 13:29:26 GMT, Roland Westrelin <roland at openjdk.org> wrote:

>> Did some quick sanity testing and `compiler/regalloc/TestC1OverlappingRegisterHint` fails with `assert(init_n->get_int() + cl->stride_con() >= cl->limit()->get_int()) failed: should be one iteration`.
>
>> Did some quick sanity testing and `compiler/regalloc/TestC1OverlappingRegisterHint` fails with `assert(init_n->get_int() + cl->stride_con() >= cl->limit()->get_int()) failed: should be one iteration`.
> 
> Thanks. That assert is broken AFAICT. It doesn't seem to account for a downward loop (which would seem to indicate that IdealLoopTree::do_one_iteration_loop() never triggered). I pushed a fix.

I ran this through some more stress testing with different values of `StressLongCountedLoop`. It all looks good except for the following crash with `compiler/c2/Test8217359.java`:

`assert(!in->is_CFG()) failed: CFG Node with no controlling input?`
Current CompileTask:
C2:    295    2 %           compiler.c2.Test8217359::test @ 43 (164 bytes)

Stack: [0x00007f4abcffc000,0x00007f4abd0fd000],  sp=0x00007f4abd0f7490,  free space=1005k
Native frames: (J=compiled Java code, A=aot compiled Java code, j=interpreted, Vv=VM code, C=native code)
V  [libjvm.so+0x1324824]  PhaseIdealLoop::build_loop_early(VectorSet&, Node_List&, Node_Stack&)+0x6e4
V  [libjvm.so+0x132ccca]  PhaseIdealLoop::build_and_optimize(LoopOptsMode)+0x4aa
V  [libjvm.so+0xa16698]  PhaseIdealLoop::optimize(PhaseIterGVN&, LoopOptsMode)+0x328
V  [libjvm.so+0xa12955]  Compile::Optimize()+0x13c5
V  [libjvm.so+0xa147c8]  Compile::Compile(ciEnv*, ciMethod*, int, bool, bool, bool, bool, DirectiveSet*)+0x1838
V  [libjvm.so+0x846cec]  C2Compiler::compile_method(ciEnv*, ciMethod*, int, bool, DirectiveSet*)+0x1dc
V  [libjvm.so+0xa24a28]  CompileBroker::invoke_compiler_on_method(CompileTask*)+0xe08
V  [libjvm.so+0xa25578]  CompileBroker::compiler_thread_loop()+0x5a8
V  [libjvm.so+0x18ab7c6]  JavaThread::thread_main_inner()+0x256
V  [libjvm.so+0x18b2150]  Thread::call_run()+0x100
V  [libjvm.so+0x15950f6]  thread_native_entry(Thread*)+0x116

Happens with `-XX:+UseParallelGC -XX:+UseNUMA -XX:StressLongCountedLoop=200000000`. Let me know if you need more info to reproduce.

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

PR: https://git.openjdk.java.net/jdk/pull/1316


More information about the hotspot-compiler-dev mailing list