This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] debug-counter for GIMPLE unrolling
- From: Richard Biener <rguenther at suse dot de>
- To: gcc-patches at gcc dot gnu dot org
- Date: Thu, 7 Nov 2019 08:35:41 +0100 (CET)
- Subject: [PATCH] debug-counter for GIMPLE unrolling
Helps to narrow down some bugs.
Bootstrapped / tested on x86_64-unknown-linux-gnu, applied.
Richard.
2019-11-07 Richard Biener <rguenther@suse.de>
* dbgcnt.def (gimple_unroll): New.
* tree-ssa-loop-ivcanon.c (try_unroll_loop_completely): Check
gimple_unroll debug counter before applying transform.
(try_peel_loop): Likewise.
Index: gcc/dbgcnt.def
===================================================================
--- gcc/dbgcnt.def (revision 277873)
+++ gcc/dbgcnt.def (working copy)
@@ -198,3 +198,4 @@ DEBUG_COUNTER (vect_slp)
DEBUG_COUNTER (dom_unreachable_edges)
DEBUG_COUNTER (match)
DEBUG_COUNTER (store_merging)
+DEBUG_COUNTER (gimple_unroll)
Index: gcc/tree-ssa-loop-ivcanon.c
===================================================================
--- gcc/tree-ssa-loop-ivcanon.c (revision 277873)
+++ gcc/tree-ssa-loop-ivcanon.c (working copy)
@@ -64,6 +64,7 @@ along with GCC; see the file COPYING3.
#include "tree-cfgcleanup.h"
#include "builtins.h"
#include "tree-ssa-sccvn.h"
+#include "dbgcnt.h"
/* Specifies types of loops that may be unrolled. */
@@ -884,6 +887,9 @@ try_unroll_loop_completely (class loop *
}
}
+ if (!dbg_cnt (gimple_unroll))
+ return false;
+
initialize_original_copy_tables ();
auto_sbitmap wont_exit (n_unroll + 1);
if (exit && niter
@@ -1074,6 +1080,9 @@ try_peel_loop (class loop *loop,
return false;
}
+ if (!dbg_cnt (gimple_unroll))
+ return false;
+
/* Duplicate possibly eliminating the exits. */
initialize_original_copy_tables ();
auto_sbitmap wont_exit (npeel + 1);