]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
2010-05-11 Christian Borntraeger <borntraeger@de.ibm.com>
authorkrebbel <krebbel@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 11 May 2010 07:29:59 +0000 (07:29 +0000)
committerkrebbel <krebbel@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 11 May 2010 07:29:59 +0000 (07:29 +0000)
        * tree-ssa-loop-prefetch.c (prune_ref_by_group_reuse): Reset
prefetch_before to PREFETCH_ALL if to accesses "meet" beyond
cache size.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@159257 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/tree-ssa-loop-prefetch.c

index 5b1d3dda3f9d3c10db18e02cfa2925d2df5e2333..4ade883db3adaa13c3c0d87aba1da1326e0720a2 100644 (file)
@@ -1,3 +1,9 @@
+2010-05-11  Christian Borntraeger  <borntraeger@de.ibm.com>
+
+        * tree-ssa-loop-prefetch.c (prune_ref_by_group_reuse): Reset
+       prefetch_before to PREFETCH_ALL if to accesses "meet" beyond
+       cache size.
+
 2010-05-11  Christian Borntraeger  <borntraeger@de.ibm.com>
 
         * tree-ssa-loop-prefetch.c: Add debug for dropped prefetches.
index 2fc901d907b1603dfce1983b3095c4c6e9611ea3..daf9956d3bc3da9eb47f4d31988108c9dc6e675c 100644 (file)
@@ -716,6 +716,9 @@ prune_ref_by_group_reuse (struct mem_ref *ref, struct mem_ref *by,
       hit_from = ddown (delta_b, PREFETCH_BLOCK) * PREFETCH_BLOCK;
       prefetch_before = (hit_from - delta_r + step - 1) / step;
 
+      /* Do not reduce prefetch_before if we meet beyond cache size.  */
+      if (prefetch_before > abs (L2_CACHE_SIZE_BYTES / step))
+        prefetch_before = PREFETCH_ALL;
       if (prefetch_before < ref->prefetch_before)
        ref->prefetch_before = prefetch_before;
 
@@ -746,6 +749,9 @@ prune_ref_by_group_reuse (struct mem_ref *ref, struct mem_ref *by,
                                reduced_prefetch_block, align_unit);
   if (miss_rate <= ACCEPTABLE_MISS_RATE)
     {
+      /* Do not reduce prefetch_before if we meet beyond cache size.  */
+      if (prefetch_before > L2_CACHE_SIZE_BYTES / PREFETCH_BLOCK)
+        prefetch_before = PREFETCH_ALL;
       if (prefetch_before < ref->prefetch_before)
        ref->prefetch_before = prefetch_before;