System and method for parallel variable optimization
AssigneeThinking Machines Corporation
InventorsJames L. Frankel, Steven J. Sistare
Life of this patent
Estimating the term…
Abstract
An optimizer for optimizing an intermediate representation (IR) tree having multiple nodes. The IR tree represents a partial compilation of a source code. The source code is written using a high level language supporting data parallel processing. According to the present invention, the optimizer optimizes the IR tree by minimizing the number and size of temporary parallel variables in the IR tree. Such minimization optimizes the IR tree because temporary parallel variables require an enormous amount of space in memory.
Claims6
A system for optimizing an intermediate representation (IR) of a source program to generate a target program, the target program to be executed in a data parallel computer, the source program written using a data parallel computer programming language supporting parallel variables having different precision, the system comprising:
- promotion operation locating means for determining whether the intermediate representation includes a promotion operation associated with a source parallel variable of a first precision and a destination parallel variable of a second precision, said second precision being greater than said first precision, said promotion operation, when executed in the data parallel computer, enabling the data parallel computer to promote the source parallel variable to said destination parallel variable;
- demotion operation locating means, responsive to said promotion operation locating means determining that said intermediate representation includes a promotion operation, for determining whether the intermediate representation includes a demotion operation to be executed by the data parallel computer after the data parallel computer executes the promotion operation;
- determining means, responsive to a positive determination by the demotion operation locating means, for determining whether the destination parallel variable of the demotion operation is of a data type which is equal to a data type of said source parallel variable of the promotion operation;
- and
- intermediate representation modifying means responsive to a positive determination by said determining means, for inserting into the intermediate representation an instruction which, when executed by the data parallel computer, enables the data parallel computer to assign said destination parallel variable of the demotion operation a data type corresponding to that of the source parallel variable of the promotion operation.
A computer-implemented method for optimizing an intermediate representation (IR) of a source program to generate a target program, the target program to be executed in a data parallel computer, the source program written using a data parallel computer programming language supporting parallel variables having different precision, the method comprising the steps of:
- determining whether the intermediate representation includes a promotion operation associated with a source parallel variable of a first precision and a destination parallel variable of a second precision, said second precision being greater than said first precision, said promotion operation, when executed in the data parallel computer, enabling the data parallel computer to promote the source parallel variable to said destination parallel variable;
- in response to determining that the intermediate representation includes a promotion operation, determining whether the intermediate representation includes a demotion operation to be executed by the data parallel computer after the data parallel computer executes the promotion operation;
- in response to determining that the intermediate representation includes a demotion operation to be executed by the data parallel computer after the data parallel computer executes the promotion operation, determining whether the destination parallel variable of the demotion operation is of a data type which is equal to a data type of said source parallel variable of the promotion operation;
- and
- in responsive to a determination that the destination parallel variable of the demotion operation is of a data type which is equal to a data type of said source parallel variable of the promotion operation, inserting into the intermediate representation an instruction which, when executed by the data parallel computer, enables the data parallel computer to assign said destination parallel variable of the demotion operation a data type corresponding to that of the source parallel variable of the promotion operation.
Dependencies are inferred from the claim text.