Patent ID: 7529911

Claim:
A method for improving the effectiveness of prefetching during execution of instructions in scout mode, wherein instructions are speculatively executed to prefetch future memory operations, but wherein results are not committed to the architectural state of a processor, the method comprising: executing instructions for a program during normal-execution mode; upon encountering a non-data dependent stall condition, performing a checkpoint and commencing execution of instructions in scout mode; and upon encountering an unresolved data dependency, performing a checkpoint and executing subsequent instructions in an execute-ahead mode; wherein during execution of a load instruction during scout mode, if the load instruction causes a lower-level cache miss, the method further comprises, allowing the load instruction to access a higher-level cache; placing the load instruction and subsequent dependent instructions into a deferred queue, resuming execution of the program in scout mode, and if the load instruction causes a hit in the higher-level cache, replaying the load instruction and subsequent dependent instructions in the deferred queue, whereby the value retrieved from the higher-level cache can help in generating prefetches during scout mode; wherein the method further comprises inserting instructions into the deferred queue during scout mode by removing the oldest instructions in the deferred queue that were deferred during scout mode if additional space is required and if instructions exist in the deferred queue that were deferred during scout mode; and wherein if instructions associated with previous checkpoints set while moving to execute-ahead mode exist in the deferred queue, if instructions do not exist in the deferred queue that were deferred during scout mode, and if there is insufficient space in the deferred queue for storing deferred instructions during scout mode, the method further comprises deleting instructions associated with one or more checkpoints set while moving to execute-ahead mode from the deferred queue to make room for storing deferred instructions during scout mode.