8310220: IGV: dump graph after each IGVN step at level 4

Reviewed-by: chagedorn, tholenstein
This commit is contained in:
Roberto Castañeda Lozano 2023-09-04 07:41:41 +00:00
parent adfc1d6cd2
commit 0d52c82ed1
7 changed files with 28 additions and 14 deletions

View File

@ -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") \

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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") \

View File

@ -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

View File

@ -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.
*
* <p>
* 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"),