When should we use prefetch?
Some CPU and compilers supply prefetch instructions. Eg: __builtin_prefetch in GCC Document . Although there is a comment in GCC's document, but it's too short to me. I want to know, in prantice, when should we use prefetch? Are there some examples? Thx! This question isn't really about compilers as they're just providing some hook to insert prefetch instructions into your assembly code / binary. Different compilers may provide different intrinsic formats but you can just ignore all these and (carefully) add it directly in assembly code. Now the real question seems to be "when are prefetches