Generating compiled code that indicates register liveness
AssigneeInternational Business Machines Corporation
InventorsMichael K. Gschwind, Valentina Salapura
Life of this patent
Estimating the term…
Abstract
Object code is generated from an internal representation that includes a plurality of source operands. The generating includes performing for each source operand in the internal representation determining whether a last use has occurred for the source operand. The determining includes accessing a data flow graph to determine whether all uses of a live range have been emitted. If it is determined that a last use has occurred for the source operand, an architected resource associated with the source operand is marked for last-use indication. A last-use indication is then generated for the architected resource. Instructions and the last-use indications are emitted into the object code.
Claims9
A method for preserving register liveness status across function calls comprising:
- inserting, by a compiler executing on a computer, into a prologue of a callee function configured to be called from a caller function, a first instruction configured to store a copy of loaded liveness data to memory when executed, the stored liveness data identifying which registers of a processor are unused by the caller function upon entry to the callee function at runtime;
- and
- inserting, by the compiler, into an epilogue of the callee function, a second instruction configured to restore, from the memory, the stored liveness data as the loaded liveness data when executed.
A computer program product comprising a tangible computer-readable storage medium storing instructions which, when executed by a processor, perform a method for preserving register liveness status across function calls comprising:
- inserting, by a compiler executing on a computer, into a prologue of a callee function configured to be called from a caller function, a first instruction configured to store a copy of loaded liveness data to memory when executed, the stored liveness data identifying which registers of the processor are unused by the caller function upon entry to the callee function at runtime;
- and
- inserting, by the compiler, into an epilogue of the callee function, a second instruction configured to restore, from the memory, the stored liveness data as the loaded liveness data when executed.
A system comprising a processor and a memory storing instructions which, when executed by the processor, perform a method for preserving register liveness status across function calls comprising:
- inserting, by a compiler executing on a computer, into a prologue of a callee function configured to be called from a caller function, a first instruction configured to store a copy of loaded liveness data to memory when executed, the stored liveness data identifying which registers of the processor are unused by the caller function upon entry to the callee function at runtime;
- and
- inserting, by the compiler, into an epilogue of the callee function, a second instruction configured to restore, from the memory, the stored liveness data as the loaded liveness data when executed.
Dependencies are inferred from the claim text.