Patent ID: 8819651

Claim:
A method, in a data processing system having a software cache, for optimizing memory accesses in source code, comprising: grouping memory references in the source code into a reference stream, the reference stream having a size equal to or less than a size of a software cache line; transforming the source code into optimized code at least by: inserting cache lookup code for performing a cache lookup of a lowest memory reference address in the reference stream to thereby generate a first cache line handle; inserting cache lookup code for performing a cache lookup of one of an actual highest memory reference address in the reference stream or a highest possible memory reference address in the reference stream, to thereby generate a second cache line handle; and for each other memory reference in the reference stream, inserting code for determining whether to use the first cache line handle or second cache line handle as a basis for retrieving data from the software cache corresponding to the memory reference; and outputting the optimized code for generation of executable code for execution on one or more processors.