diff --git a/src/hotspot/share/opto/c2_globals.hpp b/src/hotspot/share/opto/c2_globals.hpp index 8d5b749f3fb..d8125660ca7 100644 --- a/src/hotspot/share/opto/c2_globals.hpp +++ b/src/hotspot/share/opto/c2_globals.hpp @@ -365,10 +365,10 @@ "Level of detail of the ideal graph printout. " \ "System-wide value, -1=printing is disabled, " \ "0=print nothing except IGVPrintLevel directives, " \ - "4=all details printed. " \ + "5=all details printed. " \ "Level of detail of printouts can be set on a per-method level " \ "as well by using CompileCommand=option.") \ - range(-1, 4) \ + range(-1, 5) \ \ notproduct(intx, PrintIdealGraphPort, 4444, \ "Ideal graph printer to network port") \ diff --git a/src/hotspot/share/opto/output.cpp b/src/hotspot/share/opto/output.cpp index ef30f6297e0..9778c289167 100644 --- a/src/hotspot/share/opto/output.cpp +++ b/src/hotspot/share/opto/output.cpp @@ -260,7 +260,7 @@ void PhaseOutput::perform_mach_node_analysis() { pd_perform_mach_node_analysis(); - C->print_method(CompilerPhaseType::PHASE_MACH_ANALYSIS, 4); + C->print_method(CompilerPhaseType::PHASE_MACH_ANALYSIS, 3); } // Convert Nodes to instruction bits and pass off to the VM diff --git a/src/hotspot/share/opto/parse2.cpp b/src/hotspot/share/opto/parse2.cpp index 56fe6dc8053..03bcba13346 100644 --- a/src/hotspot/share/opto/parse2.cpp +++ b/src/hotspot/share/opto/parse2.cpp @@ -2785,7 +2785,7 @@ void Parse::do_one_bytecode() { jio_snprintf(buffer, sizeof(buffer), "Bytecode %d: %s", bci(), Bytecodes::name(bc())); bool old = printer->traverse_outs(); printer->set_traverse_outs(true); - printer->print_method(buffer, 4); + printer->print_method(buffer, 5); printer->set_traverse_outs(old); } #endif diff --git a/src/hotspot/share/opto/phaseX.cpp b/src/hotspot/share/opto/phaseX.cpp index 1e36f015117..e21b54dde26 100644 --- a/src/hotspot/share/opto/phaseX.cpp +++ b/src/hotspot/share/opto/phaseX.cpp @@ -891,9 +891,12 @@ void PhaseIterGVN::verify_step(Node* n) { } void PhaseIterGVN::trace_PhaseIterGVN(Node* n, Node* nn, const Type* oldtype) { + const Type* newtype = type_or_null(n); + if (nn != n || oldtype != newtype) { + C->print_method(PHASE_AFTER_ITER_GVN_STEP, 4, n); + } if (TraceIterativeGVN) { uint wlsize = _worklist.size(); - const Type* newtype = type_or_null(n); if (nn != n) { // print old node tty->print("< "); @@ -1021,6 +1024,7 @@ void PhaseIterGVN::trace_PhaseIterGVN_verbose(Node* n, int num_processed) { void PhaseIterGVN::optimize() { DEBUG_ONLY(uint num_processed = 0;) NOT_PRODUCT(init_verifyPhaseIterGVN();) + C->print_method(PHASE_BEFORE_ITER_GVN, 3); if (StressIGVN) { shuffle_worklist(); } @@ -1030,12 +1034,14 @@ void PhaseIterGVN::optimize() { // update edge info and put uses on worklist. while(_worklist.size()) { if (C->check_node_count(NodeLimitFudgeFactor * 2, "Out of nodes")) { + C->print_method(PHASE_AFTER_ITER_GVN, 3); return; } Node* n = _worklist.pop(); if (loop_count >= K * C->live_nodes()) { DEBUG_ONLY(dump_infinite_loop_info(n, "PhaseIterGVN::optimize");) C->record_method_not_compilable("infinite loop in PhaseIterGVN::optimize"); + C->print_method(PHASE_AFTER_ITER_GVN, 3); return; } DEBUG_ONLY(trace_PhaseIterGVN_verbose(n, num_processed++);) @@ -1050,6 +1056,7 @@ void PhaseIterGVN::optimize() { loop_count++; } NOT_PRODUCT(verify_PhaseIterGVN();) + C->print_method(PHASE_AFTER_ITER_GVN, 3); } #ifdef ASSERT diff --git a/src/hotspot/share/opto/phasetype.hpp b/src/hotspot/share/opto/phasetype.hpp index af2e584ce6a..ce27cd2a7f1 100644 --- a/src/hotspot/share/opto/phasetype.hpp +++ b/src/hotspot/share/opto/phasetype.hpp @@ -30,7 +30,10 @@ flags(AFTER_STRINGOPTS, "After StringOpts") \ flags(BEFORE_REMOVEUSELESS, "Before RemoveUseless") \ flags(AFTER_PARSING, "After Parsing") \ + flags(BEFORE_ITER_GVN, "Before Iter GVN") \ flags(ITER_GVN1, "Iter GVN 1") \ + flags(AFTER_ITER_GVN_STEP, "After Iter GVN Step") \ + flags(AFTER_ITER_GVN, "After Iter GVN") \ flags(INCREMENTAL_INLINE_STEP, "Incremental Inline Step") \ flags(INCREMENTAL_INLINE_CLEANUP, "Incremental Inline Cleanup") \ flags(INCREMENTAL_INLINE, "Incremental Inline") \ diff --git a/src/utils/IdealGraphVisualizer/README.md b/src/utils/IdealGraphVisualizer/README.md index 2a364dc19e2..f930ea604a4 100644 --- a/src/utils/IdealGraphVisualizer/README.md +++ b/src/utils/IdealGraphVisualizer/README.md @@ -22,15 +22,16 @@ for building and running IGV. # Usage -The JVM support is controlled by the flag `-XX:PrintIdealGraphLevel=#` where `#` -is: +The JVM support is controlled by the flag `-XX:PrintIdealGraphLevel=N`, where +Ideal graphs are dumped at the following points: -* 0: no output, the default -* 1: dumps graph after parsing, before matching, and final code (also dumps - graphs for failed compilations, if available) -* 2: more detail, including after loop opts -* 3: even more detail -* 4: prints graph after parsing every bytecode (very slow) +* `N=0`: no output (default) +* `N=1`: after parsing, before matching, and final code (also for failed + compilations, if available) +* `N=2`: additionally, after every major phase (including loop opts) +* `N=3`: additionally, after every minor phase +* `N=4`: additionally, after every effective IGVN step (slow) +* `N=5`: additionally, after parsing every bytecode (very slow) By default the JVM expects that it will connect to a visualizer on the local host on port 4444. This can be configured using the options diff --git a/test/hotspot/jtreg/compiler/lib/ir_framework/CompilePhase.java b/test/hotspot/jtreg/compiler/lib/ir_framework/CompilePhase.java index 6cb889a80e4..6f5149a79ba 100644 --- a/test/hotspot/jtreg/compiler/lib/ir_framework/CompilePhase.java +++ b/test/hotspot/jtreg/compiler/lib/ir_framework/CompilePhase.java @@ -29,7 +29,7 @@ import java.util.Map; /** * This enum represents all available compile phases on which an IR matching can be done. There is a 1:1 mapping * between IGV phases as specified in phasetype.hpp. Compile phases which are normally not emitted by C2 like FAILURE - * or DEBUG are not listed. This enum should be kept in sync with phasetye.hpp. + * or DEBUG are not listed. This enum should be kept in sync with phasetype.hpp. * *
* There are two additional compile phases PRINT_IDEAL and PRINT_OPTO_ASSEMBLY. PRINT_IDEAL is the output that is printed @@ -43,7 +43,10 @@ public enum CompilePhase { AFTER_STRINGOPTS("After StringOpts"), BEFORE_REMOVEUSELESS("Before RemoveUseless"), AFTER_PARSING("After Parsing"), + BEFORE_ITER_GVN("Before Iter GVN"), ITER_GVN1("Iter GVN 1"), + AFTER_ITER_GVN_STEP("After Iter GVN Step"), + AFTER_ITER_GVN("After Iter GVN"), INCREMENTAL_INLINE_STEP("Incremental Inline Step"), INCREMENTAL_INLINE_CLEANUP("Incremental Inline Cleanup"), INCREMENTAL_INLINE("Incremental Inline"),