This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFC] Don't schedule prefetch INSNs


Isn't that a big hammer as it will also prevent unrelated accesses from
being scheduled?

I'm trying to optimize memcpy loops with prefetches. Therefore I prefetch the cache line for the next iteration. So the prefetching instructions issued are not related to the memory access in the current iteration.


loop over cache lines:
   read prefetch x + cache_line_size
   write prefetch y + cache_line_size
   copy cache line x to y

Here I want the prefetching instructions to stay before the copy.

Another point is that the change also seems to prevent DCE to throw IFs around prefetches away. As in:

loop over cache lines:
   if (cache_lines_to_be_copied > 0)
     {
       read prefetch x + cache_line_size
       write prefetch y + cache_line_size
     }
   copy cache line x to y

Bye,

-Andreas-


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]