Method and system for calculating instruction lookahead
First Claim
1. A method in a computer for calculating an instruction lookahead value for a start instruction, the method comprising:
- for paths of execution that start at the start instruction, calculating a path lookahead value for the path of execution as a number of instructions along that path starting at the start instruction that do not depend on the start instruction; and
setting the instruction lookahead value to a minimum of the calculated path lookahead value.
4 Assignments
0 Petitions
Accused Products
Abstract
A computer-based method and system for determining designations for conditional branch operations and settings for lookahead values for a portion of a computer program. The lookahead system of the present invention evaluates various combinations of designations for the conditional branch operations for the portion of the computer program. The lookahead system generates a metric to measure the amount of parallel processing that would result from each combination of designations assuming that the lookahead values are set to optimal values for that combination. This metric may take into consideration estimated or actual execution frequencies of the instructions. The lookahead system then designates the conditional branch operations and sets the lookahead values based on the metric generated for one of the combinations.
57 Citations
71 Claims
-
1. A method in a computer for calculating an instruction lookahead value for a start instruction, the method comprising:
-
for paths of execution that start at the start instruction, calculating a path lookahead value for the path of execution as a number of instructions along that path starting at the start instruction that do not depend on the start instruction; and
setting the instruction lookahead value to a minimum of the calculated path lookahead value. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20)
for a path of execution that starts at the start instruction and includes a branch instruction with a conditional branch operation, calculating a number of instructions along that path of execution that do not depend on the start instruction; and
designating the conditional branch operation as often or seldom based on the calculated number.
-
-
6. The method of claim 5 including calculating a number for a plurality of paths of execution and wherein the designating is based on the plurality of the calculated numbers.
-
7. The method of claim 6 wherein the designating weights the calculated number by a probability associated with the path of execution.
-
8. The method of claim 5 including setting a lookahead value for the start instruction based on the designation of the conditional branch operation.
-
9. The method of claim 5 wherein the calculating starts at the branch instruction.
-
10. The method of claim 1 including:
-
for each of a plurality of combinations of designations for the conditional branch operations for a portion of a computer program, generating a metric to measure an amount of parallel processing that would result from the combination of designations; and
designating the conditional branch operations based on the metric generated for one of the combinations.
-
-
11. The method of claim 10 wherein a designation is a branch often designation.
-
12. The method of claim 10 wherein a designation is a branch seldom designation.
-
13. The method of claim 10 wherein the generating of the metric includes calculating lookahead values for instructions of the portion based on the combination.
-
14. The method of claim 10 wherein the computer program is to execute in a multithreaded processor.
-
15. The method of claim 10 wherein the designating of the conditional branch operations includes selecting the combination that the metric indicates will result in the highest amount of parallel processing.
-
16. The method of claim 10 wherein a conditional branch operation is left undesignated.
-
17. The method of claim 1 including designating a conditional branch operation as seldom or often or leaving a conditional branch operation undesignated based on the number of instructions on a path of execution starting with the start instruction.
-
18. The method of claim 17 wherein a conditional branch operation is designated as often even though the branch is taken seldom.
-
19. The method of claim 17 wherein a conditional branch operation is designated as seldom even though the branch is taken often.
-
20. The method of claim 17 wherein a conditional branch operation undesignated when each path of execution starting from the conditional branch has the same number of non-dependent instructions.
-
21. A method in a computer for designating a conditional branch operation of a branch instruction, the method comprising:
-
for a path of execution that starts at a start instruction and includes the branch instruction that includes the conditional branch operation, calculating a number of instructions along that path of execution that do not depend on the start instruction; and
designating the conditional branch operation as often or seldom based on the calculated number. - View Dependent Claims (22, 23, 24, 25)
-
-
26. A method in a computer system for determining designations for conditional branch operations for a portion of a computer program, the method comprising:
-
for each of a plurality of combinations of designations for the conditional branch operations for the portion, generating a metric to measure amount of parallel processing that would result from the combination of designations; and
designating the conditional branch operations based on the metric generated for one of the combinations. - View Dependent Claims (27, 28, 29, 30, 31)
-
-
32. A computer-readable medium containing instructions for controlling a computer to calculate an instruction lookahead value for a start instruction, by a method comprising:
-
for paths of execution that start at the start instruction, calculating a path lookahead value for the path of execution as a number of instructions along that path starting at the start instruction that do not depend on the start instruction; and
setting the instruction lookahead value based on the calculated path lookahead values. - View Dependent Claims (33, 34, 35)
-
-
36. A computer-readable medium containing instructions controlling a computer system to designate a conditional branch operation of a branch instruction, by a method comprising:
-
for a path of execution that starts at a start instruction and includes a branch instruction with a conditional branch operation, calculating a number of instructions along that path of execution that do not depend on the start instruction; and
designating the conditional branch operation as often or seldom based on the calculated number. - View Dependent Claims (37, 38, 39, 40, 41)
-
-
42. A computer-readable medium containing instructions for controlling a computer system to determine a designation for conditional branch operations for a portion of a computer program, by a method comprising:
-
for each of a plurality of combinations of designations for the conditional branch operations for the portion of the computer program, generating a metric to measure an amount of parallel processing that would result from the combination of designations; and
designating the conditional branch operations based on the metric generated for one of the combinations. - View Dependent Claims (43, 44, 45, 46, 47, 48, 49, 50, 51)
-
-
52. A computer system for calculating an instruction lookahead value for a start instruction, the system comprising:
-
means for calculating a path lookahead value for paths of execution starting at the start instruction, the path lookahead value indicating a number of instructions along that path starting at the start instruction that do not depend on the start instruction; and
means setting the instruction lookahead value based on the calculated path lookahead value. - View Dependent Claims (53, 54, 55)
-
-
56. A computer system for designating a conditional branch operation of a branch instruction, comprising:
-
means for calculating a number of instructions along that path of execution that do not depend on a start instruction for each path of execution that starts at the start instruction and that includes the branch instruction;
means for, when a path of execution that starts at the start instruction includes a branch instruction with a conditional branch operation, designating the conditional branch operation as often or seldom based on the calculated number. - View Dependent Claims (57, 58, 59, 60)
-
-
61. A computer system for determining designations for conditional branch operations for a portion of a computer program, comprising:
-
means for generating a metric to measure an amount of parallel processing that would result from a combination of designations, for each of a plurality of combinations of designations for conditional branch operations for a portion of a computer program; and
means for designating the conditional branch operations based on the metric generated for one of the combinations. - View Dependent Claims (62, 63, 64, 65, 66, 67, 68, 69, 70, 71)
-
Specification