Skip to content

Commit a86c606

Browse files
author
duke
committedSep 4, 2023
Automatic merge of jdk:master into master
2 parents 852a3d9 + 0d52c82 commit a86c606

File tree

7 files changed

+29
-15
lines changed

7 files changed

+29
-15
lines changed
 

‎src/hotspot/share/opto/c2_globals.hpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -365,10 +365,10 @@
365365
"Level of detail of the ideal graph printout. " \
366366
"System-wide value, -1=printing is disabled, " \
367367
"0=print nothing except IGVPrintLevel directives, " \
368-
"4=all details printed. " \
368+
"5=all details printed. " \
369369
"Level of detail of printouts can be set on a per-method level " \
370370
"as well by using CompileCommand=option.") \
371-
range(-1, 4) \
371+
range(-1, 5) \
372372
\
373373
notproduct(intx, PrintIdealGraphPort, 4444, \
374374
"Ideal graph printer to network port") \

‎src/hotspot/share/opto/output.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ void PhaseOutput::perform_mach_node_analysis() {
260260

261261
pd_perform_mach_node_analysis();
262262

263-
C->print_method(CompilerPhaseType::PHASE_MACH_ANALYSIS, 4);
263+
C->print_method(CompilerPhaseType::PHASE_MACH_ANALYSIS, 3);
264264
}
265265

266266
// Convert Nodes to instruction bits and pass off to the VM

‎src/hotspot/share/opto/parse2.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -2785,7 +2785,7 @@ void Parse::do_one_bytecode() {
27852785
jio_snprintf(buffer, sizeof(buffer), "Bytecode %d: %s", bci(), Bytecodes::name(bc()));
27862786
bool old = printer->traverse_outs();
27872787
printer->set_traverse_outs(true);
2788-
printer->print_method(buffer, 4);
2788+
printer->print_method(buffer, 5);
27892789
printer->set_traverse_outs(old);
27902790
}
27912791
#endif

‎src/hotspot/share/opto/phaseX.cpp

+8-1
Original file line numberDiff line numberDiff line change
@@ -891,9 +891,12 @@ void PhaseIterGVN::verify_step(Node* n) {
891891
}
892892

893893
void PhaseIterGVN::trace_PhaseIterGVN(Node* n, Node* nn, const Type* oldtype) {
894+
const Type* newtype = type_or_null(n);
895+
if (nn != n || oldtype != newtype) {
896+
C->print_method(PHASE_AFTER_ITER_GVN_STEP, 4, n);
897+
}
894898
if (TraceIterativeGVN) {
895899
uint wlsize = _worklist.size();
896-
const Type* newtype = type_or_null(n);
897900
if (nn != n) {
898901
// print old node
899902
tty->print("< ");
@@ -1021,6 +1024,7 @@ void PhaseIterGVN::trace_PhaseIterGVN_verbose(Node* n, int num_processed) {
10211024
void PhaseIterGVN::optimize() {
10221025
DEBUG_ONLY(uint num_processed = 0;)
10231026
NOT_PRODUCT(init_verifyPhaseIterGVN();)
1027+
C->print_method(PHASE_BEFORE_ITER_GVN, 3);
10241028
if (StressIGVN) {
10251029
shuffle_worklist();
10261030
}
@@ -1030,12 +1034,14 @@ void PhaseIterGVN::optimize() {
10301034
// update edge info and put uses on worklist.
10311035
while(_worklist.size()) {
10321036
if (C->check_node_count(NodeLimitFudgeFactor * 2, "Out of nodes")) {
1037+
C->print_method(PHASE_AFTER_ITER_GVN, 3);
10331038
return;
10341039
}
10351040
Node* n = _worklist.pop();
10361041
if (loop_count >= K * C->live_nodes()) {
10371042
DEBUG_ONLY(dump_infinite_loop_info(n, "PhaseIterGVN::optimize");)
10381043
C->record_method_not_compilable("infinite loop in PhaseIterGVN::optimize");
1044+
C->print_method(PHASE_AFTER_ITER_GVN, 3);
10391045
return;
10401046
}
10411047
DEBUG_ONLY(trace_PhaseIterGVN_verbose(n, num_processed++);)
@@ -1050,6 +1056,7 @@ void PhaseIterGVN::optimize() {
10501056
loop_count++;
10511057
}
10521058
NOT_PRODUCT(verify_PhaseIterGVN();)
1059+
C->print_method(PHASE_AFTER_ITER_GVN, 3);
10531060
}
10541061

10551062
#ifdef ASSERT

‎src/hotspot/share/opto/phasetype.hpp

+3
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,10 @@
3030
flags(AFTER_STRINGOPTS, "After StringOpts") \
3131
flags(BEFORE_REMOVEUSELESS, "Before RemoveUseless") \
3232
flags(AFTER_PARSING, "After Parsing") \
33+
flags(BEFORE_ITER_GVN, "Before Iter GVN") \
3334
flags(ITER_GVN1, "Iter GVN 1") \
35+
flags(AFTER_ITER_GVN_STEP, "After Iter GVN Step") \
36+
flags(AFTER_ITER_GVN, "After Iter GVN") \
3437
flags(INCREMENTAL_INLINE_STEP, "Incremental Inline Step") \
3538
flags(INCREMENTAL_INLINE_CLEANUP, "Incremental Inline Cleanup") \
3639
flags(INCREMENTAL_INLINE, "Incremental Inline") \

‎src/utils/IdealGraphVisualizer/README.md

+10-9
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,16 @@ for building and running IGV.
2222

2323
# Usage
2424

25-
The JVM support is controlled by the flag `-XX:PrintIdealGraphLevel=#` where `#`
26-
is:
27-
28-
* 0: no output, the default
29-
* 1: dumps graph after parsing, before matching, and final code (also dumps
30-
graphs for failed compilations, if available)
31-
* 2: more detail, including after loop opts
32-
* 3: even more detail
33-
* 4: prints graph after parsing every bytecode (very slow)
25+
The JVM support is controlled by the flag `-XX:PrintIdealGraphLevel=N`, where
26+
Ideal graphs are dumped at the following points:
27+
28+
* `N=0`: no output (default)
29+
* `N=1`: after parsing, before matching, and final code (also for failed
30+
compilations, if available)
31+
* `N=2`: additionally, after every major phase (including loop opts)
32+
* `N=3`: additionally, after every minor phase
33+
* `N=4`: additionally, after every effective IGVN step (slow)
34+
* `N=5`: additionally, after parsing every bytecode (very slow)
3435

3536
By default the JVM expects that it will connect to a visualizer on the local
3637
host on port 4444. This can be configured using the options

‎test/hotspot/jtreg/compiler/lib/ir_framework/CompilePhase.java

+4-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
/**
3030
* This enum represents all available compile phases on which an IR matching can be done. There is a 1:1 mapping
3131
* between IGV phases as specified in phasetype.hpp. Compile phases which are normally not emitted by C2 like FAILURE
32-
* or DEBUG are not listed. This enum should be kept in sync with phasetye.hpp.
32+
* or DEBUG are not listed. This enum should be kept in sync with phasetype.hpp.
3333
*
3434
* <p>
3535
* 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 {
4343
AFTER_STRINGOPTS("After StringOpts"),
4444
BEFORE_REMOVEUSELESS("Before RemoveUseless"),
4545
AFTER_PARSING("After Parsing"),
46+
BEFORE_ITER_GVN("Before Iter GVN"),
4647
ITER_GVN1("Iter GVN 1"),
48+
AFTER_ITER_GVN_STEP("After Iter GVN Step"),
49+
AFTER_ITER_GVN("After Iter GVN"),
4750
INCREMENTAL_INLINE_STEP("Incremental Inline Step"),
4851
INCREMENTAL_INLINE_CLEANUP("Incremental Inline Cleanup"),
4952
INCREMENTAL_INLINE("Incremental Inline"),

0 commit comments

Comments
 (0)
Please sign in to comment.