×

Minimizing register spills by using register moves

  • US 9,009,692 B2
  • Filed: 12/26/2009
  • Issued: 04/14/2015
  • Est. Priority Date: 12/26/2009
  • Status: Active Grant
First Claim
Patent Images

1. A system comprising:

  • a compiler; and

    a memory;

    wherein the compiler comprises;

    first instructions configured to generate code from a computer program, wherein said generating the code comprises performing register allocation for a plurality of variables of the computer program, and wherein the register allocation results in a plurality of spilled variables; and

    second instructions configured to;

    determine that a period of use of at least two spilled variables is covered by a period of availability of an available register;

    determine a priority of each of the at least two spilled variables, wherein the priority is based at least in part on a number of cycles executed from a stack memory store instruction to a stack memory load instruction for a respective spilled variable;

    determine to store a first spilled variable in the available register responsive to determining the first spilled variable has a highest priority of the at least two spilled variables;

    wherein in response to the second instructions determining to store the first spilled variable in the available register, the first instructions are configured to modify the code to allocate the first spilled variable to the available register by replacing stack memory store and load instructions corresponding to the first spilled variable with inter-register-file move instructions.

View all claims
  • 1 Assignment
Timeline View
Assignment View
    ×
    ×