RFR: 8280076: Unify IGV and IR printing

Christian Hagedorn chagedorn at openjdk.java.net
Mon Jan 17 16:10:28 UTC 2022


On Mon, 17 Jan 2022 12:22:32 GMT, Nils Eliasson <neliasso at openjdk.org> wrote:

> This patch adds support for controlling printing of the textual ideal representation (PrintIdeal) in the same way as the printing of IGV graphs currently works. The new flag PrintIdealLevel uses the same phases and levels as the PrintIdealGraphLevel flag. This new flag also gets added to CompileCommand and CompilerDirectives. 
> 
> The motivation for this change is to add support for testing during different phases with the TestIR framework.
> 
> The old flag (PrintIdeal) is kept intact for now.
> 
> This patch is based upon https://github.com/openjdk/jdk/pull/7088
> 
> Please review,
> Nils

Nice! That's a good basis for adding IR matching on different phases to the IR framework.

src/hotspot/share/opto/c2_globals.hpp line 116:

> 114:                                                                             \
> 115:   notproduct(uintx, PrintIdealLevel, 0,                                     \
> 116:           "Print ideal IR on stdout."                                       \

Missing space after `stdout.`.

src/hotspot/share/opto/compile.cpp line 539:

> 537: 
> 538: #ifndef PRODUCT
> 539: void Compile::print_ideal_ir(const char *name) {

I suggest to call it `compile_phase` instead of `name`. 
Also: `const char *name` - > `const char* name`.

-------------

Marked as reviewed by chagedorn (Reviewer).

PR: https://git.openjdk.java.net/jdk/pull/7108


More information about the hotspot-compiler-dev mailing list