Patent ID: 6425124
Filing Date: 2002-07-23
Classification: G06F

Abstract:
A resource allocation device for use by a compiler, the resource allocation device for translating a high-level language program or an intermediate language program into a machine language of a target machine, the resource allocation device performing resource allocation by allocating variables of a number of operations included in a program portion of the program to resources such as registers and memories, the resource allocation device comprising:variable holding means for holding the variables included in the program portion; allocation pattern generation means for generating allocation patterns, each allocation pattern defining a different allocation of the variables to the resources; instruction sequence holding means for holding instruction sequences for different combinations of the operations and the resources, each instruction sequence corresponding to one of the operations and written in an assembly language and/or a macro language; instruction sequence extraction means for extracting from the instruction sequence holding means instruction sequences, a number of instruction sequences equal to the number of operations being extracted for each allocation pattern, the instruction sequence extracting means generating, for each allocation pattern, a program which corresponds to the program portion and which comprises extracted instruction sequences; a cost table for holding both the extracted instruction sequences and a corresponding cost for each extracted instruction sequence, each cost representing a number of execution clock cycles required for execution of the corresponding extracted instruction sequence; cost detection means for detecting, from the cost table, the cost of each extracted instruction sequence; total cost computation means for computing a total cost of each allocation pattern by adding the costs of the number of extracted instruction sequences for the allocation pattern; and best pattern determining means for determining an allocation pattern with a lowest cost by referring to the total cost of each allocation pattern, the resource allocation thereby being performed in accordance with the determined allocation pattern.