← Back to Patent Explorer
US6314562B1 Expired / Lapsed US ⏱️ 0.0 years remaining

Method and system for anticipatory optimization of computer programs

Assignee: Microsoft Technology Licensing LLC
•
Filing: 1997-09-12
•
Granted: 2001-11-06
•
Expires: 2017-09-12
📄 Original PDF 🌐 Google Patents 🔄 Sync Now

Abstract

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.

Inventors

  • 👤 Ted J. Biggerstaff

Bibliographic Details

Application Number —
Jurisdiction US
Data Source google_patents
Last Synchronized 2026-11-03 20:48
CPC Classifications
G; G06; G06F; G06F9/00; G06F9/06; G06F9/44; G06F9/451

Claims Analysis

Total Claims: 59
Claim 1
Independent Claim 188 words
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.
Claim 2
Independent Claim 188 words
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.
Claim 3
Dependent Claim 33 words
The method of claim 1 wherein the identifying of an optimization selects one of a plurality of optimizations that can be applied when translating a high-level computer program into a low-level computer program.
Claim 4
Dependent Claim 20 words
The method of claim 2 wherein the additional optimizations can be defined by a developer of the high-level computer program.
Claim 5
Dependent Claim 22 words
The method of claim 1 wherein the high-level computer program and the low-level computer program are represented by an abstract syntax tree.
Claim 6
Dependent Claim 17 words
The method of claim 1 wherein the identifying and indicating are performed by high-level computational construct transforms.
Claim 7
Dependent Claim 13 words
The method of claim 1 including generating code for the low-level computer program.
Claim 8
Dependent Claim 15 words
The method of claim 1 , wherein the high-level computational constructs are represented by matrices.
Claim 9
Independent Claim 145 words
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.
Claim 10
Independent Claim 145 words
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.
Claim 11
Dependent Claim 15 words
The method of claim 8 , wherein the high-level computational constructs are represented by matrices.
Claim 12
Independent Claim 135 words
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.
Claim 13
Independent Claim 135 words
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.
Claim 14
Dependent Claim 20 words
The method of claim 10 wherein the analyzing, storing, and translating are performed by transforms that implement the optimization techniques.
Claim 15
Dependent Claim 22 words
The method of claim 11 including defining a new high-level computational construct and providing a transform for that new high-level computational construct.
Claim 16
Dependent Claim 28 words
The method of claim 10 including defining a new high-level computational construct and providing a plurality of transforms that define all transformations of the new high-level computational construct.
Claim 17
Dependent Claim 18 words
The method of claim 13 wherein the transforms define all optimization behaviors of the new high-level computational construct.
Claim 18
Dependent Claim 17 words
The method of claim 13 wherein the transforms define multiple implementations of the new high-level computational construct.
Claim 19
Dependent Claim 26 words
The method of claim 13 wherein the transforms define various optimizations to apply to the new high-level computational construct in combination with other high-level computational constructs.
Claim 20
Dependent Claim 20 words
The method of claim 13 wherein the transforms define modifications to optimization tags to express interdependencies among the optimization tags.
Claim 21
Dependent Claim 19 words
The method of claim 13 wherein modifiers within optimization tags are invoked based on occurrences of named optimization events.
Claim 22
Dependent Claim 17 words
The method of claim 10 wherein the high-level computer program is represented in a tree data structure.
Claim 23
Dependent Claim 15 words
The method of claim 10 , wherein the high-level computational constructs are represented by matrices.
Claim 24
Dependent Claim 15 words
The method of claim 20 , wherein the high-level computational constructs are represented by matrices.
Claim 25
Independent Claim 119 words
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.
Claim 26
Independent Claim 119 words
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.
Claim 27
Dependent Claim 19 words
The method of claim 22 wherein the optimization tags express an implementation of the optimization in an abstract form.
Claim 28
Dependent Claim 22 words
The method of claim 23 whereby the abstract form indicates one of a plurality of low-level implementations of the high-level computational construct.
Claim 29
Dependent Claim 15 words
The method of claim 23 whereby further optimizations can be identified from the optimization tags.
Claim 30
Dependent Claim 17 words
The method of claim 22 wherein the optimization tags include modifiers that specify variations in the optimizations.
Claim 31
Dependent Claim 17 words
The method of claim 26 wherein one modifier takes precedence over a variation specified by another modifier.
Claim 32
Dependent Claim 18 words
The method of claim 26 wherein one modifier indicates that an expression should be moved outside a loop.
Claim 33
Dependent Claim 15 words
The method of claim 26 wherein one modifier indicates that an expression is a constant.
Claim 34
Dependent Claim 19 words
The method of claim 22 wherein modifiers within optimization tags are invoked based on occurrences of named optimization events.
Claim 35
Dependent Claim 21 words
The method of claim 22 wherein a transform expresses high-level structure of an implementation of optimizations indicated by the optimization tags.
Claim 36
Dependent Claim 18 words
The method of claim 22 wherein a transform expresses low-level structure of optimizations indicated by the optimization tags.
Claim 37
Dependent Claim 25 words
The method of claim 22 wherein the transforms are provided so that new transforms can be provided without modification to the applying of the transforms.
Claim 38
Dependent Claim 31 words
The method of claim 22 wherein the annotations are stored separately from the high-level implementation of the computer program so that the annotations can be manipulated separately from the computer program.
Claim 39
Dependent Claim 27 words
The method of claim 22 including generating a low-level implementation of the computer program in accordance with the indicated optimizations that are expressed at an implementation-independent level.
Claim 40
Dependent Claim 25 words
The method of claim 22 wherein a transform indicates that a low-level implementation of a computational construct can be moved outside of an iteration statement.
Claim 41
Dependent Claim 17 words
The method of claim 22 wherein a transform indicates that an iteration control statement should be unwrapped.
Claim 42
Dependent Claim 27 words
The method of claim 22 wherein an optimization tag indicates an optimization of the low-level implementation and thereby avoiding analysis of a low-level implementation to identify optimizations.
Claim 43
Dependent Claim 125 words
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.
Claim 44
Dependent Claim 125 words
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.
Claim 45
Dependent Claim 35 words
The computer system of claim 39 wherein the high-level representation is a tree data structure and each component visits nodes of the tree in one or more depth-first, left-to-right traversals of the tree data structure.
Claim 46
Dependent Claim 21 words
The computer system of claim 39 wherein each component invokes transform modules that are defined to be used by that component.
Claim 47
Dependent Claim 35 words
The computer system of claim 39 wherein the add optimization tag component identifies optimization tags that have already been added to the high-level representation that can be migrated to a higher level in the representation.
Claim 48
Dependent Claim 18 words
The computer system of claim 42 wherein the identified optimization tags are coalesced into a single optimization tag.
Claim 49
Dependent Claim 190 words
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.
Claim 50
Dependent Claim 190 words
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.
Claim 51
Dependent Claim 34 words
The computer-readable medium of claim 44 wherein the identifying of an optimization selects one of a plurality of optimizations that can be applied when translating a high-level computer program into a low-level computer program.
Claim 52
Dependent Claim 21 words
The computer-readable medium of claim 45 wherein the additional optimizations can be defined by a developer of the high-level computer program.
Claim 53
Dependent Claim 23 words
The computer-readable medium of claim 44 wherein the high-level computer program and the low-level computer program are represented by an abstract syntax tree.
Claim 54
Dependent Claim 18 words
The computer-readable medium of claim 44 wherein the identifying and indicating are performed by high-level computational construct transforms.
Claim 55
Dependent Claim 14 words
The computer-readable medium of claim 44 including generating code from the low-level computer program.
Claim 56
Dependent Claim 19 words
The computer-readable medium of claim 44 wherein a modifier of an optimization further indicates a variation in the optimization.
Claim 57
Dependent Claim 20 words
The computer-readable medium of claim 44 including mediating various modifiers of an optimization to resolve any inconsistencies among the modifiers.
Claim 58
Dependent Claim 20 words
The computer-readable medium of claim 44 including generating the low-level computer program with optimization without analyzing the low-level computational construct.
Claim 59
Dependent Claim 16 words
The computer-readable medium of claim 44 , wherein the high-level computational constructs are represented by matrices.

USPTO Annuity & Maintenance Windows

Annuity Stage Window Opens Payment Deadline Surcharge Period Until Estimated Fee Status
3.5 Years (Year 4) 2004-11-05 2005-05-07 2005-11-06 $2000.00 Window Closed / Lapsed
7.5 Years (Year 8) 2008-11-05 2009-05-07 2009-11-06 $3760.00 Window Closed / Lapsed
11.5 Years (Year 12) 2012-11-05 2013-05-07 2013-11-06 $7700.00 Window Closed / Lapsed

Assigned Categories & Tags

No categories assigned to this patent yet.

Assign Category Tag