diff options
author | spop <spop@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-06-09 22:56:08 +0000 |
---|---|---|
committer | spop <spop@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-06-09 22:56:08 +0000 |
commit | 94ce9ff0a1203321644b4023a6f7960396484fbf (patch) | |
tree | 6ff7eee3799c706cf82ef8a5fee1d131603eb000 /gcc/tree-ssa-loop-prefetch.c | |
parent | 1aabe697f03d7bb006744c168b1a51494ed2644d (diff) | |
download | gcc-94ce9ff0a1203321644b4023a6f7960396484fbf.tar.gz |
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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@160515 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssa-loop-prefetch.c')
-rw-r--r-- | gcc/tree-ssa-loop-prefetch.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/gcc/tree-ssa-loop-prefetch.c b/gcc/tree-ssa-loop-prefetch.c index 705ee81b9c8..8097124bc7f 100644 --- a/gcc/tree-ssa-loop-prefetch.c +++ b/gcc/tree-ssa-loop-prefetch.c @@ -513,6 +513,10 @@ gather_memory_references_ref (struct loop *loop, struct mem_ref_group **refs, if (step == NULL_TREE) 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 are integer constants. */ agrp = find_or_create_group (refs, base, step); |