Method, system, and computer program product for performing register promotion via load and store placement optimization within an optimizing compiler
First Claim
1. A method for performing register promotion, that optimizes placement of load and store operations of a computer program, within a compiler, comprising the steps of:
- (1) accessing a static single assignment (SSA) representation of the computer program;
(2) performing static single assignment partial redundancy elimination (SSAPRE) on said SSA representation to remove at least one redundant load operation, comprising the steps of;
(a) inserting Φ
functions at iterated post-dominance frontiers of loads and their left occurrences, where different values of said loads assigned values of left occurrences reach common points in the computer program, a result of each of said Φ
functions being stored in a hypothetical variable h;
(b) assigning an SSA version to each said hypothetical variable h in the computer program;
(c) determining whether each of said Φ
functions in the computer program is down safe;
(d) determining whether each of said loads or their assigned values will be available at each of said Φ
functions following eventual insertion of code into the computer program for purposes of partial redundancy elimination;
(e) transforming said SSA representation of the computer program having said hypothetical variables h to an SSA graph that includes some insertion information reflecting eventual insertions of code into the computer program for purposes of partial redundancy elimination; and
(f) updating said SSA graph based on said insertion information to introduce real temporary variables t for each of said hypothetical variables h;
thereby obtaining a first optimized SSA representation; and
(3) performing static single use partial redundancy elimination (SSUPRE) on said first optimized SSA representation, said SSUPRE internally using a single static use (SSU) representation to remove at least one redundant store operation, thereby obtaining a second optimized SSA representation;
whereby the compiler can produce more efficient, register-promoted executable program code from said second optimized SSA representation.
9 Assignments
0 Petitions
Accused Products
Abstract
A method, system, and computer program product for performing register promotion, that optimizes placement of load and store operations of a computer program within a compiler. Based on the observation that the circumstances for promoting a memory location'"'"'s value to register coincide with situations where the program exhibits partial redundancy between accesses to the memory location, the system is an approach to register promotion that models the optimization as two separate problems: (1) the partial redundancy elimination (PRE) of loads and (2) the PRE of stores. Both of these problems are solved through a sparse approach to PRE. The static single assignment PRE (SSAPRE) method for eliminating partial redundancy using a sparse SSA representation representations the foundation in eliminating redundancy among memory accesses, enabling the achievement of both computational and live range optimality in register promotion results. A static single use (SSU) representation is defined allowing the dual of the SSAPRE algorithm, called SSUPRE, to perform the partial redundancy elimination of stores. SSUPRE is performed after the PRE of loads, taking advantage of the loads'"'"' having been converted into pseudo-register references so that there are fewer barriers to the movement of stores. Consequently, the compiler produces more efficient, register-promoted executable program code from the SSA representation.
-
Citations
8 Claims
-
1. A method for performing register promotion, that optimizes placement of load and store operations of a computer program, within a compiler, comprising the steps of:
-
(1) accessing a static single assignment (SSA) representation of the computer program; (2) performing static single assignment partial redundancy elimination (SSAPRE) on said SSA representation to remove at least one redundant load operation, comprising the steps of; (a) inserting Φ
functions at iterated post-dominance frontiers of loads and their left occurrences, where different values of said loads assigned values of left occurrences reach common points in the computer program, a result of each of said Φ
functions being stored in a hypothetical variable h;(b) assigning an SSA version to each said hypothetical variable h in the computer program; (c) determining whether each of said Φ
functions in the computer program is down safe;(d) determining whether each of said loads or their assigned values will be available at each of said Φ
functions following eventual insertion of code into the computer program for purposes of partial redundancy elimination;(e) transforming said SSA representation of the computer program having said hypothetical variables h to an SSA graph that includes some insertion information reflecting eventual insertions of code into the computer program for purposes of partial redundancy elimination; and (f) updating said SSA graph based on said insertion information to introduce real temporary variables t for each of said hypothetical variables h; thereby obtaining a first optimized SSA representation; and (3) performing static single use partial redundancy elimination (SSUPRE) on said first optimized SSA representation, said SSUPRE internally using a single static use (SSU) representation to remove at least one redundant store operation, thereby obtaining a second optimized SSA representation; whereby the compiler can produce more efficient, register-promoted executable program code from said second optimized SSA representation. - View Dependent Claims (2, 3)
-
-
4. A method for representing a computer program within a compiler in a static single use (SSU) representation, comprising the steps of:
-
(1) accessing a static single assignment (SSA) representation of the computer program; (2) inserting Λ
functions in said SSA representation at iterated post-dominance frontiers of each store and iterated post-dominance frontiers of each load, the use of each of said Λ
functions being represented by a hypothetical variable h; and(3) assigning a SSU version to each of said hypothetical variable h in the computer program; whereby the SSU representation allows the compiler to eliminate partial redundancy among stores within the computer program.
-
-
5. A computer program product comprising a computer usable medium having computer readable program code means embodied in said medium for causing an application program to execute on a computer that optimizes placement of load and store operations of a computer program, within a compiler, said computer readable program code means comprising:
-
a first computer readable program code means for causing the computer to access a static single assignment (SSA) representation of the computer program; a second computer readable program code means for causing the computer to perform static single assignment partial redundancy elimination (SSAPRE) on said SSA representation to remove at least one redundant load operation, comprising; a third computer readable program code means for causing the computer to process said SSA representation of the computer program to eliminate partially redundant loads, wherein said third computer readable program code means comprises; a fourth computer readable program code means for causing the computer to insert Φ
functions at iterated post-dominance frontiers of loads and their left occurrences, where different values of said loads assigned values of left occurrences reach common points in the computer program, a result of each of said Φ
functions being stored in a hypothetical variable h;a fifth computer readable program code means for causing the computer to assign an SSA version to each said hypothetical variable h in the computer program; a sixth computer readable program code means for causing the computer to determine whether each of said Φ
functions in the computer program is down safe;a seventh computer readable program code means for causing the computer to determine whether each of said loads or their assigned values will be available at each of said Φ
functions following eventual insertion of code into the computer program for purposes of partial redundancy elimination;an eighth computer readable program code means for causing the computer to transform said SSA representation of the computer program having said hypothetical variables h to an SSA graph that includes some insertion information reflecting eventual insertions of code into the computer program for purposes of partial redundancy elimination; and a ninth computer readable program code means for causing the computer to update said SSA graph based on said insertion information to introduce real temporary variables t for each of said hypothetical variables h; thereby obtaining a first optimized SSA representation; and a tenth computer readable program code means for causing the computer to perform static single use partial redundancy elimination (SSUPRE) on said first optimized SSA representation, said SSUPRE internally using a single static use (SSU) representation to remove at least one redundant store operation, thereby obtaining a second optimized SSA representation; wherein the compiler produces more efficient, register-promoted executable program code from said second optimized SSA representation. - View Dependent Claims (6, 7)
-
-
8. A computer program product comprising a computer usable medium having computer readable program code means embodied in said medium for causing an application program to execute on a computer that represents a computer program within a compiler in a static single use (SSU) representation, said computer readable program code means comprising:
-
a first computer readable program code means for causing the computer to access a static single assignment (SSA) representation of the computer program; a second computer readable program code means for causing the computer to insert Λ
functions in said SSA representation at iterated post-dominance frontiers of each store and iterated post-dominance frontiers of each load, the use of each of said Λ
functions being represented by a hypothetical variable h; anda third computer readable program code means for causing the computer to assign a SSU version to each of said hypothetical variable h in the computer program; whereby the SSU representation allows the compiler to eliminate partial redundancy among stores within the computer program.
-
Specification