Eliminating cold register store/restores within hot function prolog/epilogs
AssigneeInternational Business Machines Corporation
InventorsGad Haber, Moshe Klausner, Vadim Eisenberg
Life of this patent
Estimating the term…
Abstract
A post-link optimization method for removing non-volatile register store/restore instructions from a hot function prolog/epilog, when the non-volatile register is referenced only in cold sections of code within the hot function. The method requires that the hot function be disassembled, but does not require the full control flow graph.
Claims36
A computer-implemented method for code optimization, comprising:
- disassembling object code that has been compiled and linked;
- analyzing the disassembled code so as to identify a function in the code, the function including store and restore instructions with respect to a non-volatile register that is referenced in a section of the function, which section is executed infrequently when the function is run;
- and
- modifying the code so that the section of the function references a substitute location, instead of the non-volatile register, and so as to eliminate a pair of the store and restore instructions with respect to the non-volatile register.
An apparatus for code optimization, comprising a code processor, which is arranged to disassemble object code that has been compiled and linked, and to analyze the disassembled code so as to identify a function in the disassembled code, the function including store and restore instructions with respect to a non-volatile register that is referenced in a section of the function, which section is executed infrequently when the function is run, and which is further arranged to modify the code so that the section of the function references a substitute location, instead of the non-volatile register, and so as to eliminate a pair of the store and restore instructions with respect to the non-volatile register.
A computer software product, comprising a computer-readable medium in which software is stored, which software, when read by a computer, causes the computer to disassemble object code that has been compiled and linked, and to analyze the disassembled code so as to identify a function in the disassembled code, the function including store and restore instructions with respect to a non-volatile register that is referenced in a section of the function, which section is executed infrequently when the function is run, and to modify the code so that the section of the function references a substitute location, instead of the non-volatile register, and so as to eliminate a pair of the store and restore instructions with respect to the non-volatile register.
Dependencies are inferred from the claim text.