JDK-8290401 : Support dump all phases and print nodes in ascending order of index
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 20
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2022-07-16
  • Updated: 2022-10-03
  • Resolved: 2022-09-27
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 20
20 b17Fixed
Related Reports
Relates :  
Description
C2 enhanced node::dump() and supported a variety of options (JDK-8283775). One interesting option is "S: sort displayed nodes by node idx". I think it's good idea to upgrade root()->dump(9999) with it. 

-    root()->dump(9999);
+    // Print out all nodes in ascending order of index.
+    root()->dump_bfs(MaxNodeLimit, nullptr, "+S$");

The IR becomes much easier to read and we can compare 2 phases using diff.  I remember Andrew Dinn introduced this idea in mailing list before. At  that time, we have to rely on external program 'sort' .
 
In addition, COMPILER_PHASES has one flag 'DEBUG' not in use. I think we can use it to dump all phases like GCC does. 

eg. 
 -XX:CompileCommand=PrintIdealPhase,java.lang.String::length,DEBUG


Comments
Changeset: fb4979c0 Author: Joshua Cao <joshcao@amazon.com> Committer: Xin Liu <xliu@openjdk.org> Date: 2022-09-27 15:52:22 +0000 URL: https://git.openjdk.org/jdk/commit/fb4979c05bca2feae8e2d86c99db5e089693606f
27-09-2022

A pull request was submitted for review. URL: https://git.openjdk.org/jdk/pull/10371 Date: 2022-09-21 04:23:34 +0000
21-09-2022

it depends on JDK-8288897, which is going to add an option $.
16-07-2022