Commit 50814135 by Changpeng Fang Committed by Sebastian Pop

Limit non-constant step prefetching only to the innermost loops.

2010-06-09  Changpeng Fang  <changpeng.fang@amd.com>

	* tree-ssa-loop-prefetch.c (gather_memory_references_ref):
	Do not the gather memory reference in the outer loop if the step
	is not a constant.

From-SVN: r160515
parent f7963a7c
2010-06-09 Changpeng Fang <changpeng.fang@amd.com> 2010-06-09 Changpeng Fang <changpeng.fang@amd.com>
* tree-ssa-loop-prefetch.c (gather_memory_references_ref):
Do not the gather memory reference in the outer loop if the step
is not a constant.
2010-06-09 Changpeng Fang <changpeng.fang@amd.com>
* tree-ssa-loop-prefetch.c (PREFETCH_MOD_TO_UNROLL_FACTOR_RATIO) : * tree-ssa-loop-prefetch.c (PREFETCH_MOD_TO_UNROLL_FACTOR_RATIO) :
Change the PREFETCH_MOD_TO_UNROLL_FACTOR_RATIO threshold value from Change the PREFETCH_MOD_TO_UNROLL_FACTOR_RATIO threshold value from
8 to 4. Minor change of the related comments. 8 to 4. Minor change of the related comments.
......
...@@ -513,6 +513,10 @@ gather_memory_references_ref (struct loop *loop, struct mem_ref_group **refs, ...@@ -513,6 +513,10 @@ gather_memory_references_ref (struct loop *loop, struct mem_ref_group **refs,
if (step == NULL_TREE) if (step == NULL_TREE)
return false; return false;
/* Limit non-constant step prefetching only to the innermost loops. */
if (!cst_and_fits_in_hwi (step) && loop->inner != NULL)
return false;
/* Now we know that REF = &BASE + STEP * iter + DELTA, where DELTA and STEP /* Now we know that REF = &BASE + STEP * iter + DELTA, where DELTA and STEP
are integer constants. */ are integer constants. */
agrp = find_or_create_group (refs, base, step); agrp = find_or_create_group (refs, base, step);
......
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