Patent ID: 6086632
Filing Date: 2000-07-11
Classification: G06F

Abstract:
A compiling apparatus for use in a computer in which a location-assignment class of a register for storing the data to be used in each of a plurality of input operands contained in each of a plurality of intermediate texts created by converting a source program is limited according to a location of each input operand of each intermediate text such that each location corresponds to a particular assignment class, said compiling apparatus comprising:an intermediate text creating part designed and constructed to create a plurality of intermediate texts by converting a source program;a register assignment part operatively connected to said intermediate text creating part, and comprisinga register management table designed and constructed to store information regarding correspondence relations between data to be used in each input operand in each intermediate text and registers to be assigned to said data,an operand location relocating part operatively connected to said register management table and designed and constructed to determine if the location of each input operand in each intermediate text should be relocated, and to relocate such input operand locations if it is determined that they should be relocated, anda register selecting part operatively connected to said operand relocation relocating part and designed and constructed to assign a register to data to be used in each input operand in each intermediate text after the completion of the relocation by said operand location relocating part, add the information regarding said registers to said intermediate texts and at the same time store the information regarding correspondence relations between said data and said registers in said register management table; andan object program creating part operatively connected to said register assignment part and designed and constructed to create an object program based on a plurality of intermediate texts to which the information regarding the register is added by said register selecting part,wherein said operand location relocating part is designed and constructed to:read said plurality of intermediate texts in an execution sequence;determine whether there exists a register which is already assigned to the data to be used in any of a plurality of input operands in the intermediate texts which were read sequentially with reference to said register management table;determine whether said register can be used at the location of said input operand in said intermediate text when it is determined that said register which is already assigned to said data exists;determine whether an operation included in said intermediate text is a commutative operation from the group consisting of addition, multiplication, and inequality operations and whether said register can be used by relocating the locations of a plurality of input operands included in said intermediate text when it is determined that said register cannot be used at the location of said input operand; andrelocate the locations of those input operands when it is determined that said register can be used by relocating the locations of said plurality of input operands.