# HG changeset patch # User jvernee # Date 1573206914 -3600 # Node ID c709424ad48fb76ff3db437c819375cb93cafb8e # Parent 47c20fc6a517d9db5ec0150d047231a768f4def6 8233389: Add PrintIdeal to compiler directives Summary: Add PrintIdeal as a compiler directive in order to enable PrintIdeal for only a single method. Reviewed-by: roland, neliasso, vlivanov, thartmann diff -r 47c20fc6a517 -r c709424ad48f src/hotspot/share/compiler/compilerDirectives.hpp --- a/src/hotspot/share/compiler/compilerDirectives.hpp Fri Nov 08 10:01:13 2019 +0100 +++ b/src/hotspot/share/compiler/compilerDirectives.hpp Fri Nov 08 10:55:14 2019 +0100 @@ -61,11 +61,12 @@ cflags(PrintIntrinsics, bool, PrintIntrinsics, PrintIntrinsics) \ NOT_PRODUCT(cflags(TraceOptoPipelining, bool, TraceOptoPipelining, TraceOptoPipelining)) \ NOT_PRODUCT(cflags(TraceOptoOutput, bool, TraceOptoOutput, TraceOptoOutput)) \ +NOT_PRODUCT(cflags(PrintIdeal, bool, PrintIdeal, PrintIdeal)) \ +NOT_PRODUCT(cflags(IGVPrintLevel, intx, PrintIdealGraphLevel, IGVPrintLevel)) \ cflags(TraceSpilling, bool, TraceSpilling, TraceSpilling) \ cflags(Vectorize, bool, false, Vectorize) \ cflags(VectorizeDebug, uintx, 0, VectorizeDebug) \ cflags(CloneMapDebug, bool, false, CloneMapDebug) \ - cflags(IGVPrintLevel, intx, PrintIdealGraphLevel, IGVPrintLevel) \ cflags(MaxNodeLimit, intx, MaxNodeLimit, MaxNodeLimit) #else #define compilerdirectives_c2_flags(cflags) diff -r 47c20fc6a517 -r c709424ad48f src/hotspot/share/opto/compile.cpp --- a/src/hotspot/share/opto/compile.cpp Fri Nov 08 10:01:13 2019 +0100 +++ b/src/hotspot/share/opto/compile.cpp Fri Nov 08 10:55:14 2019 +0100 @@ -648,6 +648,7 @@ _has_reserved_stack_access(target->has_reserved_stack_access()), #ifndef PRODUCT _trace_opto_output(directive->TraceOptoOutputOption), + _print_ideal(directive->PrintIdealOption), #endif _has_method_handle_invokes(false), _clinit_barrier_on_entry(false), @@ -873,7 +874,7 @@ NOT_PRODUCT( verify_graph_edges(); ) #ifndef PRODUCT - if (PrintIdeal) { + if (print_ideal()) { ttyLocker ttyl; // keep the following output all in one block // This output goes directly to the tty, not the compiler log. // To enable tools to match it up with the compilation activity, @@ -983,6 +984,7 @@ _has_reserved_stack_access(false), #ifndef PRODUCT _trace_opto_output(directive->TraceOptoOutputOption), + _print_ideal(directive->PrintIdealOption), #endif _has_method_handle_invokes(false), _clinit_barrier_on_entry(false), diff -r 47c20fc6a517 -r c709424ad48f src/hotspot/share/opto/compile.hpp --- a/src/hotspot/share/opto/compile.hpp Fri Nov 08 10:01:13 2019 +0100 +++ b/src/hotspot/share/opto/compile.hpp Fri Nov 08 10:55:14 2019 +0100 @@ -408,6 +408,7 @@ bool _print_intrinsics; // True if we should print intrinsics for this compilation #ifndef PRODUCT bool _trace_opto_output; + bool _print_ideal; bool _parsed_irreducible_loop; // True if ciTypeFlow detected irreducible loops during parsing #endif bool _has_irreducible_loop; // Found irreducible loops @@ -724,6 +725,7 @@ #ifndef PRODUCT bool trace_opto_output() const { return _trace_opto_output; } + bool print_ideal() const { return _print_ideal; } bool parsed_irreducible_loop() const { return _parsed_irreducible_loop; } void set_parsed_irreducible_loop(bool z) { _parsed_irreducible_loop = z; } int _in_dump_cnt; // Required for dumping ir nodes.