发明名称 Method and system for register allocation
摘要 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. As the instructions are being processed, the number of occurrences and location of a temporary variable associated with a spilled variable within the instructions is maintained. The number of occurrences of the temporary variable is checked before a load is inserted into the new instructions as well as before a temporary variable is removed from use. If the variable has only occurred once then the memory operand of the temporary is used in place of the load of the temporary variable saving a load instruction. If the temporary variable is about to be removed from use and the temporary variable has only occurred one time then the variable is not stored saving a store instruction within the spill code.
申请公布号 US2004226005(A1) 申请公布日期 2004.11.11
申请号 US20040864708 申请日期 2004.06.09
申请人 MICROSOFT CORPORATION 发明人 TARDITI DAVID R.
分类号 G06F9/45;(IPC1-7):G06F9/45 主分类号 G06F9/45
代理机构 代理人
主权项
地址