From 1a70c8d54274226d5613569fe7df134f882a0263 Mon Sep 17 00:00:00 2001 From: Maxim Kuvyrkov Date: Tue, 6 Jun 2017 17:00:46 +0000 Subject: Add debug counter for loop array prefetching. * dbgcnt.def (prefetch): New debug counter. * tree-ssa-loop-prefetch.c (dbgcnt.h): New include. (schedule_prefetches): Stop issueing prefetches if debug counter tripped. Change-Id: Ia6160364735a889fb6d2370be21d98f87c0fe962 From-SVN: r248924 --- gcc/tree-ssa-loop-prefetch.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'gcc/tree-ssa-loop-prefetch.c') 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) -- cgit v1.1