IP Library Granted Patent US 8,151,252
Granted Patent B2
US 8,151,252 · App. 12/035,828 · Granted Apr 3, 2012

Compiler framework for speculative automatic parallelization with transactional memory

View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 8,151,252
App. No.
12/035,828
Granted
Apr 3, 2012
Kind
B2
Abstract

A computer program is speculatively parallelized with transactional memory by scoping program variables at compile time, and inserting code into the program at compile time. Determinations of the scoping can be based on whether scalar variables being scoped are involved in inter-loop non-reduction data dependencies, are used outside loops in which they were defined, and at what point in a loop a scalar variable is defined. The inserted code can include instructions for execution at a run time of the program to determine loop boundaries of the program, and issue checkpoint instructions and commit instructions that encompass transaction regions in the program. A transaction region can include an original function of the program and a spin-waiting loop with a non-transactional load, wherein the spin-waiting loop is configured to wait for a previous thread to commit before the current transaction commits.

Claims (39)

1. A method for parallelizing execution of a computer program, comprising:

scoping program variables of the program at compile time of the program, including scoping scalar variables that are involved in an inter-loop reduction dependence as shared;

inserting code into the program at compile time, wherein the inserted code comprises instructions for causing a computer to perform actions at run time of the program including:

determining loop boundaries at run time;

issuing checkpoint instructions and commit instructions that encompass transaction regions in the program, wherein each transaction region comprises a function needed to perform work of the computer program and a spin-waiting loop with a non-transactional load, wherein the spin-waiting loop waits for a previous thread to commit before the spin-waiting loop commits; and

storing the program including the inserted code.

2. The method of claim 1 , wherein the scoping further comprises:

scoping a non-loop-index scalar variable that carries inter-loop non-reduction data dependences, as shared; and

scoping a scalar variable that is defined in a loop prior to a last iteration of the loop and used outside the loop, as shared.

3. The method of claim 1 , wherein the inserted code comprises instructions for causing the computer to perform, in response to a failure of a speculatively executed thread of the program, restarting the speculatively executed thread after a prior thread is done.

4. The method of claim 1 , wherein the inserted code comprises instructions for enabling each thread in the program to perform reduction and copy-out immediately after commit.

5. The method of claim 1 , wherein the inserted code comprises instructions for enabling a main thread in the program to perform reduction and copy-out for threads in the program in response to indications from the threads, wherein each of the indications indicates that a corresponding thread has committed.

6. The method of claim 1 , wherein the inserted code comprises instructions for enabling a main thread in the program to perform reduction and copy-out after all speculative threads in the program are done.

7. Apparatus comprising a processor, wherein the apparatus is configured to:

receive a computer program;

scope program variables of the program at compile time, including scoping scalar variables that are involved in an inter-loop reduction dependence as shared;

insert code into the program at compile time, wherein the inserted code comprises instructions for causing a computer to perform actions at run time of the program, the actions including:

determining loop boundaries of the program at run time; and

issuing checkpoint instructions and commit instructions that encompass transaction regions in the program, wherein each transaction region comprises a function needed to perform work of the computer program and a spin-waiting loop with a non-transactional load, wherein the spin-waiting loop waits for a previous thread to commit before the spin-waiting loop commits;

store the program including the inserted code.

8. The apparatus of claim 7 , wherein the apparatus is further configured to:

scope a non-loop-index scalar variable that carries inter-loop data non-reduction dependencies, as shared; and

scope a scalar variable that is defined in a loop prior to a last iteration of the loop and used outside the loop, as shared.

9. The apparatus of claim 7 , wherein the inserted code comprises instructions for causing the computer to perform, in response to a failure of a speculatively executed thread of the program, restarting the speculatively executed thread after a prior thread is done.

10. The apparatus of claim 7 , wherein the inserted code comprises instructions for enabling each thread in the program to perform reduction and copy-out immediately after commit.

11. The apparatus of claim 7 , wherein the inserted code comprises instructions for enabling a main thread in the program to perform reduction and copy-out for threads in the program in response to indications from the threads, wherein each of the indications indicates that a corresponding thread has committed.

12. The apparatus of claim 7 , wherein the inserted code comprises instructions for enabling a main thread in the program to perform reduction and copy-out after all speculative threads in the program are done.

13. A computer readable storage medium comprising instructions for causing a computer to perform:

scoping program variables of a computer program at compile time of the program, including scoping scalar variables that are involved in an inter-loop reduction dependence as shared;

inserting code into the program at compile time, wherein the inserted code comprises instructions for performing actions at run time of the program including:

determining loop boundaries at run time;

issuing checkpoint instructions and commit instructions that encompass transaction regions in the program, wherein each transaction region comprises a function needed to perform work of the computer program and a spin-waiting loop with a non-transactional load, wherein the spin-waiting loop waits for a previous thread to commit before the spin-waiting loop commits.

14. The medium of claim 13 , wherein the scoping further comprises:

scoping a non-loop-index scalar variable that carries inter-loop non-reduction data dependences, as shared; and

scoping a scalar variable that is defined in a loop prior to a last iteration of the loop and used outside the loop, as shared.

15. The medium of claim 13 , wherein the inserted code comprises instructions for performing, in response to a failure of a speculatively executed thread of the program, restarting the speculatively executed thread after a prior thread is done.

16. The medium of claim 13 , wherein the inserted code comprises instructions for enabling each thread in the program to perform reduction and copy-out immediately after commit.

17. The medium of claim 13 , wherein the inserted code comprises instructions for enabling a main thread in the program to perform reduction and copy-out for threads in the program in response to indications from the threads, wherein each of the indications indicates that a corresponding thread has committed.

18. The medium of claim 13 , wherein the inserted code comprises instructions for enabling a main thread in the program to perform reduction and copy-out after all speculative threads in the program are done.

Assignments (2)
MERGER AND CHANGE OF NAME Recorded Dec 16, 2015
From: ORACLE USA, INC.; SUN MICROSYSTEMS, INC.; ORACLE AMERICA, INC.
To: ORACLE AMERICA, INC.
Reel/Frame 037311/0150 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Feb 26, 2008
From: SONG, YONGHONG; KONG, XIANGYUN; KALOGEROPULOS, SPIROS; TIRUMALAI, PARTHA P.
To: SUN MICROSYSTEMS, INC.
Reel/Frame 020562/0146 →