Compiler support for optimizing decomposed software transactional memory operations
First Claim
1. A method of compiling a program, the program including software transactional memory blocks and the method comprising:
- by a computer, optimizing the program to create an optimized program containing software transactional memory instructions;
wherein optimizing the program comprises;
(a) inserting one or more word-based direct-access software transactional memory instructions at the software transactional memory blocks;
(b) replacing the one or more word-based direct-access software transactional memory instructions with decomposed software transactional memory instructions in the program at the software transactional memory blocks;
and(c) performing optimizations on the program to create the optimized program, such that at least some of the optimizations are configured to operate specifically on the decomposed software transactional memory instructions;
wherein performing optimizations comprises performing a common subexpression elimination procedure which is modified to operate on decomposed software transactional memory instructions such that a decomposed software transactional memory instruction to open an object for read, that comprises a parameter that references the object, is eliminated which takes place after a decomposed software transactional memory instruction to open the object for update within a same transaction;
wherein the optimizations are performed within software transactional memory constraints, the software transactional memory constraints comprising data dependencies which are introduced into the decomposed software transactional memory instructions;
wherein the data dependencies enforce a call order based on output variables for at least some of the decomposed software transactional memory instructions being input variables for subsequent decomposed software transactional memory instructions; and
compiling the optimized program.
2 Assignments
0 Petitions
Accused Products
Abstract
A software transactional memory system is described which utilizes decomposed software transactional memory instructions as well as runtime optimizations to achieve efficient performance. The decomposed instructions allow a compiler with knowledge of the instruction semantics to perform optimizations which would be unavailable on traditional software transactional memory systems. Additionally, high-level software transactional memory optimizations are performed such as code movement around procedure calls, addition of operations to provide strong atomicity, removal of unnecessary read-to-update upgrades, and removal of operations for newly-allocated objects. During execution, multi-use header words for objects are extended to provide for per-object housekeeping, as well as fast snapshots which illustrate changes to objects. Additionally, entries to software transactional memory logs are filtered using an associative table during execution, preventing needless writes to the logs. Finally a garbage collector with knowledge of the software transactional memory system compacts software transactional memory logs during garbage collection.
76 Citations
10 Claims
-
1. A method of compiling a program, the program including software transactional memory blocks and the method comprising:
-
by a computer, optimizing the program to create an optimized program containing software transactional memory instructions; wherein optimizing the program comprises; (a) inserting one or more word-based direct-access software transactional memory instructions at the software transactional memory blocks; (b) replacing the one or more word-based direct-access software transactional memory instructions with decomposed software transactional memory instructions in the program at the software transactional memory blocks; and (c) performing optimizations on the program to create the optimized program, such that at least some of the optimizations are configured to operate specifically on the decomposed software transactional memory instructions; wherein performing optimizations comprises performing a common subexpression elimination procedure which is modified to operate on decomposed software transactional memory instructions such that a decomposed software transactional memory instruction to open an object for read, that comprises a parameter that references the object, is eliminated which takes place after a decomposed software transactional memory instruction to open the object for update within a same transaction; wherein the optimizations are performed within software transactional memory constraints, the software transactional memory constraints comprising data dependencies which are introduced into the decomposed software transactional memory instructions; wherein the data dependencies enforce a call order based on output variables for at least some of the decomposed software transactional memory instructions being input variables for subsequent decomposed software transactional memory instructions; and compiling the optimized program. - View Dependent Claims (2, 3, 4, 5, 6, 7)
-
-
8. A compiler system for compiling a program containing software transactional memory blocks, the system comprising:
-
a processor; a memory; a first compilation module configured to represent source code of the program as an intermediate representation comprising, at least in part, representations of decomposed software transactional memory instructions, the decomposed software transactional memory instructions replacing at least one or more word-based software transactional memory instructions; and an optimization module configured to optimize an intermediate representation for the source code of the program, the intermediate representation comprising, at least in part, decomposed software transactional memory instructions; wherein the optimization module is further configured to perform a common subexpression elimination on the decomposed software transactional memory instructions, the common subexpression elimination comprising removing a redundant decomposed software transactional memory instruction to open an object for reading, that comprises a parameter that references the object, located after a decomposed software transactional memory instruction to open the object for updating within a same transaction; wherein the representations of decomposed software transactional memory instructions are optimized at least in part according to software transactional memory optimization rules, the software transactional memory optimization rules comprising data dependencies in the decomposed software transactional memory instructions; wherein the data dependencies enforce a call order based on output variables for at least some of the decomposed software transactional memory instructions being input variables for subsequent decomposed software transactional memory instructions; and a second compilation module configured to compile the optimized intermediate representation into an executable form. - View Dependent Claims (9)
-
-
10. One or more computer-readable storage memories or magnetic disk containing instructions which, when executed by a computer, cause the computer to perform a method for optimizing a program comprising decomposed direct-access software transactional memory instructions, the method comprising:
-
receiving an intermediate representation of the program comprising a control-flow graph, the intermediate representation including representations of the decomposed direct-access software transactional memory instructions located in the program in software transactional memory, blocks marked as atomic, wherein the decomposed direct-access software transactional memory, instructions replace at least one or more word-based software transactional memory instructions in one or more transactions that perform operations directly to a heap; and applying optimization rules specific to decomposed direct-access software transactional memory instructions in order to optimize the representations of the decomposed direct-access software transactional memory instructions, wherein applying optimization rules comprises; performing a modified common subexpression elimination on the decomposed direct-access software transactional memory instructions which eliminates read open instructions which occur after update open instructions, wherein a respective read open instruction of the eliminated read open instructions comprises a parameter that references an object and the respective read open instruction is subsumed by a respective update open instruction of the update open instructions; wherein the modified common subexpression elimination procedure also eliminates read open instructions of the decomposed direct-access software transactional memory instructions in a first transaction which are made redundant and subsumed by read open instructions or update open instructions of the decomposed direct-access software transactional memory instructions in a second transaction, wherein the first transaction is nested within the second transaction; removing redundant load-store elimination for decomposed direct-access software transactional memory instructions which comprise reads, writes, and entries to logs; and performing code motion optimizations for decomposed direct-access software transactional memory instructions; wherein the optimization rules comprise restrictions on the control-flow graph for the intermediate representation, the restrictions on the control-flow graph comprising data dependencies between decomposed direct-access software transactional memory instructions, wherein the data dependencies enforce a call order, at least for atomicity, which enforces that a location is open for reading when read or the location is open for updating when updated or a store is logged for the location when updated, the enforcement based on output variables for decomposed direct-access software transactional memory instructions being input variables for-subsequent decomposed direct access software transactional memory instructions.
-
Specification