diff options
author | Martin Liska <mliska@suse.cz> | 2019-07-03 14:43:44 +0200 |
---|---|---|
committer | Martin Liska <marxin@gcc.gnu.org> | 2019-07-03 12:43:44 +0000 |
commit | d398999dbe0eca4978beaa82bf84b3e3b0798f0e (patch) | |
tree | 6efaba0e8aa6ce61052fd129296bcc445171f438 | |
parent | 596341c741a4a746497a1da8322fce0ad625e26b (diff) | |
download | gcc-d398999dbe0eca4978beaa82bf84b3e3b0798f0e.tar.gz |
Add dbgcnt for gimple_match and generic_match.
2019-07-03 Martin Liska <mliska@suse.cz>
* dbgcnt.def (DEBUG_COUNTER): Add match debug counter.
* genmatch.c (dt_simplify::gen_1): Generate dbgcnt
condition.
* generic-match-head.c: Include dbgcnt.h.
* gimple-match-head.c: Likewise.
From-SVN: r273006
-rw-r--r-- | gcc/ChangeLog | 8 | ||||
-rw-r--r-- | gcc/dbgcnt.def | 1 | ||||
-rw-r--r-- | gcc/generic-match-head.c | 2 | ||||
-rw-r--r-- | gcc/genmatch.c | 4 | ||||
-rw-r--r-- | gcc/gimple-match-head.c | 2 |
5 files changed, 15 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 579463e0a68..63160aab268 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,13 @@ 2019-07-03 Martin Liska <mliska@suse.cz> + * dbgcnt.def (DEBUG_COUNTER): Add match debug counter. + * genmatch.c (dt_simplify::gen_1): Generate dbgcnt + condition. + * generic-match-head.c: Include dbgcnt.h. + * gimple-match-head.c: Likewise. + +2019-07-03 Martin Liska <mliska@suse.cz> + * gcov-counter.def (GCOV_COUNTER_V_SINGLE): Remove. (GCOV_COUNTER_V_TOPN): New. (GCOV_COUNTER_V_INDIR): Use _topn. diff --git a/gcc/dbgcnt.def b/gcc/dbgcnt.def index dd874c519bb..230072f7bb5 100644 --- a/gcc/dbgcnt.def +++ b/gcc/dbgcnt.def @@ -195,3 +195,4 @@ DEBUG_COUNTER (tree_sra) DEBUG_COUNTER (vect_loop) DEBUG_COUNTER (vect_slp) DEBUG_COUNTER (dom_unreachable_edges) +DEBUG_COUNTER (match) diff --git a/gcc/generic-match-head.c b/gcc/generic-match-head.c index 76fc9993481..b54e03552ba 100644 --- a/gcc/generic-match-head.c +++ b/gcc/generic-match-head.c @@ -35,7 +35,7 @@ along with GCC; see the file COPYING3. If not see #include "case-cfn-macros.h" #include "gimplify.h" #include "optabs-tree.h" - +#include "dbgcnt.h" /* Routine to determine if the types T1 and T2 are effectively the same for GENERIC. If T1 or T2 is not a type, the test diff --git a/gcc/genmatch.c b/gcc/genmatch.c index 7b9b09c7d8b..109bd9e6f2d 100644 --- a/gcc/genmatch.c +++ b/gcc/genmatch.c @@ -3310,6 +3310,10 @@ dt_simplify::gen_1 (FILE *f, int indent, bool gimple, operand *result) } } + if (s->kind == simplify::SIMPLIFY) + fprintf_indent (f, indent, "if (__builtin_expect (!dbg_cnt (match), 0)) return %s;\n", + gimple ? "false" : "NULL_TREE"); + fprintf_indent (f, indent, "if (__builtin_expect (dump_file && (dump_flags & TDF_FOLDING), 0)) " "fprintf (dump_file, \"%s ", s->kind == simplify::SIMPLIFY diff --git a/gcc/gimple-match-head.c b/gcc/gimple-match-head.c index f83f2256178..df9f0c50590 100644 --- a/gcc/gimple-match-head.c +++ b/gcc/gimple-match-head.c @@ -42,7 +42,7 @@ along with GCC; see the file COPYING3. If not see #include "gimplify.h" #include "optabs-tree.h" #include "tree-eh.h" - +#include "dbgcnt.h" /* Forward declarations of the private auto-generated matchers. They expect valueized operands in canonical order and do not |