Lukas' Notes

computer-architecture memory

Definition

Instruction Prefetching

Instruction prefetching is the speculative fetching of instructions into the instruction cache before they are demanded by the fetch stage. The goal is to hide the latency of main memory by ensuring instructions are already present in the cache when the PC reaches them.

The simplest form is sequential prefetching: after fetching cache line , also fetch line . This works well for straight-line code but fetches useless lines after a taken branch.