Method and system for interprocedural prefetching
AssigneeSun Microsystems, Inc.
InventorsYonghong Song, Spiros Kalogeropulos, Partha P. Tirumalai
Life of this patent
Estimating the term…
Abstract
A computing system has an amount of shared cache, and performs runtime automatic parallelization wherein when a parallelized loop is encountered, a main thread shares the workload with at least one other non-main thread. A method for providing interprocedural prefetching includes compiling source code to produce compiled code having a main thread including a parallelized loop. Prior to the parallelized loop in the main thread, the main thread includes prefetching instructions for the at least one other non-main thread that shares the workload of the parallelized loop. As a result, the main thread prefetches data into the shared cache for use by the at least one other non-main thread.
Claims20
A method of interprocedural prefetching for runtime automatic parallelization in a computing system, the computing system performing runtime automatic parallelization wherein when a parallelized loop is encountered, a main thread shares the workload with at least one other non-main thread, and wherein an amount of cache is shared, the method comprising:
- receiving a source code including a loop;
- and
- compiling the source code to produce a compiled code having a main thread including a parallelized loop, the parallelized loop corresponding to the source code loop, wherein prior to the parallelized loop in the main thread, the main thread includes prefetching instructions for at least one other non-main thread that shares the workload of the parallelized loop, whereby the main thread prefetches data into the shared cache for use by the at least one other non-main thread.
A method of interprocedural prefetching for runtime automatic parallelization in a computing system, the computing system performing runtime automatic parallelization wherein when a parallelized loop is encountered, a main thread shares the workload with at least one other non-main thread, and wherein an amount of cache is shared, the method comprising:
- receiving a source code including a loop;
- compiling the source code to produce a compiled code having a main thread including a parallelized loop, the parallelized loop corresponding to the source code loop;
- and
- during compiling, determining a prefetch overhead as the added execution time for the main thread due to prefetching wherein prefetch instructions are inserted prior to the parallelized loop in the main thread to prefetch for at least one other non-main thread that shares the workload of the parallelized loop,
- determining a prefetch benefit as the saved execution time for the at least one other non-main thread due to the prefetching,
- comparing the prefetch overhead to the prefetch benefit, and
- when the prefetch benefit is greater than the prefetch overhead, inserting the prefetch instructions prior to the parallelized loop in the main thread, whereby the main thread prefetches data into the shared cache for use by the at least one other non-main thread.
A computer readable storage medium having information stored thereon to direct a computer to:
- compile a source code including a loop to produce a compiled code having a main thread including a parallelized loop corresponding to the source code loop, the compiled code being suitable for runtime automatic parallelization in a computing system wherein when the parallelized loop is encountered, the main thread shares the workload with at least one other non-main thread, and wherein an amount of cache in the computing system is shared, wherein prior to the parallelized loop in the main thread, the main thread includes prefetching instructions for the at least one other non-main thread that shares the workload of the parallelized loop, whereby the main thread prefetches data into the shared cache for use by the at least one other non-main thread.
Dependencies are inferred from the claim text.