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

Integrated register allocation, instruction scheduling, instruction reduction and loop unrolling

Assignee: Intel Corp
•
Filing: 1992-11-30
•
Granted: 1994-11-22
•
Expires: 2012-11-30
📄 Original PDF 🌐 Google Patents 🔄 Sync Now

Abstract

Abstract An improved register allocator, an improved instruction scheduler, an instruction combiner, and an improved loop unroller is provided to the code generator of a compiler of a computer system. Both the improved instruction scheduler and the improved loop unroller support a "preliminary" and a "final" mode of operation. Upon invocation, the improved register allocator determines and prioritizes regions of the program being compiled. Next, the improved register allocator, in cooperation with the improved instruction scheduler, the instruction combiner, and the improved loop unroller, determines the optimal partitioning for global and local registers for each region. Then, the improved register allocator allocates registers to each region based on the determined number of global registers for the region. After allocating registers for each region, the improved register allocator merges the regions together. The improved loop unroller and the improved instruction scheduler are then invoked successively in "final" mode to unroll the various loops and schedule the instructions being generated.

Inventors

  • 👤 Kevin J. Smith
  • 👤 Hugh R. Kenner
  • 👤 William A. Savage
  • 👤 Alice Kwong

Bibliographic Details

Application Number —
Jurisdiction US
Data Source google_patents
Last Synchronized 2026-10-30 06:10
CPC Classifications
G; G06; G06F; G06F8/00; G06F8/40; G06F8/41; G06F8/44; G06F8/441; G06F8/443; G06F8/45; G06F8/451; G06F8/452

Claims Analysis

Total Claims: 23
Claim 1
Independent Claim 203 words
In a computer system comprising a plurality of registers and a plurality of pipelines for parallel and overlapping execution of instructions, a method for allocating said registers to instructions being generated for a program being compiled, unrolling loops of said program, and scheduling said instructions being generated for execution, said method comprising the steps of: a) allocating global registers to said instructions being generated for a first time using all registers of said computer system; b) scheduling said instructions being generated for a first time, allocating local registers using a copy of all registers of said computer system; c) determining optimal number of times to unroll loops of said program; d) determining optimal partitioning of said registers of said computer system into global and local registers, said partitioning determination being made based on the relative utilities of each of said registers to global register allocation and instruction scheduling; e) allocating global registers to said instructions being generated for a second time using said registers of said computer system partitioned to be global registers; f) unrolling said loops; and g) scheduling said instructions being generated for a second time, allocating local registers using said registers of said computer system partitioned to be local registers.
Claim 2
Dependent Claim 203 words
In a computer system comprising a plurality of registers and a plurality of pipelines for parallel and overlapping execution of instructions, a method for allocating said registers to instructions being generated for a program being compiled, unrolling loops of said program, and scheduling said instructions being generated for execution, said method comprising the steps of: a) allocating global registers to said instructions being generated for a first time using all registers of said computer system; b) scheduling said instructions being generated for a first time, allocating local registers using a copy of all registers of said computer system; c) determining optimal number of times to unroll loops of said program; d) determining optimal partitioning of said registers of said computer system into global and local registers, said partitioning determination being made based on the relative utilities of each of said registers to global register allocation and instruction scheduling; e) allocating global registers to said instructions being generated for a second time using said registers of said computer system partitioned to be global registers; f) unrolling said loops; and g) scheduling said instructions being generated for a second time, allocating local registers using said registers of said computer system partitioned to be local registers.
Claim 3
Dependent Claim 74 words
The method as set forth in claim 1, wherein, a plurality of combinations of said instructions have equivalent combined single instructions; said step c) further comprises identifying said combinations of instructions that are not scheduled for parallel execution with other instructions, and replacing said identified combinations of instructions with their corresponding equivalent single instructions, said identification and replacement being performed before said determination of optimal number of times to unroll loops of said program.
Claim 4
Dependent Claim 115 words
The method as set forth in claim 1, wherein, said steps a) through e) are performed for regions of said program, one region at a time, in order of their priorities, each of said regions comprising a collection of basic blocks which satisfy the following predecessor and successor relationship rules with basic blocks outside the region: (1) all basic blocks outside the region having a successor basic block in the region have one and only one successor basic block, (2) all basic blocks outside the region having a predecessor basic block in the region have one and only predecessor basic block, said regions being merged after having said steps a) through e) performed on them.
Claim 5
Dependent Claim 24 words
The method as set forth in claim 1, wherein, said relative utilities in said step d) are measured by register usage and definition counts.
Claim 6
Dependent Claim 271 words
In a computer system comprising a plurality of registers and a plurality of pipelines for parallel and overlapping execution of instructions, an apparatus for allocating said registers to instructions being generated for a program being compiled, unrolling loops of said program, and scheduling said instructions being generated for execution, said apparatus comprising: a) first register allocation means for allocating global registers to said instructions being generated for a first time using all registers of said computer system; b) first scheduling means coupled to said first register allocation means for scheduling said instructions being generated for a first time, allocating local registers using a copy of all registers of said computer system; c) first loop unrolling means coupled to said first register allocation for determining optimal number of times to unroll loops of said program; d) partition determination means coupled to said first register allocation for determining optimal partitioning of said registers of said computer system into global and local registers, said partitioning determination being made based on the relative utility of each of said registers to global register allocation and instruction scheduling; e) second register allocation means coupled to said first register allocation means for allocating global registers to said instructions being generated for a second time using said registers of said computer system partitioned to be global registers; f) second loop unrolling means coupled to said second register allocation means for unrolling said loops; and g) second scheduling means coupled to said second unrolling means for scheduling said instructions being generated for a second time, allocating local registers using said registers of said computer system partitioned to be local registers.
Claim 7
Dependent Claim 271 words
In a computer system comprising a plurality of registers and a plurality of pipelines for parallel and overlapping execution of instructions, an apparatus for allocating said registers to instructions being generated for a program being compiled, unrolling loops of said program, and scheduling said instructions being generated for execution, said apparatus comprising: a) first register allocation means for allocating global registers to said instructions being generated for a first time using all registers of said computer system; b) first scheduling means coupled to said first register allocation means for scheduling said instructions being generated for a first time, allocating local registers using a copy of all registers of said computer system; c) first loop unrolling means coupled to said first register allocation for determining optimal number of times to unroll loops of said program; d) partition determination means coupled to said first register allocation for determining optimal partitioning of said registers of said computer system into global and local registers, said partitioning determination being made based on the relative utility of each of said registers to global register allocation and instruction scheduling; e) second register allocation means coupled to said first register allocation means for allocating global registers to said instructions being generated for a second time using said registers of said computer system partitioned to be global registers; f) second loop unrolling means coupled to said second register allocation means for unrolling said loops; and g) second scheduling means coupled to said second unrolling means for scheduling said instructions being generated for a second time, allocating local registers using said registers of said computer system partitioned to be local registers.
Claim 8
Dependent Claim 84 words
The apparatus as set forth in claim 5, wherein, a plurality of combinations of said instructions have equivalent combined single instructions; said apparatus further comprises instruction combining means coupled to said first register allocation means for identifying said combinations of instructions that are not scheduled for parallel execution with other instructions, and replacing said identified combinations of instructions with their corresponding equivalent single instructions, said identification and replacement being performed before said determination of optimal number of times to unroll loops of said program.
Claim 9
Dependent Claim 164 words
The apparatus as set forth in claim 5, wherein, said first register allocation means, said first scheduling means, said first loop unrolling means, said partition determination means perform said first register allocation, said first instruction scheduling, said determination of optimal number of times to unroll loops of said program, and said partitioning of registers for regions of said program, one region at a time, in order of their priorities, each of said regions comprising a collection of basic blocks which satisfy the following predecessor and successor relationship rules with basic blocks outside the region: (1) all basic blocks outside the region having a successor basic block in the region have one and only one successor basic block, (2) all basic blocks outside the region having a predecessor basic block in the region have one and only predecessor basic block, said regions being merged after having said first time register allocation, said first time instruction scheduling, and said first time loop unrolling performed on them.
Claim 10
Dependent Claim 23 words
The apparatus as set forth in claim 5, wherein, said partition determination means measures said relative utilities by register usage and definition counts.
Claim 11
Dependent Claim 108 words
The apparatus as set forth in claim 5, wherein, said first and second register allocation means being the same register allocation means; said first and second scheduling means being the same scheduling means, said first scheduling means being said same scheduling means operating in a first mode, and said second scheduling means being said same scheduling means operating in a second mode; said first and second loop unrolling means being the same loop unrolling means, said first loop unrolling means being said same loop unrolling means operating in a first mode, and said second loop unrolling means being said same loop unrolling means operating in a second mode.
Claim 12
Dependent Claim 317 words
In a computer system comprising a plurality of registers and a plurality of pipelines for parallel and overlapping execution of instructions, a code generator of a compiler for generating instructions for a program being compiled, wherein said registers are allocated to said instructions being generated, said code generator comprising: a) a translator for translating intermediate representations of said program; b) an optimizer coupled to said translator for receiving said intermediate representations and optimizing said instructions being generated for said program being compiled; c) first register allocator for allocating global registers to said instructions being generated for a first time using all registers of said computer system; d) first scheduler coupled to said first register allocator for scheduling said instructions being generated for a first time, allocating local registers using a copy of all registers of said computer system; e) first loop unroller coupled to said first register allocator for determining optimal number of times to unroll loops of said program; f) partition determinator coupled to said first register allocator for determining optimal partitioning of said registers of said computer system into global and local registers, said partitioning determination being made based on the relative utility of each of said registers to global register allocation and instruction scheduling; g) second register allocator coupled to said first register allocator for allocating global registers to said instructions being generated for a second time using said registers of said computer system partitioned to be global registers; h) second loop unroller coupled to said second register allocator for unrolling said loops; i) second scheduler coupled to said second unroller for scheduling said instructions being generated for a second time, allocating local registers using said registers of said computer system partitioned to be local registers; and j) an assembly generator coupled to said scheduler for receiving said optimized, register allocated, and scheduled intermediate representations and generating said instructions for said program being compiled.
Claim 13
Dependent Claim 317 words
In a computer system comprising a plurality of registers and a plurality of pipelines for parallel and overlapping execution of instructions, a code generator of a compiler for generating instructions for a program being compiled, wherein said registers are allocated to said instructions being generated, said code generator comprising: a) a translator for translating intermediate representations of said program; b) an optimizer coupled to said translator for receiving said intermediate representations and optimizing said instructions being generated for said program being compiled; c) first register allocator for allocating global registers to said instructions being generated for a first time using all registers of said computer system; d) first scheduler coupled to said first register allocator for scheduling said instructions being generated for a first time, allocating local registers using a copy of all registers of said computer system; e) first loop unroller coupled to said first register allocator for determining optimal number of times to unroll loops of said program; f) partition determinator coupled to said first register allocator for determining optimal partitioning of said registers of said computer system into global and local registers, said partitioning determination being made based on the relative utility of each of said registers to global register allocation and instruction scheduling; g) second register allocator coupled to said first register allocator for allocating global registers to said instructions being generated for a second time using said registers of said computer system partitioned to be global registers; h) second loop unroller coupled to said second register allocator for unrolling said loops; i) second scheduler coupled to said second unroller for scheduling said instructions being generated for a second time, allocating local registers using said registers of said computer system partitioned to be local registers; and j) an assembly generator coupled to said scheduler for receiving said optimized, register allocated, and scheduled intermediate representations and generating said instructions for said program being compiled.
Claim 14
Dependent Claim 84 words
The code generator as set forth in claim 10, wherein, a plurality of combinations of said instructions have equivalent combined single instructions; said code generator further comprises instruction combiner coupled to said first register allocator for identifying said combinations of instructions that are not scheduled for parallel execution with other instructions, and replacing said identified combinations of instructions with their corresponding equivalent single instructions, said identification and replacement being performed before said determination of optimal number of times to unroll loops of said program.
Claim 15
Dependent Claim 95 words
The code generator as set forth in claim 10, wherein, said first and second register allocator being the same register allocator; said first and second scheduler being the same scheduler, said first scheduler being said same scheduler operating in a first mode, and said second scheduler being said same scheduler operating in a second mode; said first and second loop unroller being the same loop unroller, said first loop unroller being said same loop unroller operating in a first mode, and said second loop unroller being said same loop unroller operating in a second mode.
Claim 16
Dependent Claim 341 words
In a computer system comprising a plurality of registers and a plurality of pipelines for parallel and overlapping execution of instructions, a compiler for compiling a program, wherein instructions being generated for said program being compiled having said registers allocated to them, said compiler comprising: a) a parser for receiving source code of said program, parsing said source code and generating tokenized statements for said program; b) an intermediate representation builder coupled to said parser for receiving said tokenized statements and building intermediate representations for said program; and c) a code generator coupled to said intermediate representation builder for generating instructions for said program, said code generator comprising an improved register allocator for allocating said registers to said instructions being generated, said improved register allocator comprising, c.1) a first register allocator for allocating global registers to said instructions being generated for a first time using all registers of said computer system; c.2) a first scheduler coupled to said first register allocator for scheduling said instructions being generated for a first time, allocating local registers using a copy of all registers of said computer system; c.3) a first loop unroller coupled to said first register allocator for determining optimal number of times to unroll loops of said program; c.4) a partition determinator coupled to said first register allocator for determining optimal partitioning of said registers of said computer system into global and local registers, said partitioning determination being made based on the relative utility of each of said registers to global register allocation and instruction scheduling; c.5) a second register allocator coupled to said first register allocator for allocating global registers to said instructions being generated for a second time using said registers of said computer system partitioned to be global registers; c.6) a second loop unroller coupled to said second register allocator for unrolling said loops; and c.7) a second scheduler coupled to said second unroller for scheduling said instructions being generated for a second time, allocating local registers using said registers of said computer system partitioned to be local registers.
Claim 17
Dependent Claim 341 words
In a computer system comprising a plurality of registers and a plurality of pipelines for parallel and overlapping execution of instructions, a compiler for compiling a program, wherein instructions being generated for said program being compiled having said registers allocated to them, said compiler comprising: a) a parser for receiving source code of said program, parsing said source code and generating tokenized statements for said program; b) an intermediate representation builder coupled to said parser for receiving said tokenized statements and building intermediate representations for said program; and c) a code generator coupled to said intermediate representation builder for generating instructions for said program, said code generator comprising an improved register allocator for allocating said registers to said instructions being generated, said improved register allocator comprising, c.1) a first register allocator for allocating global registers to said instructions being generated for a first time using all registers of said computer system; c.2) a first scheduler coupled to said first register allocator for scheduling said instructions being generated for a first time, allocating local registers using a copy of all registers of said computer system; c.3) a first loop unroller coupled to said first register allocator for determining optimal number of times to unroll loops of said program; c.4) a partition determinator coupled to said first register allocator for determining optimal partitioning of said registers of said computer system into global and local registers, said partitioning determination being made based on the relative utility of each of said registers to global register allocation and instruction scheduling; c.5) a second register allocator coupled to said first register allocator for allocating global registers to said instructions being generated for a second time using said registers of said computer system partitioned to be global registers; c.6) a second loop unroller coupled to said second register allocator for unrolling said loops; and c.7) a second scheduler coupled to said second unroller for scheduling said instructions being generated for a second time, allocating local registers using said registers of said computer system partitioned to be local registers.
Claim 18
Dependent Claim 85 words
The compiler as set forth in claim 13, wherein, a plurality of combinations of said instructions have equivalent combined single instructions; said improved code generator further comprises an instruction combiner coupled to said first register allocator for identifying said combinations of instructions that are not scheduled for parallel execution with other instructions, and replacing said identified combinations of instructions with their corresponding equivalent single instructions, said identification and replacement being performed before said determination of optimal number of times to unroll loops of said program.
Claim 19
Dependent Claim 94 words
The compiler as set forth in claim 13, wherein, said first and second register allocator being the same register allocator; said first and second scheduler being the same scheduler, said first scheduler being said same scheduler operating in a first mode, and said second scheduler being said same scheduler operating in a second mode; said first and second loop unroller being the same loop unroller, said first loop unroller being said same loop unroller operating in a first mode, and said second loop unroller being said same loop unroller operating in a second mode,
Claim 20
Dependent Claim 275 words
A computer system comprising: a) a plurality of registers; b) a plurality of pipelines for parallel and overlapping execution of instructions; c) a compiler for compiling a program, wherein instructions being generated for said program being compiled having said registers allocated to them, said compiler comprising an improved code generator for generating said instructions for said program, said improvement comprising, c.1) a first register allocator for allocating global registers to said instructions being generated for a first time using all registers of said computer system; c.2) a first scheduler coupled to said first register allocator for scheduling said instructions being generated for a first time, allocating local registers using a copy of all registers of said computer system; c.3) a first loop unroller coupled to said first register allocator for determining optimal number of times to unroll loops of said program; c.4) a partition determinator coupled to said first register allocator for determining optimal partitioning of said registers of said computer system into global and local registers, said partitioning determination being made based on the relative utility of each of said registers to global register allocation and instruction scheduling; c.5) a second register allocator coupled to said first register allocator for allocating global registers to said instructions being generated for a second time using said registers of said computer system partitioned to be global registers; c.6) a second loop unroller coupled to said second register allocator for unrolling said loops; and c.7) a second scheduler coupled to said second unroller for scheduling said instructions being generated for a second time, allocating local registers using said registers of said computer system partitioned to be local registers.
Claim 21
Dependent Claim 275 words
A computer system comprising: a) a plurality of registers; b) a plurality of pipelines for parallel and overlapping execution of instructions; c) a compiler for compiling a program, wherein instructions being generated for said program being compiled having said registers allocated to them, said compiler comprising an improved code generator for generating said instructions for said program, said improvement comprising, c.1) a first register allocator for allocating global registers to said instructions being generated for a first time using all registers of said computer system; c.2) a first scheduler coupled to said first register allocator for scheduling said instructions being generated for a first time, allocating local registers using a copy of all registers of said computer system; c.3) a first loop unroller coupled to said first register allocator for determining optimal number of times to unroll loops of said program; c.4) a partition determinator coupled to said first register allocator for determining optimal partitioning of said registers of said computer system into global and local registers, said partitioning determination being made based on the relative utility of each of said registers to global register allocation and instruction scheduling; c.5) a second register allocator coupled to said first register allocator for allocating global registers to said instructions being generated for a second time using said registers of said computer system partitioned to be global registers; c.6) a second loop unroller coupled to said second register allocator for unrolling said loops; and c.7) a second scheduler coupled to said second unroller for scheduling said instructions being generated for a second time, allocating local registers using said registers of said computer system partitioned to be local registers.
Claim 22
Dependent Claim 86 words
The computer system as set forth in claim 16, wherein, a plurality of combinations of said instructions have equivalent combined single instructions; said improved code generator further comprises an instruction combiner coupled to said first register allocator for identifying said combinations of instructions that are not scheduled for parallel execution with other instructions, and replacing said identified combinations of instructions with their corresponding equivalent single instructions, said identification and replacement being performed before said determination of optimal number of times to unroll loops of said program.
Claim 23
Dependent Claim 95 words
The computer system as set forth in claim 16, wherein, said first and second register allocator being the same register allocator; said first and second scheduler being the same scheduler, said first scheduler being said same scheduler operating in a first mode, and said second scheduler being said same scheduler operating in a second mode; said first and second loop unroller being the same loop unroller, said first loop unroller being said same loop unroller operating in a first mode, and said second loop unroller being said same loop unroller operating in a second mode.

References Cited (Backward Citations)

US4782444A Cited
US5261062A Cited

USPTO Annuity & Maintenance Windows

Annuity Stage Window Opens Payment Deadline Surcharge Period Until Estimated Fee Status
3.5 Years (Year 4) 1997-11-21 1998-05-23 1998-11-22 $2000.00 Window Closed / Lapsed
7.5 Years (Year 8) 2001-11-21 2002-05-23 2002-11-22 $3760.00 Window Closed / Lapsed
11.5 Years (Year 12) 2005-11-21 2006-05-23 2006-11-22 $7700.00 Window Closed / Lapsed

Assigned Categories & Tags

No categories assigned to this patent yet.

Assign Category Tag