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

Compilation using two-colored pebbling register allocation method such that spill code amount is invariant with basic block's textual ordering

Assignee: International Business Machines Corp
•
Filing: 1985-12-17
•
Granted: 1988-11-01
•
Expires: 2005-12-17
📄 Original PDF 🌐 Google Patents 🔄 Sync Now

Abstract

Abstract A method for allocating and optimizing register assignments during compiling of source into executable code in either a scalar or vector processor uses a pebble game heuristic played on each basic block dependency graph for local optimization. Like variable analysis and loop unrolling are used for global optimization.

Inventors

  • 👤 Ashfaq A. Munshi
  • 👤 Karl M. Schimpf

Bibliographic Details

Application Number —
Jurisdiction US
Data Source google_patents
Last Synchronized 2026-10-25 07:46
CPC Classifications
G; G06; G06F; G06F9/00; G06F8/00; G06F8/40; G06F8/41; G06F8/44; G06F8/441

Claims Analysis

Total Claims: 6
Claim 1
Independent Claim 207 words
A method for allocating and optimizing register assignments during the compiling of source into executable code in either a scalar or a vector processor, the source code including regions of code without branches termed "basic blocks", each basic block having statements defining computations, each processor comprising memory for storing sequences of executable code and data, and means for accessing said memory and executing any accessed code; the memory being mapped as a two-level model including a finite number p greater than 0 of registers and a comparably infinite internal memory, said registers having access times faster than that of internal memory, comprising the processor-implemented steps of: (a) ascertaining data dependency graph attributes of each basic block; (b) generating a local register allocation and assignment for q of the p registers in the range 0<q<p with reference to all computations within each basic block by performing a "two-color pebbling game" heuristic over the ascertained data dependency graph utilizing the two-level memory model; and (c) performing live variable analysis upon a flow graph-like representation of the basic blocks and responsively generating a global register allocation and assignment among (p-q) remaining registers assuming that loops expressed in the flow graph among the basic blocks are the most significant optimization entity.
Claim 2
Independent Claim 207 words
A method for allocating and optimizing register assignments during the compiling of source into executable code in either a scalar or a vector processor, the source code including regions of code without branches termed "basic blocks", each basic block having statements defining computations, each processor comprising memory for storing sequences of executable code and data, and means for accessing said memory and executing any accessed code; the memory being mapped as a two-level model including a finite number p greater than 0 of registers and a comparably infinite internal memory, said registers having access times faster than that of internal memory, comprising the processor-implemented steps of: (a) ascertaining data dependency graph attributes of each basic block; (b) generating a local register allocation and assignment for q of the p registers in the range 0<q<p with reference to all computations within each basic block by performing a "two-color pebbling game" heuristic over the ascertained data dependency graph utilizing the two-level memory model; and (c) performing live variable analysis upon a flow graph-like representation of the basic blocks and responsively generating a global register allocation and assignment among (p-q) remaining registers assuming that loops expressed in the flow graph among the basic blocks are the most significant optimization entity.
Claim 3
Dependent Claim 22 words
A method according to claim 1, wherein the data dependency graph for each basic block is of the directed acyclic graph type.
Claim 4
Dependent Claim 119 words
A method according to claim 1, wherein the step of generating a local register allocation and assignment includes the steps of: (b1) selecting the set of nodes of the graph which have the largest number of successors (dominators) in a leaf-to-root node direction; (b2) ascertaining a cover cost of every node that is an immediate successor of the set chosen above, and assigning a register to that immediate successor in the set for which the cover cost is minimal; and (b3) in the absence of any available allocatable registers, writing out an intermediate or final result signified by the computation at that node to internal memory and then subsequently loading said result back to an available register as required.
Claim 5
Dependent Claim 91 words
A method according to claim 1, wherein the step of generating a global register allocation and schedule includes: (c1) generating a list for each variable and the frequency with which the variable is loaded or stored in the local allocations for these basic blocks weighted by the nesting level of that variable; and (c2) selecting the variable having the highest frequency to reside in a global register, the steps of listing and selection being repeated until either no more of the (p-q) global registers are available, or the list is empty.
Claim 6
Dependent Claim 84 words
A method according to claim 1, wherein the step of performing live variable analysis and responsively allocating and assigning (p-q) registers globally includes the steps of ascertaining the "live ranges" for all variables not local to a basic block; and allocating the variable with the largest live range to a global register, and in the event of two or more variables having the same live range, assigning one of the (p-q) registers to that variable having the largest number of uses or nesting level.

References Cited (Backward Citations)

US3400371A Cited
US3921153A Cited
US4493020A Cited
US4378590A Cited
US4435753A Cited
US4571678A Cited
US4567574A Cited
US4727487A Cited
US4656583A Cited
US4667290A Cited
US4656582A Cited
US4722071A Cited

USPTO Annuity & Maintenance Windows

Annuity Stage Window Opens Payment Deadline Surcharge Period Until Estimated Fee Status
3.5 Years (Year 4) 1991-11-01 1992-05-02 1992-11-01 $2000.00 Window Closed / Lapsed
7.5 Years (Year 8) 1995-11-01 1996-05-02 1996-11-01 $3760.00 Window Closed / Lapsed
11.5 Years (Year 12) 1999-11-01 2000-05-02 2000-11-01 $7700.00 Window Closed / Lapsed

Assigned Categories & Tags

No categories assigned to this patent yet.

Assign Category Tag