Patent ID: 7457923

Claim:
A computer-based method comprising: determining, by executing a sequence of program instructions of a computer program on a processor during execution of said computer program, whether a triggering event, correlated with a cache miss for a load instruction occurred, wherein said determining by executing a sequence of program instructions comprises: generating a first value by executing instructions in said sequence of program instructions wherein said first value is based on characteristics associated with said triggering event; comparing said first value with a known value to determine whether a predetermined relationship exists between said first value and said known value; and indicating said triggering event occurred when said comparing finds a predetermined relationship between said first value and said known value and otherwise indicating said triggering event did not occur; prefetching, by executing a scout code sequence of program instructions on said processor, data for the load instruction following the determining finding that the triggering event occurred; and continuing without prefetching data for the load instruction following the determining finding that the triggering event had not occurred, wherein said triggering event comprises at least one of a correlated cache miss event and a correlated control flow event; further wherein for said correlated cache miss event, said cache miss for a load instruction is correlated with a cache miss for another load instruction different from said load instruction, wherein said generating a first value comprises: determining a latency of said load instruction; and also wherein, said known value comprises a maximum latency of a cache; and said predetermined relationship is said latency being greater than said maximum latency; and still further wherein for said correlated control flow event, said sequence of program instructions includes a control flow sequence of instructions executed before said load instruction; and said cache miss for said load instruction is correlated with execution of said control flow sequence of instructions, wherein said generating a first value comprises: initializing a storage element to a known value prior to start of execution of said control flow sequence; adding a first known value to said storage element in a first portion of said control flow sequence; shifting said value in said storage element in a predetermined direction and adding a second known value to said storage element in a second portion of said control flow sequence different from said first portion; and also wherein said known value comprises a concatenation of the first and second known values; and said predetermined relationship is a value in said storage element equaling said concatenation of the first and second known values.