Anticipatory optimization with composite folding
First Claim
1. A method in a computer system for generating code for a high-level program that is specified using programming-language-defined computational constructs and that is to be translated into a low-level computer program using low-level computational constructs, the programming-language-defined computational constructs defining a data flow and including high-level operands that are domain-specific composites of low-level computational constructs and including high-level operators for indicating operations on the high-level operands, the method comprising:
- identifying selected domain-specific composites within the programming-language-defined computational constructs; and
applying one or more abstract optimization tags to the programming-language-defined computational constructs in association with the selected domain-specific composites, the one or more abstract optimization tags identifying one or more anticipated optimization transformations for modifying the data flow in the translation from the high-level program to the low-level program.
1 Assignment
0 Petitions
Accused Products
Abstract
A method and system for anticipatory optimization of computer programs. The system generates code for a program that is specified using programming-language-defined computational constructs and user-defined, domain-specific computational constructs, the computational constructs including high-level operands that are domain-specific composites of low-level computational constructs. The system generates an abstract syntax tree (AST) representation of the program in a loop merging process. The AST has nodes representing the computational constructs of the program and abstract optimization tags for folding of the composites. A composite folding process is applied to the AST according to the optimization tags to generate optimized code for the program. The composite folding process includes identifying an optimization event, identifying each abstract optimization tag applied to the programming-language-defined computational constructs and having a transformation condition identifying the optimization event as a condition for attempting an anticipated optimization in the translation, and attempting execution of each of the anticipated optimization transformations associated with the optimization event.
240 Citations
72 Claims
-
1. A method in a computer system for generating code for a high-level program that is specified using programming-language-defined computational constructs and that is to be translated into a low-level computer program using low-level computational constructs, the programming-language-defined computational constructs defining a data flow and including high-level operands that are domain-specific composites of low-level computational constructs and including high-level operators for indicating operations on the high-level operands, the method comprising:
-
identifying selected domain-specific composites within the programming-language-defined computational constructs; and
applying one or more abstract optimization tags to the programming-language-defined computational constructs in association with the selected domain-specific composites, the one or more abstract optimization tags identifying one or more anticipated optimization transformations for modifying the data flow in the translation from the high-level program to the low-level program. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15)
generating an abstract syntax tree (AST) representation of the programming-language-defined computational constructs, the AST having nodes representing the computational constructs of the program; and
applying the one or more abstract optimization tags to the programming-language-defined computational constructs includes applying the optimization tags to the AST.
-
-
15. The method of claim 1 in which the domain-specific composites are of the graphics imaging domain.
-
16. In a computer readable data storage medium having therein a high-level program that is specified using programming-language-defined computational constructs and that is to be translated into a low-level computer program using low-level computational constructs, the programming-language-defined computational constructs including high-level operands that are composites of low-level computational constructs and including high-level operators for indicating operations on the high-level operands, an optimization tag data structure, comprising:
-
an anticipated optimization transformation in the translation from the high-level program to the low-level program; and
a transformation condition identifying a condition for attempting the anticipated optimization in the translation from the high-level program to the low-level program. - View Dependent Claims (17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31)
-
-
32. In a computer readable data storage medium software instructions for generating code for a high-level program that is specified using programming-language-defined computational constructs and that is to be translated into a low-level computer program using low-level computational constructs, the programming-language-defined computational constructs defining a data flow and including high-level operands that are domain-specific composites of low-level computational constructs and including high-level operators for indicating operations on the high-level operands, comprising:
software instructions for applying one or more abstract optimization tags to the programming-language-defined computational constructs in association with the selected domain-specific composites, the one or more abstract optimization tags identifying one or more anticipated optimization transformations for modifying the data flow in the translation from the high-level program to the low-level program. - View Dependent Claims (33, 34, 35, 36, 37, 38, 39, 40, 41, 42)
-
43. A method for generating code for a high-level program that is specified using programming-language-defined computational constructs and that is to be translated into a low-level computer program using low-level computational constructs, the programming-language-defined computational constructs including high-level operands that are domain-specific composites of low-level computational constructs and including high-level operators for indicating operations on the high-level operands, comprising:
-
identifying an optimization event;
identifying each abstract optimization tag applied to the programming-language-defined computational constructs and having a transformation condition identifying the optimization event as a condition for attempting an anticipated optimization in the translation; and
attempting execution of each of the anticipated optimization transformations associated with the optimization event. - View Dependent Claims (44, 45, 46, 47, 48)
-
-
49. A method in a computer system for generating code for a program, the program being specified using programming-language-defined computational constructs and user-defined, domain-specific computational constructs, the computational constructs including high-level operands that are domain-specific composites of low-level computational constructs, the method comprising:
-
generating in a loop merging process an abstract syntax tree (AST) representation of the program, the AST having nodes representing the computational constructs of the program and abstract optimization tags for folding of the composites; and
applying a composite finding process to the AST according to the optimizations tags to generate optimized code for the program. - View Dependent Claims (50, 51, 52, 53)
identifying an optimization event;
identifying each abstract optimization tag, applied to the programming-language-defined computational constructs and having a transformation condition identifying the optimization event as a condition for attempting an anticipated optimization in the translation; and
attempting execution of each of the anticipated optimization transformations associated with the optimization event.
-
-
51. The method of claim 49 wherein the computer system uses multiple phases and each user-defined, domain-specific transform has an associated phase during which it can transform the AST.
-
52. The method of claim 49 in which the optimization event is a scheduled event that occurs, upon a scheduled basis.
-
53. The method of claim 49 in which the optimization event is an unscheduled event that does not occur upon a scheduled basis.
-
54. A method for generating code for a high-level program that is specified using programming-language-defined computational constructs and that is to be translated into a low-level computer program using low-level computational constructs, the high-level computational constructs including high-level operands that are domain-specific composites of low-level computational constructs and including high-level operators for indicating operations on the high-level operands, comprising:
-
identifying an optimization event;
identifying each abstract optimization tag applied to the programming-language-defined computational constructs and having a transformation condition identifying the optimization event as a condition for attempting an anticipated optimization in the translation, the abstract optimization tags being arranged in the programming-language-defined computational constructs in a sequential order; and
attempting execution of each of the anticipated optimization transformations associated with the optimization event, at least a pair of the anticipated optimization transformations being attempted in an indicated sequential order different from the sequential order of the optimization tags. - View Dependent Claims (55, 56, 57, 58, 59, 60)
-
-
61. A method for generating code for a high-level program that is specified using programming-language-defined computational constructs and that is to be translated into a low-level computer program using low-level computational constructs, the high-level computational constructs including high-level, operands that are domain-specific composites of low-level computational constructs and including high-level operators for indicating operations on the high-level operands, comprising:
-
identifying an optimization event including an unscheduled event that does not occur upon a scheduled basis;
identifying each abstract optimization tag applied to the programming-language-defined computational constructs and having a transformation condition identifying the optimization event as a condition for attempting an anticipated optimization in the translation, the abstract optimization tags being arranged in the programming-language-defined computational constructs in a sequential order; and
attempting execution of each of the anticipated optimization transformations associated with the optimization event, the anticipated optimization transformations associated with unscheduled events being attempted in the sequential order of the optimization tags and an attempt of the anticipated optimization transformation associated with the unscheduled event interrupting the attempt of the anticipated optimization transformation associated with the scheduled event. - View Dependent Claims (62, 63, 64)
-
-
65. A method for generating code for a high-level program that is specified using programming-language-defined computational constructs and that is to be translated into a low-level computer program using low-level computational constructs, the high-level computational constructs including high-level operands that are domain-specific composites of low-level computational constructs and including high-level operators for indicating operations on the high-level operands, comprising:
-
identifying an optimization event;
identifying each abstract optimization tag applied to the programming-language-defined computational constructs and having a transformation condition identifying the optimization event as a condition for attempting an anticipated optimization in the translation, at least one of the optimization tags being generated automatically in response to the optimization transformation in another of the optimization tags; and
attempting execution of each of the anticipated optimization transformations associated with the optimization event. - View Dependent Claims (66, 67, 68, 69, 70, 71, 72)
-
Specification