Irreducible loop

Control-flow graph

(a) an if-then-else
(b) a while loop
(c) a natural loop with two exits, e.g. while with an if…break in the middle; non-structured but reducible
(d) an irreducible CFG: a loop with two entry points, e.g. goto into a while or for loop

Java case

public class IrreducibleLoop {
    public static void test(int loop) {


super public class IrreducibleLoop
    version 63:0
  public Method "<init>":"()V" 
    stack 1 locals 1
        invokespecial    Method java/lang/Object."<init>":"()V";
  public static Method test:"(I)V" 
    stack 2 locals 2
    L0: iconst_0;
        ifne    L2;
    L1: stack_frame_type append;
        locals_map int;
        if_icmpge    L3;
    L2: stack_frame_type same;
        goto    L1;
    L3: stack_frame_type chop1;

} // end Class IrreducibleLoop

public class Main {
    public static void main(String[] args) {
        for (int i = 0; i < 12000; i++) {


java -jar asmtools-core-7.0.b10-ea.jar jasm IrreducibleLoop.jasm
java -XX:TieredStopAtLevel=1 -Xcomp -XX:CompileCommand=compileonly,IrreducibleLoop::* Main


Float-point fused Multiply-Add AArch64 vs LoongArch64

AA64: fmadd  d, n, m, a: d = a + n * m
LA64: fmadd  d, j, k, a: d = a + j * k

AA64: fmsub  d, n, m, a: d = a + (-n) * m
                         d = a - n * m
                         d = - (n * m - a)
LA64: fnmsub d, j, k, a: d = - (j * k - a)
                         d = a - j * k
                         d = a + (-j) * k

AA64: fnmadd d, n, m, a: d = (-a) + (-n) * m
                         d = - (n * m + a)
LA64: fnmadd d, j, k, a: d = - (j * k + a)
                         d = (-a) + (-n * m)

AA64: fnmsub d, n, m, a: d = (-a) + n * m
                         d = n * m - a
LA64: fmsub  d, j, k, a: d = j * k - a
                         d = (-a) + j * k

Hotspot stress diagnostic options

SafepointALot: Generate a lot of safepoints. This works with GuaranteedSafepointInterval.

HandshakeALot: Generate a lot of handshakes. This works with GuaranteedSafepointInterval.

DeoptimizeALot: Deoptimize at every exit from the runtime system.

ZombieALot: Create zombies (non-entrant) at exit from the runtime system.

WalkStackALot: Trace stack (no print) at every exit from the runtime system.

DeoptimizeObjectsALot: For testing purposes concurrent threads revert optimizations based on escape analysis at intervals given with DeoptimizeObjectsALotInterval=n. The thread count is given with DeoptimizeObjectsALotThreadCountSingle and DeoptimizeObjectsALotThreadCountAll.

DontYieldALot: Throw away obvious excess yield calls.

StringDeduplicationResizeALot: Force more frequent table resizing.

DeoptimizeNMethodBarriersALot: Make nmethod barriers deoptimise a lot.

OpenJDK Guide

Java Virtual Machine Guide:

HostSpot Virtual Machine Garbage Collection Tuning Guide:

OpenJDK Developers’ Guide:

HotSpot Runtime Overview:

Java Coding Style:

HotSpot Coding Style:

HotSpot VM Options:


HotSpot Glossary of Terms:

Building the JDK:

Building jtreg:

JVM Allocate Prefetch Options: