Prefetching

The goal of prefetch insertion optimization is to reduce cache misses by providing hints to the processor about when data should be loaded into the cache. The prefetch optimization is enabled or disabled by the -prefetch[-] compiler option.

-prefetch enables (default) prefetch insertion optimization. Note that -O3 must be specified for this option to work.

To disable prefetch insertion optimization, use -prefetch-.

To facilitate compiler optimization:

For more information on how to optimize with -prefetch[-], refer to the
Intel® Pentium® 4 and Intel Xeon Processor Optimization Reference Manual.

In addition to the -prefetch option, the _mm_prefetch intrinsic and PREFETCH compiler directive are also available. The intrinsic prefetches data from the specified address on one memory cache line. The compiler directive enables a data prefetch from memory.