diff options
author | Maxim Kuvyrkov <maxim.kuvyrkov@linaro.org> | 2017-06-06 17:00:46 +0000 |
---|---|---|
committer | Maxim Kuvyrkov <mkuvyrkov@gcc.gnu.org> | 2017-06-06 17:00:46 +0000 |
commit | 1a70c8d54274226d5613569fe7df134f882a0263 (patch) | |
tree | cdde47417866f7ddef28e0e0e14d3165b6226876 /gcc/tree-ssa-loop-prefetch.c | |
parent | 6c6b519a32c3431fa5fde89db585ddc32eb83da2 (diff) | |
download | gcc-1a70c8d54274226d5613569fe7df134f882a0263.zip gcc-1a70c8d54274226d5613569fe7df134f882a0263.tar.gz gcc-1a70c8d54274226d5613569fe7df134f882a0263.tar.bz2 |
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
Diffstat (limited to 'gcc/tree-ssa-loop-prefetch.c')
-rw-r--r-- | gcc/tree-ssa-loop-prefetch.c | 5 |
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) |