Reverting the change in loopPredicate.cpp:1393 and running the regression test crashes the frequency computation code:
http://cr.openjdk.java.net/~thartmann/8235452/webrev.00/
#
# A fatal error has been detected by the Java Runtime Environment:
#
# Internal Error (/oracle/jdk_jdk/open/src/hotspot/share/opto/loopPredicate.cpp:888), pid=18401, tid=18412
# assert(_phase->get_loop(c) == loop) failed: have to be in the same loop
#
# JRE version: Java(TM) SE Runtime Environment (14.0) (fastdebug build 14-internal+0-adhoc.tobias.open)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (fastdebug 14-internal+0-adhoc.tobias.open, mixed mode, compressed oops, g1 gc, linux-amd64)
# Problematic frame:
# V [libjvm.so+0x116338b] PathFrequency::to(Node*)+0x9b
#
# Core dump will be written. Default location: Core dumps may be processed with "/usr/share/apport/apport %p %s %c %d %P" (or dumping to /home/tobias/Downloads/tmp2/tmp/core.18401)
#
# If you would like to submit a bug report, please visit:
# https://bugreport.java.com/bugreport/crash.jsp
#
--------------- S U M M A R Y ------------
Command Line: -Xbatch -XX:CompileCommand=quiet -XX:CompileCommand=compileonly,Test::test -XX:+PrintCompilation -XX:-TieredCompilation -XX:+TraceLoopOpts -XX:+UseG1GC -XX:PrintIdealGraphFile=graph.xml -XX:+PrintIdealGraph -XX:PrintIdealGraphLevel=4 Test
Host: prometheus, Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz, 8 cores, 15G, Ubuntu 18.04.3 LTS
Time: Mon Dec 9 09:28:46 2019 CET elapsed time: 0 seconds (0d 0h 0m 0s)
--------------- T H R E A D ---------------
Current thread (0x00007fc3e03cf000): JavaThread "C2 CompilerThread0" daemon [_thread_in_native, id=18412, stack(0x00007fc3ba8aa000,0x00007fc3ba9ab000)]
Current CompileTask:
C2: 696 29 % b Test::test @ 19 (49 bytes)
Stack: [0x00007fc3ba8aa000,0x00007fc3ba9ab000], sp=0x00007fc3ba9a5080, free space=1004k
Native frames: (J=compiled Java code, A=aot compiled Java code, j=interpreted, Vv=VM code, C=native code)
V [libjvm.so+0x116338b] PathFrequency::to(Node*)+0x9b
V [libjvm.so+0x115feb9] PhaseIdealLoop::loop_predication_impl(IdealLoopTree*) [clone .part.93]+0x999
V [libjvm.so+0x11606ba] IdealLoopTree::loop_predication(PhaseIdealLoop*)+0x1ca
V [libjvm.so+0x1198519] PhaseIdealLoop::build_and_optimize(LoopOptsMode)+0xfd9
V [libjvm.so+0x978e41] PhaseIdealLoop::optimize(PhaseIterGVN&, LoopOptsMode)+0x2c1
V [libjvm.so+0x975cd8] Compile::Optimize()+0xa08
V [libjvm.so+0x977565] Compile::Compile(ciEnv*, C2Compiler*, ciMethod*, int, bool, bool, bool, DirectiveSet*)+0x1215
V [libjvm.so+0x7e1140] C2Compiler::compile_method(ciEnv*, ciMethod*, int, DirectiveSet*)+0x110
V [libjvm.so+0x9836db] CompileBroker::invoke_compiler_on_method(CompileTask*)+0x2db
V [libjvm.so+0x9846b8] CompileBroker::compiler_thread_loop()+0x4d8
V [libjvm.so+0x16a8db6] JavaThread::thread_main_inner()+0x206
V [libjvm.so+0x16adf16] Thread::call_run()+0xf6
V [libjvm.so+0x13c955e] thread_native_entry(Thread*)+0x10e