← Back to Patent Explorer
US5202995A Expired / Lapsed US ⏱️ 0.0 years remaining

Method for removing invariant branches from instruction loops of a computer program

Assignee: International Business Machines Corp
•
Filing: 1992-09-03
•
Granted: 1993-04-13
•
Expires: 2012-09-03
📄 Original PDF 🌐 Google Patents 🔄 Sync Now

Abstract

Abstract Removal of invariant branches from nests of loops results in an optimized computer program with increased speed of execution. To accomplish this objective, each loop of a program is then examined, looking at inner loops before their containing outer loops, to locate conditional branch instructions which are loop invariant. Each conditional branch which is evaluated based upon loop invariant calculations is rewritten, outside the outermost loop for which this branch is invariant. The moved branch is modified to branch around the loop in which it was originally contained if its condition is evaluated false. A new copy of the loop is made in which the invariant branch is rewritten as an unconditional branch. In the original copy of the loop, the invariant branch is deleted, and a branch is inserted after the modified original loop to skip around the new copy when the original copy is executed. Finally, any sections of the program which will never be executed as a result of the above described transformation are deleted.

Inventors

  • 👤 John K. P. O'Brien

Bibliographic Details

Application Number —
Jurisdiction US
Data Source google_patents
Last Synchronized 2026-10-27 15:16
CPC Classifications
G; G06; G06F; G06F8/00; G06F8/40; G06F8/41; G06F8/44; G06F8/443

Claims Analysis

Total Claims: 12
Claim 1
Independent Claim 258 words
A computer implemented method of reducing the execution time of a computer program which includes at least one instruction loop having a first conditional branch instruction internal to the loop which has a condition part and a branch part including a target address, wherein the condition part is invariant with respect to the instruction loop, said computer implemented method comprising the steps of: a) identifying said first conditional branch instruction; b) copying said first conditional branch instruction to a location in the computer program immediately before the instruction loop to create a second copy of the conditional branch instruction; c) copying the instruction loop to create a copy of the instruction loop, including a third copy of the conditional branch instruction, and inserting the copy of the instruction loop in a location in the computer program after the instruction loop, wherein said location is identified by a starting address; d) modifying the branch part of the second copy of the conditional branch instruction to branch to the copy of the instruction loop; e) inserting an unconditional branch instruction, to branch around the copy of the instruction loop, at a location in the computer program before the copy of the instruction loop; and f) deleting the first conditional branch instruction; and g) changing the third conditional branch instruction to an unconditional branch instruction, wherein said unconditional branch instruction includes a further target address and said further target address is said target address modified relative to said starting address such that the execution time of the computer program is reduced.
Claim 2
Dependent Claim 258 words
A computer implemented method of reducing the execution time of a computer program which includes at least one instruction loop having a first conditional branch instruction internal to the loop which has a condition part and a branch part including a target address, wherein the condition part is invariant with respect to the instruction loop, said computer implemented method comprising the steps of: a) identifying said first conditional branch instruction; b) copying said first conditional branch instruction to a location in the computer program immediately before the instruction loop to create a second copy of the conditional branch instruction; c) copying the instruction loop to create a copy of the instruction loop, including a third copy of the conditional branch instruction, and inserting the copy of the instruction loop in a location in the computer program after the instruction loop, wherein said location is identified by a starting address; d) modifying the branch part of the second copy of the conditional branch instruction to branch to the copy of the instruction loop; e) inserting an unconditional branch instruction, to branch around the copy of the instruction loop, at a location in the computer program before the copy of the instruction loop; and f) deleting the first conditional branch instruction; and g) changing the third conditional branch instruction to an unconditional branch instruction, wherein said unconditional branch instruction includes a further target address and said further target address is said target address modified relative to said starting address such that the execution time of the computer program is reduced.
Claim 3
Dependent Claim 30 words
The method of claim 1, wherein the step a) is preceded by the step of removing computations, which are invariant with respect to the instruction loop, from the instruction loop.
Claim 4
Dependent Claim 56 words
The method of claim 1, wherein said instruction loop is nested within one or more outer loops and the step b) includes the step of copying the first conditional branch instruction to a location in the computer program immediately preceding an outmost loop for which the condition part of the first conditional branch instruction is invariant.
Claim 5
Dependent Claim 33 words
The method of claim 1, wherein steps a) through f) are repeated for each conditional branch in the instruction loop having a condition part which is invariant with respect to the instruction loop.
Claim 6
Dependent Claim 60 words
The method of claim 1, wherein a computer program consists of a plurality of instruction loops and step a) includes the steps of: a1) selecting one of said instruction loops for the identification of said first conditional branch instruction; and b1) evaluating a further instruction loop if said first conditional branch instruction is not identified in the selected instruction loop.
Claim 7
Dependent Claim 18 words
The method of claim 1, further comprising the step of: h) deleting unnecessary sections of the computer program.
Claim 8
Dependent Claim 42 words
The method of claim 1, wherein the step a) includes the step of: a1) representing the computer program as a flowgraph; and a2) evaluating the flowgraph to identify said first conditional branch instruction as being invariant with respect to the instruction loop.
Claim 9
Dependent Claim 42 words
The method of claim 7, wherein the step a1) further includes the steps of: a3) identifying region constants for the instruction loop; and a4) identifying said first conditional branch instruction as being controlled by at least one of the identified region constants.
Claim 10
Dependent Claim 31 words
The method of claim 7, wherein said first conditional branch instruction is identified only if it is represented by a flow graph as an articulation node of a strongly connected region.
Claim 11
Dependent Claim 266 words
A computer implemented method of reducing the execution time of a computer program which includes at least one instruction loop having a first conditional branch instruction which has a condition part and a branch part including a target address, wherein the condition part is invariant with respect to the instruction loop, said computer implemented method comprising the steps of: a) locating the instruction loop in the computer program b) identifying said first conditional branch instruction in the instruction loop; c) copying said first conditional branch instruction to a location in the computer program immediately before the instruction loop to create a second copy of the conditional branch instruction; d) copying the instruction loop to create a copy of the instruction loop, including a third copy of the conditional branch instruction, and inserting the copy of the instruction loop in a location in the computer program after the instruction loop, wherein said location is identified by a starting address; e) modifying the branch part of the second copy of the conditional branch instruction to branch to the copy of the instruction loop; f) inserting an unconditional branch instruction, to branch around the copy of the instruction loop, at a location in the computer program before the copy of the instruction loop; g) deleting the first conditional branch instruction; and h) changing the third conditional branch instruction to an unconditional branch instruction, wherein said unconditional branch instruction includes a further target address and said further target address is said target address modified relative to said starting address such that the execution time of the computer program is reduced.
Claim 12
Dependent Claim 266 words
A computer implemented method of reducing the execution time of a computer program which includes at least one instruction loop having a first conditional branch instruction which has a condition part and a branch part including a target address, wherein the condition part is invariant with respect to the instruction loop, said computer implemented method comprising the steps of: a) locating the instruction loop in the computer program b) identifying said first conditional branch instruction in the instruction loop; c) copying said first conditional branch instruction to a location in the computer program immediately before the instruction loop to create a second copy of the conditional branch instruction; d) copying the instruction loop to create a copy of the instruction loop, including a third copy of the conditional branch instruction, and inserting the copy of the instruction loop in a location in the computer program after the instruction loop, wherein said location is identified by a starting address; e) modifying the branch part of the second copy of the conditional branch instruction to branch to the copy of the instruction loop; f) inserting an unconditional branch instruction, to branch around the copy of the instruction loop, at a location in the computer program before the copy of the instruction loop; g) deleting the first conditional branch instruction; and h) changing the third conditional branch instruction to an unconditional branch instruction, wherein said unconditional branch instruction includes a further target address and said further target address is said target address modified relative to said starting address such that the execution time of the computer program is reduced.

References Cited (Backward Citations)

US4567574A Cited
US4656583A Cited
US4656582A Cited
US4773007A Cited
US4991088A Cited

USPTO Annuity & Maintenance Windows

Annuity Stage Window Opens Payment Deadline Surcharge Period Until Estimated Fee Status
3.5 Years (Year 4) 1996-04-12 1996-10-12 1997-04-13 $2000.00 Window Closed / Lapsed
7.5 Years (Year 8) 2000-04-12 2000-10-12 2001-04-13 $3760.00 Window Closed / Lapsed
11.5 Years (Year 12) 2004-04-12 2004-10-12 2005-04-13 $7700.00 Window Closed / Lapsed

Assigned Categories & Tags

No categories assigned to this patent yet.

Assign Category Tag