Patent US5854933A successfully refreshed from Google Patents.
← Back to Patent Explorer
US5854933A Expired / Lapsed US ⏱️ 0.0 years remaining

Method for optimizing a computer program by moving certain load and store instructions out of a loop

Assignee: Intel Corp
•
Filing: 1996-08-20
•
Granted: 1998-12-29
•
Expires: 2016-08-20
📄 Original PDF 🌐 Google Patents 🔄 Sync Now

Abstract

Abstract A method, performed by a computer, for optimizing a computer program having a plurality of instructions that form a loop. The loop has a first block and a second block. The first block has at least one instruction for using a variable and the second block has an ambiguous definition instruction for defining the variable. A load instruction for loading the variable into a register is inserted prior to the plurality of instructions that form the loop. In addition, at least one instruction for using the variable is replaced with an instruction for using the register. Further, a load instruction for loading the variable into the register is inserted after the ambiguous definition instruction.

Inventors

  • 👤 Po-Hua Chang

Bibliographic Details

Application Number —
Jurisdiction US
Data Source google_patents
Last Synchronized 2026-11-04 20:18
CPC Classifications
G; G06; G06F; G06F8/00; G06F8/40; G06F8/41; G06F8/44; G06F8/443; G06F8/4441; G06F8/4442

Claims Analysis

Total Claims: 34
Claim 1
Independent Claim 125 words
A method, performed by a microprocessor, for optimizing a computer program having a plurality of instructions that form a loop, the loop having a first block and a second block, the first block having at least one instruction for using a variable, the second block having at least one ambiguous definition instruction for defining the variable, the method comprising: (a) inserting a load instruction for loading the variable into a register, the load instruction being inserted prior to the plurality of instructions that form the loop; (b) replacing the at least one instruction for using the variable with an instruction for using the register; and (c) inserting a load instruction for loading the variable into the register after the at least one ambiguous definition instruction.
Claim 2
Independent Claim 125 words
A method, performed by a microprocessor, for optimizing a computer program having a plurality of instructions that form a loop, the loop having a first block and a second block, the first block having at least one instruction for using a variable, the second block having at least one ambiguous definition instruction for defining the variable, the method comprising: (a) inserting a load instruction for loading the variable into a register, the load instruction being inserted prior to the plurality of instructions that form the loop; (b) replacing the at least one instruction for using the variable with an instruction for using the register; and (c) inserting a load instruction for loading the variable into the register after the at least one ambiguous definition instruction.
Claim 3
Dependent Claim 16 words
The method of claim 1, wherein the first block does not have any unambiguous definition instructions.
Claim 4
Independent Claim 171 words
A method, performed by a microprocessor, for optimizing a computer program having a plurality of instructions that form a loop, the loop having a frequently executed block and a less frequently executed block, the frequently executed block having at least one instruction for using a variable, the less frequently executed block having at least one ambiguous definition instruction for defining the variable, the method comprising: (a) determining if there is sufficient profit in optimizing the frequently executed block; (b) determining if register pressure is low; and (c) if there is sufficient profit in assigning the variable to a register and register pressure is low, then i) inserting a load instruction for loading the variable into a register, the load instruction being inserted prior to the plurality of instructions that form the loop; ii) replacing the at least one instruction for using the variable with an instruction for using the register; and iii) inserting a load instruction for loading the variable into the register after the at least one ambiguous definition instruction.
Claim 5
Independent Claim 171 words
A method, performed by a microprocessor, for optimizing a computer program having a plurality of instructions that form a loop, the loop having a frequently executed block and a less frequently executed block, the frequently executed block having at least one instruction for using a variable, the less frequently executed block having at least one ambiguous definition instruction for defining the variable, the method comprising: (a) determining if there is sufficient profit in optimizing the frequently executed block; (b) determining if register pressure is low; and (c) if there is sufficient profit in assigning the variable to a register and register pressure is low, then i) inserting a load instruction for loading the variable into a register, the load instruction being inserted prior to the plurality of instructions that form the loop; ii) replacing the at least one instruction for using the variable with an instruction for using the register; and iii) inserting a load instruction for loading the variable into the register after the at least one ambiguous definition instruction.
Claim 6
Dependent Claim 21 words
The method of claim 3, wherein profiling is utilized to determine the frequently executed block and the less frequently executed block.
Claim 7
Dependent Claim 17 words
The method of claim 3, wherein the frequently executed block does not have any unambiguous definition instructions.
Claim 8
Independent Claim 191 words
A method, performed by a microprocessor, for optimizing a computer program having a plurality of instructions that form a loop, the loop having at least one exit point, a first block, and a second block, the first block having at least one unambiguous definition instruction for defining a variable and at least one instruction for using the variable, the second executed block having a ambiguous definition instruction, the method comprising: (a) inserting a load instruction for loading the variable into a register, the load instruction being inserted prior to the plurality of instructions that form the loop; (b) replacing the at least one instruction for unambiguously defining the variable with an instruction for defining the register; (c) replacing the at least one instruction for using the variable with an instruction for using the register; (d) inserting a store instruction for storing the register into the variable before the at least one ambiguous definition instruction; (e) inserting a load instruction for loading the variable into the register after the at least one ambiguous definition instruction; and (f) inserting an instruction for storing the register into the variable after each loop exit point.
Claim 9
Independent Claim 191 words
A method, performed by a microprocessor, for optimizing a computer program having a plurality of instructions that form a loop, the loop having at least one exit point, a first block, and a second block, the first block having at least one unambiguous definition instruction for defining a variable and at least one instruction for using the variable, the second executed block having a ambiguous definition instruction, the method comprising: (a) inserting a load instruction for loading the variable into a register, the load instruction being inserted prior to the plurality of instructions that form the loop; (b) replacing the at least one instruction for unambiguously defining the variable with an instruction for defining the register; (c) replacing the at least one instruction for using the variable with an instruction for using the register; (d) inserting a store instruction for storing the register into the variable before the at least one ambiguous definition instruction; (e) inserting a load instruction for loading the variable into the register after the at least one ambiguous definition instruction; and (f) inserting an instruction for storing the register into the variable after each loop exit point.
Claim 10
Dependent Claim 16 words
The method of claim 6, wherein the first block does not have any unambiguous definition instructions.
Claim 11
Independent Claim 236 words
A method, performed by a microprocessor, for optimizing a computer program having a plurality of instructions that form a loop, the loop having at least one exit point, a frequently executed block, and a less frequently executed block, the frequently executed block having at least one unambiguous definition instruction for defining a variable and at least one instruction for using the variable, the less frequently executed block having a ambiguous definition instruction, the method comprising: (a) determining if there is sufficient profit in optimizing the frequently executed block; (b) determining if register pressure is low; and (c) if there is sufficient profit in assigning the variable to a register and register pressure is low, then i) inserting a load instruction for loading the variable into a register, the load instruction being inserted prior to the plurality of instructions that form the loop, ii) replacing the at least one instruction for unambiguously defining the variable with an instruction for defining the register, iii) replacing the at least one instruction for using the variable with an instruction for using the register, iv) inserting a store instruction for storing the register into the variable before the at least one ambiguous definition instruction, v) inserting a load instruction for loading the variable into the register after the at least one ambiguous definition instruction, and vi) inserting an instruction for storing the register into the variable after each loop exit point.
Claim 12
Independent Claim 236 words
A method, performed by a microprocessor, for optimizing a computer program having a plurality of instructions that form a loop, the loop having at least one exit point, a frequently executed block, and a less frequently executed block, the frequently executed block having at least one unambiguous definition instruction for defining a variable and at least one instruction for using the variable, the less frequently executed block having a ambiguous definition instruction, the method comprising: (a) determining if there is sufficient profit in optimizing the frequently executed block; (b) determining if register pressure is low; and (c) if there is sufficient profit in assigning the variable to a register and register pressure is low, then i) inserting a load instruction for loading the variable into a register, the load instruction being inserted prior to the plurality of instructions that form the loop, ii) replacing the at least one instruction for unambiguously defining the variable with an instruction for defining the register, iii) replacing the at least one instruction for using the variable with an instruction for using the register, iv) inserting a store instruction for storing the register into the variable before the at least one ambiguous definition instruction, v) inserting a load instruction for loading the variable into the register after the at least one ambiguous definition instruction, and vi) inserting an instruction for storing the register into the variable after each loop exit point.
Claim 13
Dependent Claim 21 words
The method of claim 8, wherein profiling is utilized to determine the frequently executed block and the less frequently executed block.
Claim 14
Dependent Claim 17 words
The method of claim 8, wherein the frequently executed block does not have any unambiguous definition instructions.
Claim 15
Dependent Claim 132 words
A computer program encoded on a computer-readable medium for execution by a computer, the program including a plurality of instructions that form a loop, the loop including a first block and a second block, the first block including at least one instruction for using a variable, the second block including at least one ambiguous definition instruction for defining the variable, the computer program being formed by: (a) inserting a load instruction for loading the variable into a register, the load instruction being inserted prior to the plurality of instructions that form the loop; (b) replacing the at least one instruction for using the variable with an instruction for using the register; and (c) inserting a load instruction for loading the variable into the register after the at least one ambiguous definition instruction.
Claim 16
Dependent Claim 132 words
A computer program encoded on a computer-readable medium for execution by a computer, the program including a plurality of instructions that form a loop, the loop including a first block and a second block, the first block including at least one instruction for using a variable, the second block including at least one ambiguous definition instruction for defining the variable, the computer program being formed by: (a) inserting a load instruction for loading the variable into a register, the load instruction being inserted prior to the plurality of instructions that form the loop; (b) replacing the at least one instruction for using the variable with an instruction for using the register; and (c) inserting a load instruction for loading the variable into the register after the at least one ambiguous definition instruction.
Claim 17
Dependent Claim 198 words
A computer program encoded on a computer-readable medium for execution by a computer, the program including a plurality of instructions that form a loop, the loop including at least one exit point, a first block, and a second block, the first block including at least one unambiguous definition instruction for defining a variable and at least one instruction for using the variable, the second executed block including an ambiguous definition instruction, the computer program being formed by: (a) inserting a load instruction for loading the variable into a register, the load instruction being inserted prior to the plurality of instructions that form the loop; (b) replacing the at least one instruction for unambiguously defining the variable with an instruction for defining the register; (c) replacing the at least one instruction for using the variable with an instruction for using the register; (d) inserting a store instruction for storing the register into the variable before the at least one ambiguous definition instruction; (e) inserting a load instruction for loading the variable into the register after the at least one ambiguous definition instruction; and (f) inserting an instruction for storing the register into the variable after each loop exit point.
Claim 18
Dependent Claim 198 words
A computer program encoded on a computer-readable medium for execution by a computer, the program including a plurality of instructions that form a loop, the loop including at least one exit point, a first block, and a second block, the first block including at least one unambiguous definition instruction for defining a variable and at least one instruction for using the variable, the second executed block including an ambiguous definition instruction, the computer program being formed by: (a) inserting a load instruction for loading the variable into a register, the load instruction being inserted prior to the plurality of instructions that form the loop; (b) replacing the at least one instruction for unambiguously defining the variable with an instruction for defining the register; (c) replacing the at least one instruction for using the variable with an instruction for using the register; (d) inserting a store instruction for storing the register into the variable before the at least one ambiguous definition instruction; (e) inserting a load instruction for loading the variable into the register after the at least one ambiguous definition instruction; and (f) inserting an instruction for storing the register into the variable after each loop exit point.
Claim 19
Dependent Claim 17 words
The computer program of claim 11, wherein the first block does not have any unambiguous definition instructions.
Claim 20
Dependent Claim 17 words
The computer program of claim 12, wherein the first block does not have any unambiguous definition instructions.
Claim 21
Dependent Claim 111 words
A computer-readable medium encoded with instructions that, when executed by a computer, perform a method for optimizing a computer program, the method comprising: (a) inserting a load instruction for loading a variable into a register, the load instruction being inserted prior to a plurality of instructions forming a loop, the loop further comprising: i) a first block including an instruction for using the variable; and ii) a second block including an ambiguous definition instruction for defining the variable; (b) replacing the instruction for using the variable with an instruction for using the register; and (c) inserting a load instruction for loading the variable into the register after the ambiguous definition instruction.
Claim 22
Dependent Claim 111 words
A computer-readable medium encoded with instructions that, when executed by a computer, perform a method for optimizing a computer program, the method comprising: (a) inserting a load instruction for loading a variable into a register, the load instruction being inserted prior to a plurality of instructions forming a loop, the loop further comprising: i) a first block including an instruction for using the variable; and ii) a second block including an ambiguous definition instruction for defining the variable; (b) replacing the instruction for using the variable with an instruction for using the register; and (c) inserting a load instruction for loading the variable into the register after the ambiguous definition instruction.
Claim 23
Dependent Claim 18 words
The computer-readable storage medium of claim 15, wherein the first block does not include any unambiguous definition instructions.
Claim 24
Dependent Claim 180 words
A computer-readable medium encoded with instructions that, when executed by a computer, perform a method for optimizing a computer program comprising a plurality of instructions forming a loop including a frequently executed block and a less frequently executed block, the frequently executed block further including at least one instruction for using a variable and the less frequently executed block further including at least one ambiguous definition instruction for defining the variable, the method comprising: (a) determining if there is sufficient profit in optimizing the frequently executed block; (b) determining if register pressure is low; and (c) if there is sufficient profit in assigning the variable to a register and register pressure is low, then i) inserting a load instruction for loading the variable into a register, the load instruction being inserted prior to the plurality of instructions that form the loop; ii) replacing the at least one instruction for using the variable with an instruction for using the register; and iii) inserting a load instruction for loading the variable into the register after the at least one ambiguous definition instruction.
Claim 25
Dependent Claim 180 words
A computer-readable medium encoded with instructions that, when executed by a computer, perform a method for optimizing a computer program comprising a plurality of instructions forming a loop including a frequently executed block and a less frequently executed block, the frequently executed block further including at least one instruction for using a variable and the less frequently executed block further including at least one ambiguous definition instruction for defining the variable, the method comprising: (a) determining if there is sufficient profit in optimizing the frequently executed block; (b) determining if register pressure is low; and (c) if there is sufficient profit in assigning the variable to a register and register pressure is low, then i) inserting a load instruction for loading the variable into a register, the load instruction being inserted prior to the plurality of instructions that form the loop; ii) replacing the at least one instruction for using the variable with an instruction for using the register; and iii) inserting a load instruction for loading the variable into the register after the at least one ambiguous definition instruction.
Claim 26
Dependent Claim 26 words
The computer-readable medium of claim 17, wherein the method further comprises profiling the loop to determine the frequently executed block and the less frequently executed block.
Claim 27
Dependent Claim 18 words
The computer-readable medium of claim 17, wherein the frequently executed block does not have any unambiguous definition instructions.
Claim 28
Dependent Claim 186 words
A computer-readable medium encoded with instructions that, when executed by a computer, perform a method for optimizing a computer program, the method comprising: (a) inserting a load instruction for loading a variable into a register, the load instruction being inserted prior to a plurality of instructions that form a loop comprising at least one exit point, a first block including at least one unambiguous definition instruction for defining the variable and at least one instruction for using the variable, and a second executed block including an ambiguous definition instruction; (b) replacing the at least one instruction for unambiguous definition instruction for defining the variable with an instruction for defining the register; (c) replacing the at least one instruction for using the variable with an instruction for using the register; (d) inserting a store instruction for storing the register into the variable before the at least one ambiguous definition instruction; (e) inserting a load instruction for loading the variable into the register after the at least one ambiguous definition instruction; and (f) inserting an instruction for storing the register into the variable after each loop exit point.
Claim 29
Dependent Claim 186 words
A computer-readable medium encoded with instructions that, when executed by a computer, perform a method for optimizing a computer program, the method comprising: (a) inserting a load instruction for loading a variable into a register, the load instruction being inserted prior to a plurality of instructions that form a loop comprising at least one exit point, a first block including at least one unambiguous definition instruction for defining the variable and at least one instruction for using the variable, and a second executed block including an ambiguous definition instruction; (b) replacing the at least one instruction for unambiguous definition instruction for defining the variable with an instruction for defining the register; (c) replacing the at least one instruction for using the variable with an instruction for using the register; (d) inserting a store instruction for storing the register into the variable before the at least one ambiguous definition instruction; (e) inserting a load instruction for loading the variable into the register after the at least one ambiguous definition instruction; and (f) inserting an instruction for storing the register into the variable after each loop exit point.
Claim 30
Dependent Claim 17 words
The computer-readable medium of claim 20, wherein the first block does not have any unambiguous definition instructions.
Claim 31
Dependent Claim 246 words
A computer-readable storage medium encoded with instructions that, when executed by a computer, perform a method for optimizing a computer program, the method comprising: (a) determining if there is sufficient profit in optimizing a frequently executed block in a plurality of instructions that form a loop, the loop comprising at least one exit point, the frequently executed block, and a less frequently executed block, the frequently executed block including at least one unambiguous definition instruction for defining a variable and at least one instruction for using the variable, and the less frequently executed block including an ambiguous definition instruction; (b) determining if register pressure is low; and (c) if there is sufficient profit in assigning the variable to a register and register pressure is low, then i) inserting a load instruction for loading the variable into a register, the load instruction being inserted prior to the plurality of instructions that form the loop, ii) replacing the at least one instruction for unambiguously defining the variable with an instruction for defining the register, iii) replacing the at least one instruction for using the variable with an instruction for using the register, iv) inserting a store instruction for storing the register into the variable before the at least one ambiguous definition instruction, v) inserting a load instruction for loading the variable into the register after the at least one ambiguous definition instruction, and vi) inserting an instruction for storing the register into the variable after each exit point.
Claim 32
Dependent Claim 246 words
A computer-readable storage medium encoded with instructions that, when executed by a computer, perform a method for optimizing a computer program, the method comprising: (a) determining if there is sufficient profit in optimizing a frequently executed block in a plurality of instructions that form a loop, the loop comprising at least one exit point, the frequently executed block, and a less frequently executed block, the frequently executed block including at least one unambiguous definition instruction for defining a variable and at least one instruction for using the variable, and the less frequently executed block including an ambiguous definition instruction; (b) determining if register pressure is low; and (c) if there is sufficient profit in assigning the variable to a register and register pressure is low, then i) inserting a load instruction for loading the variable into a register, the load instruction being inserted prior to the plurality of instructions that form the loop, ii) replacing the at least one instruction for unambiguously defining the variable with an instruction for defining the register, iii) replacing the at least one instruction for using the variable with an instruction for using the register, iv) inserting a store instruction for storing the register into the variable before the at least one ambiguous definition instruction, v) inserting a load instruction for loading the variable into the register after the at least one ambiguous definition instruction, and vi) inserting an instruction for storing the register into the variable after each exit point.
Claim 33
Dependent Claim 25 words
The computer-readable medium of claim 22, wherein the method further comprises profiling utilized to determine the frequently executed block and the less frequently executed block.
Claim 34
Dependent Claim 18 words
The computer-readable medium of claim 22, wherein the frequently executed block does not have any unambiguous definition instructions.

References Cited (Backward Citations)

US5287510A Cited
US5317743A Cited
US5265253A Cited
US5649203A Cited
US5652889A Cited
US5438669A Cited
US5386562A Cited

USPTO Annuity & Maintenance Windows

Annuity Stage Window Opens Payment Deadline Surcharge Period Until Estimated Fee Status
3.5 Years (Year 4) 2001-12-28 2002-06-29 2002-12-29 $2000.00 Window Closed / Lapsed
7.5 Years (Year 8) 2005-12-28 2006-06-29 2006-12-29 $3760.00 Window Closed / Lapsed
11.5 Years (Year 12) 2009-12-28 2010-06-29 2010-12-29 $7700.00 Window Closed / Lapsed

Assigned Categories & Tags

No categories assigned to this patent yet.

Assign Category Tag