From aec3078a261f536c88115b961587ab1ae2183206 Mon Sep 17 00:00:00 2001 From: Saranya Natarajan Date: Fri, 23 Jan 2026 13:22:10 +0100 Subject: [PATCH] fix --- src/hotspot/share/opto/compile.cpp | 7 ++++--- src/hotspot/share/opto/compile.hpp | 3 ++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/hotspot/share/opto/compile.cpp b/src/hotspot/share/opto/compile.cpp index 202246ab244..b7f96ebb5e7 100644 --- a/src/hotspot/share/opto/compile.cpp +++ b/src/hotspot/share/opto/compile.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2026, 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 @@ -1876,7 +1876,7 @@ 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() || ((0 <= _loop_opts_cnt) && (_loop_opts_cnt < LoopOptsCount))) { + if (_print_phase_loop_opts) { print_method(PHASE_AFTER_LOOP_OPTS, 2); } C->set_post_loop_opts_phase(); // no more loop opts allowed @@ -2404,7 +2404,8 @@ void Compile::Optimize() { if (failing()) return; - if (has_loops()) { + _print_phase_loop_opts = has_loops(); + if (_print_phase_loop_opts) { print_method(PHASE_BEFORE_LOOP_OPTS, 2); } diff --git a/src/hotspot/share/opto/compile.hpp b/src/hotspot/share/opto/compile.hpp index 45a3a4f548f..bf8b26c684c 100644 --- a/src/hotspot/share/opto/compile.hpp +++ b/src/hotspot/share/opto/compile.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2026, 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 @@ -355,6 +355,7 @@ class Compile : public Phase { bool _print_assembly; // True if we should dump assembly code for this compilation bool _print_inlining; // True if we should print inlining for this compilation bool _print_intrinsics; // True if we should print intrinsics for this compilation + bool _print_phase_loop_opts; // True if we should before and after print phase loop opts #ifndef PRODUCT uint _phase_counter; // Counter for the number of already printed phases uint _igv_idx; // Counter for IGV node identifiers