aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/dbgcnt.c8
-rw-r--r--gcc/dbgcnt.h1
-rw-r--r--gcc/dumpfile.c1
-rw-r--r--gcc/dumpfile.h3
-rw-r--r--gcc/gimple-range-path.cc2
-rw-r--r--gcc/tree-ssa-threadupdate.c13
6 files changed, 23 insertions, 5 deletions
diff --git a/gcc/dbgcnt.c b/gcc/dbgcnt.c
index 934bbe0..6a7eb34c 100644
--- a/gcc/dbgcnt.c
+++ b/gcc/dbgcnt.c
@@ -98,6 +98,14 @@ dbg_cnt (enum debug_counter index)
return false;
}
+/* Return the counter for INDEX. */
+
+unsigned
+dbg_cnt_counter (enum debug_counter index)
+{
+ return count[index];
+}
+
/* Compare limit_tuple intervals by first item in descending order. */
static int
diff --git a/gcc/dbgcnt.h b/gcc/dbgcnt.h
index 17f2091..3c35dcc 100644
--- a/gcc/dbgcnt.h
+++ b/gcc/dbgcnt.h
@@ -33,6 +33,7 @@ enum debug_counter {
extern bool dbg_cnt_is_enabled (enum debug_counter index);
extern bool dbg_cnt (enum debug_counter index);
+extern unsigned dbg_cnt_counter (enum debug_counter index);
extern void dbg_cnt_process_opt (const char *arg);
extern void dbg_cnt_list_all_counters (void);
diff --git a/gcc/dumpfile.c b/gcc/dumpfile.c
index 8169daf..e6ead5d 100644
--- a/gcc/dumpfile.c
+++ b/gcc/dumpfile.c
@@ -145,6 +145,7 @@ static const kv_pair<dump_flags_t> 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 892bfc9..6c7758d 100644
--- a/gcc/dumpfile.h
+++ b/gcc/dumpfile.h
@@ -197,6 +197,9 @@ enum dump_flag
/* For error. */
TDF_ERROR = (1 << 26),
+ /* Dumping for range path solver. */
+ TDF_THREADING = (1 << 27),
+
/* All values. */
TDF_ALL_VALUES = (1 << 29) - 1
};
diff --git a/gcc/gimple-range-path.cc b/gcc/gimple-range-path.cc
index 9da67d2..a29d531 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 (0 && dump_file)
+#define DEBUG_SOLVER (dump_file && dump_flags & TDF_THREADING)
path_range_query::path_range_query (gimple_ranger &ranger, bool resolve)
: m_ranger (ranger)
diff --git a/gcc/tree-ssa-threadupdate.c b/gcc/tree-ssa-threadupdate.c
index 71e602f..dcabfdb 100644
--- a/gcc/tree-ssa-threadupdate.c
+++ b/gcc/tree-ssa-threadupdate.c
@@ -218,10 +218,15 @@ dump_jump_thread_path (FILE *dump_file,
const vec<jump_thread_edge *> &path,
bool registering)
{
- fprintf (dump_file,
- " %s jump thread: (%d, %d) incoming edge; ",
- (registering ? "Registering" : "Cancelling"),
- path[0]->e->src->index, path[0]->e->dest->index);
+ if (registering)
+ fprintf (dump_file,
+ " [%u] Registering jump thread: (%d, %d) incoming edge; ",
+ dbg_cnt_counter (registered_jump_thread),
+ path[0]->e->src->index, path[0]->e->dest->index);
+ else
+ fprintf (dump_file,
+ " Cancelling jump thread: (%d, %d) incoming edge; ",
+ path[0]->e->src->index, path[0]->e->dest->index);
for (unsigned int i = 1; i < path.length (); i++)
{