Commit 1a70c8d5 by Maxim Kuvyrkov Committed by Maxim Kuvyrkov

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
parent 6c6b519a
2017-06-06 Maxim Kuvyrkov <maxim.kuvyrkov@linaro.org>
* dbgcnt.def (prefetch): New debug counter.
* tree-ssa-loop-prefetch.c (dbgcnt.h): New include.
(schedule_prefetches): Stop issueing prefetches if debug counter
tripped.
2017-06-06 Tom de Vries <tom@codesourcery.com> 2017-06-06 Tom de Vries <tom@codesourcery.com>
* doc/sourcebuild.texi (Testsuites, C Language Testsuites, * doc/sourcebuild.texi (Testsuites, C Language Testsuites,
......
...@@ -174,6 +174,7 @@ DEBUG_COUNTER (merged_ipa_icf) ...@@ -174,6 +174,7 @@ DEBUG_COUNTER (merged_ipa_icf)
DEBUG_COUNTER (postreload_cse) DEBUG_COUNTER (postreload_cse)
DEBUG_COUNTER (pre) DEBUG_COUNTER (pre)
DEBUG_COUNTER (pre_insn) DEBUG_COUNTER (pre_insn)
DEBUG_COUNTER (prefetch)
DEBUG_COUNTER (registered_jump_thread) DEBUG_COUNTER (registered_jump_thread)
DEBUG_COUNTER (sched2_func) DEBUG_COUNTER (sched2_func)
DEBUG_COUNTER (sched_block) DEBUG_COUNTER (sched_block)
......
...@@ -48,6 +48,7 @@ along with GCC; see the file COPYING3. If not see ...@@ -48,6 +48,7 @@ along with GCC; see the file COPYING3. If not see
#include "tree-inline.h" #include "tree-inline.h"
#include "tree-data-ref.h" #include "tree-data-ref.h"
#include "diagnostic-core.h" #include "diagnostic-core.h"
#include "dbgcnt.h"
/* This pass inserts prefetch instructions to optimize cache usage during /* This pass inserts prefetch instructions to optimize cache usage during
accesses to arrays in loops. It processes loops sequentially and: accesses to arrays in loops. It processes loops sequentially and:
...@@ -1058,6 +1059,10 @@ schedule_prefetches (struct mem_ref_group *groups, unsigned unroll_factor, ...@@ -1058,6 +1059,10 @@ schedule_prefetches (struct mem_ref_group *groups, unsigned unroll_factor,
if (2 * remaining_prefetch_slots < prefetch_slots) if (2 * remaining_prefetch_slots < prefetch_slots)
continue; continue;
/* Stop prefetching if debug counter is activated. */
if (!dbg_cnt (prefetch))
continue;
ref->issue_prefetch_p = true; ref->issue_prefetch_p = true;
if (remaining_prefetch_slots <= prefetch_slots) if (remaining_prefetch_slots <= prefetch_slots)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment