aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-loop-prefetch.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/tree-ssa-loop-prefetch.c')
-rw-r--r--gcc/tree-ssa-loop-prefetch.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/gcc/tree-ssa-loop-prefetch.c b/gcc/tree-ssa-loop-prefetch.c
index f5f2802..6010141 100644
--- a/gcc/tree-ssa-loop-prefetch.c
+++ b/gcc/tree-ssa-loop-prefetch.c
@@ -48,6 +48,7 @@ along with GCC; see the file COPYING3. If not see
#include "tree-inline.h"
#include "tree-data-ref.h"
#include "diagnostic-core.h"
+#include "dbgcnt.h"
/* This pass inserts prefetch instructions to optimize cache usage during
accesses to arrays in loops. It processes loops sequentially and:
@@ -1058,6 +1059,10 @@ schedule_prefetches (struct mem_ref_group *groups, unsigned unroll_factor,
if (2 * remaining_prefetch_slots < prefetch_slots)
continue;
+ /* Stop prefetching if debug counter is activated. */
+ if (!dbg_cnt (prefetch))
+ continue;
+
ref->issue_prefetch_p = true;
if (remaining_prefetch_slots <= prefetch_slots)