Re: Can this type of cache miss be reduced?

Eric Fisher <joefoxreal@gmail.com>
Wed, 3 Jun 2009 01:52:25 +0000 (UTC)

          From comp.compilers

Related articles
Can this type of cache miss be reduced? joefoxreal@gmail.com (Eric Fisher) (2009-06-01)
Re: Can this type of cache miss be reduced? gneuner2@comcast.net (George Neuner) (2009-06-01)
Re: Can this type of cache miss be reduced? max@gustavus.edu (Max Hailperin) (2009-06-02)
Re: Can this type of cache miss be reduced? joefoxreal@gmail.com (Eric Fisher) (2009-06-03)
Re: Can this type of cache miss be reduced? lkrupp@indra.com (Louis Krupp) (2009-06-03)
Re: Can this type of cache miss be reduced? gah@ugcs.caltech.edu (glen herrmannsfeldt) (2009-06-03)
Re: Can this type of cache miss be reduced? max@gustavus.edu (Max Hailperin) (2009-06-03)
| List of all articles for this month |

From: Eric Fisher <joefoxreal@gmail.com>
Newsgroups: comp.compilers
Date: Wed, 3 Jun 2009 01:52:25 +0000 (UTC)
Organization: A poorly-installed InterNetNews site
References: 09-06-003
Keywords: architecture
Posted-Date: 03 Jun 2009 05:49:53 EDT

Thanks a lot.


I'm looking at the data prefetching. There's an example of loop spliting
in "The compiler Design Handbook"


for (i=0; i<m; i++){
        sum[0] += a[i];
}


===>


for (i=0; i<m; i+=n){
      sum[0] += a[i];
      for(i1 = i+1; i1 < min(m, i+n); i1++){
              sum[0] += a[i1];
      }
}


So we can insert prefetching as


for (i=0; i<m; i+=n){
      prefetch(a[i+pd]);
      sum[0] += a[i];
      for(i1 = i+1; i1 < min(m, i+n); i1++){
              sum[0] += a[i1];
      }
}


I tried this method in my test program. The surprising thing is that the
performance is degrading due to the loop splitting. Even though the data
prefetching can get back some benefit, the overall performance is lower
than before.


Any suggestion?


Cheers
Eric Fisher



Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.