Claims
- 1. A method, performed by a compiler, of reducing the execution time of a program including a number of blocks in control flow order, said method comprising the acts of:
assigning a hardness parameter to each block indicating the amount of resources required to execute the block; comparing each assigned hardness parameter to an external boundary parameter to identify target blocks that require excessive resources to execute; for each target block, comparing the hardness parameter of target block to the hardness parameter a target blocks predecessor; and if the hardness parameter of the target block is greater than the hardness parameter of the predecessor block, migrating critical operations out of the target block to be executed in parallel inside the predecessor block.
- 2. A method, performed by a compiler, of reducing the execution time of a program including a number of blocks in control flow order, said method comprising the acts of:
assigning a hardness parameter to each block indicating the amount of resources required to execute the block; comparing each assigned hardness parameter to an external boundary parameter to identify target blocks that require excessive resources to execute; for each target block with a plurality of predecessor blocks, comparing the hardness parameter of target block to the hardness parameter of each of the target block's predecessors; and if the hardness parameter of the target block is greater than the hardness parameter of each of the predecessor blocks, migrating critical operations out of the target block to be executed in parallel inside each predecessor block.
- 3. The method of claim 2 where said act of comparing comprises:
migrating operations from the target block if (C(B)>>C(Bpred)) is true, where C(B) is the execution counter of the target block, C(Bpred) is the execution counter of the predecessor block.
- 4. The method of claim 1 where said act of assigning a hardness parameter comprises the acts of:
setting the hardness parameter equal to a combination of an execution counter parameter of the block and number of operations parameter.
- 5. The method of claim 4 where said act of comparing comprises:
migrating operations from the target block if(C(B)≧C(Bpred) and (W(B)−W(Bpred) >Wdiff0)) is true, where C(B) is the execution counter of the target block, C(Bpred) is the execution counter of the predecessor block, W(B) is the number of operations parameter of the target block, W(Bpred) is the number of operations parameter of the predecessor block, and Wdiff0 is an external boundary parameter.
- 6. A method for unloading operations from a scheduled block of operations with the block having a scheduled time of execution longer than optimal, with the block preceded by other control flow predecessor operations, said method comprising the acts of:
identifying as critical operations those operation in the scheduled block with the longest execution time; iteratively migrating critical operations from said critical block to a control flow predecessor block of scheduled operations; and replacing migrated critical operations with non-critical operations to reduce scheduled execution time of the block.
- 7. The method of claim 6 where said critical operation is a load operation and where said method further comprising the acts of:
migrating said load operation followed by a write register operation to a control flow predecessor block, with the write register operation writing the result of said load to a specified register; and replacing the load operation in the scheduled block with a read register operation which reads the result from the specified register.
- 8. The method of claim 6 where said critical operation is a load operation followed by a specific operation with multiple successor operations scheduled in said block, with the specific operation operating on the result of the load operation, said method further comprising the steps of:
migrating said load operation, said specific operation, and a write register operation, following said specific operation, to each control flow predecessor block, with the write register operation writing the result of said specific operation to a specified register; and replacing the specific operation in the scheduled block with a read register operation which reads the result from the specified register.
- 9. A computer program product comprising:
a computer readable medium having program code for implementing compiler operations to balance Extended Scalar Blocks (ESBs) in a control flow, said program code comprising:
program code for causing a computer to identify critical operations in a source ESB; program code for causing a computer to recursively pass an argument tree for each identified critical block and copy and insert each operation in the argument tree into each control flow predecessor of the source ESB and to get a virtual register needed for inserted operations; program code for causing a computer to for insert write operations after each copied critical operation in the control flow predecessor for setting the result operand in a virtual register; program code for causing a computer to critical operations and operations in the argument tree with a read operation that reads the result of critical operations migrated to the control flow predecessor from the virtual registers so that the height of the source ESB is reduced.
- 10. The computer program product of claim 10 with said computer code further comprising:
program code for causing a computer to test whether the difference between the height of the source ESB after migration of critical operations and the height before critical operations is greater than a selected height and; program code for causing a computer to end the optimization if yes and for continuing the optimization if no.
CROSS REFERENCES TO RELATED APPLICATIONS
[0001] This application is a continuation of and claims the benefit of U.S. application Ser. No. 09/506,408, filed Feb. 17, 2000, which is a continuation of U.S. application Ser. Nos. 60/120,353, 60/120,357, 60/120,375, 60/120,448, 60/120,527 and 60/120,649, all filed Feb. 17, 1999, the disclosures of which are each incorporated herein by reference.
Provisional Applications (6)
|
Number |
Date |
Country |
|
60120353 |
Feb 1999 |
US |
|
60120357 |
Feb 1999 |
US |
|
60120375 |
Feb 1999 |
US |
|
60120448 |
Feb 1999 |
US |
|
60120527 |
Feb 1999 |
US |
|
60120649 |
Feb 1999 |
US |
Continuations (1)
|
Number |
Date |
Country |
Parent |
09506408 |
Feb 2000 |
US |
Child |
09771481 |
Jan 2001 |
US |