From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2136) id BF8583858D39; Tue, 9 Nov 2021 13:29:38 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BF8583858D39 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Aldy Hernandez To: gcc-cvs@gcc.gnu.org Subject: [gcc r12-5048] Remove TDF_THREADING flag in favor of param. X-Act-Checkin: gcc X-Git-Author: Aldy Hernandez X-Git-Refname: refs/heads/master X-Git-Oldrev: c71cb26a9e841888f52e4bfcaad94c8f8ecb4fdb X-Git-Newrev: 47c2cf3ac684fab21ec31c72462b7b21845a41f2 Message-Id: <20211109132938.BF8583858D39@sourceware.org> Date: Tue, 9 Nov 2021 13:29:38 +0000 (GMT) X-BeenThere: gcc-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Nov 2021 13:29:38 -0000 https://gcc.gnu.org/g:47c2cf3ac684fab21ec31c72462b7b21845a41f2 commit r12-5048-g47c2cf3ac684fab21ec31c72462b7b21845a41f2 Author: Aldy Hernandez Date: Tue Nov 9 10:14:25 2021 +0100 Remove TDF_THREADING flag in favor of param. I am returning a TDF_* flag to the queue of available entries as I am unconvinced that we need to burn an entire flag for internal debugging constructs, especially since we seem to be running out of them. I've added a --param=threader-debug entry similar to the one we use for ranger debugging. Currently this only affects the backward threader, but since the DOM threader is an outlier and on the chopping block, I avoided using the "backward" name. Tested on x86-64 Linux. gcc/ChangeLog: * dumpfile.c (dump_options): Remove TDF_THREADING entry. * dumpfile.h (enum dump_flag): Remove TDF_THREADING and adjust remaining entries. * flag-types.h (enum threader_debug): New. * gimple-range-path.cc (DEBUG_SOLVER): Use param_threader_debug. * params.opt: Add entry for --param=threader-debug=. Diff: --- gcc/dumpfile.c | 1 - gcc/dumpfile.h | 23 ++++++++++------------- gcc/flag-types.h | 7 +++++++ gcc/gimple-range-path.cc | 2 +- gcc/params.opt | 13 +++++++++++++ 5 files changed, 31 insertions(+), 15 deletions(-) diff --git a/gcc/dumpfile.c b/gcc/dumpfile.c index e6ead5debe5..8169daf7f59 100644 --- a/gcc/dumpfile.c +++ b/gcc/dumpfile.c @@ -145,7 +145,6 @@ static const kv_pair dump_options[] = {"missed", MSG_MISSED_OPTIMIZATION}, {"note", MSG_NOTE}, {"optall", MSG_ALL_KINDS}, - {"threading", TDF_THREADING}, {"all", dump_flags_t (TDF_ALL_VALUES & ~(TDF_RAW | TDF_SLIM | TDF_LINENO | TDF_GRAPH | TDF_STMTADDR | TDF_RHS_ONLY | TDF_NOUID diff --git a/gcc/dumpfile.h b/gcc/dumpfile.h index 76226753845..2487ae243c6 100644 --- a/gcc/dumpfile.h +++ b/gcc/dumpfile.h @@ -146,20 +146,17 @@ enum dump_flag : uint32_t /* Dump folding details. */ TDF_FOLDING = (1 << 21), - /* Dumping for range path solver. */ - TDF_THREADING = (1 << 22), - /* MSG_* flags for expressing the kinds of message to be emitted by -fopt-info. */ /* -fopt-info optimized sources. */ - MSG_OPTIMIZED_LOCATIONS = (1 << 23), + MSG_OPTIMIZED_LOCATIONS = (1 << 22), /* Missed opportunities. */ - MSG_MISSED_OPTIMIZATION = (1 << 24), + MSG_MISSED_OPTIMIZATION = (1 << 23), /* General optimization info. */ - MSG_NOTE = (1 << 25), + MSG_NOTE = (1 << 24), /* Mask for selecting MSG_-kind flags. */ MSG_ALL_KINDS = (MSG_OPTIMIZED_LOCATIONS @@ -178,16 +175,16 @@ enum dump_flag : uint32_t sub-option of -fopt-info to show the internal messages. */ /* Implicitly supplied for messages at the top-level dump scope. */ - MSG_PRIORITY_USER_FACING = (1 << 26), + MSG_PRIORITY_USER_FACING = (1 << 25), /* Implicitly supplied for messages within nested dump scopes. */ - MSG_PRIORITY_INTERNALS = (1 << 27), + MSG_PRIORITY_INTERNALS = (1 << 26), /* Supplied when an opt_problem generated in a nested scope is re-emitted at the top-level. We want to default to showing these in -fopt-info output, but to *not* show them in dump files, as the message would be shown twice, messing up "scan-tree-dump-times" in DejaGnu tests. */ - MSG_PRIORITY_REEMITTED = (1 << 28), + MSG_PRIORITY_REEMITTED = (1 << 27), /* Mask for selecting MSG_PRIORITY_* flags. */ MSG_ALL_PRIORITIES = (MSG_PRIORITY_USER_FACING @@ -195,16 +192,16 @@ enum dump_flag : uint32_t | MSG_PRIORITY_REEMITTED), /* All -fdump- flags. */ - TDF_ALL_VALUES = (1 << 29) - 1, + TDF_ALL_VALUES = (1 << 28) - 1, /* Dumping for -fcompare-debug. */ - TDF_COMPARE_DEBUG = (1 << 29), + TDF_COMPARE_DEBUG = (1 << 28), /* Dump a GIMPLE value which means wrapping certain things with _Literal. */ - TDF_GIMPLE_VAL = (1 << 30), + TDF_GIMPLE_VAL = (1 << 29), /* For error. */ - TDF_ERROR = ((uint32_t)1 << 31), + TDF_ERROR = ((uint32_t)1 << 30), }; /* Dump flags type. */ diff --git a/gcc/flag-types.h b/gcc/flag-types.h index 459e3e07016..cfd2a5f6f50 100644 --- a/gcc/flag-types.h +++ b/gcc/flag-types.h @@ -462,6 +462,13 @@ enum ranger_debug | RANGER_DEBUG_TRACE) }; +/* Jump threader verbose dumps. */ +enum threader_debug +{ + THREADER_DEBUG_NONE = 0, + THREADER_DEBUG_ALL = 1 +}; + /* EVRP mode. */ enum evrp_mode { diff --git a/gcc/gimple-range-path.cc b/gcc/gimple-range-path.cc index 9d3fe89185e..52de10369f3 100644 --- a/gcc/gimple-range-path.cc +++ b/gcc/gimple-range-path.cc @@ -34,7 +34,7 @@ along with GCC; see the file COPYING3. If not see #include "gimple-iterator.h" // Internal construct to help facilitate debugging of solver. -#define DEBUG_SOLVER (dump_file && dump_flags & TDF_THREADING) +#define DEBUG_SOLVER (dump_file && (param_threader_debug == THREADER_DEBUG_ALL)) path_range_query::path_range_query (gimple_ranger &ranger, bool resolve) : m_ranger (ranger) diff --git a/gcc/params.opt b/gcc/params.opt index 4b409d55a2d..e725c99e5e4 100644 --- a/gcc/params.opt +++ b/gcc/params.opt @@ -1047,6 +1047,19 @@ Maximum number of escape points tracked by modref per SSA-name. Common Joined UInteger Var(param_modref_max_adjustments) Init(8) IntegerRange(0, 254) Param Optimization Maximum number of times a given range is adjusted during the dataflow. +-param=threader-debug= +Common Joined Var(param_threader_debug) Enum(threader_debug) Init(THREADER_DEBUG_NONE) Param Optimization +--param=threader-debug=[none|all] Enables verbose dumping of the threader solver. + +Enum +Name(threader_debug) Type(enum threader_debug) UnknownError(unknown threader debug mode %qs) + +EnumValue +Enum(threader_debug) String(none) Value(THREADER_DEBUG_NONE) + +EnumValue +Enum(threader_debug) String(all) Value(THREADER_DEBUG_ALL) + -param=tm-max-aggregate-size= Common Joined UInteger Var(param_tm_max_aggregate_size) Init(9) Param Optimization Size in bytes after which thread-local aggregates should be instrumented with the logging functions instead of save/restore pairs.