[gcc/devel/ranger] Add code to trace compute_logical_operands.
Aldy Hernandez
aldyh@gcc.gnu.org
Tue Mar 10 13:29:54 GMT 2020
https://gcc.gnu.org/g:7b0df61d25e5d156aea41fd0ddc318e904db7894
commit 7b0df61d25e5d156aea41fd0ddc318e904db7894
Author: Aldy Hernandez <aldyh@redhat.com>
Date: Tue Mar 10 10:49:19 2020 +0100
Add code to trace compute_logical_operands.
Diff:
---
gcc/gimple-range-gori.cc | 28 ++++++++++++++++++++++++++++
gcc/gimple-range-gori.h | 9 ++++++---
2 files changed, 34 insertions(+), 3 deletions(-)
diff --git a/gcc/gimple-range-gori.cc b/gcc/gimple-range-gori.cc
index b90b0756d83..d6710ffe044 100644
--- a/gcc/gimple-range-gori.cc
+++ b/gcc/gimple-range-gori.cc
@@ -1271,3 +1271,31 @@ trace_gori_compute::compute_operand_range (irange &r, gimple *stmt,
bool res = super::compute_operand_range (r, stmt, lhs, name, name_range);
return trailer (idx, "compute_operand_range", res, name, r);
}
+
+bool
+trace_gori_compute::compute_logical_operands (irange &r, gimple *stmt,
+ const irange &lhs,
+ tree name,
+ const irange *name_range)
+{
+ unsigned idx = ++trace_count;
+ if (dumping (idx))
+ {
+ fprintf (dump_file, "compute_logical_operands (");
+ print_generic_expr (dump_file, name, TDF_SLIM);
+ fprintf (dump_file, ") with range ");
+ if (name_range)
+ name_range->dump (dump_file);
+ else
+ fputs ("NULL", dump_file);
+ fprintf (dump_file, " at stmt:\n");
+ dumping (idx, true);
+ fputs (" ", dump_file);
+ lhs.dump (dump_file);
+ fprintf (dump_file, " <==> ");
+ print_gimple_stmt (dump_file, stmt, 0, TDF_SLIM);
+ indent += bump;
+ }
+ bool res = super::compute_logical_operands (r, stmt, lhs, name, name_range);
+ return trailer (idx, "compute_logical_operands", res, name, r);
+}
diff --git a/gcc/gimple-range-gori.h b/gcc/gimple-range-gori.h
index eca9571327a..7f4b1a5b482 100644
--- a/gcc/gimple-range-gori.h
+++ b/gcc/gimple-range-gori.h
@@ -157,6 +157,9 @@ protected:
tree name,
const irange *name_range = NULL);
bool has_edge_range_p (edge e, tree name);
+ virtual bool compute_logical_operands (irange &r, gimple *stmt,
+ const irange &lhs,
+ tree name, const irange *name_range);
gori_map m_gori_map;
private:
void get_tree_range (irange &, tree expr, tree name,
@@ -180,9 +183,6 @@ private:
(irange &r, gimple *stmt,
const irange &lhs,
tree name, const irange *name_range);
- bool compute_logical_operands (irange &r, gimple *stmt,
- const irange &lhs,
- tree name, const irange *name_range);
bool logical_combine (irange &r, enum tree_code code,
const irange &lhs,
const irange &op1_true,
@@ -206,6 +206,9 @@ protected:
const irange &lhs,
tree name,
const irange *name_range = NULL);
+ virtual bool compute_logical_operands (irange &r, gimple *stmt,
+ const irange &lhs,
+ tree name, const irange *name_range);
private:
typedef gori_compute super; // Inherited from class for easy changing.
protected:
More information about the Gcc-cvs
mailing list