This is the mail archive of the
mailing list for the GCC project.
Re: [RFC] Don't schedule prefetch INSNs
- From: Andreas Krebbel <krebbel at linux dot vnet dot ibm dot com>
- To: Zdenek Dvorak <rakdver at kam dot mff dot cuni dot cz>
- Cc: Adam Nemet <anemet at caviumnetworks dot com>, gcc-patches at gcc dot gnu dot org
- Date: Mon, 25 May 2009 09:38:28 +0200
- Subject: Re: [RFC] Don't schedule prefetch INSNs
- References: <4A13DE4D.email@example.com> <20090520164849.GA4197@kam.mff.cuni.cz>
It will be worthwhile if the basic block is a loop body. It might make
sense to prefetch something used in the next loop iteration. Actually
that's what I am trying to do for memcpys.
in that case, the placement of the prefetch inside the loop body is
more or less irrelevant, no?
In the example described in my other mail the prefetches would be
completely useless when the get moved over the copy instruction like this:
loop over cache lines (x += cache_line_size, y += cache_line_size):
copy cache line x to y
read prefetch x + cache_line_size
write prefetch y + cache_line_size
The prefetch of the cache lines for the next loop iteration would be too
close to the memory access.