×

Eliminating store/restores within hot function prolog/epilogs using volatile registers

  • US 7,017,154 B2
  • Filed: 03/14/2002
  • Issued: 03/21/2006
  • Est. Priority Date: 03/23/2001
  • Status: Expired due to Fees
First Claim
Patent Images

1. 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 first function in the code, the first function including store and restore instructions with respect to one or more non-volatile registers and further including a call instruction to a second function, which second function is performed infrequently when the first function is run;

    identifying one or more volatile registers unused in the first function; and

    modifying the code so as to replace each reference in the first function to at least one of the non-volatile registers with a reference to a corresponding one of the identified volatile registers, and so as to eliminate at least one pair of the store and restore instructions in the first function with respect to the at least one of the non-volatile registers while storing the corresponding one of the identified volatile registers before the call instruction to the second function and restoring the corresponding one of the identified volatile registers after the call instruction to the second function, whereby a number of the store and restore instructions is reduced in the first function and increased in the second function.

View all claims
  • 0 Assignments
Timeline View
Assignment View
    ×
    ×