Method and system for target register allocation
First Claim
1. A method in a computer system for locating target definitions for branches of a program, the method comprising:
- for basic blocks of the program having a branch with a target, determining a live range of one or more basic blocks, the basic block with the branch being an ending basic block of the live range;
identifying a basic block that dominates two live ranges with ending basic blocks having a branch with the same target; and
locating a target definition for the branches of the ending basic blocks of the live ranges that are dominated by the identified basic block in the identified basic block.
4 Assignments
0 Petitions
Accused Products
Abstract
A computer-based method and system for allocating target registers to branch operations and for determining the location of target definitions for the branch operations within a computer program. The target register allocation system of the present invention allocates a target register to be specified by each branch operation. The target register is to contain the address of the target that is loaded by the target definition. The target register allocation system determines a location in the computer program for a target definition such that whenever the branch operation is executed, the allocated target register contains the address of the target of the branch. The target allocation system may determine the location to be in a dominator block of the branch operation. The target allocation system may also determine the location a target definition so that the address of the target that is loaded by the target definition can be used by multiple branch operations. The target allocation system may also determine the location of the target definition based on execution frequency of locations. The target allocation system may, when a branch operation is in a loop, determine the location of the target definition to be outside the loop. The target allocation system may, when the program is a function, give preference to a non-callee save register in allocating a target register. The target allocation system may give preference to a callee save register of a function whose invocation is located in between the determined location and the location of the branch operation on a path of execution when allocating a target register.
53 Citations
34 Claims
-
1. A method in a computer system for locating target definitions for branches of a program, the method comprising:
-
for basic blocks of the program having a branch with a target, determining a live range of one or more basic blocks, the basic block with the branch being an ending basic block of the live range;
identifying a basic block that dominates two live ranges with ending basic blocks having a branch with the same target; and
locating a target definition for the branches of the ending basic blocks of the live ranges that are dominated by the identified basic block in the identified basic block. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8)
-
-
9. A computer system for locating target definitions for branches of a program, comprising:
-
a component that, for basic blocks of the program having a branch with a target, determines a live range of one or more basic blocks, the basic block with the branch being an ending basic block of the live range;
a component that identifies a basic block that dominates live ranges with ending basic blocks having a branch with the same target; and
a component that coalesces the dominated live ranges so that a target definition for the branches of the ending basic blocks of the coalesced live ranges can be located in the identified dominating basic block. - View Dependent Claims (10, 11, 12, 13, 14, 15, 16, 17)
-
-
18. A computer-readable medium containing instructions for controlling a computer system to locate target definitions for branches of a program, by a method comprising:
-
identifying live ranges of one or more basic blocks, each live range having a branch in an ending basic block of the live range;
identifying a basic block that dominates two live ranges with ending basic blocks having a branch with the same target; and
locating a target definition for the branches of the ending basic blocks of the live ranges that are dominated by the identified basic block in the identified basic block. - View Dependent Claims (19, 20, 21, 22, 23, 24, 25)
-
-
26. A computer system for locating target definitions for branches of a program, comprising:
-
means for identifying a live range of one or more basic blocks, each live range having a branch;
means for identifying a basic block that dominates live ranges having a branch with the same target; and
means for coalescing the dominated live ranges so that a target definition for the branches of the coalesced live ranges can be located in the identified dominating basic block. - View Dependent Claims (27, 28, 29, 30, 31, 32, 33, 34)
-
Specification