Method and system for anticipatory optimization of computer programs
First Claim
1. A method in a computer system for optimizing a high-level computer program using high-level computational constructs 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 composites of low-level computational constructs and including high-level operators for indicating operations on the high-level operands, the method comprising:
- selecting a statement of the high-level computer program, the selected statement having a high-level operator and high-level operands, each high-level operand having implementing low-level computational constructs that implement access to the high-level operand;
identifying an optimization of the implementing low-level computational constructs that would result in an optimized translation of the selected statement into the low-level computational constructs;
when an optimization has been identified, indicating that the identified optimization can be applied to the selected statement of the high-level computer program; and
when translating the selected statement of the high-level computer program to the low-level computer program, applying the indicated optimization generate combined low-level implementations customized to the high-level operators and operands of the selected statement without first generating the implementations for each operator and operand of the selected statement.
2 Assignments
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 system generates an abstract syntax tree (AST) representation of the program. The AST has nodes representing the computational constructs of the program. For each user-defined, domain-specific computational construct, the system determines whether a user-defined, domain-specific transform has been defined for the computational construct. The transform transforms a portion of the AST relating to the user-defined, domain-specific computational construct into one or more programming-language-defined computational constructs. When a domain-specific transform has been defined for the computational construct, the system transforms the AST in accordance with the domain-specific transform. The transformed AST is in a form that reflects an optimization of the programming-language-defined computational constructs based on the user-defined, domain-specific computational construct.
122 Citations
53 Claims
-
1. A method in a computer system for optimizing a high-level computer program using high-level computational constructs 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 composites of low-level computational constructs and including high-level operators for indicating operations on the high-level operands, the method comprising:
-
selecting a statement of the high-level computer program, the selected statement having a high-level operator and high-level operands, each high-level operand having implementing low-level computational constructs that implement access to the high-level operand;
identifying an optimization of the implementing low-level computational constructs that would result in an optimized translation of the selected statement into the low-level computational constructs;
when an optimization has been identified, indicating that the identified optimization can be applied to the selected statement of the high-level computer program; and
when translating the selected statement of the high-level computer program to the low-level computer program, applying the indicated optimization generate combined low-level implementations customized to the high-level operators and operands of the selected statement without first generating the implementations for each operator and operand of the selected statement. - View Dependent Claims (2, 3, 4, 5, 6, 7)
-
-
8. A method in a computer system for optimizing a high-level computer program using high-level computational constructs 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 composites of low-level computational constructs and including high-level operators for indicating operations on the high-level operands, the method comprising:
-
selecting a statement of the high-level computer program, the selected statement having a high-level operator and high-level operands, the high-level operand having implementing low-level computational constructs that implement the high-level operand;
converting the selected statement into an intermediate-level statement having operator and operands, the intermediate-level statement including an indication of an optimization that is identified from the high-level computational constructs of the selected statement; and
translating the intermediate-level statement into a low-level computational constructs, wherein the translation uses the indicated optimization to optimize the low-level computational constructs. - View Dependent Claims (9)
-
-
10. A method in a computer system for identifying optimizations to be used when translating a high-level computer program using high-level computational constructs into a low-level computer program using low-level computational constructs, the method comprising:
-
providing a plurality of optimization techniques, the optimization techniques indicating the optimizations that may be applicable when translating high-level computational constructs into low-level computational constructs;
analyzing the high-level computational constructs of a representation of the high-level computer program to determine optimization techniques that may be applied to the translation of the high-level computer program;
storing an indication of each determined optimization technique in such a way that does not change the representation of the high-level computer program; and
translating the high-level computer program into the low-level computer program using the stored indications of the determined optimization technique to guide the translation. - View Dependent Claims (11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21)
-
-
22. A method in a computer system for identifying optimizations that can be applied when generating a low-level implementation of the computer program from a high-level implementation of a computer program, the method comprising:
-
providing a plurality of transforms for annotating high-level computational constructs of the high-level implementation of the computer program with optimization tags that indicate optimizations that may be applicable when generating the low-level implementation of the computer program; and
for each high-level computational construct of the high-level implementation of the computer program, applying those transforms that are applicable to the high-level computational construct to annotate the high-level computational construct with various optimization tags so that the low-level implementation can be generated in accordance with the optimization tags. - View Dependent Claims (23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38)
-
-
39. A computer system for optimizing a computer program when transforming a high-level representation of the computer program into a low-level representation of the computer program in accordance with an analysis of the high-level representation, comprising:
-
a inline function component for determining whether any invocations of functions in the high-level representation should be transformed into inline execution of the functions;
an eliminate barriers component for determining whether any computational constructs of the high-level representation can be transformed to permit identifying certain optimizations;
an add optimization tag component for adding optimization tags to the high-level representation that indicate optimization that may be applied when generating the code; and
a code generation component for generating a low-level representation that is optimized in accordance with the added optimization tags. - View Dependent Claims (40, 41, 42, 43)
-
-
44. Computer-readable medium containing instructions for causing a computer system to optimize a high-level computer program using high-level computational constructs 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 composites of low-level computational constructs and including high-level operators for indicating operations on the high-level operands, by:
-
selecting a statement of the high-level computer program, the selected statement having a high-level operator and high-level operands, each high-level operand having implementing low-level computational constructs that implement the behavior of the high-level operand;
identifying an optimization of the implementing low-level computational constructs that would result in an optimized translation of the selected statement into the low-level computational constructs;
when an optimization has been identified, indicating that the identified optimization can be applied to the selected statement of the high-level computer program; and
when translating the selected statement of the high-level computer program to the low-level computer program, applying the indicated optimization to the low-level computational constructs implementing the behavior of the selected statement wherein the optimizations are identified from the high-level computer program rather than on the low-level computer program. - View Dependent Claims (45, 46, 47, 48, 49, 50, 51, 52, 53)
-
Specification