×

Resource assignment apparatus

  • US 5,684,994 A
  • Filed: 10/19/1994
  • Issued: 11/04/1997
  • Est. Priority Date: 10/20/1993
  • Status: Expired due to Term
First Claim
Patent Images

1. A resource assignment apparatus used by a compiler which compiles programs written in a high-level language into programs written in machine language for assigning assignments which are a pairing of variables and live ranges in a program to separate resource elements which make up resources, divided up according to function, such as registers and memory, according to a priority value of the assignment, comprising:

  • assignment storage means for storing the assignments in a program and their priority values;

    first resource element assigning means for taking an assignment with a highest priority value from the assignment storage means and assigning the assignment with the highest priority value to a resource element;

    assigning result storage means for storing assigning results;

    assignment retrieval means for retrieving from the assignment storage means an assignment which has a next highest priority value after a priority value of an assignment which has just been assigned;

    interfering assignment extraction means for extracting assignments whose live ranges interfere with a live range of the assignment retrieved by the assignment retrieval means;

    same resource remaining resource element determination means for determining whether there are any resource elements of resources which perform a same function as each of the resource elements to which the assignments extracted by the interfering assignment extraction means have been assigned by referring to the assigning result storage means;

    coherent assignment retrieval means for retrieving the assignments for which, by referring to the starting point and end point of the live range, a starting point is coincident with the end point of the assignment retrieved by the assignment retrieval means and assignments for which an end point is coincident with the starting point of the assignment retrieved by the assignment retrieval means;

    succession resource element determination means for determining the resource element to which the assignments retrieved by the coherent assignment retrieval means are assigned, by referring to the assigning result storage means;

    second resource element assigning meansfor assigning, when there is only one resource element determined by the same resource remaining element determination means, the assignment retrieved by the assignment retrieval means to the resource element,for assigning the assignment taken by the assignment retrieval means to any resource element which is the determination result of the same resource remaining resource element determination means and, moreover, the determination result of the succession resource element determination means, when there is a plurality of resource elements determined by the same resource remaining resource element determination means and a resource element determined by the succession resource element determination means exists,and for storing the assigning result in the assigning result storage means;

    control means for repeatedly having the assignment retrieval means activated, until all of the assignments have been assigned;

    profit value calculation means for calculating a profit value which shows how memory size and/or execution time are reduced for a machine language program after compiling if an assignment is assigned to one of the resource elements determined by the same resource remaining resource element determination means, for each of the resource elements determined by the same resource remaining resource element determination means;

    loss value calculation means for calculating a loss value which shows how memory size and/or execution time are increased for a machine language program after compiling if an assignment is assigned to one of the resource elements determined by the same resource remaining resource element determination means for each of the resource elements determined by the same resource remaining resource element determination means;

    secondary interfering assignment extraction means for retrieving assignments which have live ranges which interfere with the live ranges of the assignments retrieved by the coherent assignment retrieval means, but are not the retrieved results of the interfering assignment extraction means; and

    first loss occurring resource element determination means for determining to which resource elements the assignments which are the retrieval results of the secondary interfering assignment retrieval means are assigned, by referring to the assigning result storage means;

    wherein the loss value calculation means calculates loss values of the resource elements determined by the first loss occurring resource element determination means based on the priority values of the assignments determined by the coherent assignment determination means and, moreover, whose live range interferes with the live range of the assignment which is assigned to each of the resource elements, with the loss values of all of the resource elements aside from the resource element determined by the first loss occurring resource element determination means being set at 0.

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