Patent ID: 7849453

Claim:
A method for software scouting the regions of a program, comprising: receiving source code for a program; compiling the source code to produce executable code for the program, wherein compiling the source code involves: identifying a first set of loops from a hierarchy of loops in the source code, wherein each loop in the first set of loops contains at least one effective prefetch candidate; from the first set of loops, identifying a second set of loops where scout-mode prefetching is profitable, wherein identifying a loop where scout-mode prefetching is profitable involves determining if p_benefit≦p_overhead for the loop, wherein computing p_benefit for a loop involves summing the result of the computation p_benefit=num_accesses*L 2 _miss_penalty*predicted_L 2 _miss_rate for each effective prefetch candidate in the loop, wherein identifying the second set of loops where scout mode prefetching is profitable includes accounting for a cost in execution time of monitoring progress of the helper-thread relative to the main thread; and for each loop in the second set of loops, producing executable code for the helper-thread by replacing each effective prefetch candidate with a prefetch instruction, whereby at runtime the helper-thread is executed in parallel with the main thread, separately from the main thread, and in advance of where the main thread is executing to prefetch data items for the main thread.