From 9cb114fd5550eb02dfd6b8db5cb5b8fb72827d53 Mon Sep 17 00:00:00 2001
From: Andrew MacLeod <amacleod@redhat.com>
Date: Tue, 19 Oct 2021 14:09:51 -0400
Subject: [PATCH 3/3] Split --param=evrp-mode into evrp-mode and ranger-debug.
With Ranger being used in more than EVRP, the debug output should no longer
be tied up with the EVRP mode flag.
* doc/invoke.texi (ranger-debug): Document.
* flag-types.h (enum ranger_debug): New.
(enum evrp_mode): Remove debug values.
* gimple-range-cache.cc (DEBUG_RANGE_CACHE): Use new debug flag.
* gimple-range-gori.cc (gori_compute::gori_compute): Ditto.
* gimple-range.cc (gimple_ranger::gimple_ranger): Ditto.
* gimple-ssa-evrp.c (hybrid_folder::choose_value): Ditto.
(execute_early_vrp): Use evrp-mode directly.
* params.opt (enum evrp_mode): Remove debug values.
(ranger-debug): New.
(ranger-logical-depth): Relocate to be in alphabetical order.
---
gcc/doc/invoke.texi | 3 +++
gcc/flag-types.h | 24 +++++++++++-------
gcc/gimple-range-cache.cc | 4 +--
gcc/gimple-range-gori.cc | 2 +-
gcc/gimple-range.cc | 2 +-
gcc/gimple-ssa-evrp.c | 6 ++---
gcc/params.opt | 52 +++++++++++++++++++++++----------------
7 files changed, 56 insertions(+), 37 deletions(-)
@@ -14510,6 +14510,9 @@ Specifies the mode VRP pass 1 should operate in.
@item vrp2-mode
Specifies the mode VRP pass 2 should operate in.
+@item ranger-debug
+Specifies the type of debug output to be issued for ranges.
+
@item evrp-switch-limit
Specifies the maximum number of switch cases before EVRP ignores a switch.
@@ -449,18 +449,24 @@ enum parloops_schedule_type
PARLOOPS_SCHEDULE_RUNTIME
};
+/* Ranger debug mode. */
+enum ranger_debug
+{
+ RANGER_DEBUG_NONE = 0,
+ RANGER_DEBUG_TRACE = 1,
+ RANGER_DEBUG_CACHE = (2 | RANGER_DEBUG_TRACE),
+ RANGER_DEBUG_GORI = 4,
+ RANGER_DEBUG_TRACE_GORI = (RANGER_DEBUG_TRACE | RANGER_DEBUG_GORI),
+ RANGER_DEBUG_ALL = (RANGER_DEBUG_GORI | RANGER_DEBUG_CACHE)
+};
+
/* EVRP mode. */
enum evrp_mode
{
- EVRP_MODE_RVRP_ONLY = 0,
- EVRP_MODE_EVRP_ONLY = 1,
- EVRP_MODE_EVRP_FIRST = 2,
- EVRP_MODE_RVRP_FIRST = 3,
- EVRP_MODE_TRACE = 4,
- EVRP_MODE_CACHE = (8 | EVRP_MODE_TRACE),
- EVRP_MODE_GORI = 16,
- EVRP_MODE_TRACE_GORI = (EVRP_MODE_TRACE | EVRP_MODE_GORI),
- EVRP_MODE_DEBUG = (EVRP_MODE_GORI | EVRP_MODE_CACHE)
+ EVRP_MODE_RVRP_ONLY,
+ EVRP_MODE_EVRP_ONLY,
+ EVRP_MODE_EVRP_FIRST,
+ EVRP_MODE_RVRP_FIRST
};
/* VRP modes. */
@@ -30,8 +30,8 @@ along with GCC; see the file COPYING3. If not see
#include "gimple-range.h"
#include "tree-cfg.h"
-#define DEBUG_RANGE_CACHE (dump_file && (param_evrp_mode & EVRP_MODE_CACHE) \
- == EVRP_MODE_CACHE)
+#define DEBUG_RANGE_CACHE (dump_file \
+ && (param_ranger_debug & RANGER_DEBUG_CACHE))
// During contructor, allocate the vector of ssa_names.
@@ -644,7 +644,7 @@ gori_compute::gori_compute (int not_executable_flag)
// Create a boolean_type true and false range.
m_bool_zero = int_range<2> (boolean_false_node, boolean_false_node);
m_bool_one = int_range<2> (boolean_true_node, boolean_true_node);
- if (dump_file && (param_evrp_mode & EVRP_MODE_GORI))
+ if (dump_file && (param_ranger_debug & RANGER_DEBUG_GORI))
tracer.enable_trace ();
}
@@ -42,7 +42,7 @@ gimple_ranger::gimple_ranger () :
{
// If the cache has a relation oracle, use it.
m_oracle = m_cache.oracle ();
- if (dump_file && (param_evrp_mode & EVRP_MODE_TRACE))
+ if (dump_file && (param_ranger_debug & RANGER_DEBUG_TRACE))
tracer.enable_trace ();
// Ensure the not_executable flag is clear everywhere.
@@ -300,7 +300,7 @@ hybrid_folder::choose_value (tree evrp_val, tree ranger_val)
return evrp_val;
// If values are different, return the first calculated value.
- if ((param_evrp_mode & EVRP_MODE_RVRP_FIRST) == EVRP_MODE_RVRP_FIRST)
+ if (param_evrp_mode == EVRP_MODE_RVRP_FIRST)
return ranger_val;
return evrp_val;
}
@@ -312,7 +312,7 @@ hybrid_folder::choose_value (tree evrp_val, tree ranger_val)
static unsigned int
execute_early_vrp ()
{
- if ((param_evrp_mode & EVRP_MODE_RVRP_FIRST) == EVRP_MODE_RVRP_ONLY)
+ if (param_evrp_mode == EVRP_MODE_RVRP_ONLY)
return execute_ranger_vrp (cfun, false);
/* Ideally this setup code would move into the ctor for the folder
@@ -325,7 +325,7 @@ execute_early_vrp ()
calculate_dominance_info (CDI_DOMINATORS);
// Only the last 2 bits matter for choosing the folder.
- switch (param_evrp_mode & EVRP_MODE_RVRP_FIRST)
+ switch (param_evrp_mode)
{
case EVRP_MODE_EVRP_ONLY:
{
@@ -136,7 +136,7 @@ Maximum number of outgoing edges in a switch before EVRP will not process it.
-param=evrp-mode=
Common Joined Var(param_evrp_mode) Enum(evrp_mode) Init(EVRP_MODE_RVRP_ONLY) Param Optimization
---param=evrp-mode=[legacy|ranger|legacy-first|ranger-first|trace|gori|cache|tracegori|debug] Specifies the mode Early VRP should operate in.
+--param=evrp-mode=[legacy|ranger|legacy-first|ranger-first] Specifies the mode Early VRP should operate in.
Enum
Name(evrp_mode) Type(enum evrp_mode) UnknownError(unknown evrp mode %qs)
@@ -153,26 +153,6 @@ Enum(evrp_mode) String(legacy-first) Value(EVRP_MODE_EVRP_FIRST)
EnumValue
Enum(evrp_mode) String(ranger-first) Value(EVRP_MODE_RVRP_FIRST)
-EnumValue
-Enum(evrp_mode) String(trace) Value(EVRP_MODE_TRACE)
-
-EnumValue
-Enum(evrp_mode) String(cache) Value(EVRP_MODE_CACHE)
-
-EnumValue
-Enum(evrp_mode) String(gori) Value(EVRP_MODE_GORI)
-
-EnumValue
-Enum(evrp_mode) String(tracegori) Value(EVRP_MODE_TRACE_GORI)
-
-EnumValue
-Enum(evrp_mode) String(debug) Value(EVRP_MODE_DEBUG)
-
--param=ranger-logical-depth=
-Common Joined UInteger Var(param_ranger_logical_depth) Init(6) IntegerRange(1, 999) Param Optimization
-Maximum depth of logical expression evaluation ranger will look through when
-evaluating outgoing edge ranges.
-
-param=fsm-scale-path-blocks=
Common Joined UInteger Var(param_fsm_scale_path_blocks) Init(3) IntegerRange(1, 10) Param Optimization
Scale factor to apply to the number of blocks in a threading path when comparing to the number of (scaled) statements.
@@ -893,6 +873,36 @@ The minimum constant stride beyond which we should use prefetch hints for.
Common Joined UInteger Var(param_profile_func_internal_id) IntegerRange(0, 1) Param
Use internal function id in profile lookup.
+-param=ranger-debug=
+Common Joined Var(param_ranger_debug) Enum(ranger_debug) Init(RANGER_DEBUG_NONE) Param Optimization
+--param=ranger-debug=[none|trace|gori|cache|tracegori|all] Specifies the output mode for debugging ranger.
+
+Enum
+Name(ranger_debug) Type(enum ranger_debug) UnknownError(unknown ranger debug mode %qs)
+
+EnumValue
+Enum(ranger_debug) String(none) Value(RANGER_DEBUG_NONE)
+
+EnumValue
+Enum(ranger_debug) String(trace) Value(RANGER_DEBUG_TRACE)
+
+EnumValue
+Enum(ranger_debug) String(cache) Value(RANGER_DEBUG_CACHE)
+
+EnumValue
+Enum(ranger_debug) String(gori) Value(RANGER_DEBUG_GORI)
+
+EnumValue
+Enum(ranger_debug) String(tracegori) Value(RANGER_DEBUG_TRACE_GORI)
+
+EnumValue
+Enum(ranger_debug) String(all) Value(RANGER_DEBUG_ALL)
+
+-param=ranger-logical-depth=
+Common Joined UInteger Var(param_ranger_logical_depth) Init(6) IntegerRange(1, 999) Param Optimization
+Maximum depth of logical expression evaluation ranger will look through when
+evaluating outgoing edge ranges.
+
-param=rpo-vn-max-loop-depth=
Common Joined UInteger Var(param_rpo_vn_max_loop_depth) Init(7) IntegerRange(2, 65536) Param Optimization
Maximum depth of a loop nest to fully value-number optimistically.
--
2.17.2