8233389: Add PrintIdeal to compiler directives

Add PrintIdeal as a compiler directive in order to enable PrintIdeal for only a single method.

Reviewed-by: roland, neliasso, vlivanov, thartmann
This commit is contained in:
Jorn Vernee 2019-11-08 10:55:14 +01:00
parent c4b3dcf8c1
commit d405f6abb6
3 changed files with 7 additions and 2 deletions

View File

@ -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)

View File

@ -648,6 +648,7 @@ Compile::Compile( ciEnv* ci_env, C2Compiler* compiler, ciMethod* target, int osr
_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 @@ Compile::Compile( ciEnv* ci_env, C2Compiler* compiler, ciMethod* target, int osr
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 @@ Compile::Compile( ciEnv* ci_env,
_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),

View File

@ -408,6 +408,7 @@ class Compile : public Phase {
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 @@ class Compile : public Phase {
#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.