diff --git a/src/hotspot/share/opto/compile.cpp b/src/hotspot/share/opto/compile.cpp index 8a059d0852f..c830d0c854b 100644 --- a/src/hotspot/share/opto/compile.cpp +++ b/src/hotspot/share/opto/compile.cpp @@ -1857,6 +1857,9 @@ void Compile::process_for_post_loop_opts_igvn(PhaseIterGVN& igvn) { // at least to this point, even if no loop optimizations were done. PhaseIdealLoop::verify(igvn); + if (has_loops() || _loop_opts_cnt > 0) { + print_method(PHASE_AFTER_LOOP_OPTS, 2); + } C->set_post_loop_opts_phase(); // no more loop opts allowed assert(!C->major_progress(), "not cleared"); @@ -2377,6 +2380,10 @@ void Compile::Optimize() { if (failing()) return; + if (has_loops()) { + print_method(PHASE_BEFORE_LOOP_OPTS, 2); + } + // Perform escape analysis if (do_escape_analysis() && ConnectionGraph::has_candidates(this)) { if (has_loops()) { diff --git a/src/hotspot/share/opto/phasetype.hpp b/src/hotspot/share/opto/phasetype.hpp index 318a01e3bd8..b3076dd8091 100644 --- a/src/hotspot/share/opto/phasetype.hpp +++ b/src/hotspot/share/opto/phasetype.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2025, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -48,6 +48,7 @@ flags(ELIMINATE_VBOX_ALLOC, "Eliminate VectorBoxAllocate") \ flags(ITER_GVN_BEFORE_EA, "Iter GVN before EA") \ flags(ITER_GVN_AFTER_VECTOR, "Iter GVN after vector box elimination") \ + flags(BEFORE_LOOP_OPTS, "Before Loop Optimizations") \ flags(BEFORE_BEAUTIFY_LOOPS, "Before beautify loops") \ flags(AFTER_BEAUTIFY_LOOPS, "After beautify loops") \ flags(BEFORE_LOOP_UNROLLING, "Before Loop Unrolling") \ @@ -88,6 +89,7 @@ flags(CCP1, "PhaseCCP 1") \ flags(ITER_GVN2, "Iter GVN 2") \ flags(PHASEIDEALLOOP_ITERATIONS, "PhaseIdealLoop iterations") \ + flags(AFTER_LOOP_OPTS, "After Loop Optimizations") \ flags(AFTER_MERGE_STORES, "After Merge Stores") \ flags(BEFORE_MACRO_EXPANSION , "Before Macro Expansion") \ flags(AFTER_MACRO_EXPANSION_STEP, "After Macro Expansion Step") \ diff --git a/test/hotspot/jtreg/compiler/lib/ir_framework/CompilePhase.java b/test/hotspot/jtreg/compiler/lib/ir_framework/CompilePhase.java index 6f4410a0220..ad32f6a94b9 100644 --- a/test/hotspot/jtreg/compiler/lib/ir_framework/CompilePhase.java +++ b/test/hotspot/jtreg/compiler/lib/ir_framework/CompilePhase.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2022, 2025, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -58,6 +58,7 @@ public enum CompilePhase { ELIMINATE_VBOX_ALLOC("Eliminate VectorBoxAllocate"), ITER_GVN_BEFORE_EA("Iter GVN before EA"), ITER_GVN_AFTER_VECTOR("Iter GVN after vector box elimination"), + BEFORE_LOOP_OPTS("Before Loop Optimizations"), BEFORE_BEAUTIFY_LOOPS("Before beautify loops"), AFTER_BEAUTIFY_LOOPS("After beautify loops"), BEFORE_LOOP_UNROLLING("Before Loop Unrolling"), @@ -95,6 +96,7 @@ public enum CompilePhase { CCP1("PhaseCCP 1"), ITER_GVN2("Iter GVN 2"), PHASEIDEALLOOP_ITERATIONS("PhaseIdealLoop iterations"), + AFTER_LOOP_OPTS("After Loop Optimizations"), AFTER_MERGE_STORES("After Merge Stores"), BEFORE_MACRO_EXPANSION("Before Macro Expansion"), AFTER_MACRO_EXPANSION_STEP("After Macro Expansion Step"),