Patent ID: 8285670

Claim:
A method, in a data processing system, for reducing coherency problems, the method comprising: receiving source code that is to be compiled; analyzing the source code to identify at least one loop of a plurality of loops that contain a memory reference; determining whether the memory reference is an access to a global memory that should be handled by a direct buffer in a local memory; responsive to an indication that the memory reference is an access to the global memory that should be handled by the direct buffer in the local memory, marking the memory reference for direct buffer transformation; applying the direct buffer transformation to the memory reference in order for at least one direct buffer to be created in the local memory for storing the memory reference; responsive to receiving one or more buffer allocation requests for the at least one loop during execution of the compiled and optimized code, determining whether a direct buffer allocation check request has been received indicating that all buffer allocation requests have been received; responsive to receiving the direct buffer allocation check request, determining whether any access ranges of the one or more buffer allocation requests overlap with each other; and responsive to none of the access ranges of the one or more buffer allocation requests overlapping with each other, allocating contiguous space in the local memory for each direct buffer recorded in a buffer directory data structure in the local memory corresponding to each buffer allocation request.