Method and system for register allocation
Abstract
A method, system, and apparatus for inserting spill code optimized for a complex instruction set computing (CISC) two-address machine, such as a machine utilizing an 80x86 processor is described. The spill code is generated in a single pass. Copy propagation and dead-code elimination are performed to remove unnecessary loads and stores from the stack. Instructions contained within the code block are processed in reverse order. Temporary variables are not extended to the point that they may become spilled by a register allocation procedure. A store to a stack location is inserted if the stack location is not dead, saving the use of a register. Memory operands are substituted when possible in place of load and store instructions on CISC machines.
Interactive Citation Constellation Global Citation Ranking
Interactive SVG Citation Constellation renders in Rust/WebAssembly. Prior art cited: 2 · Forward citations: 9.
Claims (1 — 1 Independent, 0 Dependent)
- Claim 1Independent Claim
A method of inserting spill code to handle a set of spilled variables, the spilled variables being identified by a register allocation procedure, into a plurality of instructions generated by a compiler, the spill code adapted for a CISC machine having registers used when executing instructions, comprising: (a) processing each instruction in reverse order in the plurality of instructions by: (i) when a variable within the instruction is dead after the instruction: (1) generating a spill code load instruction for each spilled variable included in a set of spilled variables to be loaded, the set
Technical Overview & Description
Full multi-page specification text is archived at the issuing office. Read complete official specification ↗
Cited By — Indexed Forward Citations (9 of 9 total)
References Cited — Backward Prior Art (2)
Non-Patent Literature (5)
- Bergner, P. et al., "Spill Code Minimization Via Interference Region Spilling;"Proceedings of the SIGPLAN '97 Conference on Programming Language Design and Implementation, May 1997, pp. 287-295.
- Bernstein, D. et al., "Spill Code Minimization Techniques for Optimizing Compilers;" Proceedings of the SIGPLAN '89 Conference on Programming Language Design and Implementation, Jun. 1989, pp. 258-263.
- Briggs, P. et al., "Improvements to Graph Coloring Register Allocation;" ACM Transactions on Programming Languages and Systems 16:3 (May 1994), pp. 428-455.
- Briggs, P., "Register Allocation Via Graph Coloring;" PhD thesis, Rice University, Apr. 1992.
- Callahan, D. et al., "Register Allocation Via Hierarchical Graph Coloring;" Proceedings of the ACM SIGPLAN '91 Conference on Programming Language Design and Implementation, Jun. 1991, pp. 192-203.