Add dbgcnt for gimple_match and generic_match.
authorMartin Liska <mliska@suse.cz>
Wed, 3 Jul 2019 12:43:44 +0000 (14:43 +0200)
committerMartin Liska <marxin@gcc.gnu.org>
Wed, 3 Jul 2019 12:43:44 +0000 (12:43 +0000)
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

gcc/ChangeLog
gcc/dbgcnt.def
gcc/generic-match-head.c
gcc/genmatch.c
gcc/gimple-match-head.c

index 579463e0a682bc916740a6f50dee37ec1dd1ce33..63160aab268bde62754b2fe3622997a2bf0bffbd 100644 (file)
@@ -1,3 +1,11 @@
+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.
index dd874c519bba0c44d74952feccf9a81dfad5c8d2..230072f7bb511fd0c7e754704e451797de9cf3d0 100644 (file)
@@ -195,3 +195,4 @@ DEBUG_COUNTER (tree_sra)
 DEBUG_COUNTER (vect_loop)
 DEBUG_COUNTER (vect_slp)
 DEBUG_COUNTER (dom_unreachable_edges)
+DEBUG_COUNTER (match)
index 76fc99934816af0b1c6f303bb2fee0895b6ae842..b54e03552bae6b254f4e502fd28200650f68035d 100644 (file)
@@ -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
index 7b9b09c7d8bbceb06410b91312d0695874cad96c..109bd9e6f2d947ff709f86cd9e0b20051e48fa55 100644 (file)
@@ -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
index f83f225617889c1cf8e6fe3f6f6f57d71f216f81..df9f0c50590943597f3127a428a57a9a42387f3d 100644 (file)
@@ -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