[14] RFR(S): 8233529: loopTransform.cpp:2984: Error: assert(p_f->Opcode() == Op_IfFalse) failed
Tobias Hartmann
tobias.hartmann at oracle.com
Fri Nov 8 12:52:04 UTC 2019
Hi,
please review the following patch:
https://bugs.openjdk.java.net/browse/JDK-8233529
http://cr.openjdk.java.net/~thartmann/8233529/webrev.00/
We have two loops (see TestRemoveMainPostLoops.java): Loop A with an inner loop followed by Loop B.
(1) OSR compilation is triggered in loop B.
(2) Pre-/main-/post loops are created for loop B.
(3) Main and post loops of B are found empty and are removed.
(4) Inner loop A is fully unrolled and removed.
(5) Only main and post loops are created for A (no pre loop -> "PeelMainPost") and main is unrolled.
(6) Pre loop of A is found empty, attempt to remove main and post loop then incorrectly selects main
loop from A.
The loop layout looks like this:
Loop: N0/N0 has_sfpt
Loop: N383/N718 limit_check sfpts={ 160 }
Loop: N512/N517 counted [int,int),+1 (4 iters) pre has_sfpt <- belongs to A
Loop: N760/N338 counted [1,100),+2 (102 iters) main has_sfpt <- belongs to B
Loop: N713/N716 counted [int,101),+1 (4 iters) post has_sfpt <- belongs to B
Please note that the order of the two loops is not like in the Java code because it's an OSR
compilation that starts execution in the second loop.
I've strengthened the asserts in locate_pre_from_main() and added a check for is_main_no_pre_loop()
in the caller.
The code has been introduced by JDK-8085832 [1].
Thanks,
Tobias
[1] https://bugs.openjdk.java.net/browse/JDK-8085832
More information about the hotspot-compiler-dev
mailing list