RFR 8233389: Add PrintIdeal to compiler directives

Vladimir Ivanov vladimir.x.ivanov at oracle.com
Mon Nov 4 14:57:06 UTC 2019


Hi Jorn,

src\hotspot\share\opto\compile.hpp:
+   bool                  _print_ideal;           // True if we should 
dump node IR for this compilation

Since the only usage is in non-product code, I suggest to put 
_print_ideal into #ifndef PRODUCT, so you don't need to initialize it in 
product build.

Also, it'll allow you to just put it on initializer list instead of 
doing it in the ctor body (akin to how _trace_opto_output is handled):

src\hotspot\share\opto\compile.cpp:

Compile::Compile( ciEnv* ci_env,
...
   : Phase(Compiler),
...
     _has_reserved_stack_access(false),
#ifndef PRODUCT
     _trace_opto_output(directive->TraceOptoOutputOption),
#endif
     _has_method_handle_invokes(false),


Overall, I don't see much value in PrintIdeal: PrintIdealGraph provides 
much more detailed information (even though in XML format) and 
IdealGraphVisualizer is better at browsing the graph. The only thing I'm 
usually missing is full text dump output on individual nodes (they are 
shown pruned in IGV; not sure whether it's IGV fault or the info is 
missing in the dump).

Best regards,
Vladimir Ivanov

On 01.11.2019 18:09, Jorn Vernee wrote:
> Hi,
> 
> I'd like to add PrintIdeal as a compiler directive in order to enable 
> PrintIdeal for only a single method when combining it with the 'match' 
> directive.
> 
> Please review the following:
> 
> Bug: https://bugs.openjdk.java.net/browse/JDK-8233389
> Webrev: http://cr.openjdk.java.net/~jvernee/print_ideal/webrev.00/
> (Testing = tier1, manual)
> 
> As a heads-up; I'm not a committer on the jdk project, so if this sounds 
> like a good idea, I would require a sponsor to push the changes.
> 
> Thanks,
> Jorn
> 


More information about the hotspot-compiler-dev mailing list