aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorAldy Hernandez <aldyh@redhat.com>2020-03-16 12:17:40 +0100
committerAldy Hernandez <aldyh@redhat.com>2020-03-16 12:31:39 +0100
commit52f48b97c56d4cd72d6a352973e3f73b15bac1c8 (patch)
tree380411570b6cd2b1b6caf60ac356f46bd432c74c /gcc
parentc6a2bc2f87e14f81a979d8d648ce1a68a40e9833 (diff)
downloadgcc-52f48b97c56d4cd72d6a352973e3f73b15bac1c8.zip
gcc-52f48b97c56d4cd72d6a352973e3f73b15bac1c8.tar.gz
gcc-52f48b97c56d4cd72d6a352973e3f73b15bac1c8.tar.bz2
Enable gori tracing with a flag: -fdump-tree-all-gori.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/dumpfile.c2
-rw-r--r--gcc/dumpfile.h5
-rw-r--r--gcc/gimple-range-gori.cc2
-rw-r--r--gcc/gimple-ssa-evrp-analyze.c4
-rw-r--r--gcc/vr-values.c11
-rw-r--r--gcc/vr-values.h14
6 files changed, 19 insertions, 19 deletions
diff --git a/gcc/dumpfile.c b/gcc/dumpfile.c
index 468ffab..9eb884e 100644
--- a/gcc/dumpfile.c
+++ b/gcc/dumpfile.c
@@ -143,8 +143,10 @@ static const kv_pair<dump_flags_t> dump_options[] =
{"missed", MSG_MISSED_OPTIMIZATION},
{"note", MSG_NOTE},
{"optall", MSG_ALL_KINDS},
+ {"gori", TDF_GORI},
{"all", dump_flags_t (TDF_ALL_VALUES
& ~(TDF_RAW | TDF_SLIM | TDF_LINENO | TDF_GRAPH
+ | TDF_GORI
| TDF_STMTADDR | TDF_RHS_ONLY | TDF_NOUID
| TDF_ENUMERATE_LOCALS | TDF_SCEV | TDF_GIMPLE))},
{NULL, TDF_NONE}
diff --git a/gcc/dumpfile.h b/gcc/dumpfile.h
index 840ae4d..26409e0 100644
--- a/gcc/dumpfile.h
+++ b/gcc/dumpfile.h
@@ -196,8 +196,11 @@ enum dump_flag
/* For error. */
TDF_ERROR = (1 << 26),
+ /* Trace GORI as it calculates ranges. */
+ TDF_GORI = (1 << 29),
+
/* All values. */
- TDF_ALL_VALUES = (1 << 29) - 1
+ TDF_ALL_VALUES = (1 << 30) - 1
};
/* Dump flags type. */
diff --git a/gcc/gimple-range-gori.cc b/gcc/gimple-range-gori.cc
index 9c195bc..86e0970 100644
--- a/gcc/gimple-range-gori.cc
+++ b/gcc/gimple-range-gori.cc
@@ -1182,7 +1182,7 @@ trace_gori_compute::trace_gori_compute ()
bool
trace_gori_compute::dumping (unsigned counter, bool trailing)
{
- if (dump_file && (dump_flags & TDF_DETAILS))
+ if (dump_file && (dump_flags & TDF_GORI))
{
// Print counter index as well as INDENT spaces.
if (!trailing)
diff --git a/gcc/gimple-ssa-evrp-analyze.c b/gcc/gimple-ssa-evrp-analyze.c
index cbcee21..a62c5f3 100644
--- a/gcc/gimple-ssa-evrp-analyze.c
+++ b/gcc/gimple-ssa-evrp-analyze.c
@@ -267,7 +267,11 @@ vr_gori_comparison::dump_differences (FILE *out) const
fprintf (out, "\n");
fprintf (out, "==============================================\n");
dump_function_to_file (current_function_decl, out, TDF_NONE);
+
+ dump_flags_t save = dump_flags;
+ dump_flags |= TDF_GORI;
m_vr_values->dump_all_value_ranges (out);
+ dump_flags = save;
}
void
diff --git a/gcc/vr-values.c b/gcc/vr-values.c
index 9ec2a4f..4f9e37a 100644
--- a/gcc/vr-values.c
+++ b/gcc/vr-values.c
@@ -1932,9 +1932,12 @@ vr_values::dump_all_value_ranges (FILE *file)
{
size_t i;
- fprintf (file, "GORI map:\n");
- m_gori_map.dump (file);
- fprintf (file, "-----------------\n");
+ if (dump_flags & TDF_GORI)
+ {
+ fprintf (file, "GORI map:\n");
+ m_gori_map.dump (file);
+ fprintf (file, "-----------------\n");
+ }
for (i = 0; i < num_vr_values; i++)
{
@@ -2067,7 +2070,6 @@ vr_gori_interface::solve_name_given_equivalence (irange &r,
return false;
}
-#if DEBUG_VR_GORI
bool
trace_vr_gori_interface::refine_range_with_equivalences (irange &r,
edge e, tree name)
@@ -2086,7 +2088,6 @@ trace_vr_gori_interface::refine_range_with_equivalences (irange &r,
bool res = super::refine_range_with_equivalences (r, e, name);
return trailer (idx, "refine_range_with_equivalences", res, name, r);
}
-#endif
/* Initialize VRP lattice. */
diff --git a/gcc/vr-values.h b/gcc/vr-values.h
index f8244ea..1a768e5 100644
--- a/gcc/vr-values.h
+++ b/gcc/vr-values.h
@@ -22,17 +22,7 @@ along with GCC; see the file COPYING3. If not see
#include "gimple-range-gori.h"
-#define DEBUG_VR_GORI 0
-
-#if DEBUG_VR_GORI
-#define VR_GORI_COMPUTE trace_gori_compute
-#define VR_GORI_INTERFACE trace_vr_gori_interface
-#else
-#define VR_GORI_COMPUTE gori_compute
-#define VR_GORI_INTERFACE vr_gori_interface
-#endif
-
-class vr_gori_interface : public VR_GORI_COMPUTE
+class vr_gori_interface : public trace_gori_compute
{
public:
virtual bool outgoing_edge_range_p (irange &, edge, tree name,
@@ -70,7 +60,7 @@ private:
gets attached to an SSA_NAME. It's unclear how useful that global
information will be in a world where we can compute context sensitive
range information fast or perform on-demand queries. */
-class vr_values : public VR_GORI_INTERFACE
+class vr_values : public trace_vr_gori_interface
{
public:
vr_values (void);