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 -opt-prefetch (Linux* and Mac OS* X) or /Qopt-prefetch (Windows*) compiler option. This option also allows you to specify the level of software prefetching.
To facilitate compiler optimization:
Minimize use of global variables and pointers.
Minimize use of complex control flow.
Choose data types carefully and avoid type casting.
In addition to the -opt-prefetch (Linux and Mac OS X) or /Qopt-prefetch (Windows) option, an intrinsic subroutine mm_prefetch and compiler directive prefetch are also available.
The architecture affects the option behavior. For more information about the differences, see the following topic:
-opt-prefetch compiler option