Patent ID: 7257810
Filing Date: 2007-08-14
Classification: G06F

Abstract:
1. A method for generating code to perform anticipatory prefetching for data references, comprising: receiving code to be executed on a computer system; analyzing the code to identify data references to be prefetched; calculating an execution time of a single loop iteration which includes the identified data references, wherein the execution time includes an adjustment for the execution probability of the identified data references; calculating a prefetch ahead distance, wherein the prefetch ahead distance includes the ratio of outstanding prefetches to the number of prefetch streams and considers the probabilistically adjusted execution time of the single loop iteration, and wherein the prefetch ahead distance indicates how many loop iterations ahead to prefetch for; and inserting prefetch instructions into a preceding basic block of the code in advance of the identified data references based upon the prefetch ahead distance, wherein inserting prefetch instructions involves inserting multiple prefetch instructions for a given cache line, and wherein inserting the prefetch instructions involves, wherein the stride value is constant for some but not necessarily all loop iterations.