Method and system for incrementally improving a program layout
First Claim
1. A method in a computer system for incrementally improving the layout of a program image of a computer program to reduce the working set, the program image having basic blocks, each basic block having a temporal usage vector indicating time intervals during which the basic block is accessed, the method comprising:
- repeating the following until a termination condition is satisfied, designating one of the basic blocks as an initial anchor basic block;
repeating the following until the same range of basic blocks is identified twice in a row, finding a basic block such that when the basic blocks in the range from the anchor basic block to the found basic block are reordered, the working set is reduced, wherein the act of finding includes finding the basic block with a desired metric value that is calculated from a permutation type and further wherein the anchor basic block and at least two found basic blocks in the repetition delimit ranges having different sizes selected from a group consisting of reflect and swap; and
designating the found basic block as the new anchor basic block; and
reordering the basic blocks in the range of basic blocks that has been identified twice in a row.
3 Assignments
0 Petitions
Accused Products
Abstract
A method and system for incrementally improving the layout of a program image of a computer program to reduce the working set. The system iteratively selects pairs of basic blocks and reorders the basic blocks in the range delimited by the selected pair of basic blocks. The system selects the pairs of basic blocks so that the working set of the computer program is improved by reordering the basic block in the range. Thus, during each iteration, the working set is improved. The system continues with these iterations until a termination condition (e.g., number of iterations) is satisfied. In one embodiment, during each iteration the system designates one of the basic blocks as an initial anchor basic block. The system then repeats the following until the same range of basic blocks is identified twice in a row. The system first finds a basic block such that when the basic blocks in the range from the anchor basic block to the found basic block are reordered, the working set is more favorable than reordering any other range that ends with the anchor basic block. The system then designates the found basic block as the new anchor basic block. When the same range is found twice in a row, the system reorders the basic blocks in the range. This process is repeated for each iteration until a termination condition is satisfied. The resulting reordered program image has its working set improved.
-
Citations
56 Claims
-
1. A method in a computer system for incrementally improving the layout of a program image of a computer program to reduce the working set, the program image having basic blocks, each basic block having a temporal usage vector indicating time intervals during which the basic block is accessed, the method comprising:
-
repeating the following until a termination condition is satisfied, designating one of the basic blocks as an initial anchor basic block;
repeating the following until the same range of basic blocks is identified twice in a row, finding a basic block such that when the basic blocks in the range from the anchor basic block to the found basic block are reordered, the working set is reduced, wherein the act of finding includes finding the basic block with a desired metric value that is calculated from a permutation type and further wherein the anchor basic block and at least two found basic blocks in the repetition delimit ranges having different sizes selected from a group consisting of reflect and swap; and
designating the found basic block as the new anchor basic block; and
reordering the basic blocks in the range of basic blocks that has been identified twice in a row. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 53)
-
-
24. A method in a computer system for identifying basic blocks of a program image of a computer program that, when reordered from an initial order, will reduce the working set of the computer program, the method comprising:
-
selecting an anchor basic block;
evaluating the effect on the working set of reordering the basic blocks in a plurality of ranges of basic blocks that are delimited at one end by the selected anchor basic block, wherein at least two ranges in the plurality of ranges are of different sizes;
selecting the range of basic blocks whose reordering would have an effect on the working set that is estimated to be more favorable than the other ranges;
selecting as the next anchor basic block the basic block at the other end of the range from the anchor basic block; and
repeating the evaluating and selecting until the same range is selected twice in a row whereby the range that is selected twice in a row is the identified range.
-
-
25. A method in a computer system for improving the organization of ordered data, the method comprising:
-
selecting an anchor position within the data;
for each of a plurality of end positions within the data, rating a reorganization of the data between the anchor position and the end position, wherein the act of rating includes rating with a desired metric value that is calculated from a permutation type and further wherein the anchor position and at least two end positions in the plurality of end positions delimit subranges of data having different sizes selected from a group consisting of reflect and swap;
selecting as a new anchor position the end position of the data whose reorganization has the highest rating;
repeating the rating and selecting of a new anchor position until the selected end position is the same as the previous anchor position; and
permuting the data between the anchor position and the end position, thus reordering the data. - View Dependent Claims (26, 27, 28, 29, 30, 31, 32, 33, 34, 54)
-
-
35. A computer-readable medium containing instructions for causing a computer system to identify basic blocks of a program image of a computer program that, when reordered from an initial order, will reduce the working set of the computer program, by:
-
selecting an anchor basic block;
evaluating the effect on the working set of reordering the basic blocks in a plurality of ranges of basic blocks that are delimited at one end by the selected anchor basic block, wherein at least two ranges in the plurality of ranges are of different sizes;
selecting the range of basic blocks whose reordering would have an effect on the working set that is estimated to be more favorable than the other ranges;
selecting as the next anchor basic block the basic block at the other end of the range from the anchor basic block; and
repeating the evaluating and selecting until the same range is selected twice in a row whereby the range that is selected twice in a row in the identified range.
-
-
36. A computer system for improving the working set of a computer program, the computer program having code portions arranged in a first order, comprising:
-
a selection component that selects two code portions such that if the code portions delimited by the two code portions in the first order are permuted by a predefined permutation algorithm then the working set of the computer program is improved; and
a permutation component that permutes the code portions delimited by the two selected code portions in accordance with the predefined permutation algorithm to arrange the code portions of the computer program in a second order distinct from the first order.
-
-
37. A computer-readable medium containing instructions for causing a computer system to improve the organization of ordered data objects, by:
-
selecting an anchor data object;
for each of a plurality of end data objects, rating a reorganization of the data objects between the anchor data object and the end data object, wherein the act of rating includes rating with a desired metric value that is calculated from a permutation type and further wherein the anchor data object and at least two end data objects in the plurality of end data objects delimit subranges of data objects having different sizes selected from a group consisting of reflect and swap;
selecting as a new anchor data object the end data object whose reorganization has the highest rating;
repeating the rating and selecting of a new anchor data object until the selected end data object is the same as the previous anchor data object; and
permuting the data between the anchor position and the end position, thus reordering the data. - View Dependent Claims (38, 39, 40, 41, 42, 43, 44, 45, 55)
-
-
46. A computer-readable medium containing instructions for causing a computer system to incrementally improve the layout of a program image of a computer program to reduce the working set, the program image having basic blocks, each basic block having a temporal usage vector indicating time intervals during which the basic block is accessed, by:
-
repeating the following until a termination condition is satisfied, designating one of the basic blocks as an initial anchor basic block;
repeating the following until the same range of basic blocks is identified twice in a row, finding a basic block such that when the basic blocks in the range from the anchor basic block to the found basic block are reordered, the working set is reduced, wherein the act of finding includes finding the basic block with a desired metric value that is calculated from a permutation type and further wherein the anchor basic block and at least two found basic blocks in the repetition delimit ranges having different sizes selected from a group consisting of reflect and swap; and
designating the found basic block as the new anchor basic block; and
reordering the basic blocks in the range of basic blocks that has been identified twice in a row. - View Dependent Claims (47, 48, 49, 50, 51, 52, 56)
-
Specification