Loop allocation for optimizing compilers
First Claim
1. A computer program product for compilation of a source code segment, said computer program product comprising:
- instruction means to generate a program dependence graph for the source code segment, the program dependence graph comprising a control dependence graph and a data dependence graph, each of the control dependence graph and the data dependence graph comprising nodes, each node in the data dependence graph being associated with one or more statements in the source code segment, instruction means to generate an interference graph from the data dependence graph, comprising instruction means for deriving nodes for the interference graph from the nodes in the data dependence graph, the nodes in the interference graph thereby each being associated with one or more statements in the source code segment, instruction means for generating a node weight for each node in the interference graph, each node having a node weight reflecting the resources used by the one or more statements associated with the node, instruction means for generating edges for the interference graph, each edge connecting a pair of nodes in the interference graph, instruction means for generating an associated edge weight for each edge reflecting the desirability of maintaining the one or more statements associated with each node of the pair of nodes connected by the edge within the same loop, instruction means for partitioning the interference graph into subgraphs based on the edge weights and the node weights of the interference graph, and instruction means for emitting code conforming to the partitioned interference graph.
1 Assignment
0 Petitions
Accused Products
Abstract
Loop allocation for optimizing compilers includes the generation of a program dependence graph for a source code segment. Control dependence graph representations of the nested loops, from innermost to outermost, are generated and data dependence graph representations are generated for each level of nested loop as constrained by the control dependence graph. An interference graph is generated with the nodes of the data dependence graph. Weights are generated for the edges of the interference graph reflecting the affinity between statements represented by the nodes joined by the edges. Nodes in the interference graph are given weights reflecting resource usage by the statements associated with the nodes. The interference graph is partitioned using a profitability test based on the weights of edges and nodes and on a correctness test based on the reachability of nodes in the data dependence graph. Code is emitted based on the partitioned interference graph.
139 Citations
33 Claims
-
1. A computer program product for compilation of a source code segment, said computer program product comprising:
-
instruction means to generate a program dependence graph for the source code segment, the program dependence graph comprising a control dependence graph and a data dependence graph, each of the control dependence graph and the data dependence graph comprising nodes, each node in the data dependence graph being associated with one or more statements in the source code segment, instruction means to generate an interference graph from the data dependence graph, comprising instruction means for deriving nodes for the interference graph from the nodes in the data dependence graph, the nodes in the interference graph thereby each being associated with one or more statements in the source code segment, instruction means for generating a node weight for each node in the interference graph, each node having a node weight reflecting the resources used by the one or more statements associated with the node, instruction means for generating edges for the interference graph, each edge connecting a pair of nodes in the interference graph, instruction means for generating an associated edge weight for each edge reflecting the desirability of maintaining the one or more statements associated with each node of the pair of nodes connected by the edge within the same loop, instruction means for partitioning the interference graph into subgraphs based on the edge weights and the node weights of the interference graph, and instruction means for emitting code conforming to the partitioned interference graph. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9, 10, 11)
-
- 12. A loop allocation optimizing compiler comprising, means for generating a program dependence graph for a source code segment, the program dependence graph comprising a control dependence graph and a data dependence graph, each of the control dependence graph and the data dependence graph comprising nodes, each node in the data dependence graph being associated with one or more statements in the source code segment, means for generating an interference graph from the data dependence graph, comprising means for deriving nodes for the interference graph from the nodes in the data dependence graph, the nodes in the interference graph thereby each being associated with one or more statements in the source code segment, means for generating a node weight for each node in the interference graph, each node having a node weight reflecting the resources used by the one or more statements associated with the node, means for generating edges for the interference graph, each edge connecting a pair of nodes in the interference graph, means for generating an associated edge weight for each edge reflecting the desirability of maintaining the one or more statements associated with each node of the pair of nodes connected by the edge within the same loop, means for partitioning the interference graph into subgraphs based on the edge weights and the node weights of the interference graph, comprising means for first conducting a profitability test to select a pair of nodes in the interference graph, means for then conducting a correctness test on the selected pair, and means for merging the selected pair of nodes into a coalesced node where the correctness test is satisfied for the selected pair, and means for emitting code conforming to the partitioned interference graph.
-
17. A method for compiling a source code segment, the method comprising the following steps:
- generating a program dependence graph for the source code segment, the program dependence graph comprising a control dependence graph and a data dependence graph, each of the control dependence graph and the data dependence graph comprising nodes, each node in the data dependence graph being associated with one or more statements in the source code segment, causing a computer to generate an interference graph from the data dependence graph, by deriving nodes for the interference graph from the nodes in the data dependence graph, the nodes in the interference graph thereby each being associated with one or more statements in the source code segment and generating a node weight for each node in the interference graph, each node having a node weight reflecting the resources used by the one or more statements associated with the node, generating edges for the interference graph, each edge connecting a pair of nodes in the interference graph, generating an associated edge weight for each edge reflecting the desirability of maintaining the one or more statements associated with each node of the pair of nodes connected by the edge within the same loop, partitioning the interference graph into subgraphs based on the edge weights and the node weights of the interference graph, and emitting code conforming to the partitioned interference graph.
- View Dependent Claims (18, 19, 20, 21, 22, 23, 24, 25, 26, 27)
-
28. A system for compilation of a source code segment, comprising:
- means to generate a program dependence graph for the source code segment, the program dependence graph comprising a control dependence graph and a data dependence graph, each of the control dependence graph and the data dependence graph comprising nodes, each node in the data dependence graph being associated with one or more statements in the source code segment, means to generate an interference graph from the data dependence graph, comprising means for deriving nodes for the interference graph from the nodes in the data dependence graph, the nodes in the interference graph thereby each being associated with one or more statements in the source code segment, means for generating a node weight for each node in the interference graph, each node having a node weight reflecting the resources used by the one or more statements associated with the node, means for generating edges for the interference graph, each edge connecting a pair of nodes in the interference graph, means for generating an associated edge weight for each edge reflecting the desirability of maintaining the one or more statements associated with each node of the pair of nodes connected by the edge within the same loop means for partitioning the interference graph into subgraphs based on the edge weights and the node weights of the interference graph, and means for emitting code conforming to the partitioned interference graph.
- View Dependent Claims (29, 30, 31, 32, 33)
Specification