WO2011018974A1 - データ処理装置、データ処理方法、プログラム変換処理装置およびプログラム変換処理方法、プログラム変換処理装置、データ処理装置、プログラム変換処理方法およびデータ処理方法、データ処理装置、データ処理方法、プログラム解析処理装置およびプログラム解析処理方法、データ処理装置、履歴保存装置、データ処理方法およびプログラム、並びに、コンパイル処理装置、データ処理装置、コンパイル処理方法およびプログラム - Google Patents

データ処理装置、データ処理方法、プログラム変換処理装置およびプログラム変換処理方法、プログラム変換処理装置、データ処理装置、プログラム変換処理方法およびデータ処理方法、データ処理装置、データ処理方法、プログラム解析処理装置およびプログラム解析処理方法、データ処理装置、履歴保存装置、データ処理方法およびプログラム、並びに、コンパイル処理装置、データ処理装置、コンパイル処理方法およびプログラム Download PDF

Info

Publication number
WO2011018974A1
WO2011018974A1 PCT/JP2010/063246 JP2010063246W WO2011018974A1 WO 2011018974 A1 WO2011018974 A1 WO 2011018974A1 JP 2010063246 W JP2010063246 W JP 2010063246W WO 2011018974 A1 WO2011018974 A1 WO 2011018974A1
Authority
WO
WIPO (PCT)
Prior art keywords
execution
instruction
reuse
history
section
Prior art date
Application number
PCT/JP2010/063246
Other languages
English (en)
French (fr)
Inventor
元史 柏谷
睦弘 大森
クルニアワン ワリー
Original Assignee
ソニー株式会社
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Priority claimed from JP2009187623A external-priority patent/JP2011039857A/ja
Priority claimed from JP2009187622A external-priority patent/JP2011039856A/ja
Priority claimed from JP2009187625A external-priority patent/JP2011039859A/ja
Priority claimed from JP2009187624A external-priority patent/JP2011039858A/ja
Priority claimed from JP2009251586A external-priority patent/JP2011096153A/ja
Application filed by ソニー株式会社 filed Critical ソニー株式会社
Priority to EP10808157A priority Critical patent/EP2466453A1/en
Priority to CN2010800349313A priority patent/CN102667715A/zh
Priority to US13/389,134 priority patent/US20120185859A1/en
Publication of WO2011018974A1 publication Critical patent/WO2011018974A1/ja

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/30Arrangements for executing machine instructions, e.g. instruction decode
    • G06F9/38Concurrent instruction execution, e.g. pipeline, look ahead
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/30Arrangements for executing machine instructions, e.g. instruction decode
    • G06F9/38Concurrent instruction execution, e.g. pipeline, look ahead
    • G06F9/3824Operand accessing
    • G06F9/383Operand prefetching
    • G06F9/3832Value prediction for operands; operand history buffers
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/30Arrangements for executing machine instructions, e.g. instruction decode
    • G06F9/30003Arrangements for executing specific machine instructions
    • G06F9/30076Arrangements for executing specific machine instructions to perform miscellaneous control operations, e.g. NOP
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/30Arrangements for executing machine instructions, e.g. instruction decode
    • G06F9/32Address formation of the next instruction, e.g. by incrementing the instruction counter
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/30Arrangements for executing machine instructions, e.g. instruction decode
    • G06F9/38Concurrent instruction execution, e.g. pipeline, look ahead
    • G06F9/3802Instruction prefetching
    • G06F9/3808Instruction prefetching for instruction reuse, e.g. trace cache, branch target cache
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/30Arrangements for executing machine instructions, e.g. instruction decode
    • G06F9/38Concurrent instruction execution, e.g. pipeline, look ahead
    • G06F9/3802Instruction prefetching
    • G06F9/3808Instruction prefetching for instruction reuse, e.g. trace cache, branch target cache
    • G06F9/381Loop buffering

Definitions

  • the present invention relates to a data processing apparatus, and in particular, a data processing apparatus that reuses an execution result of an instruction section that is executed a plurality of times, a processing method thereof, a data conversion processing apparatus that converts a program corresponding to the data processing apparatus, and It relates to the processing method.
  • the present invention also relates to a program conversion processing device, and more particularly to a program conversion processing device, a data processing device, and a processing method for converting a call instruction in an instruction section in which an execution result is reused into a reuse instruction.
  • the present invention relates to a data processing device, and in particular, a data processing device that reuses an execution result of an instruction section that is executed a plurality of times, a processing method thereof, and a data conversion process that converts the program into a program corresponding to the data processing device
  • the present invention relates to an apparatus and a processing method thereof.
  • the present invention also relates to a data processing device, and more particularly, to a data processing device that executes an instruction section in which an execution result is reused, a history storage device, a processing method therefor, and a program that causes a computer to execute the method.
  • the present invention relates to a compile processing apparatus, and in particular, a compile processing apparatus, a data processing apparatus, and a compile process for identifying an instruction section in which an execution result is reused using a hash value generated by a hash function. It relates to a method and a program.
  • an instruction interval in which an execution result of an instruction interval executed in the past among the instruction intervals executed a plurality of times can be reused is referred to as a reuse interval.
  • a device for generating a cache index used as an index at the time of retrieval using a hash function has been proposed (for example, non-reuse) (See Patent Document 1).
  • the interval reuse device that generates a cache index using this hash function calculates a hash value that is a cache index by using two input values of the Ackerman function as inputs of the hash function. Then, the section reuse device stores the execution result of the Ackermann function based on the generated cache index, and searches the execution result using the generated cache index as an index when searching the execution result.
  • the search may take time because the bit length of the hash value (cache index) is unnecessarily long with respect to the number of execution results to be held. If this search takes time, in such a section reuse device, the efficiency of value reuse is reduced.
  • This invention is made in view of such a situation, and it aims at further shortening the processing time of the reuse area by reuse of an execution result.
  • the present invention has been made in view of such a situation, and an object thereof is to improve the efficiency of value reuse.
  • the present invention has been made in view of such a situation.
  • value reuse (memoization)
  • the value reuse is saved by saving the execution result from the memory for saving the execution result.
  • the goal is to improve efficiency.
  • the present invention has been made in view of such a situation, and when performing value reuse (memoization), by shortening the bit length of data to be held in a memory for storing execution results,
  • the purpose is to improve the efficiency of value reuse.
  • the first aspect of the present invention has been made to solve the above-described problem.
  • the first aspect of the present invention executes processing based on an instruction sequence including a reuse section that is an instruction section that is executed a plurality of times.
  • An execution unit a history memory that associates an input value and an execution result in the reuse section for each piece of identification information for identifying the reuse section, and holds an execution history, and notifies the execution of the process in the reuse section
  • An execution history search that acquires an input value of the reuse section based on a notice command and retrieves the execution result in the execution history based on the acquired input value and the identification information specified by the notice command And when the execution result is extracted by the execution history search unit when the process in the reuse section identified by the notice instruction is executed, the extraction is performed.
  • the execution result is a data processing apparatus and a processing method comprising an execution result output section for outputting to the execution unit.
  • the execution history search unit obtains an input value of the reuse section in an instruction group from the notice instruction to an instruction immediately before a call instruction for calling a head address of the reuse section.
  • An input value may be acquired based on an input value setting command for setting.
  • the execution history search unit has an effect that the data set by the input value setting command following the notice command is acquired as the input value of the reuse section.
  • the execution history search unit may search the execution result in the execution history based on the acquired input value and the identification information included in the notice command. Good. As a result, the execution history search unit causes the execution result in the history memory to be searched using the identification information included in the notice command and the input value acquired based on the notice command.
  • the history memory associates an input value and an execution result in the reuse section for each head address of the reuse section that is the identification information, and holds the execution history as the execution history.
  • the section outputs the head address to the execution history search section based on the notice command including reference information for referring to the head address, and the execution history search section outputs the identification information from the execution section as the identification information.
  • the execution result in the execution history may be searched based on the head address and the input value of the reuse section.
  • the start address of the reuse section is output from the execution unit based on the reference information included in the notice command, and the start address of the reuse section output from the execution unit and the input acquired based on the notice command
  • the value is used to search the execution result in the history memory.
  • the notice command is a notice setting command for setting the start address of the reuse section, which is the identification information
  • the history memory is provided for each start address of the reuse section.
  • the execution value is stored as the execution history in association with the input value and the execution result in the reuse section, and the execution unit determines the start address based on the notice setting instruction including the setting information indicating the setting destination of the start address. Is set as the setting destination, and the execution history search unit acquires the input value of the reuse section based on the advance notice setting command, and the acquired input value and the start address set by the execution unit Based on the above, the execution result in the execution history may be searched. As a result, the execution history search unit obtains the execution history in the history memory based on the start address set by the notice setting command for setting the start address of the reuse section and the input value acquired based on the notice setting instruction. It brings about the effect of making it search.
  • the history memory associates the priority when deleting the execution history with the input value and the execution result in the reuse section corresponding to the priority, as the execution history.
  • the execution history search unit may delete the execution history in the history memory based on the priority included in the notice command. As a result, the execution history search unit deletes the execution history in the history memory based on the priority assigned to each execution history.
  • the execution unit performs processing in the reuse section identified by the notice instruction when the execution result in the execution history is not extracted from the history memory by the execution history search unit.
  • the execution history search unit may cause the history memory to hold the input value acquired based on the notice command, the execution result executed by the execution unit, and the identification information. .
  • the execution history search unit obtains the input value acquired based on the notice command, the execution result executed based on the input value, and the identification information. This brings about the effect that it is retained in the history memory.
  • the history memory associates an input value and an execution result in the function for each identification information for identifying the function that is the reuse section, and holds the execution history as the execution history.
  • the execution history search unit acquires an input value of the function based on a notice command for notifying execution of the function, and executes the execution based on the acquired input value and the identification information specified by the notice command.
  • the execution result in the history is searched, and the execution result output unit extracts the execution result if the execution result is extracted by the execution history search unit when the function identified by the notice instruction is executed.
  • the execution result may be output to the execution unit.
  • the execution history search unit acquires the input value of the function based on the advance notice for notifying the execution of the function, and uses these obtained input values and the identification information specified by the advance instruction.
  • the execution result associated with the parameter is extracted from the history memory, and when the function is executed, the execution result unit causes the execution unit to output the extracted execution result.
  • the reusability indicating the degree to which the execution results of the instruction sections executed a plurality of times in the program coincide with each other is determined for each instruction section based on the usage state of the instruction section. And the input value in the reuse section immediately before the input value setting instruction for setting the input value in the reuse section selected based on the reuse degree among the plurality of instruction sections.
  • a program conversion processing apparatus and a processing method thereof including a notice command generating unit for generating a notice command for notifying the setting of the information.
  • the reuse level generation unit generates a reuse level for each command section based on the usage mode of the instruction section, and the input value setting command in the reuse section selected based on the generated reuse level.
  • the notice command generation unit generates a notice command for notifying the execution of the reuse section.
  • the notice command generation unit generates the notice command including identification information for identifying the plurality of reuse sections selected based on the degree of reuse. Also good. As a result, the notice command generation unit generates a notice command including identification information for identifying a plurality of reuse sections selected based on the degree of reuse.
  • the notice command generation unit generates the notice command including reference information for referring to the start address after an address setting instruction for setting the start address of the reuse section. You may make it do.
  • the notification command generating unit After the address setting command, the notification command generating unit generates a notification command including reference information for referring to the head address of the reuse section set by the address setting command.
  • the notice command generation unit outputs the notice command as an address setting instruction including setting information indicating a setting destination of the start address in order to set a start address of the reuse section. You may make it produce
  • the notice command generation unit may generate the notice command including a priority given in accordance with the reuse degree generated by the reuse degree generation unit. Good. As a result, the notice command generation unit generates a notice command including a priority for deleting the execution history of the history memory.
  • the second aspect of the present invention has been made in order to solve the above-described problems.
  • the first aspect of the present invention is that an analysis unit for analyzing a usage state of an instruction section in a program and an execution result of the instruction section are used again.
  • a reuse degree generation unit that generates a reuse degree indicating a degree of being generated based on the result of the analysis, and an instruction conversion unit that converts a call instruction in the instruction section into a reuse instruction based on the reuse degree.
  • a program conversion processing device and a program conversion processing method This brings about the effect that the calling instruction in the instruction section is converted into the reuse instruction based on the reuse degree indicating the degree of reuse of the execution result.
  • the analysis unit analyzes the number of input values in the command section as the usage mode, and the reuse level generation unit calculates the reuse level based on the analysis result. You may make it produce
  • the analysis unit analyzes a combination of values that can be taken by the input value of the instruction section as the usage mode
  • the reuse level generation unit is configured to perform the above-described analysis based on the result of the analysis.
  • the degree of reuse may be generated. This brings about the effect that the degree of reuse is generated based on the combination of values that can be taken by the input values in the command section.
  • the analysis unit analyzes the number of times the instruction section is called as the usage mode, and the reuse level generation unit generates the reuse level based on the analysis result. You may make it do. This brings about the effect that the degree of reuse is generated based on the number of times the instruction section is called.
  • the instruction section is a function
  • the analysis unit analyzes the input value of the function and the number of times it is called as the usage mode
  • the reuse degree generation unit is a result of the analysis.
  • the reuse degree may be generated based on the above. This brings about the effect that the degree of reuse is generated based on the input value of the function and the number of times it is called.
  • the instruction section is a loop
  • the analysis unit analyzes the input value of the loop and the number of calls as the usage mode
  • the reuse degree generation unit is a result of the analysis.
  • the reuse degree may be generated based on the above. This brings about the effect that the degree of reuse is generated based on the input value of the loop and the number of times it is called.
  • the analysis unit analyzes whether the input value of the instruction interval is accompanied by memory access as the usage mode
  • the reuse degree generation unit is configured to analyze the instruction interval of the instruction interval.
  • the degree of reuse indicating the degree lower than that when the input value without memory access is used may be generated. This brings about the effect that a low reuse degree is generated for an instruction section having an input value accompanied by memory access.
  • the instruction conversion unit includes an execution history data amount that is data for holding the reuse degree and the execution result of the instruction section, and a history memory that holds the execution history.
  • the call instruction is converted into the reuse instruction in order from the instruction section having the highest degree of reuse so that the total amount of the data in the instruction section is within the capacity of the history memory. You may do it.
  • the call instruction is converted into the reuse instruction in order from the instruction section having the highest reuse degree so that the total amount of data of the execution history is within the capacity of the history memory.
  • the first aspect further includes a priority generation unit that generates a priority when the execution history is held in the history memory based on the reuse degree, and the instruction conversion unit includes The calling instruction in the instruction section may be converted into the reuse instruction including the priority. This brings about the effect that the calling instruction in the instruction section for reusing the execution result is converted into the reusing instruction including the priority.
  • the second aspect of the present invention executes processing in the reuse section that is called by a reuse instruction that specifies a reuse section in which an execution result is reused among a plurality of instruction sections.
  • Data processing apparatus and data processing comprising: an execution unit that outputs section identification information of a section, an input value of the reuse section, and an execution result of the reuse section as an execution history; and a history memory that holds the execution history Is the method. This brings about the effect that the execution history of the reuse section called by the reuse instruction is retained.
  • the execution unit may be configured to use the reuse section called by the reuse instruction that designates an instruction section extracted based on the degree of reuse of the plurality of instruction sections. Processing may be executed and the execution history may be output. This brings about the effect of outputting the execution history of the reuse section determined based on the degree of reuse of the execution result.
  • the reuse interval is a function
  • the execution unit includes the interval information, the input value of the reuse interval, the start address of the function as the execution result of the reuse interval, and the input value of the function. You may make it output the execution result of the said function. This brings about the effect that the start address, input value, and execution result of the function are output.
  • the reuse interval is a loop
  • the execution unit includes the interval information, the input value of the reuse interval, the start address of the loop as the execution result of the reuse interval, and the input value of the loop.
  • the execution result of the loop may be output. As a result, the start address of the loop, the input, and the execution result are output.
  • a history search unit that outputs the execution result is further provided. You may make it comprise. Thereby, when the execution result is searched in the history memory, the execution result is output.
  • a priority table that holds a priority indicating the order in which the execution result is reused and an address of the execution history in the history memory as priority information, and the priority table From the lowest priority history search unit that searches for the priority information having the lowest priority as erasure candidate information, and the erasure candidate information when the execution unit is to hold a new execution history in the history memory.
  • a priority comparison unit that compares the priority of the new execution history with the priority of the new execution history, and the deletion candidate when the priority of the deletion candidate information is lower than the priority of the new execution history
  • An erasing unit that erases the execution history from the history memory based on the address of the information may be further provided.
  • the apparatus further comprises a history memory management unit that manages the free space of the history memory, and the priority comparison unit is configured so that the data amount of the new execution history is larger than the free space of the history memory.
  • the priority of the deletion candidate information may be compared with the priority of the new execution history. This brings about an effect of comparing the priorities when the data amount of the new execution history is larger than the free capacity of the history memory.
  • the third aspect of the present invention has been made to solve the above-described problem.
  • the first aspect of the present invention is to execute a process based on an instruction sequence including a plurality of instruction sections and to call the instruction sections.
  • An input value setting instruction address that holds an input value setting instruction address, which is an address of an input value setting instruction for setting an input value in the instruction section before each call instruction is executed, for each section identification information in the instruction section
  • a table a history memory for associating an input value and an execution result in the instruction section for each section identification information and holding as an execution history, and from the input value setting instruction to the calling instruction specified by the input value setting instruction address
  • the execution history search unit that searches the execution result in the execution history using information, and the execution history search unit executes the execution result when the call instruction specified by the input value setting instruction address is executed.
  • a data processing apparatus and a processing method therefor comprising: an execution result output unit that outputs the extracted execution result to the execution unit when extracted.
  • the input value setting instruction address table is configured to set the input value setting instruction for setting an input value of a reuse section which is an instruction section executed a plurality of times among the plurality of instruction sections.
  • the input value setting instruction address of each of the reuse sections is held for each section identification information, and the execution history search unit is configured to execute the execution unit based on the input value setting instruction in the instruction group in the reuse section.
  • the execution result in the reuse section is searched using the input value output from the section and the section identification information corresponding to the input value setting instruction address, and the execution result output section uses the input value setting instruction address.
  • the execution history search unit extracts the execution result of the reuse section in the execution history.
  • the execution result of the extracted may be output to the execution unit if it is.
  • the input value acquired by the input value setting instruction specified by the input value setting instruction address and the input value setting instruction before execution of the calling instruction of the reuse section that is an instruction section that is executed a plurality of times When the execution result in the history memory is searched using the section identification information corresponding to the address, and the calling instruction of the reuse section specified by the input value setting instruction address is executed, the execution result is obtained by the execution history search unit. When extracted, the execution result is output to the execution unit.
  • the input value setting instruction address corresponding to the input value referred to in the instruction section called by the calling instruction among the input values set based on the input value setting instruction; You may make it further comprise the input value setting command address output part which outputs the said area identification information to the said input value setting command address table.
  • the input value setting instruction address output unit sets the input value referenced by the instruction section of the calling instruction among the input values set by the input value setting instruction before the calling instruction.
  • the input value setting command address and the section identification information are output.
  • the input value setting instruction address output unit outputs the input value setting instruction address of the first input value setting instruction among the input value setting instructions corresponding to the plurality of input values referred to in the instruction section.
  • the start address of the command section which is the section identification information
  • the input value setting instruction address of the earliest input value setting instruction and its instruction among the input value setting instructions for setting a plurality of input values referenced in the instruction section of the function by the input value setting instruction address output unit This produces the effect of outputting the start address of the section.
  • the input value setting command address table includes the input value setting command of the earliest input value setting command among the input value setting commands for setting a plurality of input values in the command section. An instruction address may be held for each section identification information. Thereby, the input value setting command address table holds the input value setting command address of the input value setting command executed first among the plurality of input value setting commands in the command interval for each section identification information. Bring.
  • the execution unit may determine the instruction section specified by the input value setting instruction address when the execution history search unit does not extract the execution result in the execution history from the history memory.
  • the execution history search unit corresponds to the input value output from the execution unit based on the input value setting command, the execution result executed by the execution unit, and the input value setting command address.
  • the section identification information may be held in the history memory.
  • the input value setting instruction address table includes the input value setting instruction address of the input value setting instruction of the function that is the instruction section for each head address of the function that is the section identification information.
  • the history memory associates an input value and an execution result in the function for each head address of the function and holds the execution history as the execution history, and the execution history search unit stores the input value in the instruction group.
  • the execution result is searched using the input value of the function output from the execution unit based on the setting instruction and the start address of the function corresponding to the input value setting instruction address.
  • the execution history search unit executes the function Serial execution result of the extracted may be output to the execution unit when the execution result is extracted.
  • the execution result is extracted by the execution history search unit when the call instruction specified by the input value setting instruction address is executed, the execution result of the function in the history memory is searched using The execution result is output to the execution unit.
  • the second aspect of the present invention provides a degree of reuse indicating the degree to which the input values for each execution of processing in an instruction section executed a plurality of times in the program match each other based on the usage state of the instruction section.
  • An input value setting instruction for setting an input value in a reuse section extracted based on the reuse degree among the plurality of instruction sections, and a reuse degree generation unit that generates each instruction section A program analysis processing apparatus and a processing method therefor including a reuse section information generation unit that generates reuse section information in which an address and section identification information for identifying the reuse section are associated with each other.
  • the reuse section is extracted from the plurality of instruction sections, and the reuse section information generation unit There is an effect of generating reuse section information in which the input value setting instruction address of the input value setting instruction in the reuse section is associated with the section identification information of the reuse section.
  • the fourth aspect of the present invention has been made to solve the above-mentioned problems.
  • the first aspect of the present invention is that an execution unit that executes an instruction interval and outputs an execution result;
  • the section identification information, the input value, and the execution result of the reuse section to be used again are stored as an execution history. When the stored execution result is used again, the section identification information and the input value are used.
  • the save history is supplied to the save history holding unit based on the execution history of the repeated reuse section, and the execution history that is the basis of the save history is supplied from the history memory when the save history is supplied.
  • the execution result of the repeated reuse section in which the execution of the reuse section is repeated is saved from the history memory to the save history holding unit.
  • the history control unit holds the save history when the data amount of the new execution history to be held in the history memory is larger than the free capacity of the history memory. You may make it supply to a part. As a result, when the data amount of the execution history is larger than the free space of the history memory, the execution result of the repeated reuse section is saved from the history memory to the save history holding unit.
  • a history restoration unit that restores the execution history to the history memory based on the save history and the representative history, and the restoration that is restored based on the section identification information and the input value
  • a history search unit that outputs the execution result based on the restored execution history may be further provided. This brings about the effect that the execution result is reused using the execution history restored based on the save history and the representative history.
  • the history search unit causes the restoration unit to start restoring the execution history. It may be.
  • the restoring unit restores the execution history of the repeated reuse section.
  • the history control unit generates the representative history further including a save count indicating the number of the save histories
  • the history restoration unit adds information indicating the save history in the representative history and the save count. Based on this, the execution history may be restored by extracting the save history from the save history holding unit.
  • the save history is extracted from the save history holding unit based on the information indicating the save history in the representative history and the save count.
  • the execution unit when the execution unit supplies the execution result of the reuse section, the execution history of the repeated reuse section, the execution history other than the repeated reuse section, and the An identifier for identifying a representative history is further output, the history memory further holds the identifier as the execution history, and the history control unit is configured to execute the identification based on the execution history identified using the identifier.
  • the save history may be supplied, and the representative history further including the identifier may be generated. This brings about the effect of identifying the execution history using the identifier.
  • the repetitive reuse section may be a subroutine, and the execution unit may output the start address of the subroutine as the section identification information. This brings about the effect that the start address of the subroutine is output as section identification information.
  • the repeated reuse section may be a loop, and the execution unit may output the start address of the loop as the section identification information. This brings about the effect that the start address of the loop is output as the section identification information.
  • the execution unit when the execution unit outputs the execution result of the iterative reuse section, the execution unit further outputs a counter value indicating the execution result of the number of executions.
  • the counter value may be further held as the execution history, and the history control unit may output the save history including the counter value. As a result, the execution history and the saving history including the counter value are retained.
  • the section identification information, the input value, and the execution result of the reuse section in which the execution result is reused are held as an execution history, and the held execution result is used again.
  • the history memory for searching for the execution history based on the section identification information and the input value, and the execution result of each iteration of the reuse section in which the execution is repeated among the reuse sections as the save history A representative history including information indicating the save history is saved in the history memory by saving the history from the history memory to an external storage unit, erasing the execution history that is the basis of the save history at the time of the save, and the history memory.
  • the fifth aspect of the present invention has been made to solve the above-mentioned problems.
  • the first aspect of the present invention is to analyze the usage of a plurality of instruction sections in a program and use the execution result again among the instruction sections.
  • a candidate value generation unit that generates a candidate value that is a candidate for the section identification value from the start address in association with the candidate function, and the candidate that is generated by the candidate value generation unit
  • a candidate value table that holds values as candidate value lists for each of the associated candidate functions, and the candidate value list in which the candidate values are all different from each other.
  • a section identification value generation function output unit that outputs the associated candidate function of the candidate value list selected based on the bit width of the candidate value in the candidate value list as the section identification value generation function, and the section identification value
  • a compile processing apparatus and a processing method thereof including a machine language program generation unit that generates a machine language program in which a generation function is embedded based on the analyzed program and the section identification value generation function, and executes the method on a computer It is a program to let you. As a result, the section identification value generation function selected from the candidate functions is embedded in the program.
  • the candidate function is a hash function
  • the section identification value generation function output unit is selected based on the bit width of the candidate value in the extracted candidate value list.
  • the hash function associated with the candidate value list may be output as the section identification value generation function.
  • the hash function is a hash function in which a value in a predetermined number of bits from the least significant bit of the start address is used as the candidate value
  • the section identification value generation function output unit outputs the extracted candidate
  • the hash function associated with the candidate value list selected based on the bit width of the candidate value in the value list may be output as the section identification value generation function.
  • the program is embedded with a hash function for calculating a value in a predetermined number of bits from the least significant bit as a hash value.
  • the section identification value generation function output unit outputs the associated candidate function of the candidate value list having the narrowest bit width in the extracted candidate value list as the section. You may make it output as an identification value generation function. As a result, the candidate function that generates the candidate value having the narrowest bit width among the candidate functions that generate candidate values that are all different from each other is output as the section identification value generation function.
  • the section identification value generation function output unit outputs an identifier for identifying the section identification value generation function as the section identification value generation function
  • the machine language program generation unit includes: A machine language program in which the identifier is embedded may be generated. As a result, the program in which the identifier for identifying the section identification value generation function is embedded is generated.
  • the second aspect of the present invention includes an execution unit that executes a plurality of instruction sections and outputs execution results, and a bit width of a start address of a reuse section in which execution results are reused among the instruction sections.
  • a history memory for holding a section identification value for identifying the reuse section with a narrow bit width value, an input value of the reuse section, and an execution result of the reuse section as an execution history, the section identification value, and
  • the data processing apparatus includes a history search unit that searches the history memory for the execution history based on the input value, and outputs the execution result when the execution history is searched. As a result, the section identification value, the input value, and the execution result are stored in the history memory as an execution history.
  • the section identification value generation function for generating the section identification value is used to generate the section identification value.
  • a section identification value generation unit configured to generate the section identification value from a start address; the execution unit supplies the section identification value generation function to the section identification value generation unit; and the history memory includes the section identification value.
  • the section identification value, the input value, and the execution result generated by the value generation section are stored as the execution history, and the history search section is configured to store the section identification value and the input value from the history memory based on the section identification value and the input value.
  • the execution history may be searched, and when the execution history is searched, the execution result may be output.
  • the section identification value generated from the start address by the section identification value generation unit, the input value supplied from the execution unit, and the execution result are retained in the history memory as an execution history.
  • the execution unit supplies the section identification value generation function to the section identification value generation unit, and the section identification value generation unit performs the start address when the execution unit executes the reuse section. Is output, the section identification value may be generated from the start address using the section identification value generation function supplied from the execution unit.
  • the section identification value is generated from the start address using the section identification value generation function supplied from the execution unit.
  • the execution unit supplies an identifier for identifying the section identification value generation function to the section identification value generation unit, and the section identification value generation unit is a candidate function that is a candidate for the section identification value generation function.
  • the section identification value generation function is selected based on the identifier, and when the execution unit outputs the start address when the reuse section is executed, the section identification value generation function is used to select the section identification value generation function.
  • the section identification value may be generated from the start address.
  • the section identification value generation function is selected from the candidate functions based on the identification value supplied from the execution unit, and the section identification value is generated from the start address using the selected section identification value.
  • the execution unit supplies the section identification value to the history memory when the reuse section is executed by an instruction including the section identification value.
  • the section identification value, the input value, and the execution result are held as the execution history, and the history search unit searches the execution history from the history memory based on the section identification value and the input value, When the execution history is searched, the execution result may be output.
  • the section identification value, the input value, and the execution result supplied from the execution unit are stored in the history memory as an execution history.
  • an analysis unit for analyzing a usage state of a plurality of instruction sections in a program and determining a reuse section in which an execution result is reused among the instruction sections, and the reuse section.
  • a section identification value output unit that outputs the candidate value as the section identification value
  • a command conversion unit that converts a command for calling the reuse section into a command with a section identification value including the section identification value
  • the reuse And a machine language program generator that generates a machine language program whose section is called by the section identification value-added instruction based on a source program including the section identification value-added instruction.
  • the candidate value generation unit generates the candidate value by using the candidate function having an input value that is a number assigned according to a predetermined order of the start address. Also good. This brings about the effect that the candidate value is generated from the number assigned according to the predetermined order of the start address.
  • the candidate value generation unit may generate the candidate value by using the candidate function having the start address as an input value. This brings about the effect
  • an execution unit that executes a plurality of instruction sections and outputs an execution result
  • the reuse section is defined by a bit width value smaller than a bit width of a start address of the reuse section.
  • a candidate that is generated from the start address by associating a candidate value that is a candidate for the section identification value with the candidate function by using a candidate function that is a candidate for the section identification value generation function for generating the section identification value to be identified A candidate value table that holds the candidate value generated by the value generation unit, the candidate value generation unit as a candidate value list for each of the associated candidate functions, and the candidate value list in which the candidate values are all different from each other Then, the associated candidate function of the candidate value list selected based on the bit width of the candidate value in the extracted candidate value list is defined as a section identification value generation function.
  • the section identification value generation function is used to start the section from the start address.
  • a section identification value generation unit that generates an identification value, a history memory that holds the section identification value, the input value, and the execution result of the reuse section as an execution history, and the above-described section based on the section identification value and the input value
  • the data processing device includes a history search unit that searches the execution history from the history memory and outputs the execution result when the execution history is searched. Accordingly, the section identification value is generated from the start address using the section identification value generation function output from the section identification value generation function output unit, and the generated section identification value, the input value supplied from the execution unit, and the execution The result is stored in the history memory as an execution history.
  • the processing time in the reuse section due to the reuse of the execution result can be further shortened.
  • the third aspect of the present invention it is possible to achieve an excellent effect that the processing time of the reuse section due to the reuse of the execution result can be shortened.
  • the efficiency of value reuse can be improved by saving the execution result from the memory that stores the execution result.
  • the effects can be achieved.
  • the fifth aspect of the present invention has been made in view of such a situation.
  • value reuse (memoization)
  • the bit length of data held in a memory for storing execution results is shortened.
  • the aim is to improve the efficiency of value reuse.
  • step S940 It is a flowchart which shows an example of the process sequence of the warning command process (step S940) about the warning command containing the identification information in the 4th Embodiment of this invention. It is a flowchart which shows an example of the process sequence of the warning command process (step S950) about the warning command containing the reference information in the 4th Embodiment of this invention. It is a flowchart which shows an example of the process sequence of the notification command process (step S960) about the notification setting command in the 4th Embodiment of this invention. It is a block diagram which shows the structural example of the compile processing apparatus 1500 in the 1st Embodiment of this invention.
  • the schematic diagram which shows the example of the production
  • FIG. 16 It is a schematic diagram which shows the example of the production
  • the schematic diagram which shows the example of the production
  • FIG. 5 is a conceptual diagram illustrating an example of a function call instruction and a function reuse instruction in the first embodiment of the invention. It is a flowchart which shows the process sequence of the compile process by the compile processing apparatus 1500 in the 1st Embodiment of this invention. It is a block diagram which shows the structural example of the data processor 1100 in the 2nd Embodiment of this invention. It is a block diagram which shows the structural example of the processor core 1300 and the log
  • FIG. 20 is a conceptual diagram illustrating an example of a function call instruction and a function reuse instruction according to the third embodiment of the present invention. It is a flowchart which shows the process sequence of the compile process by the compile processing apparatus 1500 in the 1st Embodiment of this invention. It is a block diagram which shows the structural example of the processor core 1300 and the log
  • FIG. It is a figure which shows the specific example of the log
  • FIG. It is a flowchart which shows the example of a process sequence of the save process of the loop separate log
  • step S3970 It is a flowchart which shows the example of a process sequence of the execution result registration process (step S3970) in embodiment of this invention. It is a flowchart which shows the example of a process sequence of the execution result output process (step S3980) in embodiment of this invention.
  • step S3980 It is a block diagram which shows the structural example of the compile processing apparatus 4100 in the 1st Embodiment of this invention. It is a conceptual diagram which shows an example of the program which the reuse command discrimination
  • FIG. 1 It is a conceptual diagram which shows an example of the data structure of the history memory 4630 in the 2nd Embodiment of this invention. It is a flowchart which shows the example of a process sequence of the command processing method by the data processor 4300 in the 2nd Embodiment of this invention. It is a block diagram which shows the structural example of the compile processing apparatus 4100 in the 3rd Embodiment of this invention. It is a block diagram which shows the structural example of the hash value determination part 4700 in the 3rd Embodiment of this invention. It is a conceptual diagram which shows an example of the hash value hold
  • 20 is a conceptual diagram illustrating an example of a function call instruction and a function reuse instruction according to the third embodiment of the present invention. It is a flowchart which shows the process sequence of the compilation process by the compilation processing apparatus 4100 in the 3rd Embodiment of this invention. It is a flowchart which shows the first half of the example of a process sequence of the hash value determination process (step S4960) by the hash value determination part 4700 in the 3rd Embodiment of this invention. It is a flowchart which shows the second half of the process sequence example of the hash value determination process (step S4960) by the hash value determination part 4700 in the 3rd Embodiment of this invention.
  • FIG. 1 is a block diagram showing an example of the configuration of the data processing apparatus according to the first embodiment of the present invention.
  • a data processing device 100 a bus 120, and a main storage unit 130 constituting an integrated circuit are shown.
  • This integrated circuit executes processing by the data processing device 100 in accordance with an instruction sequence read from the main storage unit 130 via the bus 120.
  • the data processing apparatus 100 includes a primary cache 200, a data processing unit 300, and an execution result reuse processing unit 400.
  • the data processing device 100 is an example of a data processing device described in the claims.
  • the primary cache 200 is a memory for reducing a delay time caused by processing when reading or writing an instruction and data from the main storage unit 130 via the bus 120.
  • the primary cache 200 is realized by, for example, a DRAM (Dynamic Random Access Memory).
  • the primary cache 200 includes an instruction cache 210 and a data cache 220.
  • the instruction cache 210 temporarily holds past instructions read from the main storage unit 130.
  • the instruction cache 210 outputs the held instruction to the data processing unit 300 via the command line 219 in accordance with a request from the data processing unit 300.
  • the instruction cache 210 holds the instruction requested from the data processing unit 300, the requested instruction is output to the data processing unit 300 among the plurality of held instructions. .
  • the instruction cache 210 holds the instruction read from the main storage unit 130 by the data processing unit 300 and outputs it to the data processing unit 300. To do.
  • the data cache 220 temporarily holds past data read from the main storage unit 130.
  • the data cache 220 outputs the held data to the data processing unit 300 via the data line 229 in accordance with a request from the data processing unit 300.
  • the requested data is output to the data processing unit 300 among the plurality of held data.
  • the data cache 220 holds the data read from the main storage unit 130 by the data processing unit 300. Further, when data for writing back to the main storage unit 130 is supplied from the data processing unit 300, the data cache 220 holds the data.
  • the data processing unit 300 executes processing based on an instruction read from the main storage unit 130. For example, the data processing unit 300 reads an instruction from the main storage unit 130 via the instruction cache 210, and transmits data stored in the main storage unit 130 via the data cache 220 according to the read instruction. read out. Then, for example, the data processing unit 300 executes arithmetic processing based on the arithmetic instruction using the read data.
  • the data processing unit 300 executes the arithmetic processing of the function using the input value of the argument in the function read from the data cache 220, and performs the processing of the arithmetic processing.
  • the execution result as a result is output to the data cache 220.
  • the data processing unit 300 outputs the input value and execution result in the function to the execution result reuse processing unit 400.
  • the data processing unit 300 is realized by, for example, a processor core.
  • the execution result reuse processing unit 400 displays the execution result of the instruction section executed in the past. It is for reuse.
  • an instruction section in which an execution result of an instruction section executed in the past among the instruction sections executed a plurality of times can be reused is referred to as a reuse section.
  • the reuse interval is an instruction interval that has the same execution result if the input value in the instruction interval is the same among the instruction intervals that are executed a plurality of times.
  • the execution result reuse processing unit 400 holds an input value and an execution result in a reuse section that is executed a plurality of times as an execution history.
  • the execution result reuse processing unit 400 when the input value of the reuse section to be executed again and the input value of the held execution history are the same, the execution result in the held execution history The result is output to the data processing unit 300.
  • the execution result reuse processing unit 400 notifies the data processing unit 300 of an instruction for skipping the processing in the reuse section.
  • the execution result reuse processing unit 400 executes the execution in the retained execution history.
  • the result is output to the data processing unit 300.
  • the execution result reuse processing unit 400 notifies the data processing unit 300 of an instruction for skipping the processing in the function.
  • the bus 120 performs communication between the data processing apparatus 100 and the main storage unit 130.
  • the bus 120 transfers a program stored in the main storage unit 130 to the data processing apparatus 100.
  • the bus 120 transfers data output from the data processing apparatus 100 to the main storage unit 130.
  • the main storage unit 130 stores a program for causing the data processing apparatus 100 to execute processing.
  • this program is assumed to be a program generated based on the definition of ABI (Application Binary Interface).
  • This program is generated based on, for example, SPARC (Scalable Processor Architecture) ABI.
  • SPARC Scalable Processor Architecture
  • FIG. 2 is a block diagram illustrating a configuration example of the data processing unit 300 and the execution result reuse processing unit 400 according to the first embodiment of the present invention. Here, it is assumed that a program in which a notice instruction is inserted is stored in the main storage unit 130.
  • the data processing unit 300 includes a fetch unit 310, an instruction decoder 320, an execution unit 330, and a register file 340.
  • the execution unit 330 includes a load unit 331, an input selection unit 332, an arithmetic circuit 333, and a store unit 334.
  • the execution result reuse processing unit 400 includes an execution history search unit 410, an execution result output unit 420, and a history memory 430.
  • the fetch unit 310 reads an instruction held in the instruction cache 210 or an instruction stored in the main storage unit 130 via the instruction line 219.
  • the fetch unit 310 reads an instruction from the instruction cache 210 in accordance with an instruction from the program counter.
  • the fetch unit 310 reads an input value setting instruction for setting an input value of an argument in the function. Then, after the input value setting instruction, the fetch unit 310 reads a call instruction for calling the function. In other words, the fetch unit 310 reads the notice instruction and the input value setting instruction corresponding to the function before reading the function call instruction that is the reuse section.
  • the fetch unit 310 supplies the read instruction to the instruction decoder 320.
  • the fetch unit 310 sends an instruction for setting the execution result to the instruction decoder 320 based on the notification from the execution history search unit 410. Supply.
  • the instruction decoder 320 decodes the instruction supplied from the fetch unit 310 and controls the execution unit 330, the register file 340, and the execution history search unit 410 based on the decoded content.
  • the instruction decoder 320 receives a notice instruction for notifying the execution of the function, the instruction decoder 320 supplies the identification information specified by the notice instruction to the execution history search unit 410.
  • the identification information here is information for mutually identifying functions that are a plurality of reuse sections, and is used as a search key for searching for an execution history held in the history memory 430. That is, the instruction decoder 320 holds the identification information for identifying the function in the execution history search unit 410 before executing the function that is the reuse section specified by the notice instruction by the notice command.
  • the instruction decoder 320 when the instruction decoder 320 receives a notice instruction including identification information, the instruction decoder 320 supplies the identification information to the execution history search unit 410 in order to input the identification information to the history memory 430.
  • the instruction decoder 320 uses the reference information for referring to the function start address.
  • the identification information is specified by a notice order including.
  • the instruction decoder 320 causes the execution history search unit 410 to output the start address of the function stored in the register file 340 based on the reference information included in the notice instruction. That is, the instruction decoder 320 causes the execution history 330 to output the start address of the function that is identification information based on the notice command including the reference information.
  • the instruction decoder 320 sets the setting included in the notice instruction. Identify identification information based on the information.
  • the instruction decoder 320 sets the start address of the function to the setting destination in the register file 340 indicated by the setting information specified in the notice instruction via the input selection unit 332.
  • the instruction decoder 320 instructs the execution history search unit 410 to acquire the head address of the function output from the input selection unit 332.
  • a notice instruction which is an address setting instruction is referred to herein as a notice setting instruction. Therefore, the instruction decoder 320 causes the execution unit 330 to set the start address of the function, which is identification information, as the setting destination based on the notice setting instruction including the setting information indicating the setting destination of the start address of the function.
  • the execution history search unit 410 outputs the data.
  • the instruction decoder 320 determines whether or not the instruction received after the notice instruction for notifying the execution of the function is an input value setting instruction for setting the input value of the argument in the function. The instruction decoder 320 determines whether the instruction is an input value setting instruction based on, for example, ABI regulations.
  • the instruction decoder 320 determines that it is an input value setting instruction for setting the input value of the argument in the function. Further, the instruction decoder 320 has a register 29 as the transfer destination register indicated by the store word instruction (sw) when the argument is 5 or more and all the input values of the argument are integers, and the offset When the value indicates “16” or more, it is determined as an input value setting command.
  • the command decoder 320 supplies an acquisition signal for acquiring data output from the input selection unit 332 as an input value of an argument to the execution history search unit 410. That is, the instruction decoder 320 sets the input value of the argument based on the input value setting instruction for setting the input value of the function among the instruction group from the notice instruction to the instruction immediately before the calling instruction for calling the function. Is controlled so as to be acquired by the execution history search unit 410.
  • the instruction decoder 320 when the instruction decoder 320 receives an input value setting instruction for setting an input value of a function read from the main storage unit 130, the instruction decoder 320 reads the input value read from the load unit 331. Control is performed so that the file is stored in the register file 340. At the same time, the instruction decoder 320 supplies an acquisition signal to the execution history search unit 410.
  • the instruction decoder 320 when the instruction decoder 320 receives an input value setting instruction for setting an input value of a function stored in the register file 340, the instruction decoder 320 outputs the input value stored in one register in the register file 340. Control to transfer to other registers. At the same time, the instruction decoder 320 supplies an acquisition signal to the execution history search unit 410.
  • the instruction decoder 320 When the instruction decoder 320 receives a call instruction for calling the head address of the function after the input value setting instruction, the input value end indicating that the setting of all input values used for the function is completed.
  • the signal is supplied to the execution history search unit 410. That is, when receiving a call instruction for calling a function corresponding to the identification information, the instruction decoder 320 supplies an input value end signal to the execution history search unit 410.
  • the instruction decoder 320 supplies the priority to the execution history search unit 410.
  • the execution unit 330 executes processing according to the control from the instruction decoder 320. That is, the execution unit 330 executes a process based on an instruction sequence including a reuse section that is an instruction section that is executed a plurality of times. For example, when a notice instruction including reference information is supplied to the instruction decoder 320, the execution unit 330 uses the start address of the function stored in the register indicated in the reference information as identification information as an execution history search unit. Output to 410.
  • the execution unit 330 sets the function start address based on the setting information indicating the setting destination of the function start address included in the notice setting instruction. Set the destination. That is, the execution unit 330 sets the function start address in the register file 340 based on the setting information of the notice setting instruction, and outputs the function start address to the execution history search unit 410 as identification information.
  • the execution unit 330 outputs the input value and execution result of the function that is the reuse section to the register file 340 or the main storage unit 130 and supplies the result to the execution history search unit 410.
  • the execution unit 330 is an example of an execution unit described in the claims.
  • the load unit 331 reads data from the main storage unit 130 or the data cache 220 in accordance with control from the instruction decoder 320 and supplies the read data to the input selection unit 332. For example, the load unit 331 reads an input value of an argument in a function from the main storage unit 130 or the data cache 220 according to control from the instruction decoder 320 and supplies the read input value to the input selection unit 332. .
  • the input selection unit 332 selects one of the data output from the execution result output unit 420, the arithmetic circuit 333, the register file 340, and the execution result output unit 420 in accordance with the control from the instruction decoder 320. It is.
  • the input selection unit 332 outputs the selected data to the register file 340 and the execution history search unit 410. That is, the input selection unit 332 selects one of the outputs of the execution result output unit 420, the arithmetic circuit 333, the register file 340, and the execution result output unit 420 according to the control of the instruction decoder 320 as the register file 340 and the execution history search unit. Output to 410.
  • the input selection unit 332 searches the register file 340 and the execution history search for data from the load unit 331 according to the control of the instruction decoder 320. Output to the unit 410. Further, when a move instruction is supplied as an input value setting instruction to the instruction decoder 320, the input selection unit 332 executes the data output from the register file 340 and the execution of the data according to the control of the instruction decoder 320. Output to the history search unit 410.
  • the input selection unit 332 uses the arithmetic result output from the arithmetic circuit 333 as an execution result under the control of the instruction decoder 320. Output to the register file 340. Further, when the execution result is extracted by the execution history search unit 410, the input selection unit 332 outputs the execution result output from the execution result output unit 420 to the register file 340 according to the control from the instruction decoder 320. To do.
  • the arithmetic circuit 333 executes arithmetic processing in accordance with control from the instruction decoder 320. For example, when an arithmetic instruction for executing arithmetic processing such as multiplication, division or sum of products is supplied to the instruction decoder 320, the arithmetic circuit 333 is stored in the register file 340 according to the control of the instruction decoder 320. The arithmetic processing is executed using the obtained data. In addition, the arithmetic circuit 333 stores the calculation result of the calculation processing as an execution result in the register file 340 via the input selection unit 332.
  • the store unit 334 is for writing back the data stored in the register file 340 or the execution result output from the execution result output unit 420 to the main storage unit 130 in accordance with the control from the instruction decoder 320.
  • the store unit 334 sends data to be written back via the data line 229 according to control from the instruction decoder 320.
  • the store unit 334 sends the execution result output from the execution result output unit 420 to the main storage unit 130 and the data cache via the data line 229. Write back to 220.
  • the register file 340 holds data output from the execution unit 330.
  • the register file 340 includes a plurality of registers, for example, 32 registers 0 to 31.
  • the register file 340 stores data output from the execution unit 330 in one register among a plurality of registers in accordance with control from the instruction decoder 320.
  • the register file 340 uses the data stored in one register among a plurality of registers as an execution result as the execution result 330 or the execution history search unit 410 via the execution unit 330. Output to. Also, the register file 340 is sent to the execution history search unit 410 via the execution unit 330 using the start address of the function stored in one of the plurality of registers as identification information, for example, according to control from the instruction decoder 320. Output.
  • the execution history search unit 410 is the same as the identification information and the input value acquired based on the notice command, out of the input value and the execution history as the execution result in the reuse section held for each piece of identification information in the history memory 430. The execution result in the execution history is searched.
  • the execution history search unit 410 holds the identification information and the input value specified based on the notice command, and outputs the held identification information and input value to the history memory 430, thereby searching for the execution history. Do.
  • the execution history search unit 410 acquires the identification information specified by the notice command in accordance with the instruction from the command decoder 320. For example, when a notice instruction including identification information is supplied to the instruction decoder 320, the execution history search unit 410 holds the identification information output from the instruction decoder 320. In addition, for example, when a notice instruction including reference information is supplied to the instruction decoder 320, the execution history search unit 410 sets the start address of the function output from the register file 340 according to the control from the instruction decoder 320. Obtained as identification information.
  • the execution history search unit 410 is stored in the register file 340 via the input selection unit 332 according to control from the instruction decoder 320, for example, when a notice setting instruction is supplied to the instruction decoder 320. Get the start address of the function as identification information. After the identification information is acquired, the execution history search unit 410 acquires the input value of the function based on the acquisition signal output from the instruction decoder 320 every time the input value setting instruction is supplied to the instruction decoder 320. .
  • the execution history search unit 410 searches for an execution result in the execution history held in the history memory 430 based on the start address of the function, which is identification information output from the execution unit 330, and the input value of the function. To do. Then, when a call instruction for calling a function is supplied to the instruction decoder 320, the execution history search unit 410 ends the search for the history memory 430 based on the input value end signal from the instruction decoder 320.
  • the execution history search unit 410 When the execution result is extracted from the history memory 430, the execution history search unit 410 outputs the execution result to the execution result output unit 420. At the same time, the execution history search unit 410 supplies information related to the storage location in the extracted execution result to the fetch unit 310 as an omission signal for omitting the processing of the function.
  • the execution history search unit 410 executes the process in the function identified by the notice instruction in the execution unit 330 and then executes the execution result output from the execution unit 330. To get. Then, the execution history search unit 410 causes the history memory 430 to hold the execution result of the function and the identification information and the input value acquired based on the notice command. That is, when the execution result is not extracted from the history memory 430, the execution history search unit 410 records the execution result of the function executed after the notice command, the function identification information and the input value held by the notice command. Register in the memory 430.
  • the execution history search unit 410 executes the execution stored in the register file 340 under the control of the instruction decoder 320. Get the result.
  • the execution history search unit 410 can store the input value and the execution result corresponding to the function identification information specified by the notice instruction in the history memory 430 in association with each other.
  • the execution history search unit 410 receives the priority from the instruction decoder 320, the input value of the function corresponding to the priority, and the execution result. Are stored in the history memory 430 for each piece of identification information as an execution history. In this case, the execution history search unit 410 deletes the execution history in the history memory 430 based on the priority stored in the history memory 430. That is, the execution history search unit 410 deletes the execution history in the history memory 430 in order from the execution history associated with the identification information having the highest priority.
  • the execution history search unit 410 is an example of an execution history search unit described in the claims.
  • the execution result output unit 420 stores the execution result in the register file 340 or the store unit 334 via the input selection unit 332. Output.
  • the execution result output unit 420 outputs execution result data to the store unit 334 or the input selection unit 332 depending on the storage location of the execution result.
  • the execution result output unit 420 is an example of an execution result output unit described in the claims.
  • the history memory 430 stores the input value corresponding to the identification information and the execution result for each piece of identification information as an execution history.
  • the history memory 430 is realized by, for example, an associative memory (CAM: Content Addressable Memory).
  • CAM Content Addressable Memory
  • the history memory 430 starts searching for an execution history associated with the identification information when the identification information, which is a search key for searching for an execution result, is input from the execution history search unit 410.
  • the history memory 430 is associated with the held input value when the input values sequentially supplied from the execution history search unit 410 and the input values held in the history memory 430 all match.
  • the execution result is output to the execution history search unit 410. That is, the execution history search unit 410 extracts an execution result from the history memory 430 by detecting from the history memory 430 the same execution history as the identification information and the input value input from the execution history search unit 410.
  • the history memory 430 is an example of a history memory described in the claims.
  • the history memory 430 holds, for example, the priority supplied from the execution history search unit 410, the input value of the function corresponding to the priority, and the execution result for each identification information as an execution history.
  • the history memory 430 realized by this associative memory holds, for example, a pattern of input values in the execution history in a tree structure.
  • a data structure in the history memory 430 will be described below with reference to the drawings.
  • FIG. 3 is a conceptual diagram showing an example of the data structure of the history memory 430 in the first embodiment of the present invention.
  • the history memory 430 holds the execution history of one piece of identification information in a tree structure among the pieces of execution history held for each piece of identification information for identifying a plurality of functions.
  • a function is assumed that has n arguments and returns an output as an execution result to m storage destinations.
  • the function address that is the head address of the function is used as identification information.
  • the function route 440 in the tree structure, the first argument nodes 451 and 452, the nth argument nodes 461 to 464, the first output nodes 471 to 474, and the mth output nodes 481 to 484 are displayed. Is shown.
  • the function route 440 shows a function address that is identification information and a pointer that points to the first argument node 451.
  • the first and nth argument nodes 451, 452, and 461 to 464 include input data indicating an argument value as an argument input value in the execution history held in the history memory 430, the type of the argument, The type indicating the storage location of the argument is shown.
  • the storage location here refers to the register number of the register file 340 or the memory address of the main storage unit 130.
  • first and nth argument nodes 451, 452, and 461 to 464 include a right pointer that points to the argument node in the next argument when the input values to be compared match each other, and the same argument in the case of mismatch And a lower pointer pointing to another argument node.
  • the first and m-th output nodes 471 to 474 and 481 to 484 are connected to the n-th argument nodes 461 to 464, respectively.
  • first and m-th output nodes 471 to 474 and 481 to 484 output data indicating execution result values as execution results in the execution history held in the history memory 430 and storage locations of the execution results are stored.
  • the type to be shown and the type of the execution result are shown.
  • the first output nodes 471 to 474 show a right pointer that points to the next output node.
  • the first and mth output nodes 471 to 474 and 481 to 484 form a linked list.
  • the right pointers of the m-th output nodes 481 to 484 indicate a null indicating the end of the output node.
  • the input value comparison processing is to compare the input data, type and type shown in the first argument node 451 with the input value from the execution history search unit 410.
  • the input value indicated by the first argument node 451 matches the input value from the execution history search unit 410, the next point indicated by the right pointer of the first argument node 451.
  • the input value comparison process is executed at the argument node.
  • the input value indicated by the first argument node 451 does not match the input value from the execution history search unit 410, the first value indicated by the lower pointer of the first argument node 451 is displayed. Input value comparison processing is executed in the argument node 452.
  • the argument node pointed to by the right or lower pointer is selected based on the result of the comparison process in each argument node, and the input value comparison process is sequentially executed in the selected argument node. For example, when the input value indicated by the nth argument node 461 and the input value from the execution history search unit 410 match each other, the first output node 471 is set by the right pointer of the nth argument node 461. Is pointed to. From the execution result indicating the output data, type and type held in the first output node 471 to the execution result held in the m-th output node 481 in order, the execution result is sequentially output to the execution history search unit 410.
  • the history memory 430 by configuring the history memory 430 with a tree structure for each piece of identification information, it is not necessary to hold the input values of the same argument redundantly, so that the storage area can be saved. Further, by dividing the data structure for each identification information, it is possible to suppress a decrease in search speed.
  • FIG. 4 is a conceptual diagram showing an operation outline of the data processing apparatus 100 when the data processing apparatus 100 according to the first embodiment of the present invention receives a notice instruction including identification information.
  • FIG. 4A is a diagram illustrating a part of an instruction sequence described in assembly language.
  • FIG. 4A shows a notice instruction (noticeCall) that specifies an index (index) and a call instruction (Call) that calls a function (func).
  • FIG. 4B shows the correspondence between the column 431 of identification information (index 0 to k) indicated by the index (index) and the column 432 of execution history search data (execution history search data 0 to k).
  • the execution history search data here indicates search data configured by the tree structure shown in FIG.
  • the identification information “index k” indicated by the index (index) is supplied from the instruction decoder 320 to the execution history search unit 410. Then, when the identification information “index k” is input to the history memory 430 by the execution history search unit 410, “execution history search data k” in the function (func) identified by this identification information (index k) is obtained. Based on this, the search of the execution history is started.
  • the execution history search unit 410 acquires the input value of the argument of the function (func), and the acquired input value is stored in the history memory 430. Input sequentially. Thereby, the input value held in the execution history search data (execution history search data k) corresponding to the identification information “index k” and the input value from the execution history search unit 410 are sequentially compared.
  • the execution history search unit 410 refers to the presence / absence of an execution result that can reuse the function (func) as a search result based on the execution history search data k based on the call command (call).
  • the data processing apparatus 100 acquires the input value of the argument of the function (func) based on the notice instruction (noticeCall) before executing the call instruction (call) of the function (func). Then, the comparison between the input value of the function (func) and the input value of the function (func) held in the history memory 430 is terminated.
  • a more specific operation example in the data processing apparatus 100 based on a notice command including identification information will be described with reference to a drawing showing an MIPS command code.
  • FIG. 5 is a diagram illustrating a part of a program executed by the data processing apparatus 100 according to the first embodiment of the present invention.
  • FIG. 5A is a diagram illustrating an example of a part of a source program of a function selected as a reuse section.
  • FIG. 5B is a diagram illustrating a part of an instruction sequence in which the source program shown in FIG. 5A is converted by the MIPS assembly language.
  • FIG. 5B shows a part of an instruction sequence generated by converting such a source program by the MIPS assembly language and performing a notice instruction insertion process.
  • FIG. 5B shows a first instruction sequence (noticeCall), a second instruction sequence (lw), a third instruction sequence (lw), a fourth instruction sequence (move), and a fifth instruction sequence.
  • (Move) sixth instruction sequence (sw), seventh instruction sequence (lw), and eighth instruction sequence (jalr).
  • the input values A to E of the first to fifth arguments are all integers.
  • a notice instruction (noticeCall) specifying an index (index) is executed.
  • the identification information indicated by the index supplied by the instruction decoder 320 is input from the execution history search unit 410 to the history memory 430, whereby the execution history is searched.
  • a load word instruction (lw) is executed.
  • the offset value “1000” is added to the reference address stored in the register 28 (R28), and the data stored in the memory address of the main storage unit 130 designated by the added value (the first value)
  • the input value A) of the argument is transferred to the register 4 (R4).
  • the load word instruction (lw) is an input value setting instruction for setting the input value of the argument by the instruction decoder 320 because the transfer destination register number indicated by the load word instruction (lw) is “R4”. It is judged that there is. Therefore, the input value A transferred to the register 4 (R4) is also supplied to the execution history search unit 410 and is compared with the input value of the first argument held in the history memory 430. At this time, if the input value A is held among the input values of the first argument held in the history memory 430, the process proceeds to the comparison process of the input value of the second argument. On the other hand, if the input value A is not held, the search of the execution history is terminated.
  • the load word instruction (lw) is executed.
  • the offset value “1004” is added to the reference address stored in the register 28 (R28), and the data stored in the memory address of the main storage unit 130 specified by the added value (the second address)
  • the argument input value B) is transferred to the register 5 (R5).
  • the load word instruction (lw) is an input value setting instruction for setting the input value of the argument by the instruction decoder 320 because the transfer destination register number indicated by the load word instruction (lw) is “R5”. It is judged. Therefore, the input value B stored in the register 5 (R5) is also supplied to the execution history search unit 410 and compared with the input value of the second argument held in the history memory 430. At this time, if the input value B is held among the input values of the second argument held in the history memory 430, the process proceeds to the comparison process of the input value of the third argument. On the other hand, if the input value B is not held, the execution history search is terminated.
  • a move instruction (move) is executed.
  • the data (the input value C of the third argument) stored in the register 10 (R10) is transferred to the register 6 (R6).
  • the instruction decoder 320 determines that the move instruction (move) is an input value setting instruction for setting the input value of the argument. For this reason, the input value C stored in the register 6 (R6) is also supplied to the execution history search unit 410 and compared with the input value of the third argument held in the history memory 430.
  • a move instruction (move) is executed.
  • the data (the input value D of the fourth argument) stored in the register 11 (R11) is transferred to the register 7 (R7).
  • the move instruction (move) is determined to be an input value setting instruction for setting the input value of the argument by the instruction decoder 320 because the transfer destination register number indicated by the move instruction (move) is “R7”. Is done. Therefore, the input value D stored in the register 7 (R7) is also supplied to the execution history search unit 410 and is compared with the input value of the fourth argument held in the history memory 430.
  • a store word instruction (sw) is executed.
  • “16” is added to the value of the stack pointer stored in the register 29 (R29), and the data (fifth argument) stored in the register 12 (R12) is added to the memory address of the added value.
  • Input value E) is transferred. Since the transfer destination register number indicated by the store word instruction (sw) is “R29” and the offset value is “16” or more, this store word instruction (sw) is input with an argument by the instruction decoder 320. It is determined that this is an input value setting command for setting a value.
  • the input value E transferred to the main storage unit 130 is also supplied to the execution history search unit 410 and compared with the input value of the fifth argument held in the history memory 430. At this time, if the input value E is held among the input values of the fifth argument held in the history memory 430, the execution result in the execution history in which the input values A to E of all the arguments match is the execution history. It is output to the search unit 410. On the other hand, if the input value A is not held, the search of the execution history is terminated.
  • the load word instruction (lw) is executed.
  • the offset value “2000” is added to the reference address stored in the register 28 (R28), and the data (start address of the function func) stored in the memory address of the added value is stored in the register 25 ( R25).
  • the load word instruction (lw) is not an input value setting instruction for setting the input value of the argument by the instruction decoder 320 because the transfer destination register number indicated by the load word instruction (lw) is “R25”. To be judged. For this reason, the execution history search unit 410 does not acquire the data output from the input selection unit 332.
  • a jump instruction (jalr) is executed.
  • the instruction at the head address of the function (func) stored in the register 25 (R25) is read.
  • the instruction decoder 320 notifies the execution history search unit 410 of an input value end signal indicating that the setting of input values of all the first to fifth arguments in the function (func) has ended.
  • the execution history search unit 410 outputs the execution result to the execution result output unit 420, and omits the function (func) processing.
  • a signal is supplied to the fetch unit 310.
  • the execution history search unit 410 records the execution result after the execution of the function (func) and the identification information and the input value acquired based on the notice instruction. Registered in the memory 430.
  • FIG. 6 is a conceptual diagram showing an example in which the processing time in the function is shortened by executing the notice instruction.
  • FIG. 6A is a conceptual diagram showing a shortened time due to reuse of execution results in a conventional data processing apparatus that executes processing of a program without a notice instruction.
  • FIG. 6B is a conceptual diagram showing a shortened time by reusing the execution result in the data processing apparatus 100 according to the first embodiment of the present invention.
  • a function having two arguments is called by a call instruction (call) in the upper routine, and returns from the lower routine by a return instruction (return) upon completion of processing in the function.
  • call instruction call
  • return instruction return
  • FIG. 6A shows an input value A setting 321 and an input value B setting 322 in the upper routine, and an input value A use 323 and an input value B use 324 in the lower routine.
  • the input value A setting 321 and the input value B setting 322 indicate the timing when the input value of the argument in the function is set. As described in FIG. 1, this is a processing procedure by a program described in accordance with the ABI rules.
  • the input value A use 323 and the input value B use 324 indicate the timing at which the input value that is an argument is used in the processing of the function that is a lower level routine.
  • FIG. 6B shows a notice instruction 421 in addition to the timing shown in FIG.
  • the notice instruction 421 indicates the timing at which the notice instruction is decoded by the instruction decoder 320. Since components other than the notice command 421 are the same as those in FIG. 6A, the same reference numerals as those in FIG.
  • the function execution history can be searched by inputting the identification information that is the search key of the history memory 430 into the history memory 430. Be started.
  • the execution history search unit 410 supplies the input values A and B acquired based on the two input value setting commands for setting the input values A and B of the argument to the history memory 430.
  • the data processing apparatus 100 ends the search of the execution result for the history memory 430 in the execution history search period t by acquiring the identification information and the input value of the argument included in the warning command based on the warning command. be able to.
  • the execution result held in the history memory 430 can be reused, the period that can be shortened (shortening period t2) can be made longer than the conventional shortening period t1.
  • FIG. 7 is a flowchart showing an example of a processing procedure of the execution result reuse method of the data processing apparatus 100 according to the first embodiment of the present invention.
  • the instruction decoder 320 decodes the notice instruction supplied from the fetch unit 310 (step S911). Then, the instruction decoder 320 supplies the search key of the history memory 430 that is the identification information specified by the notice instruction to the execution history search unit 410, whereby the execution history search unit 410 acquires the identification information. In other words, the identification information included in the notice command is acquired by the execution history search unit 410, and the acquired identification information is input from the execution history search unit 410 to the history memory 430 (step S912). As a result, a search for a plurality of execution histories corresponding to the identification information in the history memory 430 is started. Note that step S912 is an example of an acquisition procedure described in the claims.
  • the fetch unit 310 reads an instruction to be executed next to the notice instruction (step S913). Thereafter, the instruction decoder 320 determines whether or not the instruction read from the fetch unit 310 is an input value setting instruction for setting the input value of the first argument of the function (step S914).
  • Step S921 is an example of an acquisition procedure described in the claims.
  • step S922 it is determined whether or not the input value of the argument acquired by the execution history search unit 410 matches the input value of the argument associated with the identification information in the history memory 430 (step S922). And when both input values do not correspond, it returns to the process of step S913.
  • step S923 the pointer is advanced to the next argument node for comparing the input values of the next argument in the history memory 430 (step S923), and the process returns to step S913. . That is, if there is an argument node that matches the input value from the execution history search unit 410 among the plurality of argument nodes, the next argument node is indicated by the right pointer of the argument node.
  • Steps S922 and S923 are an example of an execution history search procedure described in the claims.
  • step S914 determines whether the instruction is not an input value setting instruction. If it is determined in step S914 that the instruction is not an input value setting instruction, the instruction decoder 320 determines whether the instruction read from the fetch unit 310 is a call instruction for calling a function. (Step S915). If it is determined that the instruction is not a calling instruction, the process returns to step S913.
  • step S916 it is determined whether or not the input values set by the input value setting instruction all match the input values associated with the identification information in the history memory 430 (step S916). ). If all input values match, an execution result reuse process is executed (step S924). That is, the execution result in the history memory 430 corresponding to the identification information and the input value acquired by the execution history search unit 410 is output from the execution result output unit 420. Then, the processing of the function that is written back to the main storage unit 130 or the register file 340 and called is completed. Note that S924 is an example of an execution result output procedure described in the claims.
  • step S917 if all the input values do not match, the called function is executed (step S917). Then, the execution history search unit 410 acquires the execution result of the executed function (step S918). Subsequently, the execution history search unit 410 registers the acquired execution result and the input value acquired in steps S912 and S921 in the history memory 430 (step S919).
  • the function identification information and the input value set by the input value setting command executed after the notice command are notified by the notice command for notifying the execution of the function.
  • an execution history in the history memory 430 that matches the specified identification information and input value can be extracted.
  • the execution result in the execution history is extracted from the history memory 430, the execution of the function called by the call instruction can be omitted, so that the processing time of the function by reusing the execution result is greatly reduced. be able to.
  • the identification information that is the search key of the history memory 430 is included in the notice command.
  • the identification information is used as the start address of the function, and the start address of the function is referred to. Reference information for this may be included in the notice command. Accordingly, an example of searching for an execution history in the history memory 430 based on a notice command including reference information will be described below as a second embodiment with reference to the drawings.
  • FIG. 8 is a conceptual diagram showing an outline of the operation of the data processing apparatus 100 when the data processing apparatus 100 according to the second embodiment of the present invention receives a notice command including reference information.
  • a function address that is a start address of a function is used as identification information that is a search key of the history memory 430.
  • FIG. 8A shows a load word instruction (lw) for setting a function address in the register 25 (R25) and a notice instruction (noticeCall) including reference information (R25). Further, here, a call instruction (Call) for calling a function stored in the register 25 (R25) is shown.
  • the reference number of the notice instruction indicates the register number (R25) in which the function address is stored. Further, when generating a warning instruction including such reference information, it is assumed that a load word instruction (lw) for setting a function address is generated before the warning instruction in the compilation process.
  • FIG. 8B shows a column 433 of function addresses (function addresses 0 to k) stored in the register 25 (R25) indicated by the reference information (R25) and execution history search data (execution history search data).
  • a correspondence table with the column 434 of 0 to k) is shown.
  • the execution history search data here indicates search data configured by the tree structure shown in FIG.
  • the instruction decoder 320 causes the execution history search unit 410 to output “function address 1” stored in the register 25 (R25) based on the reference information (R25) included in the notice instruction (noticeCall). . That is, the execution unit 330 outputs the function address “function address 1” to the execution history search unit 410 based on the notice command including the reference information. Then, when the “function address 1” is input to the history memory 430 by the execution history search unit 410, the search of the execution history is started based on the execution history search data 1 corresponding to the function address 1. .
  • the execution history search unit 410 holds the input value of the argument in the function, and the held input value is sequentially stored in the history memory 430. Entered. Thereby, the input value held in the execution history search data (execution history search data 1) corresponding to the function address (function address 1) and the input value from the execution history search unit 410 are sequentially compared.
  • the execution history search unit 410 refers to the presence / absence of an execution result that can be reused as a search result by the execution history search data 1 corresponding to the function address 1 based on the call instruction (call).
  • the data processing apparatus 100 identifies the search key of the history memory 430 based on the reference information included in the notice instruction (noticeCall) before executing the call instruction (call) of the function (function address 1). Information (function address 1) can be acquired.
  • FIG. 9 is a diagram illustrating a part of a program executed by the data processing apparatus 100 according to the second embodiment of the present invention.
  • FIG. 9A is a diagram illustrating an example of a part of a source program of a function selected as a reuse section.
  • FIG. 5B is a diagram illustrating a part of an instruction sequence in which the source program shown in FIG. 5A is converted by the MIPS assembly language.
  • FIG. 9B shows a part of an instruction sequence generated by converting such a source program by the MIPS assembly language and applying a notice instruction insertion process.
  • FIG. 9B shows a first instruction sequence (lw), a second instruction sequence (noticeCall), a third instruction sequence (lw), a fourth instruction sequence (lw), and a fifth instruction sequence.
  • (Move) sixth instruction sequence (move), seventh instruction sequence (sw), and eighth instruction sequence (jalr).
  • input values A to E of function arguments are all integers.
  • the load word instruction (lw) is executed.
  • the offset value “2000” is added to the reference address stored in the register 28 (R28), and the data (start address of the function func) stored in the memory address of the added value is stored in the register 25 ( R25).
  • the load word instruction that sets the start address of the function read from the main storage unit 130 in the register file 340 is referred to as an address setting instruction.
  • a notice instruction (noticeCall) including reference information (R25) is executed.
  • the function address which is identification information stored in the register 25, is output to the execution history search unit 410 based on the reference information (R25). That is, the execution unit 330 outputs a function address to the execution history search unit 410 based on the notice command including the reference information.
  • the execution history search unit 410 inputs the function address to the history memory 430, whereby the execution history is searched.
  • the load word instruction (lw) is executed.
  • the offset value “1000” is added to the reference address stored in the register 28 (R28), and the data (first argument of the first argument) stored in the memory address of the main storage unit 130, which is the added value, is added.
  • the input value A) is transferred to the register 4 (R4).
  • the load word instruction (lw) is an input value setting instruction for setting the input value of the argument by the instruction decoder 320 because the transfer destination register number indicated by the load word instruction (lw) is “R4”. It is judged. For this reason, the input value A transferred to the register 4 (R4) is also supplied to the execution history search unit 410 and compared with the input value of the first argument held in the history memory 430. At this time, if the input value A is held among the input values of the first argument held in the history memory 430, the process proceeds to the comparison process of the input value of the second argument. On the other hand, if the input value A is not held, the search of the execution history is terminated.
  • the load word instruction (lw) is executed.
  • the offset value “1004” is added to the reference address stored in the register 28 (R28), and the data (the second argument of the second argument) stored in the memory address of the main storage unit 130, which is the added value, is added.
  • the input value B) is transferred to the register 5 (R5).
  • the load word instruction (lw) is an input value setting instruction for setting the input value of the argument by the instruction decoder 320 because the transfer destination register number indicated by the load word instruction (lw) is “R5”. It is judged that there is. Therefore, the input value B stored in the register 5 (R5) is also supplied to the execution history search unit 410 and compared with the input value of the second argument held in the history memory 430. At this time, if the input value B is held among the input values of the second argument held in the history memory 430, the process proceeds to the comparison process of the input value of the third argument. On the other hand, if the input value B is not held, the execution history search is terminated.
  • a move instruction (move) is executed.
  • the data (the input value C of the third argument) stored in the register 10 (R10) is transferred to the register 6 (R6).
  • the move instruction (move) is an input value setting instruction for setting the input value of the argument by the instruction decoder 320 because the transfer destination register number indicated in the move instruction (move) is “R6”. To be judged. For this reason, the input value C stored in the register 6 (R6) is also supplied to the execution history search unit 410 and compared with the input value of the third argument held in the history memory 430.
  • a move instruction (move) is executed.
  • the data (the input value D of the fourth argument) stored in the register 11 (R11) is transferred to the register 7 (R7).
  • the move instruction (move) is an input value setting instruction for setting the input value of the argument by the instruction decoder 320 because the transfer destination register number indicated in the move instruction (move) is “R7”. Identified. Therefore, the input value D stored in the register 7 (R7) is also supplied to the execution history search unit 410 and is compared with the input value of the fourth argument held in the history memory 430.
  • a store word instruction (sw) is executed.
  • “16” is added to the value of the stack pointer stored in the register 29 (R29), and the data (fifth argument) stored in the register 12 (R12) is added to the memory address of the added value.
  • Input value E) is transferred.
  • This store word instruction (sw) has the transfer destination register number “R29” indicated by the store word instruction (sw) and the offset value is “16” or more. It is determined that this is an input value setting command for setting an input value.
  • the input value E transferred to the main storage unit 130 is also supplied to the execution history search unit 410, and the supplied input value E and the input value of the fifth argument held in the history memory 430 Are compared.
  • the input value E is held among the input values of the fifth argument held in the history memory 430, the execution result in the execution history in which the input values A to E of all the arguments match is the execution history. It is output to the search unit 410.
  • the search of the execution history is terminated.
  • a jump instruction (jalr) is executed.
  • the instruction at the head address of the function (func) stored in the register 25 (R25) is read.
  • the instruction decoder 320 notifies the execution history search unit 410 of an input value end signal indicating that the setting of input values of all the first to fifth arguments in the function (func) has ended.
  • the execution history search unit 410 outputs the execution result to the execution result output unit 420, and omits the function (func) processing.
  • a signal is supplied to the fetch unit 310.
  • the execution history search unit 410 records the execution result after the execution of the function (func) and the identification information and the input value acquired based on the notice instruction. Registered in the memory 430.
  • the execution history search unit 410 performs the start address of the function based on the reference information included in the notice command before the function identified by the notice command is executed. Can be acquired as identification information.
  • the execution history search unit 410 uses the execution history stored in the history memory 430 based on the start address of the function that is the reuse section output from the execution unit 330 as the identification information and the input value of the function. The execution result can be searched.
  • the execution result reuse processing unit 400 can acquire the identification information and the input value in the execution history search unit 410 by a notice command including reference information, and thus is retained in the history memory 430 before the function is executed. Execution history can be searched.
  • FIG. 10 is a conceptual diagram showing an outline of the operation of the data processing apparatus 100 when a notice setting command is received in the data processing apparatus 100 according to the third embodiment of the present invention.
  • a function address that is a start address of a function is used as identification information that is a search key of the history memory 430.
  • FIG. 10A shows a notice setting instruction (memolw) for setting a function address in the register 25 (R25) and a call instruction (Call) for calling a function corresponding to the function address stored in the register 25 (R25). It is shown.
  • memolw notice setting instruction
  • Call call instruction
  • the address setting instruction (lw) for setting the function address in the register 25 (R25) can be omitted as compared with the second embodiment.
  • FIG. 10B is a conceptual diagram showing an example of execution history search data for each function address, which is identification information in the history memory 430.
  • FIG. 10B shows a column 435 of function addresses (function addresses 0 to k) set in the register 25 (R25) by the notice setting instruction (memolw) and execution history search data (execution history search data 0 to 0).
  • a correspondence table with column 436 of k) is shown.
  • the execution history search data here indicates search data configured by the tree structure shown in FIG.
  • the instruction decoder 320 sets “function address 1” in the register 25 (R25) indicated in the setting information specified in the notice setting instruction (memolw), and also sets “function address” in the execution history search unit 410. 1 ”is acquired. That is, the execution unit 330 sets the function start address “function address 1” as the setting destination (R25) based on the notice setting instruction (memolw) including setting information indicating the setting destination (R25) of the function start address. .
  • the execution history search unit 410 acquires the input value of the argument, and the acquired input value is sequentially input to the history memory 430.
  • the input value held in the execution history search data (execution history search data 1) corresponding to the function address (function address 1) and the input value from the execution history search unit 410 are sequentially compared.
  • the call instruction (call) is supplied to the instruction decoder 320, whereby the function memory (function address 1) acquired by the execution history search unit 410 and the presence / absence of the execution history matching the input value are executed from the history memory 430.
  • the history search unit 410 is notified. That is, the execution history search unit 410 refers to the search result by the execution history search data 1 corresponding to the function address 1 based on the call command (call).
  • the data processing apparatus 100 executes the function history (function address 1) set by the notice setting instruction (memolw) before executing the call instruction (call) of the function (function address 1). 410 can be obtained.
  • a more specific operation example in the data processing apparatus 100 based on the notice setting instruction will be described with reference to the drawings showing instruction codes based on MIPS.
  • FIG. 11 is a diagram illustrating a part of a program executed by the data processing apparatus 100 according to the third embodiment of the present invention.
  • a call to a function (func) having five arguments (a to e) is described.
  • an int type function (func) is described.
  • This function (func) is a first argument (a), second argument (b), third argument (c), fourth argument (d) and fifth argument as int type arguments. With an argument (e).
  • FIG. 11B shows a part of an instruction sequence generated by converting such a source program by the MIPS assembly language and performing a notice instruction insertion process.
  • FIG. 11B shows a first instruction sequence (memolw), a second instruction sequence (lw), a third instruction sequence (lw), a fourth instruction sequence (move), and a fifth instruction sequence.
  • Move sixth instruction sequence
  • sw seventh instruction sequence
  • input values A to E of function arguments are all integers.
  • a notice setting instruction (memolw) is executed.
  • the offset value “2000” is added to the reference address stored in the register 28 (R28), and the data (start address of the function func) stored in the memory address of the added value is stored in the register 25 ( R25). That is, the execution unit 330 sets the function start address as the setting destination based on the setting information indicating the setting destination of the function start address included in the notice setting instruction.
  • the function history output from the input selection unit 332 is acquired by the execution history search unit 410. Then, the execution history search unit 410 inputs the function address to the history memory 430, whereby the execution history is searched.
  • a load word instruction (lw) is executed.
  • the offset value “1000” is added to the reference address stored in the register 28 (R28), and the data (first argument of the first argument) stored in the memory address of the main storage unit 130, which is the added value, is added.
  • the input value A) is transferred to the register 4 (R4).
  • the load word instruction (lw) is an input value setting instruction for setting the input value of the argument by the instruction decoder 320 because the transfer destination register number indicated by the load word instruction (lw) is “R4”. It is judged that there is. For this reason, the input value A transferred to the register 4 (R4) is also supplied to the execution history search unit 410 and compared with the input value of the first argument held in the history memory 430.
  • the process proceeds to the comparison process of the input value of the second argument. On the other hand, if the input value A is not held, the search of the execution history is terminated.
  • the load word instruction (lw) is executed.
  • the offset value “1004” is added to the reference address stored in the register 28 (R28), and the data (the second argument of the second argument) stored in the memory address of the main storage unit 130, which is the added value, is added.
  • the input value B) is transferred to the register 5 (R5).
  • the load word instruction (lw) is an input value setting instruction for setting the input value of the argument by the instruction decoder 320 because the transfer destination register number indicated by the load word instruction (lw) is “R5”. It is judged that there is. Therefore, the input value B stored in the register 5 (R5) is also supplied to the execution history search unit 410 and compared with the input value of the second argument held in the history memory 430.
  • a move instruction (move) is executed.
  • the data (the input value C of the third argument) stored in the register 10 (R10) is transferred to the register 6 (R6).
  • the instruction decoder 320 determines that the move instruction (move) is an input value setting instruction for setting an input value of an argument.
  • the input value C stored in the register 6 (R6) is also supplied to the execution history search unit 410. Therefore, the input value C supplied to the execution history search unit 410 is held in the history memory 430.
  • the input value of the third argument is compared.
  • a move instruction (move) is executed.
  • the data (the input value D of the fourth argument) stored in the register 11 (R11) is transferred to the register 7 (R7).
  • the move instruction (move) is an input value setting instruction for setting the input value of the argument by the instruction decoder 320 because the transfer destination register number indicated in the move instruction (move) is “R7”. Identified. Therefore, the input value D stored in the register 7 (R7) is also supplied to the execution history search unit 410 and is compared with the input value of the fourth argument held in the history memory 430.
  • a store word instruction (sw) is executed.
  • “16” is added to the value of the stack pointer stored in the register 29 (R29), and the data (fifth argument) stored in the register 12 (R12) is added to the memory address of the added value.
  • Input value E) is transferred.
  • This store word instruction (sw) has the transfer destination register number “R29” indicated by the store word instruction (sw) and the offset value is “16” or more. It is determined that this is an input value setting command for setting an input value.
  • the input value E transferred to the main storage unit 130 is also supplied to the execution history search unit 410, and the supplied input value E and the input value of the fifth argument held in the history memory 430 Are compared.
  • the input value E is held among the input values of the fifth argument held in the history memory 430, the execution result in the execution history in which the input values A to E of all the arguments match is the execution history. It is output to the search unit 410.
  • the search of the execution history is terminated.
  • a jump instruction (jalr) is executed.
  • the instruction at the head address of the function (func) stored in the register 25 (R25) is read.
  • the instruction decoder 320 notifies the execution history search unit 410 of an input value end signal indicating that the setting of input values of all the first to fifth arguments in the function (func) has ended.
  • the execution history search unit 410 outputs the execution result to the execution result output unit 420, and omits the function (func) processing.
  • a signal is supplied to the fetch unit 310.
  • the execution history search unit 410 records the execution result after the execution of the function (func) and the identification information and the input value acquired based on the notice instruction. Registered in the memory 430.
  • the execution history search unit 410 acquires, as identification information, a function address set based on a notice setting instruction corresponding to the function before the function is executed. be able to. Thereby, the execution history search unit 410 can search for the execution result in the history memory 430 based on the start address of the function set by the execution unit 330 and the input value of the function acquired by the notice setting instruction. it can.
  • the execution result reuse processing unit 400 can acquire the identification information and the input value in the execution history search unit 410 according to the notice setting command, so that the execution history held in the history memory 430 before the function is executed. Can be searched.
  • the processing time by reusing the execution result of the function is significantly shortened based on the notice instruction included in the program stored in the main storage unit 130. be able to.
  • a program conversion apparatus for inserting such a notice command into a program will be described with reference to the drawings.
  • FIG. 12 is a block diagram showing a functional configuration example of the program conversion processing device according to the fourth embodiment of the present invention.
  • the program conversion processing device 500 includes a source program storage unit 510, a notice instruction insertion code generation unit 600, and an object program storage unit 520.
  • the program conversion processing device 500 is an example of a program conversion processing device described in the claims.
  • the source program storage unit 510 stores a source program to be compiled. This source program is a source program including a reuse section in which the execution result is used again.
  • the source program storage unit 510 supplies the stored source program to the notice instruction insertion code generation unit 600.
  • the notice instruction insertion code generation unit 600 compiles the source program from the source program storage unit 510 to generate an object program that is a machine language program after performing processing for inserting the notice instruction. .
  • the notice instruction insertion code generation unit 600 stores the generated object program in the object program storage unit 520.
  • the notice instruction insertion code generation unit 600 includes a program analysis unit 610, a program optimization processing unit 620, and a code generation unit 630.
  • the program analysis unit 610 executes analysis processing such as morphological analysis and syntax analysis based on the source program read from the source program storage unit 510.
  • the program analysis unit 610 generates a program with an intermediate expression expressed by an intermediate code in a format suitable for analysis or optimization, and executes an analysis process on the generated program.
  • the program analysis unit 610 includes a reuse candidate section extraction unit 611 and a reuse candidate section analysis unit 612.
  • the reuse candidate section extraction unit 611 extracts a reuse candidate section, which is a candidate for a reuse section that reuses an execution result, from the program among a plurality of command sections.
  • the reuse candidate section extraction unit 611 extracts a function that becomes a reuse candidate section from among a plurality of functions that are command sections that are executed a plurality of times.
  • the reuse candidate section extraction unit 611 excludes the functions whose execution results cannot be reused from the reuse candidate sections because the execution results are different even if the input values of the reuse candidate sections are the same.
  • the reuse candidate section extraction unit 611 excludes a function including a branch instruction in the instruction section from the reuse candidate section.
  • the reuse candidate section extraction unit 611 supplies the extracted reuse candidate section identification information together with the program to the reuse candidate section analysis unit 612.
  • the reuse candidate section analysis unit 612 analyzes the usage mode of the reuse candidate section extracted by the reuse candidate section extraction unit 611.
  • the reuse candidate section analysis unit 612 analyzes, for example, the number and types of arguments in a function and the number of times that one function is executed for each function as a usage mode.
  • the reuse candidate section analysis unit 612 outputs, for example, the number of ranges that the argument can take from the processing contents of the function as the analysis result of the usage mode.
  • the reuse candidate section analysis unit 612 supplies the analysis result to the program optimization processing unit 620 together with the identification information of the reuse candidate section and the program.
  • the program optimization processing unit 620 performs optimization for improving the execution speed of the program and optimization for reducing the code size based on the program supplied from the reuse candidate section analysis unit 612.
  • the program optimization process is executed.
  • the program optimization processing unit 620 includes a reuse degree generation unit 621, a reuse section selection unit 622, and a notice instruction generation processing unit 623.
  • the reuse level generation unit 621 generates a reuse level indicating the degree to which the execution result of the reuse candidate section is reused based on the analysis result supplied from the reuse candidate section analysis unit 612. In other words, the reuse level generation unit 621 generates a reuse level indicating the degree to which the execution results of the instruction sections executed a plurality of times coincide with each other based on the usage state of the instruction sections.
  • the reuse level generation unit 621 generates a reuse level according to the number of executions of the reuse candidate section, for example.
  • the reuse degree generation unit 621 sets the degree of reuse larger as the number of executions increases.
  • the reuse level generation unit 621 generates the reuse level according to the number of ranges that can be taken by the input value of the reuse candidate section, for example.
  • the degree of reuse is calculated by, for example, multiplying the inverse of the number of combinations by a constant. For this reason, it means that it is a reuse candidate area with a high degree of reuse, so that the reuse degree of a reuse candidate area is large.
  • the reuse level generation unit 621 supplies the generated reuse level to the reuse interval selection unit 622 together with the identification information of the program and the reuse candidate interval.
  • the reuse level generation unit 621 is an example of a reuse level generation unit described in the claims.
  • the reuse section selection unit 622 selects a reuse section from among a plurality of reuse candidate sections based on the reuse degree of the reuse candidate section supplied from the reuse degree generation unit 621. For example, the reuse section selection unit 622 selects a reuse candidate section that is equal to or greater than a certain threshold (reuse threshold) regarding the degree of reuse as a reuse section.
  • a certain threshold reuse threshold
  • the reuse section selection unit 622 generates the priority when deleting the execution history for each piece of identification information in the history memory 430 based on the degree of reuse.
  • the reuse segment selection unit 622 generates the priority so that the higher the reuse degree, the lower the priority.
  • the reuse section selection unit 622 supplies the identification information and the priority related to the selected reuse section to the notice instruction generation processing unit 623 together with the program.
  • the notice command generation processing unit 623 generates a notice command including information for specifying the reuse section before the calling instruction for calling the reuse section selected by the reuse section selection unit 622. is there.
  • the notice instruction generation processing unit 623 generates an input value setting instruction for setting the input value of the reuse section from the notice instruction to the instruction immediately before the calling instruction.
  • the notice command generation processing unit 623 sets the input value in the reuse section immediately before the input value setting command for setting the input value in the reuse section selected based on the degree of reuse among the plurality of command sections. Generate a notice command to notify the setting. For example, the notice instruction generation processing unit 623 inserts a notice instruction before a function call instruction that is a reuse section, and generates an input value setting instruction between the notice instruction and the call instruction.
  • the notice instruction generation processing unit 623 generates a notice instruction including identification information of a function called by the call instruction before the call instruction. That is, the notice command generation processing unit 623 generates a notice command including identification information for identifying a plurality of reuse sections selected based on the degree of reuse. For example, as illustrated in FIG. 5B, the notice command generation processing unit 623 generates a notice command (noticeCall) including identification information indicated by an index (index).
  • the notice instruction generation processing unit 623 includes, for example, a notice instruction including reference information for referring to the start address of a function preset in the register file 340 for execution of the call instruction before the call instruction. Insert.
  • the notice instruction generation processing unit 623 generates an address setting instruction for setting the head address of the function in the register file 340 before the notice instruction including the reference information. That is, the notice command generation processing unit 623 generates a notice command including reference information for referring to the start address after the address setting instruction for setting the start address of the reuse section.
  • the notice command generation processing unit 623 generates a notice command (noticeCall) including reference information (R25) as shown in FIG. 9B, for example.
  • the warning instruction generation processing unit 623 generates, as a warning setting instruction, a warning instruction including setting information indicating a setting destination of the start address of a function that is a jump destination of the calling instruction before the calling instruction. To do. That is, the notice command generation processing unit 623 generates a notice command as an address setting instruction including setting information indicating a setting destination of the function start address in order to set the start address of the reuse section. In this example, the notice instruction generation processing unit 623 generates a notice setting instruction (memolw) as shown in FIG.
  • the notice command generation processing unit 623 generates a notice command including identification information or a notice command further including the priority generated by the reuse section selecting unit 622 when generating a notice command including reference information. Are generated before the call instruction.
  • the notice command generation processing unit 623 generates a notice command including the priority given in accordance with the degree of reuse generated by the reuse degree generation unit 621.
  • the notice command generation processing unit 623 supplies an optimized program including the generated notice command to the code generation unit 630.
  • the notice command generation processing unit 623 is an example of the notice command generation processing unit described in the claims.
  • the code generation unit 630 generates an object program that is a code of a machine language program based on the optimized program supplied from the notice instruction generation processing unit 623.
  • the code generation unit 630 supplies the generated object program to the object program storage unit 520.
  • the object program storage unit 520 stores the object program supplied from the code generation unit 630.
  • the object program stored in the object program storage unit 520 is stored in the main storage unit 130 shown in FIG.
  • the notice command generation processing unit 623 it is possible to generate a program in which a notice command for notifying the execution of the call instruction is executed before the call instruction of the reuse section is executed.
  • the reuse level generation unit 621 the reuse level is generated based on the usage mode of the instruction interval that is executed a plurality of times. Therefore, the probability that the execution result is reused among the plurality of instruction intervals.
  • a high instruction interval can be selected as a reuse interval.
  • FIG. 13 is a diagram exemplifying a data format of a notice command generated by the program conversion processing device 500 according to the fourth embodiment of the present invention.
  • a notice command based on the data format of a 32-bit command according to MIPS is shown.
  • FIG. 13 (A) of FIG. 13 is a diagram showing a data format of a notice instruction including identification information.
  • FIG. 13B is a diagram showing a data format of a notice instruction including reference information.
  • FIG. 13C shows the data format of the notice setting instruction.
  • FIG. 13A shows fields representing operation code 711, index 712, priority 713, and function code 714, respectively.
  • operation code 711 “000000” indicating a special instruction (SPECIAL) is stored in 26 to 31 bits.
  • SPECIAL special instruction
  • identification information for identifying each of a plurality of functions selected by the reuse section selection unit 622 is stored in 10 to 25 bits.
  • priority 713 the priority when deleting the execution history in the history memory 430 is stored in 6 to 9 bits.
  • priority 713 the priority value generated by the reuse section selection unit 622 is stored.
  • function code 714 “000101” is stored in 0 to 5 bits as a notice instruction (noticeCall).
  • FIG. 13B shows fields representing operation code 721, priority 722, transfer destination register 723, and function code 724, respectively.
  • operation code 711 “000000” indicating a special instruction (SPECIAL) is stored in 26 to 31 bits.
  • SPECIAL special instruction
  • the priority when deleting the execution history of the history memory 430 is stored in 11 to 25 bits.
  • the priority value generated by the reuse section selection unit 622 is stored.
  • the transfer destination register 723 stores, as reference information, the register number storing the start address of the function in 6 to 10 bits.
  • “000101” is stored in 0 to 5 bits as a notice instruction (noticeCall).
  • FIG. 13C shows fields representing the operation code 731, the reference register 732, the transfer destination register 733, and the offset 734, respectively.
  • “011111” indicating a notice setting instruction (memolw) is stored in 26 to 31 bits.
  • the register number (R25) in which the reference address is stored is stored in 21 to 25 bits.
  • the transfer destination register 733 stores, as setting information indicating the setting destination, a register number in which a function start address for calling a function is set in 16 to 20 bits.
  • an offset value with respect to the reference address is stored in 0 to 15 bits.
  • Such a notice command or notice setting command is generated by the notice command generation processing unit 623 before a call command for calling a function.
  • FIG. 14 is a flowchart showing an example of the processing procedure of the notice instruction generation processing method of the program conversion processing apparatus 500 in the fourth embodiment of the present invention.
  • the reuse candidate section extraction unit 611 reads the source program from the source program storage unit 510 (step S931). Then, the reuse candidate section extraction unit 611 extracts a function that becomes a reuse candidate section from among a plurality of functions that are command sections that are executed a plurality of times (step S932).
  • step S933 the usage pattern of the reuse candidate section extracted by the reuse candidate section extraction unit 611 is analyzed by the reuse candidate section analysis unit 612 (step S933).
  • the reuse degree generation unit 621 generates a reuse degree for each reuse candidate section based on the usage mode of the reuse candidate section (step S934).
  • step S934 is an example of a reuse degree generation procedure described in the claims.
  • step S940 is an example of a notice instruction generation procedure described in the claims.
  • FIG. 15 is a flowchart illustrating an example of a processing procedure of a notice command process (step S940) for a notice command including identification information according to the fourth embodiment of the present invention.
  • the notice command generation processing unit 623 generates a notice command including identification information before the reuse section call command (step S942). For example, a notice instruction (noticeCall) specifying an index (index) is generated as in the first instruction sequence shown in FIG.
  • the announcement command generation processing unit 623 generates an input value setting command for setting the input value of the reuse section after the announcement command including the identification information (step S943).
  • input value setting instructions two load word instructions, two move instructions, and a store word instruction
  • FIG. 10 the announcement command generation processing unit 623 generates an input value setting command for setting the input value of the reuse section after the announcement command including the identification information.
  • the notice command generation processing unit 623 generates an address setting command for setting the start address of the reuse section after the input value setting command (step S944).
  • an address setting instruction (load word instruction) is generated as in the seventh instruction sequence shown in FIG.
  • the notice command generation processing unit 623 generates a call command for the reuse section after the address setting command (step S945).
  • a call instruction (jump instruction) is generated as in the eighth instruction sequence shown in FIG.
  • the notice command generation processing unit 623 repeatedly performs a series of processes in steps S942 to S945 for all reuse sections (step S946), and the process for all reuse sections is completed. The notice command generation process ends.
  • FIG. 16 is a flowchart showing an example of the processing procedure of the notice command processing (step S950) for the notice command including the reference information according to the fourth embodiment of the present invention.
  • the notice command generation processing unit 623 generates an address setting command for setting the start address of the reuse section (step S951).
  • an address setting instruction (load word instruction) is generated as in the first instruction sequence shown in FIG. 9B.
  • the notice command generation processing unit 623 generates a notice command including reference information after the address setting command (step S952). For example, a notice instruction (noticeCall) indicating the reference information (R25) is generated as in the second instruction sequence shown in (b) of FIG.
  • the announcement command generation processing unit 623 generates an input value setting command for setting the input value of the reuse section after the announcement command including the reference information (step S943).
  • input value setting instructions two load word instructions, two move instructions, and a store word instruction
  • FIG. 9B input value setting instructions
  • the notice command generation processing unit 623 generates a reuse section call command after the input value setting command (step S945).
  • a call instruction (jump instruction) is generated as in the eighth instruction sequence shown in FIG.
  • the notice command generation processing unit 623 repeatedly performs a series of processes of steps S951, S952, S943, and S945 until all reuse sections are processed (step S946). Then, when the processing for all the reuse sections ends, the notice command generation process ends.
  • FIG. 17 is a flowchart showing an example of the processing procedure of the notice command processing (step S960) for the notice setting command according to the fourth embodiment of the present invention.
  • the notice command generation processing unit 623 generates a notice setting command for setting the start address of the reuse section (step S961).
  • a notice setting instruction (memolw) is generated as in the first instruction sequence shown in FIG.
  • the notice value generation processing unit 623 generates an input value setting instruction for setting the input value of the reuse section after the notice setting instruction (step S943).
  • input value setting instructions two load word instructions, two move instructions, and a store word instruction
  • the notice command generation processing unit 623 generates a reuse section call command after the input value setting command (step S946).
  • a call instruction (jump instruction) is generated as in the seventh instruction sequence shown in FIG.
  • the notice command generation processing unit 623 repeatedly performs a series of processes in steps S961, S943, and S945 until all reuse sections are processed (step S946). Then, when the processing for all the reuse sections ends, the notice command generation process ends.
  • the processing time of the reuse section due to the reuse of the execution result by the data processing device 100 is generated by generating the notice instruction before the call instruction of the reuse section. Can be reduced.
  • the reuse rate of the execution result in the data processing apparatus 100 can be improved.
  • the processing of the reuse section is performed by performing the reuse processing of the execution result of the reuse section based on the notice command for notifying the execution of the process in the reuse section. Time can be greatly reduced.
  • First embodiment (compilation processing control: an example in which a call instruction is converted into a reuse instruction so that the total amount of data in the execution history is within the capacity of the history memory) 2.
  • Second Embodiment (Data Processing Control: Example of Holding Execution History Based on Reusage Instruction Converted so that Sum of Execution History Data Volume is Within Capacity of History Memory) 3.
  • Third embodiment (compilation control: example of conversion to a reuse instruction including priority) 4).
  • Fourth Embodiment (Data Processing Control: Example of Holding Execution History Based on Reuse Command Including Priority)
  • FIG. 18 is a block diagram illustrating a configuration example of the compile processing device 1500 according to the first embodiment of this invention.
  • the compile processing apparatus 1500 includes a source program storage unit 1510, a reuse assist compile processing unit 1520, and an object program storage unit 1530.
  • the instruction section processed by the compile processing apparatus 1500 is a function.
  • the source program storage unit 1510 stores a source program to be compiled.
  • This source program is, for example, a source program including a reuse section in which the execution result is reused.
  • the source program storage unit 1510 supplies the stored source program to the reuse assist compilation processing unit 1520.
  • the reuse assist compile processing unit 1520 compiles the source program read from the source program storage unit 1510 to generate an object program that is a machine language program after giving a reuse instruction.
  • the reuse instruction here is a process for reusing the execution result when the reuse section is called by distinguishing between the reuse section and the non-reuse section based on the degree of reuse. Is a command for causing the data processing apparatus to perform the operation.
  • the reuse assist compilation processing unit 1520 supplies the generated object program to the object program storage unit 1530.
  • the reuse assist compilation processing unit 1520 includes a program conversion processing unit 1600 and a code generation unit 1522.
  • the program conversion processing unit 1600 converts the source program into a highly efficient program including a reuse instruction by analyzing and optimizing the source program read from the source program storage unit 1510.
  • the program conversion processing unit 1600 includes a source program analysis unit 1610 and an optimization unit 1620.
  • the program conversion processing unit 1600 is an example of a program conversion processing device described in the claims.
  • the source program analysis unit 1610 performs morphological analysis, syntax analysis, and the like based on the source program read from the source program storage unit 1510.
  • the source program analysis unit 1610 generates an intermediate code program in a format suitable for analysis and optimization, and then analyzes the generated program.
  • the source program analysis unit 1610 includes a reuse candidate section extraction unit 1611 and a reuse candidate section analysis unit 1612.
  • the reuse candidate section extraction unit 1611 extracts a reuse candidate section that is a candidate for a reuse section that reuses an execution result from a program among a plurality of command sections.
  • the reuse candidate section extraction unit 1611 extracts command sections that may be called a plurality of times, such as functions and loops, as reuse candidate sections.
  • the reuse candidate section extraction unit 1611 excludes from the reuse candidate section functions that have no possibility of reusing execution results, such as functions that have different input results even if the input values are the same.
  • the reuse candidate section extraction unit 1611 excludes a function including a system call as the excluded function, for example.
  • the reuse candidate section extraction unit 1611 supplies the extracted reuse candidate section identification information to the reuse candidate section analysis unit 1612 together with the program.
  • the reuse candidate section analysis unit 1612 analyzes the usage mode related to the reuse candidate section extracted by the reuse candidate section extraction unit 1611.
  • the reuse candidate section analysis unit 1612 analyzes, for example, the contents relating to the arguments that are the input values of the function and the loop and the contents relating to the number of calls of the function and the loop as usage modes. Further, the reuse candidate section analysis unit 1612 outputs an estimated combination value as an analysis result, for example, by analyzing a combination of values that an argument can take based on the processing contents of a function and a loop.
  • the reuse candidate section analysis unit 1612 is a result of executing the reuse candidate section when the optimization unit 1620 predicts the data amount of the execution history which is data for reusing the execution result. Analyze contents related to execution results.
  • the reuse candidate section analysis unit 1612 supplies the result of the analysis to the optimization unit 1620 together with the identification information and program of the reuse candidate section.
  • the reuse candidate section analysis unit 1612 is an example of an analysis unit described in the claims.
  • the reuse candidate section is an example of an instruction section described in the claims.
  • the optimization unit 1620 performs program optimization processing such as optimization for improving execution speed and optimization for reducing code size based on the program supplied from the reuse candidate section analysis unit 1612. It is.
  • the optimization unit 1620 includes a reuse level generation unit 1621 and a reuse instruction conversion unit 1623.
  • the reuse level generation unit 1621 generates a reuse level indicating the degree to which the execution result of the reuse candidate section is reused based on the analysis result supplied from the reuse candidate section analysis unit 1612. For example, the reuse degree generation unit 1621 generates a reuse degree according to a combination of values that can be taken by the input values of the reuse candidate section. In this case, since the degree of reuse increases as the combination of values that can be taken by the input values in the reuse candidate section decreases, the degree of reuse is generated with the combination of values that can be taken by the input values as the denominator.
  • the reuse level generation unit 1621 supplies the generated reuse level to the reuse command conversion unit 1623 together with the identification information of the reuse candidate section and the program.
  • the reuse level generation unit 1621 is an example of a reuse level generation unit described in the claims.
  • the reuse instruction conversion unit 1623 converts a call instruction of a reuse candidate section that reuses an execution result into a reuse instruction based on the degree of reuse supplied from the reuse degree generation unit 1621.
  • the reuse instruction conversion unit 1623 supplies an optimized program including the converted instruction to the code generation unit 1522.
  • the reuse instruction conversion unit 1623 for example, based on the reuse degree, the predicted value of the data amount of the execution history of the reuse candidate section, and the capacity of the history memory in which the execution history is registered, A call instruction of a reuse section to be reused is converted into a reuse instruction.
  • the reuse instruction conversion unit 1623 depends on combinations of values that can be taken by the input values of the reuse candidate section, the number of input values, the number of execution results, and the number of input values and the number of bits of the execution results. To generate a predicted value of the data amount of the execution history.
  • the reuse instruction conversion unit 1623 sequentially calls the call instructions from the reuse candidate section with the highest reuse degree so that the sum of the predicted values of the data amount of the execution history is within the capacity of the history management unit. Convert to The reuse instruction conversion unit 1623 is an example of an instruction conversion unit described in the claims.
  • the code generation unit 1522 generates an object program that is a code of a machine language program based on the optimized program supplied from the reuse instruction conversion unit 1623.
  • the code generation unit 1522 supplies the generated object program to the object program storage unit 1530.
  • the object program storage unit 1530 stores the object program supplied from the code generation unit 1522.
  • the compile processing device 1500 distinguishes between a function that is reused and a function that is not reused by converting a function call instruction into a reuse instruction according to the degree to which the function execution result is reused. Generate a program that can.
  • the compile processing apparatus 1500 has been described with respect to an example in which a function is a reuse target, but a loop can also be a reuse target.
  • the reuse candidate section analysis unit 1612 analyzes the loop in the same manner as the function, and the reuse degree generation unit 1621 generates a reuse degree based on the analysis result of the reuse candidate section analysis unit 1612.
  • the reuse candidate section analysis unit 1612 analyzes the usage mode of the reuse candidate section for each function.
  • the reuse level generation unit 1621 may be generated for each function call instruction for more detailed analysis.
  • the reuse instruction conversion unit 1623 converts the call instruction into a reuse instruction for each function call instruction based on a different reuse degree for each function call instruction even if the function is the same.
  • FIG. 19 is a schematic diagram illustrating an example of a function that is excluded from a reuse candidate section when the reuse candidate section extraction unit 1611 extracts a reuse candidate section in the first embodiment of this invention.
  • the functions excluded from the reuse candidate sections by the reuse candidate section extraction unit 1611 are indicated by C language codes in each frame.
  • FIG. 19A shows a function (funcA) including a system call as a function excluded from the reuse candidate section.
  • the function (funcA) including this system call is likely to have different execution results each time it is executed even if the input values are the same. For this reason, the function (funcA) including the system call cannot be used as a reuse section. Therefore, the reuse candidate section extraction unit 1611 excludes a function including a system call from the reuse candidate section.
  • FIG. 19 shows a random number generation function (rand) as a function excluded from the reuse candidate section.
  • This random number generation function (rand) is a function that outputs a random value as an execution result each time it is called. For this reason, the reuse candidate section extraction unit 1611 excludes the random number generation function from the reuse candidate sections.
  • the reuse candidate section extraction unit 1611 excludes from the reuse candidate section functions that are unlikely to be reused in the execution result at the stage of analyzing the source program.
  • FIG. 20 is a schematic diagram illustrating a generation example of the reuse degree by the reuse degree generation unit 1621 when the number of arguments is analyzed as a usage mode by the reuse candidate section analysis unit 1612 according to the first embodiment of the present invention. It is.
  • FIG. 20 is a schematic diagram illustrating an example of a function having a different number of arguments.
  • funcA to C three functions having the same argument type as the input value but different numbers of arguments are shown. .
  • funcA that takes one int (integer) type variable as an argument
  • funcB that uses two int type variables as arguments
  • funcC A function having a variable as an argument is indicated by a C language code.
  • the reuse candidate section analysis unit 1612 analyzes the number of arguments in the three functions (func A to C) for each function. Then, the reuse level generation unit 1621 generates the reuse level based on the number of arguments analyzed by the reuse candidate section analysis unit 1612.
  • FIG. 20B is a schematic diagram showing an example of the degree of reuse generated based on the analysis result of the function shown in FIG.
  • the function with one argument (funcA) has the highest degree of reuse
  • the function with two arguments (funcB) has the second highest degree of reuse
  • the function with three arguments (funcC) It shows that the degree of reuse is the lowest.
  • the degree of matching of input values increases as the number of arguments decreases.
  • the degree of reuse showing the high degree is generated in order from the function with the smallest number.
  • the reuse level generation unit 1621 generates the reuse level according to the number of input values
  • the present invention is not limited to this.
  • the reuse degree generating unit 1621 obtains a combination of input values based on a combination of values that can be taken by the respective arguments, and this input
  • the degree of reuse is generated according to the number of value combinations is conceivable.
  • FIG. 21 is a schematic diagram illustrating a generation example of the reuse degree by the reuse degree generation unit 1621 in the case where the reuse candidate section analysis unit 1612 analyzes the argument type as the usage mode according to the first embodiment of this invention. It is.
  • FIG. 21 is a schematic diagram illustrating an example of a function having different argument types.
  • funcA to C three functions having the same number of arguments but different types of arguments are shown.
  • a function (funcA) having one variable of Boolean (Boolean) type, which is 1-bit binary numerical data, as an argument is indicated by a C language code.
  • a function (funcB) that uses one char type variable that is 16-bit binary character data as an argument and a function (funcC) that uses one int type variable that is 32-bit binary numeric data as an argument.
  • the reuse candidate section analysis unit 1612 analyzes the argument types in these three functions for each function. Then, the reuse degree generation unit 1621 generates a reuse degree based on the argument type analyzed by the reuse candidate section analysis unit 1612.
  • FIG. 21B is a schematic diagram showing an example of the degree of reuse generated based on the analysis result of the function shown in FIG.
  • the reusability of funcA with one variable of bool type as the argument is the highest
  • the reusability of funcB with one variable of char type as the argument is the second highest. It is shown that the degree of reuse of funcC with the number of variables as the argument is the lowest.
  • the reuse degree generation unit 1621 generates a degree of reuse indicating a higher degree in order from the function having the lowest expressiveness of the argument.
  • the expressiveness of this argument can be judged from the number of bits of the argument type. Therefore, the reuse level generation unit 1621 determines the argument having the smallest number of bits of the argument type as the argument having the lowest expressiveness, and sequentially determines the expressiveness of the argument.
  • FIG. 22 shows an example of reuse level generation by the reuse level generation unit 1621 in the case where the reuse candidate section analysis unit 1612 analyzes different arguments as constants and variables as usage modes according to the first embodiment of this invention. It is a schematic diagram which shows.
  • FIG. 22 is a schematic diagram showing an example of a function whose argument is either a constant or a variable.
  • main program main including two functions having the same number of arguments but different as constant arguments and variable arguments is shown.
  • a function (funcA) having one constant (0) and a plurality of variables as arguments, one int type variable (a), and a plurality of variables same as funcA are used as arguments.
  • the function (funcB) to be performed is indicated by a C language code.
  • the reuse candidate section analysis unit 1612 analyzes for each function whether the argument in the two functions is a constant or a variable. Then, the reuse degree generation unit 1621 generates a reuse degree based on the result analyzed by the reuse candidate section analysis unit 1612.
  • FIG. 22 is a schematic diagram showing an example of the degree of reuse generated based on the analysis result of the function shown in (a) of FIG.
  • the degree of reuse of a function (funcA) having one constant (0) and a plurality of variables as arguments is one int type variable (a) and the same plurality of variables as the first function are arguments. It is shown that the degree of reuse of the function (funcB) is higher.
  • the reuse level generation unit 1621 generates a reuse level that indicates a higher degree in order from a function having the largest number of constant arguments, for a plurality of functions having the same number of arguments but including constants as arguments.
  • the degree of reuse is generated by excluding arguments that are constants from the number of arguments, but the present invention is not limited to this.
  • the value that can be taken by the input value is “1”
  • by multiplying the value that can be taken by the constant and the value that can be taken by each variable a combination of values that can be taken by the entire input value is generated, A case where the degree of reuse is generated according to the generated combination is considered.
  • FIG. 23 shows a generation example of the reuse level by the reuse level generation unit 1621 when the combination of values taken by the arguments is analyzed as a usage mode by the reuse candidate section analysis unit 1612 according to the first embodiment of the present invention. It is a schematic diagram shown.
  • FIG. 23 is a schematic diagram illustrating an example of a function having different combinations of values taken by arguments.
  • the reuse candidate sections extracted by the reuse candidate section extraction unit 1611 two functions having the same number of arguments and the same type but limited values taken by the arguments are shown.
  • one int type variable is defined as an argument, but the value taken by the argument is limited to two values “2” and “3” when the function is called.
  • the function (funcA) is shown by a C language code.
  • one int type variable is defined as an argument, but at the stage when the function is called, the argument has four values of “2”, “3”, “4”, or “5”.
  • a function (funcB) whose value to be taken is limited is indicated by a C language code.
  • the reuse candidate section analysis unit 1612 analyzes the combination of values taken by the arguments in the two functions for each function. Then, the reuse degree generation unit 1621 generates a reuse degree based on the argument type analyzed by the reuse candidate section analysis unit 1612.
  • FIG. 23 is a schematic diagram showing an example of the degree of reuse generated based on the analysis result of the function shown in (a) of FIG.
  • the reuse degree of the function (funcA) in which the value taken by the argument is limited to two values “2” and “3” is “2”, “3”, “4”, or “5”. It is shown that the degree of reuse is higher than the function (funcB) in which the value taken by the argument is limited to these four values.
  • FIG. 24 shows an example of reuse level generation by the reuse level generation unit 1621 when analyzing the number of times the function is called by the reuse candidate section analysis unit 1612 as the usage mode in the first embodiment of this invention. It is a schematic diagram.
  • FIG. 24 is a schematic diagram illustrating an example of a function having a different number of times the function is called. Here, two functions that are called differently from the reuse candidate sections extracted by the reuse candidate section extraction unit 1611 are shown.
  • funcA a function called once
  • funcB a function called three times
  • the reuse candidate section analysis unit 1612 analyzes the number of times called by these two functions for each function. Then, the reuse degree generation unit 1621 generates a reuse degree based on the number of times the call is analyzed by the reuse candidate section analysis unit 1612.
  • FIG. 24B is a schematic diagram showing an example of the degree of reuse generated based on the analysis result of the function shown in FIG.
  • the degree of reuse of the function (funcB) called three times is higher than the degree of reuse of the function (funcA) called once.
  • the reuse level generation unit 1621 generates, for a plurality of functions having the same arguments but different number of times the function is called, a reuse level indicating a higher degree in order from the function having the highest number of calls.
  • FIG. 25 shows an example of how the reuse level is generated by the reuse level generator 1621 when the reuse candidate section analyzer 1612 in the first embodiment of the present invention analyzes the presence or absence of an argument that accompanies memory access as the usage mode. It is a schematic diagram which shows.
  • FIG. 25 is a schematic diagram illustrating an example of a function that accompanies memory access in setting an argument.
  • two functions having different arguments with memory access from among the reuse candidate sections extracted by the reuse candidate section extraction unit 1611 are shown.
  • a function (funcA) having a pointer and specifying the address of the memory area and a plurality of other variables as arguments (funcA) is indicated by a C language code. Yes.
  • a C language code shows a function (funcB) having one int type variable and a plurality of other variables the same as funcA as arguments.
  • the reuse candidate section analysis unit 1612 analyzes whether or not memory access is involved in these two functions. Then, the reuse degree generation unit 1621 generates a reuse degree based on the result analyzed by the reuse candidate section analysis unit 1612.
  • FIG. 25 is a schematic diagram illustrating an example of the degree of reuse generated based on the analysis result of the function illustrated in (a) in FIG.
  • the degree of reuse of funcB which uses one int type variable and the same other variables as funcA as arguments, is one variable specifying the address of the memory area and the other variables as arguments. It is shown that the degree of reuse of funcA is higher.
  • an argument specifying a memory area address with a pointer cannot reuse an execution result unless both the designated address and the designated address value match. That is, if multiple functions with the same number and type of arguments but different argument pointers are reuse candidate sections, the function with fewer arguments with pointers has a higher probability of reuse of execution results. Become.
  • the reuse level generation unit 1621 when the reuse level generation unit 1621 generates the reuse level for a plurality of functions having pointers and specifying the address of the memory area and having different numbers of arguments, the reuse level generation unit 1621 starts with the function having the smallest number of arguments having pointers. Generate a degree of reuse indicating a high degree. That is, when the function specifies a memory address by a variable having a pointer and uses a variable accompanied by memory access as an argument, the reuse level generation unit 1621 has a lower degree than a function having a variable having a pointer as an argument. A degree of reuse indicating is generated.
  • the reuse candidate section analysis unit 1612 analyzes the usage mode of the reuse candidate section, and the reuse degree generation unit 1621 generates the reuse degree based on the analysis result.
  • the reuse candidate section analysis unit 1612 analyzes the usage mode of the reuse candidate section for each function, and the reuse level generation unit 1621 describes the case of generating the reuse level for each function. However, it is not limited to this.
  • the reuse candidate section analysis unit 1612 analyzes a usage mode of a function called for each function call instruction, and the reuse level generation unit 1621 generates a reuse level for each function call command. It is done.
  • FIG. 26 is a schematic diagram of a program illustrating a first operation example of the program conversion processing unit 1600 according to the first embodiment of the present invention.
  • the reuse candidate section analysis unit 1612 analyzes the usage modes illustrated in FIGS. 20 to 25. Further, here, when the reuse candidate section analysis unit 1612 can guess the combination of values that can be taken by the argument by analyzing the processing contents of the reuse candidate section, the estimated combination value is used as the analysis result. Shall be output.
  • the reuse instruction conversion unit 1623 determines the instruction interval based on the degree of reuse, the capacity of the history memory in which the execution history written in the program is registered, and the predicted execution history data amount.
  • the call instruction is converted into a reuse instruction.
  • the instruction section is a function
  • the calling instruction is a “call” instruction when expressed in assembly language
  • the reusable instruction is expressed as “memocall” in assembly language.
  • the execution result of each function is one variable of the same type as the input value.
  • FIG. 26 (a) shows an operation example of the program conversion processing unit 1600 when the data processing device 1100 includes a history memory with a small capacity.
  • the frame on the left side with respect to the right arrow an example of the source program before being processed by the program conversion processing unit 1600 is shown in C language.
  • An example of a program processed by the program conversion processing unit 1600 is shown in assembly language in a frame on the right side with respect to the right arrow.
  • the history memory holds about five execution histories of a function that outputs one bool type execution result by using one bool type variable as an argument. It is assumed that the capacity is sufficient. Further, it is assumed that the history memory has a capacity that cannot hold even one execution history of a function that outputs one char type execution result by using one char type variable as an argument.
  • a main function (funcX) of the program and three functions called by the main function are shown.
  • a function (funcA) having one variable of a bool type as an argument a function (funcB) having one variable of a char type as an argument, and one variable of an int type as an argument Function (funcC).
  • the reuse candidate section extraction unit 1611 of the program conversion processing unit 1600 extracts a reuse candidate section from the source program.
  • a function having a bool type argument (funcA), a function having a char type argument (funcB), and a function having an int type argument (funcC) are extracted as reuse candidate sections.
  • the reuse candidate section analysis unit 1612 analyzes the usage mode of the extracted three functions (funcA to C). As a result, the argument of funcA is analyzed as one variable of bool type, the argument of funcB is analyzed as one variable of char type, and the argument of funcC is analyzed as one variable of int type.
  • the reuse candidate section analysis unit 1612 estimates combinations of values that can be used as arguments based on the processing contents of the function. In this program, it is assumed that the reuse candidate section analysis unit 1612 estimates that 50 execution results are provided for funcB, and outputs an analysis result indicating that execution results cannot be estimated for funcA and funcC.
  • the reuse level generation unit 1621 generates a reuse level based on the analysis result from the reuse candidate section analysis unit 1612. For example, regarding the function (funcA) having a Boolean argument, the reuse level generation unit 1621 has a maximum of two execution histories from the analysis result regarding the argument because one Boolean variable is an argument. Is a function that generates
  • generator 1621 with respect to the function (funcB) with argument of type char, for one variable char type is an argument, from the analysis results on that argument, up to 2 to 16 execution history Is determined to be generated. Further, with respect to function (funcC) with an int argument for one variable of type int is an argument, from the analysis results on the argument, determines the function of generating a maximum of 2 32 execution history. Along with these determinations, the reuse level generation unit 1621 determines the amount of execution history using the estimated combination value estimated based on the processing content of the function.
  • this reusability generation unit 1621 has a function (funcA) having a bool type argument having a maximum of two execution histories, and a function having a char type argument (funcB) having a maximum of 50 execution histories.
  • function with argument of type int (funcC) execution history determines the maximum 2 to 32.
  • the reuse level generation unit 1621 has the highest reuse rate of funcA having a bool type argument, the second highest reuse rate of funcB having a char type argument, and has an int type argument.
  • a reuse degree having the lowest degree of reuse of funcC is generated.
  • the reuse instruction conversion unit 1623 converts a call instruction in the instruction section into a reuse instruction based on the degree of reuse.
  • the reuse instruction conversion unit 1623 detects the capacity of the history memory from the code written in the program. Further, the reuse instruction conversion unit 1623 determines the data amount of the execution history predicted for the three functions (funcA to C) that are the reuse candidate sections, the combination of values that the input value can take, the number of execution results, The function is predicted for each function from the input value and the number of bits of the execution result.
  • the reuse instruction conversion unit 1623 sets the functions registered in the history memory in order from the function having the highest reuse degree. At this time, the reuse instruction conversion unit 1623 sets a function to be held in the history memory so that the total amount of execution history data predicted in the reuse candidate section is within the capacity of the history memory, and calls the function. An instruction (call) is converted into a reuse instruction (memocall).
  • the reuse instruction conversion unit 1623 analyzes that all execution histories can be registered in the history memory with respect to funcA having a Boolean type argument, and the funcA call instruction (call) is reused (memocall). ).
  • the reusable instruction conversion unit 1623 holds the data amount of the execution history of the function (funcA) converted into the reusable instruction in the history memory, the execution history of funcB having the char type argument is 1 It is determined that no individual can be registered. For this reason, the reuse instruction conversion unit 1623 does not convert the call instruction (call) of funcB into a reuse instruction (memocall).
  • the reuse instruction conversion unit 1623 determines that no funcC execution history can be held for funcC having an int-type argument, and the funcC call instruction (call) ) Is not converted.
  • the program conversion processing unit 1600 calls a funcA having a Boolean argument by a reuse instruction (memocall) and calls the other two functions (funcB and C) by a call instruction (call). Is generated.
  • FIG. 26B shows an example of the operation of the program conversion processing unit 1600 when the data processing apparatus 1100 includes a history memory 1430 with a large capacity.
  • the frame on the left side with respect to the right arrow an example of a source program before being processed by the program conversion processing unit 1600 is shown in C language, as in FIG. .
  • An example of a program processed by the program conversion processing unit 1600 is shown in assembly language in a frame on the right side with respect to the right arrow.
  • the history memory has a capacity sufficient to hold about 55 execution histories of a function that outputs one char type execution result by using one char type variable as an argument. Suppose there is.
  • the operations of the reuse candidate section extraction unit 1611, the reuse candidate section analysis unit 1612, and the reuse level generation unit 1621 are the same as the operations shown in FIG. .
  • the reuse instruction conversion unit 1623 converts the function call instruction (call) to the reuse instruction (call) as in FIG. memorycall).
  • the reuse instruction conversion unit 1623 first analyzes that a function having a Boolean argument (funcA) can register all execution histories in the history memory, and uses the funcA call instruction (call) as a reuse instruction. Convert to (memocall). Next, the reuse instruction conversion unit 1623 can register all the execution history of funcB having a char type argument in the history memory obtained by subtracting the data amount of the execution history of the function (funcA) converted into the reuse instruction. To analyze. By this analysis, the reuse instruction conversion unit 1623 converts the calling instruction (call) of funcB into a reuse instruction (memocall).
  • the reuse instruction conversion unit 1623 has only two execution histories of funcC having an int type argument in the history memory obtained by subtracting the data amount of the execution history of the functions (func A and B) converted into reuse instructions. Analyzes that registration is not possible. By this analysis, the reuse instruction conversion unit 1623 does not convert the funcC call instruction (call).
  • the program conversion processing unit 1600 generates a program that calls funcA having a bool type argument and funcB having a char type argument by a reuse instruction (memocall), and funcC calls by a call instruction (call). .
  • the reuse interval is a function
  • the call instruction is assumed to be a “call” instruction when expressed in assembly language
  • the reuse instruction is assumed to be expressed as “memocall” in assembly language. It is not limited to this.
  • the reuse interval is a loop
  • the call instruction is assumed to be a “branch” instruction when expressed in assembly language
  • the reuse instruction is expressed as “memoLoop” in assembly language.
  • FIG. 27 is a conceptual diagram showing an example of a function call instruction and a function reuse instruction according to the first embodiment of the present invention.
  • the processor core of the data processing apparatus that processes the reuse instruction is configured by MIPS.
  • the left end indicates the most significant bit (MSB), and the right end indicates the least significant bit (LSB).
  • FIG. 27A shows a JALR (JumpJLink Register) instruction which is a function call instruction (call) in the MIPS instruction set.
  • the MIPS instruction set is a 32-bit fixed-length instruction set, and the JALR instruction is represented by a bit string of 32 bits (0 to 31).
  • This JALR instruction includes an operation code field 1710, a function address field (rs) 1720, a first unused field 1730, a return address field (rd) 1740, a second unused field 1750, and a function designation field 1760. Composed.
  • the operation code field 1710 is a field for designating the type of instruction.
  • the opcode field 1710 is a bit string composed of the 26th to 31st bits. In this opcode field 1710, a bit string of “000000” is stored as a SPECIAL instruction.
  • the function address field (rs) 1720 is a field for designating a register for storing a function address.
  • the function address field (rs) 1720 is a bit string composed of the 21st to 25th bits.
  • the first unused field 1730 is a field that is not used in the JALR instruction.
  • the first unused field 1730 is the 16th to 20th bit strings.
  • the first unused field 1730 stores a bit string of “00000” in the JALR instruction.
  • the return address field (rd) 1740 is a field for designating a return address from the function.
  • the return address field (rd) 1740 is a bit string composed of the 11th to 15th bits. This return address field (rd) 1740 stores a bit string (11111) indicating the 31st register in the JALR instruction.
  • the second unused field 1750 is a field that is not used in the JALR instruction.
  • the second unused field 1750 is a bit string composed of the sixth to tenth bits.
  • the second unused field 1750 stores a bit string “00000” in the JALR instruction.
  • the function designation field 1760 is a field for designating one function among the plurality of functions when the instruction designated by the operation code field 1710 includes a plurality of functions.
  • This function designation field 1760 is a bit string composed of the 0th to 5th bits.
  • the function designation field 1760 stores a bit string “001001” in the JALR instruction.
  • FIG. 27B shows an example of a function reuse instruction.
  • This reuse instruction is expressed by a bit string of 32 bits (0 to 31).
  • the reuse instruction includes an operation code field 1710, a function address field (rs) 1720, a first reuse field 1731, a return address field (rd) 1740, a second reuse field 1751, and a function designation field 1760. Consists of Here, since the configuration other than the first reuse field 1731 and the second reuse field 1751 is the same as that in FIG. 27A, the same reference numerals as those in FIG. The description here is omitted.
  • the first reuse field 1731 and the second reuse field 1751 are both fields indicating a reuse instruction.
  • the first reuse field 1731 and the second reuse field 1751 are obtained by changing the bit strings of the first unused field 1730 and the second unused field 1750 in the JALR instruction to bit strings other than “00000”.
  • the first reuse field 1731 and the second reuse field 1751 may indicate a reuse instruction if one bit string is other than “00000”, and the other bit string may be “00000”.
  • FIG. 28 is a flowchart showing a processing procedure of compile processing by the compile processing device 1500 according to the first embodiment of the present invention.
  • the source program is read from the source program storage unit 1510 by the compile processing device 1500 (step S1911).
  • a reuse candidate section is extracted by the reuse candidate section extraction unit 1611 (step S1912).
  • Step S1913 is an example of an analysis procedure described in the claims.
  • step S1914 is an example of a reuse degree generation procedure described in the claims.
  • the reuse instruction conversion unit 1623 converts the call instruction for the reuse candidate section into a reuse instruction based on the degree of reuse (step S1916). This means that if the function is a reuse candidate section, the function call instruction (call) is converted to a reuse instruction (memoCall). Note that step S1915 is an example of an instruction conversion procedure described in the claims.
  • the code generation unit 1522 generates an object program that is a code of the machine language program based on the program including the converted instruction (step S1917).
  • a call instruction for a reuse candidate section to be reused can be re-used based on the degree to which the execution result is reused. It can be converted into usage instructions.
  • FIG. 29 is a block diagram illustrating a configuration example of the data processing device 1100 according to the second embodiment of the present invention.
  • This data processing apparatus 1100 is mutually connected to the main storage unit 1130 via a bus 1120.
  • the command interval processed by the data processing device 1100 is a function.
  • the data processing device 1100 executes each process in the program data.
  • the data processing apparatus 1100 is realized by a CPU (Central Processing Unit) in a general computer, for example.
  • the data processing apparatus 1100 includes a primary cache 1200, a processor core 1300, and a history management unit 1400.
  • the data processing apparatus 1100 processes a program including a reuse instruction generated by the compile processing apparatus 1500 according to the first embodiment of the present invention.
  • the primary cache 1200 temporarily holds information that the processor core 1300 inputs / outputs via the bus 1120.
  • the primary cache 1200 includes an instruction cache 1210 and a data cache 1220.
  • the instruction cache 1210 temporarily holds instructions executed in the processor core 1300.
  • the instruction cache 1210 temporarily reduces instructions that the processor core 1300 frequently executes, thereby reducing access from the processor core 1300 to the main storage unit 1130 and reducing data input waiting time in the processor core 1300. Let The instruction cache 1210 supplies the reuse instruction supplied from the main storage unit 1130 to the processor core 1300.
  • the data cache 1220 temporarily holds input data and output data of the processor core 1300.
  • the data cache 1220 temporarily holds input data of the processor core 1300 that is frequently used, thereby reducing access from the processor core 1300 to the main storage unit 1130, and reducing the data input waiting time in the processor core 1300. Reduce.
  • the data cache 1220 outputs the function input value and the function start address supplied from the main storage unit 1130 to the processor core 1300.
  • the processor core 1300 executes operations in accordance with program instructions.
  • the processor core 1300 is realized by, for example, a MIPS (Microprocessor without Interlocked Pipeline Stages) processor.
  • the processor core 1300 executes an instruction based on the instruction input from the instruction cache 1210 and the data cache 1220, the input data, and the start address of the function, and outputs the execution result of the result.
  • the input instruction is a reuse instruction that specifies a reuse section and the execution result is not supplied from the history management unit 1400
  • the processor core 1300 displays the execution result that is the result of executing this instruction in the data cache 1220. And output to the history management unit 1400.
  • the processor core 1300 stops the processing in the reuse section and uses the reuse section. Return to the routine that called the interval.
  • the history management unit 1400 retains and manages the execution result of the reuse section.
  • the history management unit 1400 holds section identification information, input values, and execution results of reuse sections supplied from the processor core 1300 as an execution history.
  • the section identification information here is information for specifying a reuse section, for example, a function or a loop start address.
  • the history management unit 1400 holds the function start address, the input value, and the execution result as the section identification information, the input value, and the execution result.
  • the history management unit 1400 searches for an execution history including the start address and the input value.
  • the bus 1120 is a bus for exchanging data to the data processing device 1100 and the main storage unit 1130.
  • the main storage unit 1130 holds data necessary for the data processing apparatus 1100 to operate.
  • the main storage unit 1130 may be, for example, a RAM (Random Access Memory).
  • the main storage unit 1130 outputs the stored data to the data processing device 1100 via the bus 1120.
  • the history management unit 1400 is provided in the data processing device 1100, so that an execution result is extracted from a plurality of command sections based on the degree of reuse.
  • the execution result of the reuse section can be reused.
  • FIG. 30 is a block diagram illustrating a configuration example of the processor core 1300 and the history management unit 1400 according to the second embodiment of the present invention.
  • the functions of the processor core 1300 and the history management unit 1400 are the same as those in FIG. 29, the same reference numerals are given and the description thereof is omitted here.
  • the processor core 1300 includes a fetch unit 1310, an instruction decoder 1320, an execution unit 1330, and a register file 1340.
  • the fetch unit 1310 reads an instruction from the main storage unit 1130 from the instruction cache 1210.
  • the fetch unit 1310 temporarily holds the read instruction, and supplies an instruction to be executed by the execution unit 1330 to the instruction decoder 1320 among the held instructions.
  • the fetch unit 1310 supplies a reuse instruction to be executed by the execution unit 1330 among the temporarily held instructions to the instruction decoder 1320.
  • the fetch unit 1310 supplies a reuse instruction stored in the main storage unit 1130 to the instruction decoder 1320.
  • the instruction decoder 1320 generates a control signal for controlling the components of the processor core 1300 by analyzing the instruction supplied from the fetch unit 1310. For example, the instruction decoder 1320 generates a control signal for controlling the execution unit 1330 and the register file 1340 by analyzing the instruction, and supplies the generated control signal to the execution unit 1330 and the register file 1340.
  • the instruction decoder 1320 analyzes the reuse instruction to generate control signals for controlling the execution unit 1330 and the register file 1340, and the execution unit 1330. This is supplied to the register file 1340.
  • the execution unit 1330 executes the instruction analyzed by the instruction decoder 1320 based on the control signal supplied from the instruction decoder 1320.
  • the execution unit 1330 starts processing of the reuse section specified by the reuse instruction. Further, along with the start of the processing of the reuse section, the execution unit 1330 outputs the section identification information of the reuse section acquired from the register file 1340 to the history management unit 1400 via the signal line 1309.
  • the execution unit 1330 executes processing in the reuse section based on the input value of the reuse section supplied from the register file 1340, and the history management unit 1400 receives the input value of the reuse section via the signal line 1309. Output to.
  • the execution unit 1330 cancels the processing of the reuse section and informs that the execution result has been received from the history management unit 1400. Is supplied to the fetch unit 1310. At this time, the execution unit 1330 outputs the execution result to the register file 1340.
  • the execution section 1330 performs the process of the reuse section to the end and outputs the execution result to the history management section 1400 and the register file 1340.
  • the execution unit 1330 is an example of an execution unit described in the claims.
  • the register file 1340 temporarily holds the data supplied from the data cache 1220 and the execution result supplied from the execution unit 1330. For example, when a control signal based on a reuse instruction is supplied from the instruction decoder 1320, the register file 1340 supplies the input value of the reuse section to the execution unit 1330.
  • the history management unit 1400 includes a history target data holding unit 1410, a history search unit 1420, a history memory 1430, and a history registration unit 1440.
  • the history target data holding unit 1410 temporarily holds the data supplied from the execution unit 1330.
  • the history target data holding unit 1410 supplies these to the history search unit 1420 as a search request.
  • the history target data holding unit 1410 supplies the start address and input value of the function supplied from the execution unit 1330 to the history search unit 1420 as a search request.
  • the history target data holding unit 1410 executes the section identification information, the input value, and the execution result supplied from the execution unit 1330 when conditions for registering the execution history are satisfied. This is supplied to the history registration unit 1440 as a history.
  • the history search unit 1420 searches the execution history based on the search request supplied from the history target data holding unit 1410, and outputs the execution result when the execution history is searched.
  • the history search unit 1420 includes a search request input unit 1421 and an execution result output unit 1422.
  • the history search unit 1420 is an example of a history search unit described in the claims.
  • the search request input unit 1421 searches for an execution history from the history memory 1430 based on the search request supplied from the history target data holding unit 1410. For example, when a function reuse instruction is analyzed by the instruction decoder 1320, the search request input unit 1421 searches the execution history by supplying the start address and input value of the function to the history memory 1430. Start.
  • the execution result output unit 1422 extracts an execution result from the history memory 1430 when an execution history is searched in the history memory 1430, and outputs the extracted execution result to the execution unit 1330.
  • the execution result output unit supplies the extracted execution result to the execution unit 1330 via the signal line 1409.
  • the history memory 1430 holds the execution history supplied from the history registration unit 1440. For example, when a search request is supplied from the history search unit 1420, the history memory 1430 holds an execution history that matches the search request, and displays the execution result of the execution history as an execution result output unit 1422. To supply.
  • the history memory 1430 holds the execution history when the execution history is supplied from the history registration unit 1440.
  • the history memory 1430 is realized by, for example, an associative memory (CAM: Content Addressable Memory).
  • CAM Content Addressable Memory
  • the history registration unit 1440 converts the execution history supplied from the history target data holding unit 1410 into a data structure that is stored in the history memory 1430, and registers the execution history in the history memory 1430. For example, when the execution history is not searched by the history search unit 1420 when a reuse instruction designating a function is analyzed in the instruction decoder 1320, the history registration unit 1440 is configured to start the function, input value, and execution. The result is registered in the history memory 1430 as an execution history.
  • the processor core 1300 and the history management unit 1400 can execute a program in which a function call instruction is converted into a reuse instruction according to the degree to which the function execution result is reused.
  • the processor core 1300 and the history management unit 1400 have been described with respect to an example in which a function is a reuse target.
  • a loop can also be a reuse target.
  • FIG. 31 is a conceptual diagram showing an example of the data structure of the history memory 1430 according to the second embodiment of the present invention.
  • a configuration is shown in which the history memory 1430 holds the execution history in one section identification information in a tree structure among the execution histories held for each section identification information.
  • a function is assumed that has n arguments and returns an output as an execution result to m storage destinations.
  • the start address of the function which is the start address of the function, is used as the section identification information.
  • the function root 1810 in the tree structure the first argument nodes 1821 and 1822, the nth argument nodes 1831 to 1834, the first output nodes 1841 to 1844, and the mth output nodes 1851 to 1854 are shown. Is shown.
  • a start address of a function as section identification information and a pointer pointing to the first argument node 1821 are shown.
  • the first and nth argument nodes 1821, 1822 and 1831 to 1834 include an input value indicating an argument value as an argument input value in the execution history held in the history memory 1430, a type of the argument, The type indicating the storage location of the argument is shown.
  • the storage location here refers to a register number or a memory address of the main storage unit 1130.
  • first and nth argument nodes 1821, 1822, and 1831 to 1834 include a right pointer that points to the argument node of the next argument when the input values to be compared match each other, and the same argument when they do not match And a lower pointer pointing to another argument node.
  • Each of the nth argument nodes 1831 to 1834 is connected to the first and mth output nodes 1841 to 1844 and 1851 to 1854, respectively.
  • the first and m-th output nodes 1841 to 1844 and 1851 to 1854 as an execution result in the execution history held in the history memory 1430, an output value indicating the value of the execution result and a storage location of the execution result are stored. The type to be shown and the type of the execution result are shown.
  • the first output nodes 1841 to 1844 show a right pointer that points to the next output node. That is, the first and mth output nodes 1841 to 1844 and 1851 to 1854 form a linked list.
  • the mth output nodes 1851 to 1854 show a null indicating the end of the output node.
  • the input value comparison process is to compare the input value, type, and type indicated by the first argument node 1821 with the input value from the history search unit 1420.
  • the argument node pointed to by the right or lower pointer is selected based on the result of the comparison process in each argument node, and the input value comparison process is sequentially executed in the selected argument node. For example, if the input value indicated by the nth argument node 1831 and the input value from the history search unit 1420 match each other, the first output node pointed to by the right pointer of the nth argument node 1831 The execution result of 1841 is output to the history search unit 1420. Finally, the execution result of the m-th output node 1851 is output to the history search unit 1420.
  • the history memory 1430 by configuring the history memory 1430 with a tree structure for each piece of identification information, it is not necessary to hold the input values of the same argument redundantly, so that the storage area can be saved. Further, by dividing the data structure for each identification information, it is possible to suppress a decrease in search speed.
  • FIG. 32 is a conceptual diagram illustrating an example of a program processed by the processor core 1300 and an execution history saved by the history management unit 1400 according to the second embodiment of the present invention.
  • a case where the execution history is stored using the conventional technique and a case where the execution history is stored according to the second embodiment of the present invention are shown.
  • the converted program is executed in order from the top of the program shown here.
  • FIG. 32 (a) is a schematic diagram showing a conversion example of a source program according to the prior art.
  • the source program is shown in C in the frame on the left side of the right arrow.
  • An example of a program converted by the prior art is shown in assembly language in a frame on the right side with respect to the right arrow.
  • a main function (funcX) of the program and six functions called by the main function are shown.
  • a function (funcA) having two variables of char type as an argument
  • a function (funcB) having one variable of char type and one variable of int type (funcB)
  • char type A function (funcC) with one variable as an argument
  • a function (funcD) having one variable of the bool type as an argument
  • a function (funcE) having two int type variables as arguments
  • a function (funcF) having one variable of int type as arguments.
  • FIG. 32B shows an example of an execution history stored in the history memory when the program shown in the frame on the right side of the right arrow in FIG. 32A is executed once in order from the top. It is a schematic diagram shown.
  • the history memory in which the execution history is stored can store the execution history related to two functions regardless of the type and number of input values and output values.
  • the effective history that has been unused for the longest period is deleted from the history memory, and then the new execution history is saved in the history memory.
  • the converted program call instructions shown in FIG. 32A are executed once in order from the top.
  • funcA to F six functions (funcA to F) are called by a reuse instruction (cal) based on the converted program on the right side of the right arrow in FIG.
  • a reuse instruction cal
  • funcA having two char type variables as arguments is called as a reuse section
  • the execution history of funcA is stored in the history memory.
  • execution history is saved after funcB, which has one char type variable and one int type variable as an argument, is called as a reuse section.
  • funcC with one char type variable as an argument is called as a reuse section in a state where there is no free space in the history memory.
  • the execution history of funcA that has been unused for the longest period is erased from the history memory, and the execution history of funcC is saved.
  • the funcD execution history is stored in place of the funcB execution history in the case of funcD with one Boolean variable as an argument.
  • the funcE execution history is stored instead of the funcC execution history.
  • a function funcF having one int type variable as an argument is called as a reuse section, the execution history of funcD that has been unused for the longest period is erased from the history memory, and the execution history of funcF Saved.
  • FIG. 32 is a schematic diagram showing a conversion example of the source program according to the first embodiment of the present invention.
  • the reuse level generation unit 1621 generates the reuse level based on a combination of values that can be taken by the input value of the function.
  • the history memory 1430 can store execution histories related to two functions regardless of the type and number of input values and output values.
  • This source program is first analyzed by the reuse candidate section analysis unit 1612 for each function with respect to the number and types of arguments in the six functions (funcA to F). Thereafter, the reuse level generation unit 1621 generates a reuse level based on the number and type of arguments analyzed by the reuse candidate section analysis unit 1612.
  • the reuse level generation unit 1621 generates the highest reuse level for funcD that takes one variable of the bool type as an argument based on the reciprocal of the combination of input values.
  • the second highest reusability is generated for funcC that takes the above variable as an argument.
  • the reuse level generation unit 1621 generates the third highest reuse level for funcB having one variable of char type and one variable of int type as arguments.
  • the fourth highest reusability is generated for funcA having two char-type variables as arguments and funcF having one int-type variable as arguments.
  • the lowest reusability is generated for funcE having two int type variables as arguments.
  • the reuse instruction conversion unit 1623 sets functions to be held in the history memory 1430 in order from the function having the highest reuse degree.
  • the reuse instruction conversion unit 1623 converts the funcD calling function (call) with one variable of the bool type as an argument and the funcC call instruction (call) with one variable of the char type as a reusing instruction (memocall). Convert.
  • FIG. 32D shows an example of an execution history stored in the history memory when the program shown in the frame on the right side of the right arrow in FIG. 32C is executed once in order from the top. It is shown.
  • the history memory 1430 can register execution histories related to two functions regardless of the type and number of input values and output values.
  • the processor core 1300 manages the execution history of funcC and funcD called by a reuse instruction (memoCall) based on the converted program shown in FIG. Output to the unit 1400.
  • a reuse instruction memoCall
  • the execution history of funcA and funcB is stored in the history memory 1430.
  • FIG. 33 is a flowchart illustrating a processing procedure of a function execution process performed by the processor core 1300 and the history management unit 1400 according to the second embodiment of the present invention.
  • an instruction for referring to a function and an input value of the function are read into the fetch unit 1310 and the register file 1340 (step S1931).
  • the instruction that references the function is decoded by the instruction decoder 1320 (step S1932).
  • the execution unit 1330 executes the function based on the input value supplied from the register file 1340 and outputs the execution result (step S1940). Then, the function execution process ends.
  • the search request input unit 1421 searches the execution history from the history memory 1430 using the start address and input value of the function supplied from the execution unit 1330 ( Step S1934).
  • step S1935 it is determined whether or not there is an execution history. If the execution history is in the history memory 1430, the execution result output unit 1422 outputs the execution result (step S1938). Subsequently, the execution unit 1330 stops the execution of the function for which the execution result is output (step S1939). Then, the execution of the function ends.
  • the execution unit 1330 executes the function based on the input value supplied from the register file 1340 and outputs the execution result (step S1936). . Then, the history registration unit 1440 registers the execution history in the history memory 1430 (step S1937). Steps S1936 and S1937 are an example of execution means described in the claims. Then, the execution of the function ends.
  • the reuse of the execution result is based on the program in which the calling instruction of the reuse section is converted into the reuse instruction according to the reuse degree of the reuse candidate section. Only the execution history of the reuse section having a high effect can be held in the history memory 1430.
  • FIG. 34 is a block diagram illustrating a configuration example of the compile processing device 1500 according to the third embodiment of the present invention.
  • the compile processing device 1500 includes a priority generation unit 1622 in addition to the configuration of the compile processing device 1500 shown in FIG.
  • the configuration other than the priority generation unit 1622 is the same as that in FIG. 18, the same reference numerals as those in FIG. 18 are given, and detailed description of the configuration of each unit here is omitted.
  • the priority generation unit 1622 generates a priority for holding the execution history in the history memory 1430 based on the reuse degree supplied from the reuse degree generation unit 1621. For example, the priority generation unit 1622 generates a higher priority in order from a reuse candidate section having a higher reuse degree.
  • the priority generation unit 1622 supplies the generated priority to the reuse instruction conversion unit 1623 together with the reuse degree, the identification information of the reuse candidate section, and the program.
  • the priority generation unit 1622 is an example of the priority generation unit described in the claims.
  • the reuse instruction conversion unit 1623 converts the calling instruction of the reuse candidate section into a reuse instruction including the priority based on the reuse degree and priority supplied from the priority generation unit 1622.
  • the reuse instruction conversion unit 1623 converts, for example, all the reuse candidate section call instructions for which the degree of reuse and the priority are calculated into a reuse instruction including the priority.
  • the reuse instruction conversion unit 1623 supplies an optimized program including the converted instruction to the code generation unit 1522.
  • the priority generation unit 1622 generates a priority according to the order of the reuse degree, but is not limited to this.
  • the priority generation unit 1622 generates the priority of the reuse candidate section based on the reuse degree, the predicted value of the execution history data amount of the reuse candidate section, and the capacity of the history memory 1430. And so on.
  • the priority generation unit 1622 generates a predicted value of the data amount of the execution history, similar to the reuse instruction conversion unit 1623 shown in FIG. Then, the priority generation unit 1622 generates the priority so that the execution history can be replaced efficiently in consideration of the timing at which the execution history is deleted from the history memory 1430.
  • the compile processing apparatus 1500 has been described with respect to an example in which a function is a reuse target, but a loop can also be a reuse target.
  • the reuse candidate section analysis unit 1612 analyzes the usage mode of the reuse candidate section for each function, but for each function call instruction for more detailed analysis. It is good also as what to do.
  • the reuse level generation unit 1621 generates a reuse level for each function call instruction, and the priority generation unit 1622 has a different priority level for each function call instruction even if the called function is the same. Is generated.
  • the reuse instruction conversion unit 1623 converts the function to be called into a reuse instruction including a different priority for each function call instruction.
  • FIG. 35 is a schematic diagram illustrating a conversion example of a program including a function in which a plurality of arguments are input values by the program conversion processing unit 1600 according to the third embodiment of the present invention.
  • FIG. 35 (a) is a schematic diagram showing a conversion example by the program conversion processing unit 1600 of a program including a plurality of functions having the same argument type but different number of arguments. Note that the reuse candidate section analysis unit 1612 and the reuse level generation unit 1621 are assumed to perform the same operation as the operation example shown in FIG. 20, and a detailed description thereof is omitted here.
  • an example of the source program before being processed by the program conversion processing unit 1600 is shown in C language.
  • An example of a program processed by the program conversion processing unit 1600 is shown in assembly language in a frame located on the right side with respect to the right arrow.
  • a main function (funcX) of the program and three functions called by the main function are shown.
  • a function (funcA) with one int type variable as an argument a function (funcB) with two int type variables as arguments, and three int type variables as arguments.
  • the function (funcC) is shown.
  • This source program is analyzed and generated by the reuse candidate section analysis unit 1612 and the reuse level generation unit 1621 in the same manner as the operation example shown in FIG. As a result, the function with one argument (funcA) has the highest degree of reuse, the function with two arguments (funcB) has the second highest degree of reuse, and the function with three arguments (funcC). The reuse degree with the lowest reuse degree is generated.
  • the priority generation unit 1622 generates priorities of three functions (funcA to funcC).
  • the priority generation unit 1622 generates the priority based on the reuse degree, thereby generating the highest priority (3) for the function (funcA) having the highest reuse degree, and the reuse degree is The second highest priority (2) is generated for the second highest function (funcB). Further, the priority generation unit 1622 generates the lowest priority (1) for the function (funcC) having the lowest reuse degree.
  • the reuse instruction conversion unit 1623 converts the call instruction of the reuse section for reusing the execution result into a reuse instruction including the priority based on the priority.
  • the reuse instruction conversion unit 1623 does not consider the capacity of the history memory, and therefore, the reuse instructions including the priorities of all the function call instructions for which the priorities are generated. Convert to As a result, the reuse instruction conversion unit 1623 converts the call instruction of the three functions (funcA to C) into a reuse instruction including the priority.
  • the program conversion processing unit 1600 generates a program as shown in the frame on the right side with respect to the right arrow.
  • funcA having one int-type variable as an argument is called by a reuse instruction (memoCall) including priority (3).
  • funcB with two int-type variables as arguments is called by a reuse instruction (memocall) including priority (2)
  • funcC with three int-type variables as arguments includes priority (1) Called by a reuse instruction (memocall).
  • FIG. 35 is a schematic diagram showing a conversion example by the program conversion processing unit 1600 of a program including a plurality of functions having different argument types and different numbers of arguments.
  • the reuse candidate section analysis unit 1612 analyzes the number of arguments and the type of the arguments as usage modes.
  • the reuse level generation unit 1621 generates the reuse level based on a combination of values that can be taken by the input value of the function.
  • FIG. 35B In the frame located on the left side with respect to the right arrow in FIG. 35B, an example of the source program before being processed by the program conversion processing unit 1600 is shown in C language. An example of a program processed by the program conversion processing unit 1600 is shown in assembly language in a frame located on the right side with respect to the right arrow.
  • a main function (funcX) of the program and four functions (funcA to D) called by the main function are shown.
  • a function (funcA) with one int type variable as an argument a function (funcB) with two int type variables as arguments, and two bool type variables as arguments
  • the function (funcC) is shown.
  • a function (funcD) having three variables of a Boolean type as arguments is shown.
  • This source program is first analyzed by the reuse candidate section analysis unit 1612 for each function with respect to the number and type of arguments in the four functions (funcA to D). Thereafter, the reuse level generation unit 1621 generates a reuse level based on the number and type of arguments analyzed by the reuse candidate section analysis unit 1612.
  • the reuse level generation unit 1621 uses the reciprocal of the combination of input values as the reuse level, and the reuse rate of funcC having two variables of the bool type as the argument is the highest, and the bool type of 3 The degree of reuse of the second highest degree of reuse of funcD is generated. Further, the reuse level generation unit 1621 uses the reciprocal of the combination of input values as the reuse level, and the reuse level of funcA having one int type variable as an argument is the third highest, and two int type The degree of reuse of funcB that uses the variable of as a parameter is the lowest degree of reuse.
  • the priority generation unit 1622 generates priorities of four functions (funcA to funcD).
  • the priority generation unit 1622 generates a priority (4) having the highest priority for a function (funcC) having the highest reuse by generating a priority based on the reuse.
  • the priority (3) having the second highest priority is generated.
  • the priority generation unit 1622 generates a priority (2) having the third highest priority for the function (funcA) having the third highest reuse degree, and a function (funcB) having the lowest reuse degree. Is generated with the lowest priority (1).
  • the reuse instruction conversion unit 1623 uses a reuse instruction including a priority for a call instruction in the reuse section for reusing the execution result. Is converted based on the priority.
  • the program conversion processing unit 1600 generates a program as shown in the frame located on the right side with respect to the right arrow.
  • funcA having one int type variable as an argument is called by a reuse instruction (memoCall) including priority (2).
  • funcB having two int-type variables as arguments is called by a reuse instruction (memoCall) including priority (1)
  • funcC having two bool-type variables as priorities (4) It is called by a reuse instruction (memoCall) including
  • funcC having three variables of the bool type as an argument is called by a reuse instruction (memoCall) including priority (3).
  • FIG. 36 is a schematic diagram illustrating a conversion example by the program conversion processing unit 1600 of a program including a function having the same argument type but different usage in the third embodiment of the present invention.
  • FIG. 36 (a) is a schematic diagram showing a conversion example by the program conversion processing unit 1600 of a program including a plurality of functions having the same argument type but having different argument usage modes by constants or variables.
  • the reuse candidate section analysis unit 1612 analyzes whether the argument is a constant or a variable and the limitation of the value that the argument can take as a usage mode.
  • the reuse level generation unit 1621 generates the reuse level based on a combination of values that can be taken by the input value of the function.
  • An example of a source program before being processed by the program conversion processing unit 1600 is shown in C language in a frame located on the left side with respect to the right arrow in FIG.
  • An example of a program processed by the program conversion processing unit 1600 is shown in assembly language in a frame located on the right side with respect to the right arrow.
  • the priority generation unit 1622 generates a value of “1 to 9” as the priority.
  • a main function (funcX) of the program and two functions (funcA and B) called by the main function are shown.
  • funcA and B the functions in which one int type variable is defined as an argument but the argument is limited to two values “2” and “3” when the function is called
  • a function (funcB) having one int type variable as an argument is shown.
  • This source program is first analyzed by the reuse candidate section analysis unit 1612 for each function regarding whether the argument in the two functions (funcA and B) is a constant or a variable, and the limitation of the value that the argument can take. The Then, the reuse degree generation unit 1621 generates a reuse degree based on the number and types of arguments analyzed by the reuse candidate section analysis unit 1612.
  • the reuse level generation unit 1621 defines one int type variable as an argument, but the function is limited to two values “2” and “3” when the function is called. The reuse degree with the highest degree of reuse is generated. Further, the reuse level generation unit 1621 generates a reuse level with the lowest degree of reuse of funcB that uses one int type variable as an argument.
  • the priority generation unit 1622 generates priorities of two functions (func A and B).
  • the priority generation unit 1622 generates a priority (9) having the highest priority for the function (funcA) having the highest reuse by generating a priority based on the reuse.
  • the priority (1) with the lowest priority is generated.
  • the reuse instruction conversion unit 1623 sets the call instruction of the reuse section for reusing the execution result to the reuse instruction including the priority. Convert based on.
  • the program conversion processing unit 1600 generates a program as shown in the frame located on the right side with respect to the right arrow.
  • This program defines one int type variable as an argument, but funcA, whose argument is limited to two values “2” and “3” when the function is called, has priority (9). Called by a re-use instruction (memoCall) that contains it. Further, funcB having one int type variable as an argument is called by a reuse instruction (memoCall) including priority (1).
  • FIG. 36 is a schematic diagram illustrating a conversion example by the program conversion processing unit 1600 of a program including a plurality of functions having different numbers of times the function is called.
  • the reuse candidate section analysis unit 1612 and the reuse level generation unit 1621 perform the same operation as the operation example shown in FIG.
  • the priority generation unit 1622 generates a value of “1 to 5” as the priority.
  • An example of the source program before being processed by the program conversion processing unit 1600 is shown in C language in a frame located on the left side with respect to the right arrow in FIG.
  • An example of a program processed by the program conversion processing unit 1600 is shown in assembly language in a frame located on the right side with respect to the right arrow.
  • funcX main function of the program and two functions (funcA and B) called by the main function are shown.
  • funcA is a function having one int type variable as an argument, and is a function called three times in the main function (funcX).
  • funcB is a function that has one int type variable as an argument, and is a function that is called once in the main function (funcX).
  • This source program is analyzed and generated by the reuse candidate section analysis unit 1612 and the reuse level generation unit 1621 in the same manner as the operation example shown in FIG. As a result, the function having one int type variable as an argument is generated, and the highest degree of reuse is generated for the function (funcA) called three times in the main function (funcX). Further, it is a function having one int type variable as an argument, and for the function (funcB) called once in the main function (funcX), the lowest degree of reuse is generated.
  • the priority generation unit 1622 generates a priority (5) having the highest priority for the function (funcA) with the highest reuse by generating a priority based on the reuse, For the function (funcB) having the lowest usage, the priority (1) having the lowest priority is generated.
  • the reuse instruction conversion unit 1623 converts the call instruction of the reuse section for reusing the execution result into a reuse instruction including the priority in the same manner as in FIG.
  • the program conversion processing unit 1600 generates a program as shown in the frame located on the right side with respect to the right arrow. That is, a function that takes one int type variable as an argument, and funcA that is called three times in the main function (funcX) is generated by a program that is called by a reusable instruction (memoCall) including priority (5). Is done. Also, a function that takes one int type variable as an argument, and funcB that is called once in the main function (funcX) is generated by a program that is called by a reuse instruction (memoCall) including priority (1) Is done.
  • FIG. 37 is a conceptual diagram showing an example of a function call instruction and a function reuse instruction according to the third embodiment of the present invention.
  • the processor core 1300 of the data processing apparatus 1100 is configured by MIPS as in FIG.
  • the left end indicates the most significant bit (MSB)
  • the right end indicates the least significant bit (LSB).
  • first reuse fields 1732 and 1733 are used.
  • second reuse fields 1752 and 1753 are shown. Since the functions of the fields other than the first reuse fields 1732 and 1733 and the second reuse fields 1752 and 1753 are the same as those in FIG. 27, the same reference numerals as those in FIG. The description of each field is omitted.
  • FIG. 37 (a) shows a JALR instruction which is a function call instruction (call) in the MIPS instruction set.
  • the JALR instruction in the MIPS instruction set is used as the function call instruction that is not reused in the third embodiment of the present invention.
  • FIG. 37 (b) shows an example of a function reuse command in the third embodiment of the present invention.
  • the first reuse fields 1732 and 1733 are fields indicating a reuse command including a priority together with the second reuse fields 1752 and 1753.
  • the first reuse fields 1732 and 1733 become a field indicating a 10-bit numerical value indicating the priority by concatenating with the bit string of the second reuse fields 1752 and 1753.
  • the first reuse field 1732 stores the value of the bit string in the reuse instruction with the lowest priority together with the second reuse field 1752.
  • the first reuse field 1732 is combined with the second reuse field 1752 to form a 10-bit bit string (0000000001). That is, in the data processing apparatus that processes this command, it is determined that this bit string (0000000001) indicates the priority (1).
  • the first reuse field 1733 stores the value of the bit string in the reuse instruction with the highest priority, together with the second reuse field 1753.
  • the first reuse field 1733 is concatenated with the second reuse field 1753 to form a 10-bit bit string (1111111111). That is, in the data processing apparatus that processes this command, it is determined that this bit string (11111111111) indicates the priority (1024).
  • the reuse instruction conversion unit 1623 changes the value indicated by the bit string obtained by connecting the first reuse fields 1732 to 1733 and the second reuse fields 1752 to 1753. Reusable instructions with different priorities can be generated.
  • FIG. 38 is a flowchart showing a processing procedure of compile processing by the compile processing device 1500 according to the first embodiment of the present invention.
  • the source program is read from the source program storage unit 1510 by the compile processing device 1500 (step S1911).
  • a reuse candidate section is extracted by the reuse candidate section extraction unit 1611 (step S1912).
  • Step S1913 is an example of an analysis procedure described in the claims.
  • step S1914 is an example of a reuse degree generation procedure described in the claims.
  • the priority generation unit 1622 generates a priority based on the reuse degree (step S1915).
  • the reuse instruction conversion unit 1623 converts the calling instruction for the reuse candidate section into a reuse instruction including the priority based on the reuse degree and the priority (step S1916).
  • the function call instruction (call) is converted into a reuse instruction (memoCall) including the priority.
  • step S1915 is an example of an instruction conversion procedure described in the claims.
  • the code generation unit 1522 generates an object program that is a code of the machine language program based on the program including the converted instruction (step S1917).
  • the call instruction of the reuse candidate section to be reused is recorded based on the degree to which the execution result is reused. It can be converted into a reuse instruction including the priority stored in the memory.
  • FIG. 39 is a block diagram illustrating a configuration example of the processor core 1300 and the history management unit 1400 according to the fourth embodiment of the present invention.
  • a priority table 1450 a history memory capacity management unit 1460, and a low priority history erasure unit 1470 are provided.
  • the functions of the components other than the priority table 1450, the history memory capacity management unit 1460, and the low priority history deletion unit 1470 are substantially the same as those in FIG. Detailed description thereof is omitted here.
  • the execution unit 1330 starts the processing of the reuse section designated by the reuse instruction including the priority. Along with the start of this processing, the section identification information and the priority of the reuse section acquired from the register file 1340 are output to the history management unit 1400 via the signal line 1309.
  • the history target data holding unit 1410 supplies the priority to the history registration unit 1440 together with the execution history.
  • the history registration unit 1440 supplies priority to the history memory 1430 when registering a new execution history in the history memory 1430.
  • the history registration unit 1440 when the capacity of the new execution history is larger than the free space of the history memory notified from the history memory capacity management unit 1460. Suspends registration.
  • the history registration unit 1440 supplies the low priority history erasing unit 1470 with the priority related to the execution history for which the registration is temporarily suspended.
  • the history registration unit 1440 is supplied with information indicating that the priority related to the new execution history is lower than the priority related to the already registered execution history from the low priority history deletion unit 1470, A new execution history is not registered.
  • the priority table 1450 holds the priority related to the execution history registered in the history memory 1430 and the address of the execution history in the history memory 1430 as priority information. For example, when a new execution history is held in the history memory 1430, the priority table 1450 indicates the priority regarding the registered execution history supplied from the history memory 1430 and the registered execution history. Address information is stored as priority information. For example, when the execution history is deleted in the history memory 1430, the priority table 1450 deletes the priority information related to the deleted execution history.
  • this priority table 1450 supplies the priority information with the lowest priority searched by the low priority history deleting unit 1470 to the low priority history deleting unit 1470 as deletion candidate information.
  • the priority table 1450 is an example of a priority table described in the claims.
  • the history memory capacity management unit 1460 manages the free capacity of the history memory 1430. For example, the history memory capacity management unit 1460 measures the free capacity of the history memory 1430 every time a new execution history is registered in the history memory 1430. Further, the history memory capacity management unit 1460 measures the free capacity of the history memory 1430 every time the execution history is deleted from the history memory 1430. The history memory capacity management unit 1460 supplies information related to the free capacity of the history memory 1430 to the history registration unit 1440.
  • the low priority history deleting unit 1470 deletes the execution history indicated by the deletion candidate information from the history memory 1430.
  • the low priority history deletion unit 1470 includes a minimum value priority history search unit 1471, a priority comparison unit 1472, and an deletion unit 1473.
  • the minimum value priority history search unit 1471 searches the priority table 1450 for priority information including the lowest priority as erasure candidate information.
  • the minimum value priority history search unit 1471 extracts the searched deletion candidate information from the priority table 1450, and supplies the extracted deletion candidate information to the priority comparison unit 1472.
  • the minimum value priority history search unit 1471 is an example of the lowest priority history search unit described in the claims.
  • the priority comparison unit 1472 compares the priority related to the new execution history with the priority included in the erasure candidate information supplied from the minimum value priority history search unit 1471.
  • the priority comparison unit 1472 supplies the deletion candidate information to the deletion unit 1473 when the priority included in the deletion candidate information is lower than the priority related to the new execution history.
  • the priority comparison unit 1472 sends information for canceling the registration of the new execution history to the history registration unit 1440.
  • the priority comparison unit 1472 is an example of the priority comparison unit described in the claims.
  • the deletion unit 1473 is to delete the execution history from the history memory 1430 based on the deletion candidate information supplied from the priority comparison unit 1472.
  • the erasure unit 1473 erases the execution history indicated by the address included in the erasure candidate information supplied from the priority comparison unit 1472 from the history memory 1430. Note that the erasing unit 1473 is an example of an erasing unit described in the claims.
  • FIG. 40 is a conceptual diagram showing an example of the data structure of the history memory 1430 according to the fourth embodiment of the present invention.
  • a configuration is shown in which the history memory 1430 holds the execution history in one section identification information in a tree structure among the execution histories held for each section identification information.
  • a function is assumed that has n arguments and returns an output as an execution result to m storage destinations.
  • the start address of the function is used as section identification information.
  • the address of the mth output is assumed to be the address of the execution history in which the priority information is registered.
  • the function root 1815 in the tree structure the first argument nodes 1825 and 1826, the nth argument nodes 1835 to 1838, the first output nodes 1845 to 1848, and the mth output nodes 1855 to 1858 are shown. Is shown.
  • the function route 1815 shows a start address of a function that is section identification information and a pointer that points to the first argument node 1825. Yes.
  • the first and n-th argument nodes 1825, 1826, and 1835 to 1838 include arguments similar to the first and n-th argument nodes 1821, 1822, and 1831 to 1834 in the first embodiment shown in FIG.
  • the input value, type, and type are shown.
  • first and nth argument nodes 1825, 1826, and 1835 to 1838 show the right pointer and the lower pointer, as in the case of the argument nodes 1821, 1822, and 1831 to 1834 of the first embodiment in FIG. Has been. Further, in the first and nth argument nodes 1825, 1826, and 1835 to 1838, an erase pointer that indicates the argument node of the next argument is indicated by a dotted arrow when being erased from the history memory 1430. Each of the nth argument nodes 1835 to 1838 is connected to the first output nodes 1845 to 1848, respectively.
  • the first and m-th output nodes 1845 to 1848 and 1855 to 1858 are the results of executing the execution history.
  • the output value, type, and type are shown.
  • right pointers are shown in the first output nodes 1845 to 1848, similarly to the output nodes 1841 to 1844 of the first embodiment.
  • the erase pointers indicating the argument nodes of the next argument are indicated by dotted arrows when they are erased from the history memory 1430.
  • erasure of the input node related to the execution history to be erased from the history memory 1430 starts from the nth input node.
  • the input node pointed to by the erase pointer holds the right pointer or the lower pointer to a node other than the node holding the erase pointer, the input node is not erased.
  • the pointer indicating the erased input node is erased, thereby terminating the erase of the input node. If the first input node does not hold the right pointer or the lower pointer that points to other than the erased input node, the function route 1815 is also erased, and the erase of the execution history is terminated.
  • the erasure pointer is referenced and extracted from the output node 1855 to the first output node 1845, the nth input node 1835 pointed to by the erasure pointer of the first output node 1845 is referenced, and the output nodes 1845 to 1855 are also referenced.
  • the output nodes up to are deleted.
  • the nth input node 1835 includes a right pointer or a lower pointer to other than the output node 1845.
  • the nth input node 1835 points to the first output node 1845 by the right pointer, whether or not the nth input node 1835 includes a lower pointer that points to the nth input node 1836. Is detected.
  • the nth input node 1836 is held in the history memory 1430 and the lower pointer is included in the nth input node 1835, the nth input node 1835 is not erased and the nth input node 1835 is deleted. The right pointer at the input node 1835 is deleted. Then, the erase of the execution history is terminated.
  • the input node indicated by the erase pointer of the nth input node 1835 is referred to. And the input node 1835 is deleted. Then, erasure of the input node is repeated until an input node that is not erased is detected or until all the input nodes are erased and the function route 1815 is erased.
  • FIG. 41 is a conceptual diagram illustrating an example of a data structure of the priority table 1450 according to the fourth embodiment of this invention.
  • the priority of 1 to 6 and the address related to the execution history generated by the reuse instruction including this priority are shown.
  • the priority registered in the priority table 1450 is shown.
  • this priority column 1861 all priorities relating to the execution history registered in the history memory 1430 are stored. For example, when the execution history generated by the reuse instruction including the priorities of 1 to 6 is held in the history memory 1430, the priorities 1 to 6 are stored in the priority column 1861.
  • the execution history final output address column 1862 the final output address of the execution history in the history memory 1430 generated by the reuse instruction including the priority shown in the priority column 1861 is shown.
  • This final output address is, for example, the address of the mth output nodes 1855 to 1858 shown in FIG.
  • the priority table 1450 when the execution history of the reuse section with the priority “6” is newly registered in the history memory 1430, the priority (6) and the mth output node of the history memory 1430 The address is supplied from the history memory 1430 to the priority table 1450.
  • the priority table 1450 when the priority (6) is already registered in the priority column 1861, the new priority information m in the execution history final output address column 1862 for the priority (6). Add the address of the first output node.
  • FIG. 42 is a conceptual diagram illustrating an example of a program processed by the processor core 1300 and an execution history stored by the history management unit 1400 according to the fourth embodiment of the present invention.
  • a case where the execution history is stored using the conventional technique and a case where the execution history is stored according to the fourth embodiment of the present invention are shown.
  • the converted program is executed in order from the top of the program shown here.
  • FIG. 42 (a) is a schematic diagram showing an example of conversion of a source program according to the prior art.
  • the source program converted by the prior art is shown in C language.
  • An example of a program converted by the prior art is shown in assembly language in a frame on the right side with respect to the right arrow.
  • the source program shows the main function (funcX) of the program and seven functions called by the main function.
  • a function (funcA) having one int type variable as an argument
  • a function (funcB) using one bool type variable as an argument
  • a bool type A function (funcC) with one variable as an argument
  • a function (funcD) having three variables of bool type as an argument
  • a function (funcE) having one variable of char type as an argument
  • a function (funcF) having two variables of bool type as arguments.
  • a function (funcG) having two int type variables as arguments is shown.
  • FIG. 42B shows an example of the execution history stored in the history memory 1430 when the program shown in the frame on the right side of the right arrow in FIG. It is a schematic diagram which shows.
  • the history memory in which the execution history is registered can register the execution history regarding three functions regardless of the type and number of input values and output values.
  • FIG. 32 when there is no free space in the history memory when registering a new execution history, an effective history that has been unused for the longest period is deleted from the history memory and then a new one is created. The execution history is registered in the history memory.
  • the converted program call instruction shown in FIG. 42A is executed once in order from the top.
  • an execution history with a high probability of being reused is not always registered in the history memory. That is, depending on the program to be executed, the execution history of a function that is not reused at all is registered in the history memory, and there is a case where the effect of reuse does not appear.
  • 42 (c) is a schematic diagram showing an example of conversion of the source program according to the first embodiment of the present invention.
  • the reuse level generation unit 1621 generates the reuse level based on a combination of values that can be taken by the input value of the function.
  • This source program is analyzed by the reuse candidate section analysis unit 1612 in the same manner as the source program shown in FIG. 32 (c), and the reuse level is generated in the same manner by the reuse level generation unit 1621.
  • the highest reuse degree is generated for funcB that takes one variable of the bool type as an argument, and the second highest reuse degree for funcF that takes two variables of the bool type as arguments. Is generated.
  • the third highest reuse factor is generated for funcD that has three variables of the bool type, and the fourth highest reuse factor for funcE that has one variable of the char type. Is generated.
  • the fifth highest reuse factor is generated for funcC that takes one variable of int type and one variable of bool type as an argument, and funcF that uses one variable of int type as an argument
  • a sixth highest degree of reuse is generated. Then, the lowest reusability is generated for funcG having two int type variables as arguments.
  • the priority generation unit 1622 generates the priority of seven functions (funcA to G).
  • the priority generation unit 1622 generates a priority (7) having the highest priority for the function (funcB) with the highest reuse by generating a priority based on the reuse, For the function (funcF) having the second highest usage, the priority (6) having the second highest priority is generated.
  • the priority generation unit 1622 generates the third highest priority (5) for the function with the third highest reuse (funcD), and the function with the fourth highest reuse (funcE).
  • the fourth highest priority (4) is generated.
  • the fifth highest priority (3) is generated for the function (funcC) with the fifth highest reuse level, and the sixth highest priority (funcA) with the sixth highest priority (funcA). 2) is generated.
  • the lowest priority (1) is generated for the function (funcG) having the lowest reuse level.
  • the reuse instruction conversion unit 1623 converts the call instruction of the reuse section for reusing the execution result into a reuse instruction including the priority based on the priority.
  • the reuse instruction conversion unit 1623 does not consider the capacity of the history memory, and therefore, the reuse instructions including the priorities include all the function call instructions for which the priorities are generated. Convert to
  • the reuse instruction conversion unit 1623 generates a program in which the call instruction (call) of seven functions (funcA to G) is converted into a reuse instruction (memoCall) including priority.
  • FIG. 42 (d) shows an example of an execution history registered based on the program shown in the frame on the right side of the right arrow in FIG. 42 (c).
  • the history memory 1430 can register execution histories related to three functions regardless of the type and number of input values and output values.
  • the processor core 1300 has functions of funcA to G called by a reuse instruction (memoCall) including a priority based on the converted program shown in FIG.
  • the execution history is output to the history management unit 1400.
  • funcA is called as a reuse section, and the execution history of funcA is registered in the history memory 1430.
  • the address and priority of the mth output node in the execution history shown in FIG. 40 are supplied from the history memory 1430 to the priority table 1450 and registered in the priority table 1450 as priority information.
  • two functions (funcB and C) called after funcA are also called as a reuse section, and the execution history is registered, and priority information is registered in the priority table 1450. .
  • the priority comparison unit 1472 includes the priority (5) related to the execution history of funcD and the deletion candidate information (funcA priority information) searched for by the minimum value priority history search unit 1471 from the priority table 1450. Compare with priority (2).
  • the minimum value priority history search unit 1471 supplies the erasure candidate information (funcA priority information) to the erasure unit 1473.
  • the erasure unit 1473 erases the execution history of funcA based on the supplied erasure candidate information.
  • the priority table 1450 erases the priority information of funcA according to the erase information of the execution history of funcA supplied from the priority table 1450.
  • the history registration unit 1440 then checks the free capacity of the history memory 1430 based on the free information of the history memory 1430 supplied from the history memory capacity management unit 1460, and then registers the execution history of funcD in the history memory 1430. As the funcD execution history is registered, priority information related to the funcD execution history is registered in the priority table 1450.
  • funcE is called as a reuse section.
  • the priority comparison unit 1472 compares the priority (4) regarding the execution history of funcE with the priority (3) of the erasure candidate information (priority information of funcC) as in the case of funcD. As a result of this comparison, it is determined that the priority (3) of the deletion candidate information (funcC priority information) is lower, and the funcC execution history is erased from the history memory 1430 as in the case of funcD. Is registered in the history memory 1430.
  • funcF is called as a reuse section.
  • the priority (4) of the erasure candidate information (funcE priority information) is lower than the priority (6) regarding the execution history of funcF.
  • the execution history of funcE is deleted from the history memory 1430, and the execution history of funcF is newly registered in the history memory 1430.
  • funcG is called as a reuse section.
  • the priority comparison unit 1472 it is determined that the priority (1) related to the execution history of funcG is lower than the priority (5) of the deletion candidate information (priority information of funcD). Then, the priority comparison unit 1472 supplies the history registration unit 1440 with information for canceling the registration of the execution history of funcG. As a result, the history registration unit 1440 stops registering the execution history of funcG in the history memory 1430.
  • the fourth embodiment of the present invention by registering the execution history in the history memory 1430 according to the priority, the function that has a high probability of being reused is registered in the history memory 1430 in advance. be able to.
  • FIG. 43 is a flowchart illustrating a processing procedure of a function execution process performed by the processor core 1300 and the history management unit 1400 according to the fourth embodiment of the present invention.
  • an instruction for referring to a function and an input value of the function are read into the fetch unit 1310 and the register file 1340 (step S1931).
  • the instruction that references the function is decoded by the instruction decoder 1320 (step S1932).
  • the execution unit 1330 executes the function based on the input value supplied from the register file 1340 and outputs the execution result (step S1940). Then, the function execution process ends.
  • the search request input unit 1421 searches the execution history from the history memory 1430 using the start address and input value of the function supplied from the execution unit 1330 ( Step S1934).
  • step S1935 it is determined whether or not there is an execution history. If the execution history is in the history memory 1430, the execution result output unit 1422 outputs the execution result (step S1938). Subsequently, the execution unit 1330 stops the execution of the function for which the execution result is output (step S1939). Then, the execution of the function ends.
  • the execution unit 1330 executes the function based on the input value supplied from the register file 1340 and outputs the execution result (step S1936). Then, the history registration unit 1440 performs an execution history registration process corresponding to the free space of the history memory 1430 (step S1950). Then, the execution of the function ends.
  • step S1950 the processing in step S1950 according to the fourth embodiment of the present invention will be described with reference to the drawings.
  • FIG. 44 is a flowchart illustrating an example of a processing procedure of execution history registration processing (step S1950) by the history management unit 1400 according to the fourth embodiment of the present invention.
  • the history registration unit 1440 determines whether or not the history memory 1430 has a free space for registering a new execution history, based on the free space information of the history memory 1430 supplied from the history memory capacity management unit 1460. (Step S1951). If the free space is in the history memory 1430, the execution history is registered in the history memory 1430 (step S1952). Subsequently, the priority of the execution history and the address of the last output node in the history memory 1430 are registered in the priority table 1450 (step S1953). Then, the execution history registration process ends.
  • the priority of the new execution history and the priority information searched by the minimum value priority history search unit 1471 is the minimum value. Are compared by the priority comparison unit 1472 (step S1954). If the priority of the new execution history is lower than the priority of the priority information, the registration of the new execution history in the history memory 1430 is canceled (step S1955). Then, the execution history registration process ends.
  • the deletion history 1473 deletes the execution history indicated by the priority information from the history memory 1430 (step S1956). And it returns to step S1951 and a process is repeated.
  • the fourth embodiment of the present invention by registering the execution history in the history memory 1430 according to the priority, the function that has a high probability of being reused is registered in the history memory 1430 in advance. be able to.
  • First Embodiment Data Processing Control: Example of Preregistration of Input Value Setting Instruction Address
  • Second Embodiment Program Analysis Processing: Extraction Example of Input Value Setting Instruction Address
  • Third Embodiment Data Processing Control: Input Value Setting Instruction Address Registration Example During Program Execution
  • Fourth Embodiment History Data Transfer Control: Example of Reading History Data from Outside the Data Processing Device to the History Memory for Each Program Execution
  • FIG. 45 is a block diagram illustrating a configuration example of the data processing device according to the first embodiment of the present invention.
  • a data processing device 2100, a bus 2120, and a main storage unit 2130 constituting an integrated circuit are shown.
  • This integrated circuit executes processing in the data processing device 2100 in accordance with a command sequence from the main storage unit 2130 read via the bus 2120.
  • the data processing device 2100 includes a primary cache 2200, a data processing unit 2300, an execution result reuse processing unit 2400, and a search start instruction address management unit 2500.
  • the data processing device 2100 is an example of a data processing device described in the claims.
  • the primary cache 2200 is a memory for reducing a delay time caused by processing when reading or writing an instruction and data from the main storage unit 2130 via the bus 2120.
  • the primary cache 2200 is realized by, for example, a DRAM (Dynamic Random Access Memory).
  • the primary cache 2200 includes an instruction cache 2210 and a data cache 2220.
  • the instruction cache 2210 temporarily holds past instructions read from the main storage unit 2130.
  • the instruction cache 2210 outputs the held instruction to the data processing unit 2300 via the command line 2219 in accordance with a request from the data processing unit 2300.
  • the instruction cache 2210 When the instruction requested by the data processing unit 2300 is held, the instruction cache 2210 outputs the requested instruction among the plurality of held instructions to the data processing unit 2300. On the other hand, when the instruction requested from the data processing unit 2300 is not held, the instruction cache 2210 holds the instruction read from the main storage unit 2130 by the data processing unit 2300.
  • the data cache 2220 temporarily holds past data read from the main storage unit 2130.
  • the data cache 2220 outputs the held data to the data processing unit 2300 via the data line 2229 in accordance with a request from the data processing unit 2300.
  • the data cache 2220 When the data requested by the data processing unit 2300 is held, the data cache 2220 outputs the requested data to the data processing unit 2300 among the plurality of held data. On the other hand, when the data requested from the data processing unit 2300 is not held, the data cache 2220 holds the data read from the main storage unit 2130 by the data processing unit 2300. Further, when data for writing back to the main storage unit 2130 is supplied from the data processing unit 2300, the data cache 2220 holds the data.
  • the data processing unit 2300 executes processing based on the command read from the main storage unit 2130. For example, the data processing unit 2300 reads an instruction from the main storage unit 2130 through the instruction cache 2210, and reads out data stored in the main storage unit 2130 through the data cache 2220 according to the read instruction. . In addition, the data processing unit 2300 executes arithmetic processing based on an arithmetic instruction using the read data, for example.
  • the data processing unit 2300 executes arithmetic processing of the function using an input value of an argument in the function from the data cache 2220, and performs the calculation.
  • the execution result that is the result of the processing is output to the data cache 2220.
  • the data processing unit 2300 outputs the input value and the execution result in the function to the execution result reuse processing unit 2400.
  • the data processing unit 2300 is realized by a processor core, for example.
  • the execution result reuse processing unit 2400 displays the execution result of the instruction section executed in the past.
  • the execution result reuse process to be reused is executed.
  • an instruction section in which an execution result of an instruction section executed in the past among the instruction sections executed a plurality of times can be reused is referred to as a reuse section.
  • the reuse section refers to an instruction section that has the same execution result if the input values in the instruction section are the same among instruction sections that are executed a plurality of times.
  • the execution result reuse processing unit 2400 holds an input value and an execution result in a reuse section that is executed a plurality of times as an execution history. Also, the execution result reuse processing unit 2400, when the input value of the reuse section to be executed again and the input value in the retained execution history are the same, the execution result in the retained execution history Is output to the data processing unit 2300. At the same time, the execution result reuse processing unit 2400 notifies the data processing unit 2300 of an instruction to omit (skip) the processing in the reuse section.
  • the execution result reuse processing unit 2400 when the input value of the argument of the function that is the reuse interval is the same as the input value in the held execution history, the execution result reuse processing unit 2400 The execution result is output to the data processing unit 2300. At the same time, the execution result reuse processing unit 2400 notifies the data processing unit 2300 of an instruction for skipping the processing in the function.
  • the search start instruction address management unit 2500 manages an instruction address serving as a reference for starting the execution history search in the execution result reuse processing unit 2400.
  • the search start instruction address management unit 2500 indicates timing for starting comparison between the input value in the execution history held in the execution result reuse processing unit 2400 and the input value set for execution of the reuse section.
  • the instruction address is managed for each reuse section as a reference.
  • the search start instruction address management unit 2500 instructs the execution result reuse processing unit 2400 to start execution history search based on the managed instruction address.
  • the bus 2120 performs communication between the data processing device 2100 and the main storage unit 2130.
  • the bus 2120 transfers the program stored in the main storage unit 2130 to the data processing device 2100.
  • the bus 2120 transfers data output from the data processing device 2100 to the main storage unit 2130.
  • the main storage unit 2130 stores a program for causing the data processing device 2100 to execute processing.
  • this program is a program generated based on the definition of ABI (Application Binary Interface).
  • This program is generated based on, for example, SPARC (Scalable Processor Architecture) _ABI.
  • the data processing device 2100 can specify the place where the input value and the execution result in the function are stored, so that the reuse of the execution result can be realized.
  • FIG. 46 is a block diagram illustrating a configuration example of the data processing unit 2300 and the execution result reuse processing unit 2400 according to the first embodiment of this invention.
  • the data processing unit 2300 includes a fetch unit 2310, an instruction decoder 2320, an execution unit 2330, and a register file 2340.
  • the execution unit 2330 includes a load unit 2331, an input selection unit 2332, an arithmetic circuit 2333, a store unit 2334, and a program counter 2350.
  • the execution result reuse processing unit 2400 includes an execution history search unit 2410, an execution result output unit 2420, and a history memory 2430. Further, the search start command address management unit 2500 includes an address determination unit 2510 and an input value setting command address table 2520.
  • the fetch unit 2310 reads an instruction held in the instruction cache 2210 or an instruction stored in the main storage unit 2130 via the instruction line 2219.
  • the fetch unit 2310 reads an instruction from the instruction cache 2210 in accordance with the instruction address output from the program counter 2350.
  • the fetch unit 2310 reads an input value setting instruction for setting an input value of an argument in the function, for example, before a call instruction for calling a function that is a reuse section. Then, after the input value setting instruction is read, the fetch unit 2310 reads the function call instruction.
  • the fetch unit 2310 supplies the read instruction to the instruction decoder 2320.
  • the fetch unit 2310 sends an instruction for setting the execution result to the instruction decoder. 2320.
  • the instruction decoder 2320 decodes the instruction supplied from the fetch unit 2310, and controls the execution unit 2330, the register file 2340, and the address determination unit 2510 based on the decoded content.
  • the instruction decoder 2320 when an input value setting instruction is supplied from the fetch unit 2310, sends an input value setting signal to the address determination unit 2510 in order to cause the execution data holding unit 2440 to hold the input value of the function argument. Supply. In this case, the instruction decoder 2320 determines whether or not the instruction supplied from the fetch unit 2310 is an input value setting instruction for setting an input value of an argument in the function. The instruction decoder 2320 determines whether or not the instruction from the fetch unit 2310 is an input value setting instruction based on, for example, ABI regulations.
  • ABI ABI regulations
  • the input values of an argument are integers
  • the number of arguments is 4 or less
  • the input values are stored in registers 4 to 7 in the register file 2340.
  • the input values of the fifth or more arguments are stacked in the stack area in the main storage unit 2130.
  • the input value of the fifth or more argument is stored in the stack area of the main storage unit 2130 corresponding to the value obtained by adding 16 or more to the stack point value stored in the register 29 of the register file 2340. Stacked.
  • the instruction decoder 2320 determines that the instruction is an input value setting instruction. Further, the instruction decoder 2320 indicates that when the number of arguments is five or more and all the arguments are integers, the transfer destination register indicated in the store word instruction (sw) is the register 29, and Since the offset value is “16” or more, it is determined as an input value setting command.
  • the instruction decoder 2320 determines whether or not the instruction is an input value setting instruction based on the data storage destination indicated by the instruction supplied from the fetch unit 2310. If it is determined that the instruction is an input value setting instruction, the instruction decoder 2320 outputs an input value setting signal to cause the execution data holding unit 2440 to hold the data output from the input selection unit 2332 as an input value of an argument. This is supplied to the address determination unit 2510.
  • the instruction decoder 2320 when receiving an input value setting instruction for setting an input value of a function read from the main storage unit 2130, stores the input value read from the load unit 2331 in a register file. 2340 is controlled to be stored. At the same time, the instruction decoder 2320 supplies an input value setting signal to the address determination unit 2510.
  • the instruction decoder 2320 when the instruction decoder 2320 receives an input value setting instruction for setting the data stored in the register file 2340 as an input value of the function, the instruction decoder 2320 stores the data in one register in the register file 2340. Transfer the input value to another register. At the same time, the instruction decoder 2320 supplies an input value setting signal to the address determination unit 2510.
  • the instruction decoder 2320 when the instruction decoder 2320 receives a call instruction for calling a function after the input value setting instruction, the instruction decoder 2320 supplies a function call signal indicating that the function jumps to the start address of the function to the address determination unit 2510. That is, when the instruction decoder 2320 accepts a function call instruction, the instruction decoder 2320 supplies a function call signal to the address determination unit 2510 in order to notify the timing for executing the execution result reuse processing in the history memory 2430. .
  • the instruction decoder 2320 refers to an input value for referring to an input value that is an argument of a function according to the storage location of the data indicated in the instruction from the fetch unit 2310 based on, for example, MIPS. Determine whether the command.
  • the instruction decoder 2320 supplies an input value reference signal to the address determination unit 2510 when receiving an input value reference instruction.
  • the instruction decoder 2320 supplies a function return signal to the address determination unit 2510 when receiving a function return instruction.
  • the instruction decoder 2320 determines whether or not the instruction is an execution result setting instruction for setting an execution result by executing the function based on the storage location indicated by the instruction from the fetch unit 2310 based on the MIPS regulations. To do.
  • the instruction decoder 2320 receives the execution result setting instruction, the instruction decoder 2320 supplies an execution result setting signal to the address determination unit 2510 in order to hold the execution data holding unit 2440.
  • the instruction decoder 2320 supplies a function return signal to the address determination unit 2510 when a function return instruction is received.
  • the instruction decoder 2320 sets the value of the program counter 2350 based on the instruction supplied from the fetch unit 2310.
  • the execution unit 2330 executes processing according to control from the instruction decoder 2320.
  • the execution unit 2330 executes processing based on an instruction sequence including a plurality of instruction sections. That is, the execution unit 2330 executes processing based on an instruction sequence including a reuse section that is an instruction section that is executed a plurality of times.
  • the execution unit 2330 outputs the input value and execution result of the function that is the reuse interval to the register file 2340 or the main storage unit 2130 and supplies the execution data holding unit 2440 with the execution data.
  • the execution unit 2330 sets the input value of the function in the register file 2340 or the main storage unit 2130 and outputs it to the execution data holding unit 2440 by executing the input value setting instruction before the function call instruction.
  • the execution unit 2330 refers to the input value set by the input value setting command by executing the input value reference command, and outputs the referenced input value to the execution data holding unit 2440.
  • the execution unit 2330 outputs, for example, the numerical value of the argument in the function, the argument type, and the storage location of the argument to the execution data holding unit 2440 as input values.
  • the execution unit 2330 is an example of an execution unit described in the claims.
  • the load unit 2331 reads data from the main storage unit 2130 or the data cache 2220 in accordance with control from the instruction decoder 2320, and supplies the read data to the input selection unit 2332.
  • the load unit 2331 reads an input value of an argument in a function from the main storage unit 2130 or the data cache 2220 in accordance with control from the instruction decoder 2320 and supplies the read input value to the input selection unit 2332.
  • the input selection unit 2332 selects one of the data output from the execution result output unit 2420, the arithmetic circuit 2333, the register file 2340, and the execution result output unit 2420 in accordance with the control from the instruction decoder 2320. is there.
  • the input selection unit 2332 outputs the selected data to the register file 2340 and the execution data holding unit 2440. That is, the input selection unit 2332 stores one of the outputs of the execution result output unit 2420, the arithmetic circuit 2333, the register file 2340, and the execution result output unit 2420 according to the control of the instruction decoder 2320. Output to the unit 2440.
  • the input selection unit 2332 converts the data from the load unit 2331 into the register file 2340 and the execution data according to the control of the instruction decoder 2320.
  • the data is output to the holding unit 2440.
  • the input selection unit 2332 transfers data in the register file 2340 to the register file 2340 and the execution data holding unit 2440 under the control of the command decoder 2320. Output.
  • the input selection unit 2332 uses the arithmetic result output from the arithmetic circuit 2333 as an execution result under the control of the instruction decoder 2320. Output to the register file 2340. Further, when the execution history search unit 2410 extracts the execution result, the input selection unit 2332 outputs the execution result output from the execution result output unit 2420 to the register file 2340 according to the control from the instruction decoder 2320. To do.
  • the arithmetic circuit 2333 executes arithmetic processing according to control from the instruction decoder 2320. For example, when an arithmetic instruction for executing arithmetic processing such as multiplication, division, or sum of products is supplied to the instruction decoder 2320, the arithmetic circuit 2333 is stored in the register file 2340 under the control of the instruction decoder 2320. The arithmetic processing is executed using the obtained data. In addition, the arithmetic circuit 2333 stores the operation result of the arithmetic processing as an execution result in the register file 2340 via the input selection unit 2332.
  • the store unit 2334 is for writing back the data stored in the register file 2340 or the execution result output from the execution result output unit 2420 to the main storage unit 2130 according to the control from the instruction decoder 2320.
  • the store unit 2334 stores data to be written back on the data line 2229 according to the control from the instruction decoder 2320. To the data cache 2220.
  • the store unit 2334 displays the execution result output from the execution result output unit 2420 via the data line 2229. 2130 and data cache 2220 are written back.
  • the register file 2340 stores data output from the execution unit 2330.
  • the register file 2340 is composed of a plurality of registers, for example, 32 registers of registers 0 to 31.
  • the register file 2340 stores the data output from the execution unit 2330 in one of a plurality of registers in accordance with control from the instruction decoder 2320.
  • the register file 2340 for example, the execution result stored in one of the plurality of registers in the execution unit 2330 or the execution history search unit 2410 via the execution unit 2330 according to the control from the instruction decoder 2320. Output to.
  • the program counter 2350 is set with a count value under the control of the instruction decoder 2320. For example, the program counter 2350 increments the count value by one every time one instruction is executed under the control of the instruction decoder 2320.
  • the program counter 2350 is set with the start address of the function stored in the register file 2340 when a function call instruction is executed under the control of the instruction decoder 2320.
  • the program counter 2350 outputs the count value to the address determination unit 2510 as an instruction address indicating the memory address of the main storage unit 2130.
  • the address determination unit 2510 includes an execution history search unit 2410 and an execution data holding unit 2440 in order to search the execution history in the history memory 2430 based on the input value setting command address registered in the input value setting command address table 2520. It is something to control. That is, the address determination unit 2510 starts searching for an execution history when the instruction address output from the program counter 2350 matches the input value setting instruction address held in the input value setting instruction address table 2520. It is.
  • the address determination unit 2510 determines whether or not the instruction address output from the program counter 2350 matches the input value setting instruction address registered in the input value setting instruction address table 2520. If both instruction addresses match, the address determination unit 2510 uses the input value output from the execution unit 2330 based on the input value setting command specified by the input value setting command address as the execution data holding unit. 2440.
  • the address determination unit 2510 causes the execution data holding unit 2440 to hold the section identification information associated with the matched input value setting command address in the input value setting command address table 2520.
  • the section identification information here is identification information for identifying a plurality of reuse sections from each other. As the section identification information, for example, the start address of a function that is a reuse section may be used.
  • the address determination unit 2510 outputs from the execution unit 2330.
  • the execution data holding unit 2440 holds the input value. That is, the address determination unit 2510 outputs the output from the execution unit 2330 as the input value of the argument in the function based on the input value setting signal supplied from the instruction decoder 2320 until the function call signal is supplied.
  • the holding unit 2440 holds it.
  • the address determination unit 2510 instructs the execution history search unit 2410 to execute the reuse of the execution result in the history memory 2430. Further, the address determination unit 2510 causes the execution data holding unit 2440 to hold the output from the execution unit 2330 as the function execution result based on the execution result setting signal supplied from the instruction decoder 2320.
  • the address determination unit 2510 executes, based on the function return signal supplied from the instruction decoder 2320, to newly register the section identification information, input value, and execution result in the execution data holding unit 2440 in the history memory 2430.
  • the history search unit 2410 is instructed to register.
  • the input value setting instruction address table 2520 is an input that is an address of an input value setting instruction for setting an input value in the function for each section identification information for identifying a function that is a reuse section executed a plurality of times. It holds the value setting instruction address.
  • the address here indicates a memory address in which the input value setting command is stored in the main storage unit 2130.
  • the input value setting instruction address table 2520 for example, data relating to a reuse section extracted by analyzing a program stored in the main storage unit 2130 by pre-execution of a compiler device or a program is held. Assuming that That is, the input value setting instruction address table 2520 holds an input setting instruction address of a function whose execution result is highly reused and section identification information for identifying the function in association with each other.
  • This input value setting command address table 2520 shows, for example, the input value setting command address of the input value setting command that sets the input value first among the input value setting commands for setting the input value in the function for each section identification information. Hold on. That is, the input value setting instruction address table 2520 holds the earliest input value setting instruction address in the reuse section for each section identification information of the reuse section. In this way, the capacity of the input value setting instruction address table 2520 can be reduced by holding only the earliest input value setting instruction.
  • the input value setting instruction address table 2520 outputs the held data to the address determination unit 2510.
  • the input value setting instruction address table 2520 when a function that is a reuse section has a plurality of arguments, a plurality of input value setting instruction addresses may be held for each section identification information.
  • the input value setting instruction address table 2520 is an example of the input value setting instruction address table described in the claims.
  • the input value setting command address table 2520 may further hold the priority when deleting the execution history for each section identification information.
  • the execution history search unit 2410 registers the priority from the address determination unit 2510 in the history memory 2430. If the capacity of the history memory 2430 exceeds a certain condition, the execution history search unit 2410 deletes the execution history in the history memory 2430 based on the priority stored in the history memory 2430.
  • the execution data holding unit 2440 holds the section identification information from the address determination unit 2510, the input value in the function from the execution unit 2330, and the execution result in accordance with the instruction from the address determination unit 2510.
  • the execution data holding unit 2440 outputs the held section identification information, the input value in the function, and the execution result to the execution history search unit 2410.
  • the execution history search unit 2410 searches for the execution history in the history memory 2430 based on the identification information output from the execution data holding unit 2440 and the input value of the function.
  • the execution history search unit 2410 includes the section identification information and the input stored in the execution data storage unit 2440 among the input values in the reuse section stored for each section identification information in the history memory 2430 and the execution history as the execution result. The execution result in the same execution history as the value is extracted.
  • the execution history search unit 2410 When the execution result is extracted from the history memory 2430, the execution history search unit 2410 outputs the execution result to the execution result output unit 2420 when receiving an instruction for the reuse process from the address determination unit 2510. At the same time, the execution history search unit 2410 supplies information related to the storage location in the extracted execution result to the fetch unit 2310 as a function omission signal for omitting function processing.
  • the execution history search unit 2410 does not output a function omission signal to the fetch unit 2310 when an instruction for the reuse process is received from the address determination unit 2510. Then, after the execution result newly generated by the execution of the function in the execution unit 2330 is held in the execution data holding unit 2440, the execution history search unit 2410 outputs the output from the execution data holding unit 2440 to the history memory 2430. sign up.
  • the execution history search unit 2410 causes the history memory 2430 to store the section identification information, the input value, and the execution result held in the execution data holding unit 2440 based on the registration instruction from the address determination unit 2510.
  • the execution result output unit 2420 sends the execution result to the register file 2340 or the store unit 2334 via the input selection unit 2332. Output.
  • the execution result output unit 2420 outputs the data in the execution result to the store unit 2334 or the input selection unit 2332 according to the storage location of the data in the execution result from the history memory 2430.
  • the execution result output unit 2420 is an example of an execution result output unit described in the claims.
  • the history memory 2430 holds, as the execution history, the input value and the execution result in the function identified by the section identification information for each section identification information.
  • the history memory 2430 is realized by, for example, an associative memory (CAM: Content Addressable Memory).
  • CAM Content Addressable Memory
  • the history memory 2430 starts searching for an execution history associated with the section identification information when section identification information, which is a search key for searching for execution results, is input from the execution history search unit 2410. To do.
  • the history memory 2430 is associated with the input value in the history memory 2430 when the input values sequentially supplied from the execution history search unit 2410 and the input values held in the history memory 2430 all match.
  • the execution result is output to the execution history search unit 2410.
  • the execution history search unit 2410 extracts an execution result from the history memory 2430 by detecting from the history memory 2430 the same execution history as the section identification information and the input value input from the execution history search unit 2410.
  • history memory 2430 realized by this associative memory holds, for example, a pattern of input values in the execution history in a tree structure.
  • the history memory 2430 is an example of a history memory described in the claims.
  • the earliest input value setting instruction in the reuse section can be specified.
  • the execution history in 2430 can be searched. Next, an example of a data structure in the history memory 2430 will be described below with reference to the drawings.
  • FIG. 47 is a conceptual diagram illustrating an example of a data structure of the history memory 2430 according to the first embodiment of this invention.
  • a configuration is shown in which the history memory 2430 holds a plurality of execution histories in one section identification information among the execution histories held for each section identification information in a tree structure.
  • a function has n arguments and returns an output as an execution result to m storage destinations.
  • the function address that is the start address of the function is used as section identification information.
  • the function root 2460 in the tree structure the first argument nodes 2461 and 2462, the nth argument nodes 2471 to 2474, the first output nodes 2481 to 2484, and the mth output nodes 2491 to 2494 are shown. Is shown.
  • a function address that is section identification information and a pointer that points to the first argument node 2461 are shown.
  • the first and nth argument nodes 2461, 2462 and 2471 to 2474 include input data indicating argument values as input values of arguments in the execution history held in the history memory 2430, the types of the arguments, The type indicating the storage location of the argument is shown.
  • the storage location here refers to the register number of the register file 2340 or the memory address of the main storage unit 2130.
  • first and nth argument nodes 2461, 2462, and 2471 to 2474 show a right pointer that points to the argument node in the next argument when the input values to be compared match each other.
  • first and nth argument nodes 2461, 2462, and 2471 to 2474 show lower pointers that point to other argument nodes in the same argument when the input values to be compared do not match.
  • the first and mth output nodes 2481 to 2484 and 2491 to 2494 are connected to the nth argument nodes 2471 to 2474, respectively.
  • first and m-th output nodes 2481 to 2484 and 2491 to 2494 output data indicating execution result values as execution results in the execution history held in the history memory 2430 and storage locations of the execution results are stored. The type to be shown and the type of the execution result are shown.
  • the first output nodes 2481 to 2484 show a right pointer that points to the output node in the next output.
  • the first and mth output nodes 2481 to 2484 and 2491 to 2494 constitute a linked list.
  • the right pointers of the m-th output nodes 2491 to 2494 indicate a null indicating the end of the output node.
  • the input value comparison processing is to compare the input data, type and type shown in the first argument node 2461 with the input value from the execution history search unit 2410.
  • the argument node pointed to by the right or lower pointer is selected based on the comparison result of the comparison process in each argument node, and the input value comparison process is sequentially executed in the selected argument node. If the input value indicated by the nth argument node 2471 and the input value from the execution history search unit 2410 match each other, the first output node 2481 is set by the right pointer of the nth argument node 2471. Is pointed to. As a result, the execution result indicating the output data, type and type held in the first output node 2481 is sequentially output to the execution history search unit 2410 from the execution result held in the m-th output node 2491 in order. Is done.
  • the history memory 2430 by configuring the history memory 2430 with a tree structure for each section identification information, it is not necessary to hold the input values of the same argument redundantly, so the storage area of the history memory 2430 can be saved. Further, by dividing the data structure for each section identification information, it is possible to suppress a decrease in search speed.
  • a registration method for the history memory 2430 an example of registration processing for the history memory 2430 in the first execution of a function that is a reuse section will be described below with reference to the drawings.
  • FIG. 48 is a conceptual diagram showing a method for registering section identification information and execution history in the first function execution by the data processing apparatus 2100 according to the first embodiment of the present invention.
  • FIG. 48A shows an example of the data format of the input value setting instruction address table 2520.
  • the input value setting command address table 2520 shows the correspondence between the earliest input value setting command address 2521 in the function and the function address 2522 which is section identification information for identifying the function.
  • FIG. 48B shows that after a function having two arguments is called by a call instruction (call) in the upper routine, the function returns to the upper routine by a return instruction (return) in the lower routine that is the instruction section of the function.
  • call call
  • return return instruction
  • FIG. 48B shows that after a function having two arguments is called by a call instruction (call) in the upper routine, the function returns to the upper routine by a return instruction (return) in the lower routine that is the instruction section of the function.
  • FIG. 48B shows that after a function having two arguments is called by a call instruction (call) in the upper routine, the function returns to the upper routine by a return instruction (return) in the lower routine that is the instruction section of the function.
  • FIG. 48B shows that after a function having two arguments is called by a call instruction (call) in the upper routine, the function returns to the upper routine by a return instruction (return) in the lower routine that is the instruction section of the function.
  • FIG. 48B shows that after a
  • the input value A setting 2321 and the input value B setting 2322 indicate the timing at which the input value A and the input value B are set in the function that is a reuse section, based on two input value setting commands.
  • the input value A is set based on the input value A setting command corresponding to the input value A setting command address.
  • the input value B is set based on the input value B setting command corresponding to the input value B setting command address.
  • the input value of the argument of the function is set by the input value setting instruction before the function call instruction (call), as described in FIG. 45, the program stored in the main storage unit 2130 This is because is generated based on the ABI rules.
  • the input value A reference 2323 and the input value B reference 2324 indicate the timing at which the input value of the function is referred to by executing the input value reference instruction in the processing of the function by the lower level routine.
  • the input value A and the input value B set by the input value A setting command and the input value B setting command are referred to based on the two input value reference commands, respectively. That is, in the function processing, the numerical value of the argument stored in the register in the register file 2340 in which the input value A and the input value B are set by executing the input value reference instruction is used.
  • the execution result C setting 2325 indicates the timing at which the execution result C generated by the function processing is set in the main storage unit 2130 or the register file 2340.
  • the execution result C is set based on the execution result setting command.
  • FIG. 48 (c) is a conceptual diagram showing an example of a data format in the history memory 2430.
  • FIG. Here, a correspondence relationship between a function address 2431 which is function section identification information and execution history search data 2432 is shown.
  • the execution history search data 2432 is search data configured by the tree structure shown in FIG. 47 and includes information associated with input values and execution results in the execution history.
  • the instruction address output from the program counter 2350 by the address determination unit 2510 matches the “input value A setting instruction address” in the input value setting instruction address table 2520. Determined.
  • the section identification information (function address 1) corresponding to the matched input value setting instruction address (input value A setting instruction address) is input to the history memory 2430. That is, the section determination information (function address 1) is held in the execution data holding unit 2440 by the address determination unit 2510, and the held “function address 1” is input to the history memory 2430 by the execution history search unit 2410. .
  • the section identification information that matches the section identification information (function address 1) from the address determination unit 2510 is not held in the history memory 2430, the section identification information (function address 1) is registered in the history memory 2430. Is done.
  • the input value A and the input value B set by the input value setting command and the execution result C set by the execution result setting command are registered in the history memory 2430 in association with the section identification information (function address 1). Is done. That is, the input value A and the input value B are held in the execution data holding unit 2440 by the address determination unit 2510 based on the input value setting signal from the instruction decoder 2320 by the execution of the input setting command. Thereafter, the execution result C is held in the execution data holding unit 2440 based on the execution result setting signal from the instruction decoder 2320 by execution of the execution result setting instruction.
  • the address determination unit 2510 instructs the execution history search unit 2410 to register the execution history.
  • the execution history search unit 2410 registers the data (input value A, input value B, and execution result C) in the execution data holding unit 2440 in the history memory 2430.
  • FIG. 49 is a conceptual diagram illustrating an example of a method related to the execution result reuse process by the data processing device 2100 according to the first embodiment of this invention.
  • (a) and (c) in FIG. 49 correspond to (a) and (c) in FIG. 48, and thus the description thereof is omitted here.
  • FIG. 49B shows that after a function having two arguments is called by a call instruction (call) in the upper routine, the function returns to the upper routine by a return instruction (return) in the lower routine that is the instruction section of the function.
  • call call instruction
  • return return instruction
  • the instruction address output from the program counter 2350 by the address determination unit 2510 matches the “input value A setting instruction address” in the input value setting instruction address table 2520. Determined.
  • the section identification information (function address 1) corresponding to the matched input value setting instruction address (input value A setting instruction address) is input to the history memory 2430. That is, the section determination information (function address 1) is held in the execution data holding unit 2440 by the address determination unit 2510, and the held function address 1 is input to the history memory 2430 by the execution history search unit 2410.
  • the input value A setting 2321 the input value A set by the input value A setting command is input to the history memory 2430.
  • the input value B setting 2322 the input value B set by the input value B setting command is input to the history memory 2430. That is, in accordance with an instruction from the address determination unit 2510, the input value A and the input value B are sequentially held in the execution data holding unit 2440 based on the input value setting signal from the instruction decoder 2320. Then, the execution history search unit 2410 sequentially inputs the input value A and the input value B in the execution data holding unit 2440 to the execution history search unit 2410.
  • the input value A and the input value B from the execution history search unit 2410 are sequentially compared with the input value held in the “execution history search data 1” corresponding to “function address 1” in the history memory 2430. Is called.
  • the address determination unit 2510 notifies the execution history search unit 2410 of the execution result reuse instruction, thereby re-executing the execution result C. Usage processing is executed. That is, when an execution result is extracted by the execution history search unit 2410 when the execution result output unit 2420 executes a call instruction specified by the input value setting instruction address, the extracted execution result is The data is output to the execution unit 2330.
  • the input value setting instruction address table 2520 the earliest input value A setting instruction to be executed first for the function at the function address 1 can be specified. Therefore, the input values (input value A and input value B) set based on the input value A setting instruction and the input value B setting instruction in the instruction group from the input value A setting instruction to the call instruction (call) are determined. Can be identified. Thus, in the execution history search period Ts until the execution of the call instruction (call) specified by the input value A setting instruction address, the execution history corresponding to the section identification information (function address 1) in the history memory 2430 is searched. be able to.
  • the execution result C associated with the input value A and the input value B from the execution history search unit 2410 is extracted from the execution history search data 1 of the function address 1 in the execution history search period Ts, thereby executing the function.
  • Time (shortening period T1) can be reduced.
  • the difference between the shortening period T1 in the first embodiment of the present invention and the shortening period by the conventional execution result reuse process will be briefly described with reference to the drawings.
  • FIG. 50 is a conceptual diagram illustrating an example in which the execution time of a function is shortened by the execution result reuse process.
  • FIG. 50A is a conceptual diagram showing a shortened period due to reuse of execution results in a conventional data processing apparatus in which the input value setting instruction address table 2520 is not provided.
  • FIG. 50B is a conceptual diagram showing a shortened period due to reuse of execution results in the data processing device 2100 according to the first embodiment of the present invention.
  • 50 (a) and (b) are the same as those shown in FIG. 49 (b), and therefore, the same reference numerals are given and description thereof is omitted here.
  • the input value A setting 2321 specified based on the input value setting instruction address table 2520 is used to input the input value.
  • a and input value B can be specified. That is, the input value of the argument in the function can be specified based on the input value setting command in the execution history search period Ts from the input value A setting command to the call command (call).
  • the search of the execution result in the history memory 2430 can be terminated in the execution history search period Ts. Therefore, if the execution result can be reused, all the periods required for executing the function (shortening period T1) ) Can be reduced. Therefore, in the first embodiment of the present invention, the execution result reuse process in the data processing device 2100 can reduce the shortening period T1 longer than the conventional shortening period T2.
  • the execution result reuse process in the data processing device 2100 can reduce the shortening period T1 longer than the conventional shortening period T2.
  • FIG. 51 is an execution history in the second and subsequent function executions by the data processing device 2100 according to the first embodiment of the present invention. It is a conceptual diagram which shows the registration method.
  • FIG. 51 since (a) to (c) in FIG. 51 correspond to (a) to (c) in FIG. 48, detailed description thereof is omitted here.
  • FIG. 51 (b) is a conceptual diagram showing a processing example of the function shown in FIG. 48 (b).
  • an input value that is an argument of a function is a variable and an input value that is not held in the history memory 2430 is set.
  • the value indicated by the input value A in the history memory 2430 is “3” and the value indicated by the input value A set by executing the function here is “5” is applicable.
  • the instruction address output from the program counter 2350 by the address determination unit 2510 matches the “input value A setting instruction address” in the input value setting instruction address table 2520. Determined.
  • the section identification information (function address 1) corresponding to the matched input value setting instruction address (input value A setting instruction address) is input to the history memory 2430. That is, the section determination information (function address 1) is held in the execution data holding unit 2440 by the address determination unit 2510, and the held “function address 1” is input to the history memory 2430 by the execution history search unit 2410. .
  • the input value A set by the input value A setting command is input to the history memory 2430.
  • the input value A from the execution history search unit 2410 and the input value held in the “execution history search data 1” in the history memory 2430 do not match, the input value A from the execution history search unit 2410 is “ It is newly registered in the “execution history search data 1”.
  • the input value B set by the input value B setting command is registered in the history memory 2430 by the execution history search unit 2410. That is, “execution history search data 1” in which the input value A and the input value B are associated is generated.
  • execution result C set by the execution result setting command is registered in the history memory 2430 by the execution history search unit 2410 in the execution result C setting 2325. That is, “execution history search data 1” in which the input value A, the input value B, and the execution result C are associated is generated.
  • the function is executed and the execution result and The input value is newly registered in the history memory 2430.
  • the input value specified by the execution of the input value reference command may be registered in the history memory 2430.
  • FIG. 52 is a flowchart showing an example of a processing procedure of the execution result reuse method by the data processing device 2100 according to the first embodiment of the present invention.
  • the fetch unit 2310 reads an instruction from the main storage unit 2130 or the instruction cache 2210 (step S2911).
  • the address determination unit 2510 determines whether or not the instruction address output from the program counter 2350 matches the input value setting instruction address registered in the input value setting instruction address table 2520 (step S2912). . If it does not match the input value setting command address, the process returns to step S2911, and is repeated until it matches the input value setting command address.
  • the address determination unit 2510 acquires the section identification information associated with the matched input value setting command address from the input value setting command address table 2520. Then, the address determination unit 2510 holds the acquired section identification information in the execution data holding unit 2440 (step S2913).
  • the execution history search unit 2410 inputs the section identification information held in the execution data holding unit 2440 to the history memory 2430 as a search key for the history memory 2430 (step S2914). As a result, a search for a plurality of execution histories corresponding to the section identification information in the history memory 2430 is started.
  • the instruction decoder 2320 determines whether or not the instruction read from the fetch unit 2310 is an input value setting instruction (step S2915). If it is determined that the instruction is an input value setting instruction, the input value set by the input value setting instruction is executed by the instruction of the address determination unit 2510 based on the input value setting signal from the instruction decoder 2320. It is held by the holding unit 2440.
  • step S2921 the execution history search unit 2410 inputs the input value held in the execution data holding unit 2440 into the history memory 2430 (step S2921). Note that the determination in step S2915 for the first time is always determined as an input value setting command here, so that the determination may be omitted and the process may proceed to step S2921.
  • the history memory 2430 causes the input value from the execution history search unit 2410 to match the input value in the execution history. Is determined (step S2922). If the input values do not match, the process proceeds to step S2924.
  • step S2923 the history memory 2430 advances the pointer to the argument node in the next argument in order to compare the input value of the next argument in the execution history. That is, if there is an argument node that matches the input value from the execution history search unit 2410, the next argument node is indicated by the right pointer of the argument node.
  • the fetch unit 2310 reads an instruction from the main storage unit 2130 or the instruction cache 2210 (step S2924), and the process returns to step S2915.
  • step S2915 it is determined whether or not the instruction read by the fetch unit 2310 is a function call instruction (step S2916). If it is not a call instruction, the process advances to step S2924.
  • steps S2915, S2916, and S2921 to S2924 are repeatedly executed until the input values of all the arguments in the function are set. That is, the input value set based on the input value setting command of the function from the input value setting command to the call command specified by the input value setting command address table 2520 is held in the execution data holding unit 2440 and held. The input value is input to the history memory 2430.
  • the section identification information corresponding to the input value setting instruction address that matches the instruction address output from the program counter 2350 is held in the execution data holding unit 2440. Then, based on the input value setting instruction in the instruction group from the input value setting instruction to the call instruction specified by the input value setting instruction address, the input value output from the execution unit is held in the execution data holding unit 2440. Is done. As a result, the execution history search unit 2410 searches for an execution result associated with the execution history in the history memory 2430 using the section identification information and the input value in the execution data holding unit 2440. Note that steps S2911 to S2916 and S2921 to S2924 are an example of an execution history search procedure described in the claims.
  • step S2916 if it is determined in step S2916 that the instruction is a function call instruction, has the section identification information and the input value from the execution data holding unit 2440 all matched with the input value associated with the section identification information in the history memory 2430? It is determined whether or not (step S2917).
  • step S2925 If the section identification information and input values from the execution history search unit 2410 all match, an execution result reuse process is executed (step S2925). That is, the execution result in the history memory 2430 corresponding to the section identification information and the input value from the execution history search unit 2410 is output from the execution result output unit 2420. Then, the data is written back to the main memory 2130 or the register file 2340, and the function processing is skipped. Note that S2925 is an example of an execution result output procedure described in the claims.
  • step S2918 the execution history search unit 2410 registers the execution result held in the execution data holding unit 2440 and the section identification information and the input value held by the processes in steps S2913 and S2921 in the history memory 2430 (step S2919). ).
  • the input value setting instruction address table 2520 causes the execution data holding unit 2440 to store the section identification information of the reuse section and the function call instruction that is the reuse section.
  • the input value can be held.
  • the execution history search unit 2410 can search the execution history in the history memory 2430 based on the section identification information and the input value held in the execution data holding unit 2440.
  • FIG. 53 is a block diagram illustrating a functional configuration example of the program analysis processing device according to the second embodiment of the present invention.
  • the program analysis processing device 2600 includes a source program storage unit 2610, a compile processing unit 2620, an object program storage unit 2660, and a reuse section information storage unit 2670.
  • the program analysis processing device 2600 is an example of a program analysis processing device described in the claims.
  • the source program storage unit 2610 stores a source program to be compiled. This source program is a source program including a reuse section in which the execution result is used again. The source program storage unit 2610 supplies the stored source program to the compile processing unit 2620.
  • the compile processing unit 2620 compiles the source program from the source program storage unit 2610 to generate an object program that is a machine language program and reuse section information.
  • the reuse section information here refers to, for each reuse section, the input value setting instruction address of the first input value setting instruction in the reuse section and the section identification information for identifying the reuse section. Information. This reuse section information is stored in the input value setting command address table 2520 in the search start command address management unit 2500 shown in FIG.
  • the compile processing unit 2620 stores the generated object program in the object program storage unit 2660 and the generated reuse section information in the reuse section information storage unit 2670.
  • the compile processing unit 2620 includes a program analysis unit 2630, a program optimization processing unit 2640, and a code generation unit 2650.
  • the program analysis unit 2630 executes analysis processing such as morphological analysis and syntax analysis based on the source program read from the source program storage unit 2610.
  • the program analysis unit 2630 generates a program with an intermediate representation expressed as an intermediate code in a format suitable for analysis or optimization, and executes an analysis process on the generated program with the intermediate representation.
  • the program analysis unit 2630 includes a reuse candidate section extraction unit 2631 and a reuse candidate section analysis unit 2632.
  • the reuse candidate section extraction unit 2631 extracts, from the program, a reuse candidate section that is a candidate for a reuse section in which an execution result is reused from among a plurality of command sections included in the program.
  • the reuse candidate section extraction unit 2631 extracts a function instruction section as a reuse candidate section.
  • This reuse candidate section extraction unit 2631 excludes functions whose execution results cannot be reused from the reuse candidate sections.
  • This reuse candidate section extraction unit 2631 excludes from the reuse candidate section a function that results in different execution results even if the input values of the instruction section are all the same, for example, a function that includes a branch instruction in the instruction section. To do.
  • the second function is executed immediately after the execution of the first function. Therefore, the second input value setting instruction is executed before the call instruction of the first function.
  • the first and second functions as described above are excluded from the reuse candidate section. Further, the reuse candidate section extraction unit 2631 supplies section identification information for identifying the extracted reuse candidate section to the reuse candidate section analysis unit 2632 together with the program.
  • the reuse candidate section analysis unit 2632 analyzes the usage mode of the reuse candidate section extracted by the reuse candidate section extraction unit 2631. This reuse candidate section analysis unit 2632 analyzes, for example, the number and types of arguments in a function and the number of times one function is executed for each function as a usage mode.
  • the reuse candidate section analysis unit 2632 outputs, for example, a range that can be taken by an argument in the function as the analysis result of the usage mode.
  • the reuse candidate section analysis unit 2632 supplies the analysis result to the program optimization processing unit 2640 together with the section identification information and program of the reuse candidate section.
  • the program optimization processing unit 2640 Based on the program supplied from the reuse candidate section analysis unit 2632, the program optimization processing unit 2640 performs program optimization such as optimization for improving the execution speed of the program and optimization for reducing the code size. The process is executed.
  • the program optimization processing unit 2640 includes a reuse degree generation unit 2641, a reuse section extraction unit 2642, and a reuse section information generation unit 2643.
  • the reuse level generation unit 2641 generates a reuse level indicating the degree to which the execution result of the reuse candidate section is reused based on the analysis result supplied from the reuse candidate section analysis unit 2632. In other words, the reuse level generation unit 2641 generates a reuse level indicating the degree to which the input values for each execution of processing in an instruction interval executed a plurality of times coincide with each other based on the usage state of the instruction interval. To do.
  • the reuse level generation unit 2641 generates a reuse level according to the number of execution times of one reuse candidate section, for example. In this case, for example, the reuse level generation unit 2641 sets the reuse level to be larger as the number of executions is larger. In addition, the reuse level generation unit 2641 generates, for example, a reuse level for the reuse candidate section according to a range that can be taken by the input value of the reuse candidate section. In this case, the degree of reuse is calculated, for example, by multiplying a reciprocal of the number of possible ranges by a constant. Thus, the larger the reuse degree of the reuse candidate section, the higher the probability that the reuse result of the reuse candidate section will be reused.
  • the reuse level generation unit 2641 supplies the reuse level related to the generated reuse candidate section to the reuse section extraction unit 2642 together with the program and the section identification information of the reuse candidate section.
  • the reuse level generation unit 2641 is an example of a reuse level generation unit described in the claims.
  • the reuse section extraction unit 2642 recycles based on the reuse degree regarding each reuse candidate section from the reuse degree generation unit 2641 among the plurality of reuse candidate sections extracted by the reuse candidate section analysis unit 2632. This is to extract the usage section. For example, the reuse section extraction unit 2642 extracts a reuse candidate section that is equal to or greater than a certain threshold (reuse threshold) regarding the degree of reuse as a reuse section.
  • a certain threshold reuse threshold
  • the reuse interval extraction unit 2642 supplies the extracted interval identification information related to the reuse interval to the reuse interval information generation unit 2643 together with the program.
  • the reuse section extraction unit 2642 may generate, for example, the priority when deleting the execution history for each section identification information in the history memory 2430 illustrated in FIG. 46 based on the degree of reuse. In this case, the reuse section extraction unit 2642 generates a priority so that the higher the reuse degree, the lower the priority.
  • the reuse section information generation unit 2643 associates the section identification information of the reuse section extracted by the reuse section extraction unit 2642 and the earliest input value setting command address in the reuse section as reuse section information. Is to be generated.
  • the reuse section information generation unit 2643 stores the memory address of the earliest input value setting instruction to be executed first on the time axis among the input value setting instructions in the reuse section extracted by the reuse section extraction unit 2642.
  • the input value setting instruction address is extracted for each reuse section.
  • the reuse section information generation unit 2643 generates reuse section identification information in which the extracted input value setting command address and section identification information extracted are associated for each reuse section.
  • the reuse interval information generation unit 2643 causes the reuse interval information storage unit 2670 to store the generated reuse interval identification information.
  • the reuse section information has been described as the reuse section information.
  • all input value setting instruction addresses are associated with each piece of section identification information. May be generated.
  • the reuse interval information generation unit 2643 for example, for the program supplied from the reuse interval extraction unit 2642, a command from the earliest input value setting instruction in the reuse interval to the call instruction for the reuse interval Rearrange the instruction codes so that the number of groups is as small as possible.
  • the execution history search period in the history memory 2430 shown in FIG. 46 can be shortened, so that the power consumption by the history memory 2430 in the data processing device 2100 can be reduced.
  • the reuse section information generation unit 2643 supplies the code generation unit 2650 with a program in which the instruction codes are rearranged.
  • the reuse section information generation unit 2643 is an example of a reuse section information generation unit described in the claims.
  • the reuse interval information generation unit 2643 based on the reuse degree from the reuse degree generation unit 2641, priorities when deleting the execution history of the history memory 2430, the interval identification information, and the earliest input
  • the reuse section information may be generated in association with the value setting instruction address.
  • the execution history search unit 2410 can delete the execution history of the history memory 2430 according to the priority. Therefore, an execution history with a high degree of reuse can be preferentially held in the history memory 2430.
  • the code generation unit 2650 generates an object program that is a code of a machine language program based on the program supplied from the reuse section information generation unit 2643.
  • the code generation unit 2650 stores the generated object program in the object program storage unit 2660.
  • the object program storage unit 2660 stores the object program output from the code generation unit 2650.
  • the object program stored in the object program storage unit 2660 is stored in the main storage unit 2130 shown in FIG.
  • the reuse section information storage unit 2670 stores the reuse section information output from the reuse section information generation unit 2643.
  • the reuse section information stored in the reuse section information storage unit 2670 is transferred to the input value setting command address table 2520 shown in FIG.
  • the reuse level generation unit 2641 the reuse level is generated based on the usage mode of the instruction interval that is executed a plurality of times. Therefore, the execution result is reused among the plurality of instruction intervals. It is possible to extract an instruction section having a high probability of being used as a reuse section. Further, by providing the reuse section information generation unit 2643, it is possible to generate reuse section information in which the input value setting command address and section identification information in the reuse section are associated with each extracted reuse section. .
  • FIG. 54 is a flowchart showing an example of a processing procedure of a program analysis processing method of the program analysis processing device 2600 according to the second embodiment of the present invention.
  • the reuse candidate section extraction unit 2631 reads the source program from the source program storage unit 2610 (step S2931). Then, the reuse candidate section extracting unit 2631 extracts a function that becomes a reuse candidate section from among the instruction sections that are a plurality of functions included in the program (step S2932).
  • step S2934 is an example of a reuse degree generation procedure described in the claims.
  • Step S2935 the reuse section extraction unit 2642 extracts a reuse section based on the reuse degree for each reuse candidate section.
  • the reuse section information generation unit 2643 generates reuse section information in which the earliest input value setting instruction address in the reuse section and the section identification information of the reuse section are associated with each reuse section.
  • Step S2936 the reuse interval information generation unit 2643 stores the generated reuse interval information in the reuse interval information storage unit 2670.
  • Step S2936 is an example of a reuse section information generation procedure described in the claims.
  • the code generation unit 2650 generates an object program based on the program supplied from the reuse section information generation unit 2643, and the generated object program is stored in the object program storage unit 2660 (step S2937). .
  • the second embodiment of the present invention it is possible to generate reuse section information in which an input value setting instruction address in a function that is a reuse section having a high reuse degree and its section identification information are associated with each other. it can.
  • the execution history for the function whose execution result is likely to be reused is held in the history memory 2430 shown in FIG. 46, and therefore the execution time can be reduced by the execution result reuse process. .
  • the example in which the reuse section information generated by the program analysis processing device 2600 is registered in the input value setting instruction address table 2520 in the data processing device 2100 has been described.
  • the reuse section information may be registered in the input value setting command address table 2520 when executing a program stored in the main storage unit 2130. Therefore, a data processing apparatus 2100 improved so as to register the input value setting instruction address and the section identification information in the input value setting instruction address table 2520 during the execution of the program will be described below as a third embodiment.
  • FIG. 55 is a block diagram showing a configuration example of the data processing device 2100 according to the third embodiment of the present invention.
  • a data processing unit 2300, an execution result reuse processing unit 2700, and a search start instruction address management unit 2800 are shown in the data processing apparatus 2100 shown in FIG.
  • the data processing unit 2300 is the same as that shown in FIG. 46, the same reference numerals as those in FIG.
  • the execution result reuse processing unit 2700 includes an execution history search unit 2710, an execution result output unit 2720, a history memory 2730, and an execution data holding unit 2740.
  • the execution history search unit 2710, the execution result output unit 2720, the history memory 2730, and the execution data holding unit 2740 are added to the execution history search unit 2410, the execution result output unit 2420, the history memory 2430, and the execution data holding unit 2440 shown in FIG. Correspond.
  • the configuration of the execution result output unit 2720 and the history memory 2730 is the same as that of the execution result output unit 2420 and the history memory 2430 illustrated in FIG. 46, and thus description thereof is omitted here.
  • the search start command address management unit 2800 includes an address determination unit 2810, an input value setting command address table 2820, an input value setting command address output unit 2830, a set input value holding unit 2840, and a search start command determining unit 2850. Prepare. Address determination unit 2810 and input value setting command address table 2820 correspond to address determination unit 2510 and input value setting command address table 2520 shown in FIG.
  • the description will focus on the function of registering the input value setting command address and the section identification information in the input value setting command address table 2820. Further, the method of searching the execution result in the history memory 2730 based on the input value setting command address registered in the input value setting command address table 2820 is realized by the same configuration as in FIG. Description is omitted.
  • the execution data holding unit 2740 holds data used for the execution result reuse process in accordance with an instruction from the address determination unit 2810, and uses the held data as an execution history search unit 2710, a set input value holding unit 2840, and a search start. This is output to the instruction determination unit 2850.
  • the execution data holding unit 2740 holds the output from the execution unit 2330 as a set input value in accordance with an instruction based on the input value setting signal from the address determination unit 2810.
  • the execution data holding unit 2740 holds the order in which the set input values are held on the time axis as the set order in which the input values are set by the input value setting command together with the set input values. For example, the execution data holding unit 2740 holds the first set input value as the first set input value in accordance with an instruction based on the input value setting signal from the address determination unit 2810.
  • the execution data holding unit 2740 outputs the held setting input values and the setting order thereof to the setting input value holding unit 2840 according to an instruction based on the function call signal from the address determination unit 2810.
  • the execution data holding unit 2740 outputs, for example, the storage location and the setting order included in the set input value to the set input value holding unit 2840.
  • the storage location here refers to the register number of the register file 2340 or the memory address of the main storage unit 2130.
  • the execution data holding unit 2740 when there are a plurality of setting input values indicating the same storage location, the execution data holding unit 2740 includes the setting input values of the largest number (maximum) setting order among the plurality of setting input values and Only the setting order is output to the setting input value holding unit 2840. That is, when there are a plurality of setting input values indicating the same storage location, the execution data holding unit 2740 outputs the last set input value and the setting order among the plurality of setting input values. . Alternatively, the execution data holding unit 2740 already holds the setting order of the new setting input value when the setting input value indicating the same storage location is newly held in the setting input value holding unit 2840. Overlays (overwrites) the setting input value in the setting order holding area.
  • the input that is not referred to as the input value of the function by causing the setting input value holding unit 2840 to hold only the setting input value of the maximum setting order among the plurality of setting input values indicating the same storage location.
  • Value setting instructions can be excluded from registration targets. This is because the instruction decoder 2320 determines whether or not the instruction is an input value setting instruction depending on the storage location of the data indicated in the instruction, but the register in which the function input value is stored is outside the function instruction section. It is also referred to by other processes. For this reason, it can be determined that the setting input values indicating the same storage location other than the setting input value set immediately before the function call instruction are not the setting of the function input value.
  • execution data holding unit 2740 holds, for example, the output from the execution unit 2330 as function section identification information in accordance with an instruction based on the function call signal from the address determination unit 2810.
  • the execution data holding unit 2740 holds, for example, an instruction address from the program counter 2350 as function section identification information in accordance with an instruction based on the function call signal from the address determination unit 2810.
  • the execution data holding unit 2740 holds the output from the execution unit 2330 as a reference input value in accordance with an instruction based on the input value reference signal from the address determination unit 2810. Further, the execution data holding unit 2740 holds the output from the execution unit 2330 as the execution result of the function in accordance with the instruction based on the execution result setting signal from the address determination unit 2810.
  • the execution data holding unit 2740 outputs the held section identification information and the reference input value to the search start instruction determining unit 2850 in accordance with an instruction based on the function return signal from the address determining unit 2810. For example, the execution data holding unit 2740 outputs the storage location indicated by the reference input value to the search start instruction determination unit 2850 according to an instruction based on the function return signal from the address determination unit 2810.
  • the execution data holding unit 2740 outputs the held section identification information, reference input value, and execution result to the execution history search unit 2710 in accordance with an instruction based on the function return signal from the address determination unit 2810.
  • the execution data holding unit 2740 outputs the held data to the execution history search unit 2710 in accordance with an instruction based on the function return signal from the address determination unit 2810, and then stores the data held in the execution data holding unit 2740. to erase.
  • the address determination unit 2810 causes the input value setting command address output unit 2830 to hold an input value setting command address of a function that is a plurality of command sections included in the program. Based on the input value setting signal supplied from the instruction decoder 2320, the address determination unit 2810 causes the instruction value output from the program counter 2350 to be held in the input value setting instruction address output unit 2830 as an input value instruction address. At the same time, the address determination unit 2810 causes the execution data holding unit 2740 to hold the input value output from the execution unit 2330 based on the input value setting signal from the instruction decoder 2320 as a set input value.
  • the address determination unit 2810 causes the execution data holding unit 2740 to hold, as section identification information, the start address that is the instruction section of the function, based on the function call signal supplied from the instruction decoder 2320, for example.
  • the address determination unit 2810 causes the execution data holding unit 2740 to hold the instruction address from the program counter 2350 as section identification information based on a function call signal from the instruction decoder 2320.
  • the address determination unit 2810 causes the execution data holding unit 2440 to hold, as section identification information, the start address of the function output from the execution unit 2330 based on a function call signal from the instruction decoder 2320, for example.
  • the address determination unit 2810 causes the execution data holding unit 2740 to hold the input value output from the execution unit 2330 based on the input value reference signal supplied from the instruction decoder 2320 as a reference input value. Further, the address determination unit 2810 causes the execution data holding unit 2740 to hold the execution result output from the execution unit 2330 based on the execution result setting signal supplied from the instruction decoder 2320.
  • the input value setting instruction address table 2820 holds, for each section identification information for identifying a function that is an instruction section, an input value setting instruction address that is an address of an input value setting instruction for setting an input value in the function. To do.
  • This input value setting command address table 2820 shows, for example, the address of the earliest input value setting command that sets the input value first among the input value setting commands for setting the input value in the function. Is stored for each section identification information.
  • the input value setting command address table 2820 outputs the held data to the address determination unit 2810.
  • the input value setting instruction address table 2820 holds a plurality of input value setting instruction addresses corresponding to the plurality of arguments for each section identification information of the function. Also good.
  • the input value setting instruction address table 2820 is an example of the input value setting instruction address table described in the claims.
  • the input value setting command address output unit 2830 associates the input value setting command address supplied from the address determination unit 2810 with the section identification information supplied from the search start command determination unit 2850 in the input value setting command address table 2820. Output.
  • the input value setting command address output unit 2830 holds the input value setting command address supplied from the address determination unit 2810.
  • the input value setting command address output unit 2830 holds the setting order, which is the order in which the input value setting command address is held on the time axis, together with the input value setting command address.
  • the execution data holding unit 2740 holds, for example, the first input value setting command address supplied from the address determination unit 2810 as the first input value setting command address.
  • the input value setting command address output unit 2830 includes the input value setting command address in the setting order determined by the search start command determination unit 2850 and the search start command determination unit 2850 among the held input value setting command addresses. Are output in association with the section identification information from. That is, the input value setting instruction address output unit 2830 associates the input value setting instruction address in the function with the function start address that is the section identification information of the function, and registers it in the input value setting instruction address table 2820 for each function. To do.
  • the input value setting command address output unit 2830 registers the held data in accordance with an instruction based on the function return signal from the address determination unit 2810, and then stores the data held in the input value setting command address output unit 2830. to erase.
  • the setting input value holding unit 2840 holds the setting input value output from the execution data holding unit 2740 and its setting order in association with each other.
  • the set input value holding unit 2840 outputs the held set input values and the setting order to the search start instruction determining unit 2850.
  • the search start instruction determination unit 2850 determines the earliest input value setting instruction in the function as the search start instruction based on the storage location included in the reference input value referenced by the execution of the input value reference instruction in the execution of the function. Is to do.
  • the search start instruction determination unit 2850 includes a storage location included in the set input value based on the input value setting instruction before the function call instruction, and a storage location included in the reference input value based on the input value reference instruction after the call instruction. Based on the above, the setting order of the earliest input value setting command is specified.
  • the search start instruction determination unit 2850 for example, among the set input values in the set input value holding unit 2840, based on the storage location of the reference input value from the execution data holding unit 2740, the setting referred to in the command section of the function The setting order of input values is extracted. Then, the search start instruction determination unit 2850 specifies the smallest setting order among the setting orders of the extracted setting input values.
  • the search start instruction determination unit 2850 first sets the input value in the storage location of the input value referred to in the instruction section of the function among the instructions determined by the instruction decoder 2320 as the input value setting instruction.
  • the setting command is specified as the earliest input value setting command.
  • the search start command determination unit 2850 notifies the input value setting command address output unit 2830 of the specified smallest setting order. At the same time, the search start command determination unit 2850 outputs the section identification information output from the execution data holding unit 2740 to the input value setting command address output unit 2830.
  • the search start command determining unit 2850 sends the input value setting command for the input value setting command address table 2820 to the input value setting command address output unit 2830. Suppress address registration. Thereby, registration of useless input value setting instruction addresses in the input value setting instruction address table 2820 can be reduced.
  • the execution history search unit 2710 registers the section identification information, the reference input value, and the execution result from the execution data holding unit 2740 in the history memory 2730 in accordance with a registration instruction based on the function return signal from the address determination unit 2810.
  • the other functions of the execution history search unit 2710 are the same as those of the execution history search unit 2410 shown in FIG. 46, and thus description thereof is omitted here.
  • the input value setting command address table 2820 stores the input value setting command address and section identification information while the program from the main storage unit 2130 is being executed. Can be registered. That is, by providing the input value setting command address output unit 2830, the input value setting command address held by the input value setting command and the section identification information of the command section specified by the input value setting command are input value setting. It can be output to the instruction address table 2820.
  • the input value setting instruction address output unit 2830 corresponds to the input value referred to in the instruction section called by the calling instruction among the input values set by the search start instruction determining unit 2850 by the input value setting instruction.
  • An input value setting instruction address can be output.
  • the input value setting instruction address output unit 2830 uses the input value setting instruction address and the section identification information of the first input value setting instruction among the input value setting instructions corresponding to the plurality of input values referred to in the instruction section.
  • the start address of a certain instruction section can be output.
  • FIG. 56 is a conceptual diagram showing an example of registering an input value setting command address and section identification information in the input value setting command address table 2820 by the data processing device 2100 according to the third embodiment of the present invention.
  • FIG. 56A shows an example of the data format of the input value setting instruction address table 2820.
  • the input value setting instruction address table 2820 shows the correspondence between the earliest input value setting instruction address 2821 in the instruction section that is a function and the function address 2822 that is section identification information for identifying the function. Yes.
  • FIG. 56 (b) is a diagram showing a correspondence relationship between the input value setting command address and the set input value that are held every time the input value setting command is executed.
  • FIG. 56B shows a setting order 2811, an input value setting command address 2831, and a setting input value 2841.
  • the setting order 2811 indicates the order in which the input value setting instructions are executed.
  • the input value setting instruction address 2831 indicates an instruction address from the program counter 2350 held in the input value setting instruction address output unit 2830 based on the input value setting instruction.
  • the set input value 2841 indicates the input value held in the set input value holding unit 2840 based on the input value setting command.
  • the input value may be only information indicating the storage location of the input value. This is because if the storage location of the input value is known, it can be determined whether or not the input value in the function has been referenced.
  • FIG. 56C shows a case where a function having two arguments is called by a call instruction (call) in the upper routine, and then returns to the upper routine by a return instruction (return) in the lower routine which is the instruction section of the function. It is a conceptual diagram which shows a series of process examples.
  • a function call instruction (call) 311 and a return instruction (return) 312 are shown. Further, an input value A setting 2321 and an input value B setting 2322 in the upper routine, and an input value A reference 2323, an input value B reference 2324, and an execution result C setting 2325 in the lower routine are shown. Since these are the same as those shown in FIG. 48B, the description thereof is omitted here.
  • FIG. 56 is a conceptual diagram showing an example of a data format in the history memory 2730.
  • a correspondence relationship between a function address 2731 which is function section identification information and execution history search data 2732 is shown.
  • the execution history search data 2732 is search data configured by the tree structure shown in FIG. 47 and includes information associated with input values and execution results in the execution history.
  • the instruction address (input value A setting instruction address) output from the program counter 2350 is input to the input value setting instruction address output unit 2830 according to an instruction from the address determination unit 2810. Retained.
  • the first set input value (input value A) held in the execution data holding unit 2740 is output to the set input value holding unit 2840 according to an instruction from the address determination unit 2810.
  • an instruction address (input value B setting instruction address) output from the program counter 2350 is held in the input value setting instruction address output unit 2830 according to an instruction from the address determination unit 2810.
  • the second set input value (input value B) held in the execution data holding unit 2740 is output to the set input value holding unit 2840 according to an instruction from the address determination unit 2810.
  • the section identification information (function address 1) is held in the execution data holding unit 2740 according to an instruction from the address determination unit 2810.
  • the input value A reference 2323, the input value B reference 2324, and the execution result C setting 2325 the first reference input value (input value A) and the second reference input value (input value B) are instructed by the address determination unit 2810.
  • the execution result (execution result C) is held in the execution data holding unit 2740.
  • section identification information in the execution data holding unit 2740, first and second reference input values (input value A and input value B) according to an instruction from the address determination unit 2810. Is output to the search start instruction determination unit 2850.
  • the search start command determination unit 2850 causes the first and second set input values (inputs) in the set input value holding unit 2840 corresponding to the first and second reference input values (input value A and input value B). The value A and the input value B) are extracted.
  • the input value referred to by the execution of the function among the set input values in the set input value holding unit 2840 is specified. This is because even an instruction determined to be an input value setting instruction by the instruction decoder 2320 may not be an instruction to set an input value for a function. For example, an instruction for storing data in the register 4 is determined as an input value setting instruction by the instruction decoder 2320, but may be used by other processing outside the instruction section of the function.
  • the search start command determination unit 2850 selects the smallest setting order (1) among the setting orders (1 and 2) of the extracted setting input values. That is, the search start command determination unit 2850 selects the setting order (1) corresponding to the set input value set based on the earliest input value setting command in the function.
  • the setting order (1) and the section identification information are supplied from the search start command determination unit 2850 to the input value setting command address output unit 2830.
  • the input value setting command address output unit 2830 associates the “input value A setting command address” corresponding to the setting order (1) from the search start command determination unit 2850 with “function address 1” and inputs the input value. It is output to the setting command address table 2820.
  • the section identification information (function address 1), the reference input value (input value A and input value B) and the execution result (execution result C) in the execution data holding unit 2740 are executed.
  • the data is output to the search unit 2710.
  • the execution history search unit 2710 registers the output data in the history memory 2730.
  • FIG. 57 is a flowchart illustrating an example of a processing procedure of an execution result reuse method by the data processing device 2100 according to the third embodiment of the present invention.
  • the fetch unit 2310 reads an instruction from the main storage unit 2130 or the instruction cache 2210 (step S2941). Subsequently, the address determination unit 2810 determines whether or not the instruction address output from the program counter 2350 matches the input value setting instruction address in the input value setting instruction address table 2820 (step S2942).
  • step S2960 If the instruction address from the program counter 2350 matches the input value setting instruction address, an execution history search process (step S2960) is executed. On the other hand, if it does not match the input value setting instruction address, the instruction decoder 2320 determines whether or not it is an input value setting instruction (step S2943).
  • Step S2954 If it is determined that the instruction is an input value setting instruction, an instruction address from the program counter 2350 is held in the input value setting instruction address output unit 2830 as an input value setting instruction address according to an instruction from the address determination unit 2810.
  • Step S2955 the output from the execution unit 2330 is held as a set input value in the execution data holding unit 2740, and the held set input value is held in the set input value holding unit 2840.
  • the instruction decoder 2320 determines whether the instruction is a function call instruction (step S2944). If it is determined that the instruction is not a function call instruction, the process returns to step S2941.
  • the instruction from the program counter 2350 is input to the input value setting instruction address output unit 2830 and the set input value and its setting.
  • the order is held in the set input value holding unit 2840.
  • a setting input value having the same storage location of the setting input value is already held in the setting input value holding unit 2840, it is overlaid on the holding area of the setting input value already held and its setting order.
  • the new setting input value and its setting order are held.
  • the address determination unit 2810 holds the start address of the function in the execution data holding unit 2740 as section identification information (step S2945).
  • the fetch unit 2310 reads an instruction from the main storage unit 2130 or the instruction cache 2210 (step S2946). Subsequently, the instruction decoder 2320 determines whether or not the read instruction is an input value reference instruction (step S2947).
  • step S2956 If it is determined that the instruction is an input value reference command, the output from the execution unit 2330 is stored as a reference input value in the execution data storage unit 2740 as a reference input value in accordance with an instruction from the address determination unit 2810 (step S2956). ), The process returns to step S2946. On the other hand, if it is determined that the instruction is not an input value reference instruction, the instruction decoder 2320 determines whether or not the read instruction is an execution result setting instruction (step S2948).
  • step S2957 If it is determined that the instruction is an execution result setting instruction, an output from the execution unit 2330 is held in the execution data holding unit 2740 as an execution result in accordance with an instruction from the address determination unit 2810 (step S2957). The process returns to step S2946. On the other hand, if it is determined that the instruction is not an execution result setting instruction, the instruction decoder 2320 determines whether or not the read instruction is a function return instruction (step S2949).
  • step S 2946 If it is determined that the instruction is not a function return instruction, the process returns to step S 2946, and the reference input value and the execution result are held in the execution data holding unit 2740 until the function call instruction is read.
  • the instruction is a function call instruction
  • the reference input value held in the execution data holding unit 2740 among the set input values held in the set input value holding unit 2840 by the search start instruction determining unit 2850 is specified.
  • the input value setting command address corresponding to the setting order specified by the search start command determining unit 2850 is the earliest input value setting command address. Extracted.
  • the input value setting command address output unit 2830 associates the earliest input value setting command address with the section identification information from the execution data holding unit 2740 and registers them in the input value setting command address table 2820 (Ste S2951). Further, in accordance with a registration instruction from the address determination unit 2810, the section identification information, the reference input value and the execution result in the execution data holding unit 2740 are registered in the history memory 2730 by the execution history search unit 2710 (step S2952).
  • FIG. 58 is a flowchart showing an example of a processing procedure of execution history search processing (step S2960) by the data processing device 2100 according to the third embodiment of the present invention.
  • the address determination unit 2810 outputs the section identification information corresponding to the input value setting command address that matches the command address from the program counter 2350 from the input value setting command address table 2820 to the execution data holding unit 2740 (step S40). S2963). Subsequently, the execution history search unit 2710 inputs the section identification information held in the execution data holding unit 2740 to the history memory 2730 as a search key of the history memory 2730 (step S2964). Thereby, a search for a plurality of execution histories corresponding to the section identification information in the history memory 2730 is started.
  • the instruction decoder 2320 determines whether or not the instruction read from the fetch unit 2310 is an input value setting instruction (step S2965). If it is determined that the instruction is an input value setting instruction, the input value set by the input value setting instruction is changed by the address determination unit 2810 based on the input value setting signal from the instruction decoder 2320. 2740.
  • step S2971 the execution history search unit 2710 inputs the input value held in the execution data holding unit 2740 to the history memory 2730 (step S2971). Note that the determination in step S2965 for the first time is always determined as an input value setting command here, so that the determination may be omitted and the process may proceed to step S2971.
  • the history memory 2730 causes the input value from the execution history search unit 2710 to match the input value in the execution history. Is determined (step S2972). If the input values do not match, the process proceeds to step S2974.
  • step S2973 the pointer is advanced to the argument node in the next argument in order to compare the input value of the next argument in the execution history in the history memory 2730. That is, if there is an argument node that matches the input value from the execution history search unit 2710, the next argument node is indicated by the right pointer of the argument node.
  • the fetch unit 2310 reads an instruction from the main storage unit 2130 or the instruction cache 2210 (step S2974), and the process returns to step S2915.
  • step S2965 it is determined whether the instruction read by the fetch unit 2310 is a function call instruction (step S2966). If it is not a function call instruction, the process advances to step S2974.
  • steps S2965, S2966, and S2971 to S2974 are repeatedly executed until all input values in the function are set. That is, the input value set based on the input value setting command of the function from the input value setting command to the call command specified by the input value setting command address table 2820 is held in the execution data holding unit 2740 and held. The input value is input to the history memory 2730.
  • the section identification information corresponding to the input value setting instruction address that matches the instruction address output from the program counter 2350 is held in the execution data holding unit 2740. Then, the input value output from the execution unit based on the input value setting command in the instruction group from the input value setting command to the call command specified by the input value setting command address is held in the execution data holding unit 2740. Is done.
  • the execution history search unit 2710 searches the execution result associated with the execution history in the history memory 2730 using the section identification information and the input value in the execution data holding unit 2740.
  • steps S2963 to S2966 and S2971 to S2974 are an example of an execution history search procedure described in the claims.
  • step S2966 determines whether the section identification information and the input value in the execution data holding unit 2740 match all the input values associated with the section identification information in the history memory 2730. It is determined whether or not (step S2967).
  • step S2975 If the section identification information and the input value from the execution history search unit 2710 all match, an execution result reuse process is executed (step S2975). That is, the execution result in the history memory 2730 corresponding to the section identification information and the input value from the execution history search unit 2710 is output from the execution result output unit 2720. Then, the data is written back to the main memory 2130 or the register file 2340, and the function processing is skipped. Note that S2975 is an example of an execution result output procedure described in the claims.
  • step S2968 the execution history search unit 2710 registers the execution result held in the execution data holding unit 2740 and the section identification information and the input value held by the processes of steps S2963 and S2971 in the history memory 2730 (step S2919).
  • the search start instruction address management unit 2800 registers the first input value setting instruction address in the function in the input value setting instruction address table 2820 during the execution of the program. can do.
  • the execution history in the history memory 2430 or 2730 can be searched before executing the calling instruction in the instruction section. Time can be shortened. Also, by providing the input value setting instruction address tables 2520 and 2720, the execution history in the history memory 2430 or 2730 can be searched before the function call instruction is executed without embedding a dedicated instruction in the program itself.
  • the history memory 2430 or 2730 may be realized by a non-volatile memory such as SRAM (Stati Random Access Memory) or ROM (Read Only Memory).
  • SRAM Stat Random Access Memory
  • ROM Read Only Memory
  • the history data held in the history memory 2430 or 2730 may be transferred to a storage unit provided outside the data processing device 2100.
  • a storage unit for storing history data is provided outside the data processing device 2100 will be briefly described as a fourth embodiment with reference to the following diagram.
  • FIG. 59 is a block diagram showing a configuration example of an integrated circuit when a history data storage unit is provided outside the data processing device 2100 according to the fourth embodiment of the present invention.
  • a history data storage unit 2140 is shown. Since the configuration other than the history data storage unit 2140 is the same as that shown in FIG. 45, the description thereof is omitted here.
  • the history data storage unit 2140 stores the history data in the history memory 2430 or 2730 transferred from the data processing device 2100 after the program stored in the main storage unit 2130 is executed.
  • the history data storage unit 2140 is realized by, for example, a nonvolatile memory.
  • the history data storage unit 2140 realized by the non-volatile memory is provided outside the data processing device 2100 to transfer the history data of the history memory 2430 or 2730, thereby avoiding the loss of the history data due to power-off. can do.
  • a history data transfer method will be briefly described with reference to the following diagram.
  • FIG. 60 is a flowchart showing a processing procedure of a history data transfer method by the data processing device 2100 according to the fourth embodiment of the present invention.
  • the application is activated (step S2991), and the data processing unit 2300 determines whether there is history data in the history data storage unit 2140 (step S2992).
  • step S2993 When history data is stored in the history data storage unit 2140, the stored history data is transferred to the history memory 2430 or 2730 by the data processing unit 2300 (step S2993). On the other hand, if no history data is stored, the process proceeds to step S2994.
  • the data processing unit 2300 executes an application that is a program stored in the main storage unit 2130 (step S2994). After execution of this application, the data processing unit 2300 reconstructs new history data to be stored in the history data storage unit 2140 based on both the history data in the history data storage unit 2140 and the history memory 2430 or 2730 ( Step S2995). Then, the reconstructed history data is stored in the history data storage unit 2140.
  • the effect of shortening the execution time by the reuse processing immediately after the program is started can be obtained. Can be improved.
  • FIG. 61 is a block diagram showing a configuration example of the data processing device 3100 according to the embodiment of the present invention.
  • the data processing device 3100 is connected to the main storage unit 3130 via the bus 3120.
  • the instruction section in which the data processing device 3100 executes processing is a function or a loop.
  • the data processing device 3100 executes each process in the program.
  • the data processing device 3100 is realized by, for example, a CPU (Central Processing Unit) in a general computer.
  • the data processing device 3100 includes a primary cache 3200, a processor core 3300, a history management unit 3400, and a history conversion unit 3500.
  • the primary cache 3200 temporarily holds information handled by the processor core 3300 via the bus 3120.
  • the primary cache 3200 includes an instruction cache 3210 and a data cache 3220.
  • the instruction cache 3210 temporarily holds instructions executed in the processor core 3300.
  • the instruction cache 3210 temporarily holds instructions executed frequently by the processor core 3300, thereby reducing access from the processor core 3300 to the main storage unit 3130 and reducing data input waiting time in the processor core 3300. Can be made.
  • the instruction cache 3210 supplies the reuse instruction supplied from the main storage unit 3130 to the processor core 3300.
  • the reuse instruction here means that the execution result is reused when the reuse section is called by distinguishing the reuse section in which the execution result is reused in the instruction section from the non-reuse section. This is an instruction for causing the data processing apparatus to perform the above process.
  • the data cache 3220 temporarily holds input data and output data of the processor core 3300.
  • the data cache 3220 temporarily reduces the access from the processor core 3300 to the main storage unit 3130 by temporarily holding input data of the processor core 3300 that is frequently used, thereby reducing the data input waiting time in the processor core 3300. Reduce.
  • the data cache 3220 outputs the input value and start address of the function or loop supplied from the main storage unit 3130 to the processor core 3300.
  • the input value is a value composed of an argument of a value passed as a value necessary for execution of the function or loop. For example, in the case of a function having three variables as arguments, The value of one variable and the address of that variable.
  • the processor core 3300 executes operations in accordance with program instructions.
  • the processor core 3300 is realized by, for example, a MIPS (Microprocessor without Interlocked Pipeline Stages) processor.
  • the processor core 3300 executes an instruction in a function or loop section input from the instruction cache 3210 based on, for example, an input value and a start address of the function or loop supplied from the data cache 3220, and outputs a result of the execution. Output as the execution result.
  • the input instruction is a reuse instruction that specifies a reuse section and the execution result is not supplied from the history management unit 3400
  • the processor core 3300 displays the execution result that is the result of executing this instruction in the data cache 3220. And output to the history management unit 3400.
  • the processor core 3300 stops the processing in the reuse section and performs this re-use. Return to the routine that called the usage interval and continue execution.
  • the history management unit 3400 retains and manages the execution result of the reuse section.
  • the history management unit 3400 retains the section identification information, the input value, and the execution result of the reuse section supplied from the processor core 3300 as an execution history.
  • the section identification information here is information for specifying a reuse section, for example, a function or loop start address. That is, the history management unit 3400 holds a function or loop start address, an input value, and an execution result as section identification information, an input value, and an execution result. Also, when the function or loop start address and input value are supplied from the processor core 3300, the history management unit 3400 searches for an execution history including the start address and input value.
  • the history conversion unit 3500 converts the execution history managed by the history management unit 3400.
  • the history conversion unit 3500 converts the execution history of the repeated reuse section in which the execution is repeated among the reuse sections registered in the history management unit 3400 into a save history held in the main storage unit 3130.
  • the save history is data for saving the execution result of the execution history of the repeated reuse section in the main storage unit 3130.
  • the history conversion unit 3500 restores the execution history based on the save history held in the main storage unit 3130.
  • the history conversion unit 3500 stores the save history in the main storage unit 3130, deletes the execution history that is the basis for generating the save history from the history management unit 3400, and displays a representative history that holds information indicating the save history. Register in the history management unit 3400.
  • the history conversion unit 3500 restores the execution history from the save history, erases the representative history, and stores the restored execution history in the history management unit 3400. sign up.
  • the bus 3120 is a bus that interconnects each unit of the data processing device 3100 and the main storage unit 3130.
  • the main storage unit 3130 holds data necessary for the data processing device 3100 to operate.
  • the main storage unit 3130 holds the save history supplied from the history conversion unit 3500.
  • the main storage unit 3130 stores a program for causing the data processing device 3100 to execute processing.
  • the main storage unit 3130 may be, for example, a RAM (Random Access Memory).
  • the main storage unit 3130 outputs the stored data to the data processing device 3100 via the bus 3120.
  • the main storage unit 3130 is an example of a save history holding unit described in the claims.
  • FIG. 62 is a block diagram illustrating a configuration example of the processor core 3300, the history management unit 3400, and the history conversion unit 3500 according to the embodiment of the present invention.
  • a main storage unit 3130 connected to the history conversion unit 3500 via the bus 3120 is also shown.
  • the functions of the processor core 3300, the history management unit 3400, the history conversion unit 3500, and the main storage unit 3130 are the same as those in FIG. 61, the same reference numerals are given and detailed description thereof will be given here. Omitted.
  • an iterative reuse interval which is an iteratively executed interval
  • a reuse interval other than the iterative reuse interval is a function
  • a reuse section other than the repeated reuse section is expressed as a function reuse section.
  • the loop execution result is expressed as a loop individual history
  • the function execution result is expressed as a function history.
  • the representative history indicating the save history is expressed as a loop representative history.
  • the processor core 3300 includes a fetch unit 310, an instruction decoder 3320, an execution unit 3330, and a register file 3340.
  • the fetch unit 310 reads an instruction from the instruction cache 3210 or the main storage unit 3130.
  • the fetch unit 310 temporarily holds the read instruction, and supplies an instruction to be executed by the execution unit 3330 among the held instructions to the instruction decoder 3320.
  • the fetch unit 310 supplies a reuse instruction to be executed by the execution unit 3330 to the instruction decoder 3320 among the temporarily held instructions.
  • the fetch unit 310 supplies a reuse instruction stored in the main storage unit 3130 to the instruction decoder 3320.
  • the instruction decoder 3320 generates a control signal for controlling the components in the processor core 3300 by decoding (decoding) the instruction supplied from the fetch unit 310. For example, the instruction decoder 3320 generates a control signal for controlling the execution unit 3330 and the register file 3340 by decoding the instruction, and supplies the generated control signal to the execution unit 3330 and the register file 3340.
  • the instruction decoder 3320 analyzes the reuse instruction to generate a control signal for controlling the execution unit 3330 and the register file 3340. This is supplied to the register file 3340.
  • the execution unit 3330 executes the instruction analyzed by the instruction decoder 3320 based on the control signal supplied from the instruction decoder 3320.
  • the execution unit 3330 starts processing of the reuse section specified by the reuse instruction.
  • the execution unit 3330 outputs the section identification information of the reuse section acquired from the register file 3340 to the history management unit 3400 via the signal line 3309.
  • the execution unit 3330 executes processing in the reuse section based on the input value of the reuse section supplied from the register file 3340, and the history management unit receives the input value of the reuse section via the signal line 3309. To 3400.
  • the execution unit 3330 cancels the processing of the reuse section and indicates that the execution result is supplied from the history management unit 3400. A signal to be notified is supplied to the fetch unit 310. At this time, the execution unit 3330 outputs the execution result to the register file 3340.
  • the execution unit 3330 executes the process of the reuse section to the end, and sends the execution result to the history management unit 3400 and the register file 3340. Output. Further, when the execution result of the repetitive reuse section is not supplied, the execution unit 3330 outputs a loop counter value indicating the execution result of the number of executions to the history management unit 3400 together with the execution result.
  • the loop counter value is an example of the counter value described in the claims.
  • the register file 3340 temporarily holds the data supplied from the data cache 3220 and the execution result supplied from the execution unit 3330. For example, when a control signal based on a reuse instruction is supplied from the instruction decoder 3320, the register file 3340 supplies the input value of the reuse section to the execution unit 3330.
  • the history management unit 3400 holds and manages the execution result of the reuse section.
  • the history target data holding unit 3410, the history search unit 3420, the history memory 3430, the history registration unit 3440, and the history memory capacity A management unit 3450 and an erasing unit 3460 are provided.
  • the history target data holding unit 3410 temporarily holds the data supplied from the execution unit 3330.
  • the history target data holding unit 3410 supplies these to the history search unit 3420 as a search request.
  • the history target data holding unit 3410 uses the function start address and input value supplied from the execution unit 3330 as a search request. To supply. Further, the history target data holding unit 3410 performs a history search using the loop start address, input value, and loop counter value supplied from the execution unit 3330 as a search request when the repetitive reuse section is executed in the execution unit 3330.
  • Unit 3420 is
  • the history target data holding unit 3410 sets the conditions for registering the execution history. This is supplied to the history registration unit 3440. For example, when a function reuse section is executed in the execution unit 3330, the history target data holding unit 3410 registers the function start address, input value, and execution result supplied from the execution unit 3330 as an execution history. Unit 3440. In addition, when the repetitive reuse section is executed in the execution unit 3330, the history target data holding unit 3410 stores the loop start address, input value, execution result, and loop counter value in the history registration unit 3440 as an execution history. Supply.
  • the history search unit 3420 searches the execution history based on the search request supplied from the history target data holding unit 3410.
  • the history search unit 3420 includes a search request input unit 3421 and an execution result output unit 3422.
  • the search request input unit 3421 searches the history memory 3430 for an execution history based on the search request supplied from the history target data holding unit 3410. For example, when an instruction designating an iterative reuse section is analyzed in the instruction decoder 3320, the search request input unit 3421 stores a loop start address, an input value, and a loop counter value designated by this instruction in the history memory. 3430. Thereby, the search of the execution history is started.
  • the execution result output unit 3422 extracts the execution result from the history memory 3430 when the execution history is searched in the history memory 3430, and outputs the extracted execution result to the execution unit 3330.
  • the execution result output unit 3422 supplies the extracted execution result to the execution unit 3330 via the signal line 3409.
  • the execution result output unit 3422 extracts save history position information indicating the save history from the history memory 3430 instead of the execution result. Then, the extracted information related to the save history is output to the history conversion unit 3500 to start restoring the execution history.
  • the history memory 3430 holds the execution history supplied from the history registration unit 3440. For example, when a search request is supplied from the history search unit 3420 and the history memory 3430 holds an execution history that matches the search request, the execution result of the execution history is output to the execution result output unit 3422. To supply. In addition, when a search request is supplied from the history search unit 3420, the history memory 3430 executes the save history position information of the loop representative history when holding a loop representative history that matches the search request. The result is supplied to the result output unit 3422. Furthermore, the history memory 3430 holds the execution history when the execution history is supplied from the history registration unit 3440.
  • the history memory 3430 supplies information related to the usage status of the history memory 3430 to the history memory capacity management unit 3450. Further, the history memory 3430 supplies the held execution history and loop representative history to the history conversion unit 3500.
  • the history memory 3430 is realized by, for example, an associative memory (CAM: Content Addressable Memory).
  • the history registration unit 3440 converts the execution history supplied from the history target data holding unit 3410 into a data structure for holding the history memory 3430, and registers the converted execution history in the history memory 3430. . For example, when the history search unit 3420 does not search for a function history, the history registration unit 3440 registers the function start address, input value, and execution result in the history memory 3430 as an execution history. Further, for example, when the loop individual history is not searched by the history search unit 3420, the history registration unit 3440 registers the loop start address, input value, execution result, and loop counter value in the history memory 3430 as the execution history. .
  • the history registration unit 3440 temporarily suspends registration when the data amount of the newly registered execution history is larger than the free space of the history memory 3430 supplied from the history memory capacity management unit 3450. . Then, the history registration unit 3440 supplies the erasing unit 3460 with erasure start information for erasing the execution history having the longest unused period from the previous use among the already registered execution histories.
  • the history memory capacity management unit 3450 manages the free capacity of the history memory 3430. For example, the history memory capacity management unit 3450 measures the free capacity of the history memory 3430 every time a new execution history is registered in the history memory 3430. Further, the history memory capacity management unit 3450 measures the free capacity of the history memory 3430 every time the execution history is deleted from the history memory 3430. The history memory capacity management unit 3450 supplies information related to the free capacity of the history memory 3430 to the history registration unit 3440.
  • the deletion unit 3460 deletes the execution history having the longest unused period from the previous use.
  • the history conversion unit 3500 converts the execution history managed by the history management unit 3400 into a save history and stores it in the main storage unit 3130.
  • the history conversion unit 3500 stores the history control unit 3510, the history restoration unit 3520, and the save area management. Part 3530.
  • the history control unit 3510 generates a save history from the loop individual execution history held in the history memory 3430 and saves it in the main storage unit 3130. For example, the history control unit 3510 extracts the execution history of the repeated reuse section from the history memory 3430 via the signal line 3490, and the execution history and the main storage unit 3130 supplied from the save area management unit 3530. The save history is saved in the main storage unit 3130 based on the address information. Also, the history control unit 3510 starts saving the save history when, for example, the data amount of a new execution history to be held in the history memory 3430 is larger than the free capacity of the history memory 3430.
  • the history control unit 3510 deletes the loop individual history that is the basis of the save history from the history memory 3430 and registers the loop representative history including the save history position information in the history memory 3430 instead of the loop individual history.
  • the save history position information here is, for example, an address of the main storage unit 3130 indicating the storage position of the save history in the main storage unit 3130.
  • the history control unit 3510 supplies the generated save history to the main storage unit 3130 via the signal line 3509.
  • the history control unit 3510 supplies the generated loop representative history to the history memory 3430 via the signal line 3590.
  • the device configured by the history control unit 3510 and the history memory 3430 is an example of a history storage device described in the claims.
  • the history restoration unit 3520 extracts the save history from the main storage unit 3130 based on the save history position information supplied from the execution result output unit 3422, and restores the execution history based on the save history. For example, when the execution result of the save history saved in the main storage unit 3130 is reused, the history restoration unit 3520 reads from the main storage unit 3130 based on the save history information supplied from the execution result output unit 3422. A save history is extracted via the signal line 3139. The history restoration unit 3520 restores the execution history based on the loop representative history extracted from the history memory 3430 and the save history extracted from the main storage unit 3130. Thereafter, the history restoration unit 3520 deletes the loop representative history held in the history memory 3430, and after securing the capacity for holding the save history in the history memory 3430, registers the restored execution history in the history memory 3430. To do.
  • the history restoration unit 3520 supplies the restored execution history to the history memory 3430 via the signal line 3580.
  • the save area management unit 3530 manages an area in which the save history in the main storage unit 3130 is held. For example, when the history control unit 3510 generates a save history, the save area management unit 3530 saves the save history in the main storage unit 3130 when an area for storing the save history is secured in the main storage unit 3130. The previous address is supplied to the history control unit 3510 via the signal line 3539.
  • the main storage unit 3130 holds a save history in this configuration diagram.
  • the main storage unit 3130 is an example of a save history holding unit described in the claims.
  • the execution history of the repeated reuse section can be saved in the main storage unit 3130.
  • the iterative reuse section is a loop
  • the present invention is not limited to this.
  • a subroutine with a recursive call recursive call
  • FIG. 63 is a block diagram showing a configuration example of the history control unit 3510 in the embodiment of the present invention.
  • the history control unit 3510 includes a save history generation unit 3600, a loop individual history deletion unit 3512, and a loop representative history registration unit 3513.
  • the save history generation unit 3600 generates a save history based on the loop individual history.
  • the save history generation unit 3600 acquires, for example, a loop individual history including an execution result by repeated execution of a loop from the history memory 3430 via the signal line 3490, and based on the acquired loop individual history. Is generated.
  • the save history generation unit 3600 receives the save destination address of the save history in the main storage unit 3130 from the save area management unit 3530 via the signal line 3539. Then, the save history generation unit 3600 saves the generated save history in the main storage unit 3130 via the signal line 3509.
  • the save history generation unit 3600 generates a loop representative history including the save history position information and supplies the loop representative history to the loop representative history registration unit 3513 via the signal line 3608. Further, the save history generating unit 3600 supplies the loop individual history that is the basis of the save history to the loop individual history erasing unit 3512 via the signal line 3609.
  • the loop individual history deleting unit 3512 deletes the execution history that is the basis of the save history.
  • the loop individual history erasure unit 3512 erases the loop individual history from the history memory 3430 via the signal line 3592 based on the loop individual history that is the basis of the save history supplied from the save history generation unit 3600. Further, the loop individual history deleting unit 3512 supplies information notifying the deletion of the loop individual history to the loop representative history registering unit 3513.
  • the loop representative history registration unit 3513 registers the loop representative history in the history memory 3430. For example, when the loop representative history is supplied from the save history generation unit 3600 and the loop representative history registration unit 3513 receives information notifying the deletion of the loop individual history from the loop individual history deletion unit, The representative history is registered in the history memory 3430 through the signal line 3593.
  • FIG. 64 is a block diagram showing a configuration example of the save history generation unit 3600 according to the embodiment of the present invention.
  • the save history generation unit 3600 includes a head search unit 3610, a continuous search unit 3620, a loop individual history acquisition unit 3630, a save history transfer unit 3640, and a loop representative history generation unit 3650.
  • the head searching unit 3610 searches the loop individual history related to the first execution of the repeated reuse section from the history memory 3430 via the signal line 3491.
  • the head search unit 3610 temporarily stops the operation and causes the continuous search unit 3620 to process the search for the loop individual history thereafter.
  • the head search unit 3610 supplies position information regarding the searched loop individual history to the continuous search unit 3620.
  • the continuous search unit 3620 transmits the loop individual history related to the second and subsequent executions via the signal line 3492 based on the position information of the loop individual history related to the first execution of the repeated reuse section supplied from the head search unit 3610. To explore. For example, when the position information of the first loop individual history is supplied from the head search unit 3610 in a loop repeated 50 times, the continuous search unit 3620 displays the loop individual history from the second time to the 50th time. Explore. The continuous search unit 3620 supplies position information for acquiring the 50 individual loop histories to the individual loop history acquisition unit 3630 when the 51st execution history is not searched.
  • the continuous search unit 3620 determines that the repetitive reuse section has not been repeatedly executed, and stops generating the save history. Then, the continuous search unit 3620 stops the operation at one end and causes the head search unit 3610 to restart the search for the loop individual history regarding the first execution of the repeated reuse section.
  • the loop individual history acquisition unit 3630 acquires the loop individual history from the history memory 3430 via the signal line 3493 based on the position information for acquiring the loop individual history supplied from the continuous search unit 3620. . For example, when position information regarding 50 loop individual histories in an iterative reuse section repeated 50 times is supplied from the continuous search unit 3620, the loop individual history acquisition unit 3630 receives the 50 loop individual histories. Is acquired from the history memory 3430. The loop individual history acquisition unit 3630 supplies the acquired loop individual history to the save history transfer unit 3640, the loop representative history generation unit 3650, and the loop individual history deletion unit 3512 via the signal line 3638 and the signal line 3609. To do.
  • the save history transfer unit 3640 generates a save history based on the loop individual history supplied from the loop individual history acquisition unit 3630, and transfers the generated save history to the main storage unit 3130. For example, when 50 loop individual histories of an iterative reuse section repeated 50 times are supplied, the evacuation history transfer unit 3640 generates 50 evacuation histories.
  • the save history transfer unit 3640 saves the save history in the main storage unit 3130 based on the address of the main storage unit 3130 supplied from the save area management unit 3530 via the signal line 3539.
  • the save history transfer unit 3640 transfers the generated save history to the main storage unit 3130 via the signal line 3509.
  • the loop representative history generation unit 3650 generates a loop representative history based on the loop individual history supplied from the loop individual history acquisition unit 3630.
  • the loop representative history generation unit 3650 generates a loop representative history including the save history position information based on the address of the main storage unit 3130 supplied from the save area management unit 3530 via the signal line 3539.
  • the loop representative history generation unit 3650 supplies the generated loop representative history to the loop representative history registration unit 3513 via the signal line 3608.
  • FIG. 65 is a block diagram showing a configuration example of the history restoration unit 3520 in the embodiment of the present invention.
  • the history restoration unit 3520 includes a save history acquisition unit 3521, a loop individual history generation unit 3522, a registration area securing unit 3523, and a loop individual history registration unit 3524.
  • the save history acquisition unit 3521 acquires a save history from the main storage unit 3130 based on the save history position information supplied from the execution result output unit 3422. For example, when the save history acquisition unit 3521 acquires the save history of the repeated reuse section that has been repeatedly executed 50 times, the save history position supplied from the execution result output unit 3422 via the signal line 3408. Based on the information, the 50 save histories are acquired from the main storage unit 3130. The save history acquisition unit 3521 supplies the acquired save history to the loop individual history generation unit 3522.
  • the loop individual history generation unit 3522 generates a loop individual history from the save history.
  • the loop individual history generation unit 3522 acquires the loop representative history including the save history position information from the history memory 3430 via the signal line 3480 based on the save history position information supplied via the signal line 3408.
  • the loop individual history generation unit 3522 generates a loop individual history based on the acquired loop representative history and the save history supplied from the save history acquisition unit 3521.
  • the loop individual history generation unit 3522 supplies the generated loop individual history to the loop individual history registration unit 3524.
  • the loop individual history generating unit 3522 supplies the loop representative history and the data amount of the loop individual history to the registration area securing unit 3523.
  • the registration area securing unit 3523 secures a free area in the history memory 3430 to register the loop individual history.
  • the registration area securing unit 3523 erases the loop representative history supplied from the loop individual history generating unit 3522 from the history memory 3430 via the signal line 3583.
  • the registration area securing unit 3523 determines whether or not there is a free capacity for registering all loop individual histories in the history memory 3430 based on the data amount of the loop individual history supplied from the loop individual history generation unit 3522. To do.
  • the registration area securing unit 3523 secures the free space via the signal line 3583. For example, the registration area securing unit 3523 erases the execution history having the longest unused period since the previous use, and secures the necessary free space in the history memory 3430.
  • the registration area securing unit 3523 supplies information related to the free space in the history memory 3430 to the loop individual history registration unit 3524.
  • the loop individual history registration unit 3524 registers the loop individual history supplied from the loop individual history generation unit 3522 in the history memory 3430 through the signal line 3584.
  • the loop individual history registration unit 3524 registers the loop individual history supplied from the loop individual history generation unit 3522 in the free space of the history memory 3430 indicated by the information supplied from the registration area securing unit 3523.
  • the main storage unit uses the execution history of the repeated reuse section in which execution is repeated as the save history. 3130 can be evacuated.
  • FIG. 66 is a schematic diagram showing a field configuration example of the function history, the loop individual history, and the loop representative history held in the history memory 3430 and the save history held in the main storage unit 3130 according to the embodiment of the present invention. is there.
  • the function history 3710 includes an identifier field 3711, a start address field 3712, an input value link field 3713, and an execution result link field 3717.
  • the identifier field 3711 is a field for identifying a function history, a loop individual history, and a loop representative history. In this identifier field 3711, 2 bits (00) indicating a function history are stored.
  • the identifier field 3711 is a head field in the function history 3710, and is a field held at the start address of the function history 3710, for example.
  • the start address field 3712 is a field for storing the start address of the function.
  • the start address of the function stored in the start address field 3712 is compared with the start address of the search request when the search history is searched by the search request input unit 3421.
  • the input value link field 3713 is a field for storing the address of the input value of the function stored using the link structure.
  • the input value link field 3713 stores an address at which the first argument value that is the value of the first argument of the three functions is held. Is done.
  • the execution result link field 3717 is a field for storing the address of the execution result of the function stored using the link structure.
  • the execution result link field 3717 stores an address at which the execution result of the function output as the execution result is stored when the search history is searched by the search request input unit 3421 and the start address and the input value match. Is done. For example, in the case of a function having three variables as output values, the address at which the value of the first variable among the three variables is stored is stored in the execution result link field 3717.
  • FIG. 66 (b) shows a field configuration example of a loop individual history 3720 that is an execution history of the repeated reuse section.
  • This loop individual history 3720 includes an identifier field 3721, a start address field 3722, an input value link field 3723, a loop counter value field 3724, and an execution result link field 3727.
  • the identifier field 3721 is a field for storing an identifier for identifying the function history, the loop individual history, and the loop representative history similarly to the identifier field 3711 shown in FIG. In this identifier field 3721, 2 bits (01) indicating a loop individual history are stored.
  • the identifier field 3721 is a head field in the loop individual history 3720, and is a field held at the start address of the loop individual history 3720, for example.
  • the start address field 3722 is a field for storing the start address of the loop.
  • the loop start address stored in the start address field 3722 is compared with the start address of the search request when the search history is searched by the search request input unit 3421.
  • the input value link field 3723 is a field for storing the address of the input value of the loop stored using the link structure.
  • the function of the input value link field 3723 is the same as that of the input value link field 3713 shown in FIG. 66 (a), and thus detailed description thereof is omitted here.
  • the loop counter value field 3724 is a field for storing a value indicating how many times the loop has been executed.
  • the loop counter value field 3724 stores a loop counter value to be compared with the loop counter value of the search request when the execution history is searched by the search request input unit 3421 and the start address and the input value match.
  • the execution result link field 3727 is a field for storing the address of the loop execution result stored using the link structure.
  • the execution result link field 3727 holds a loop execution result output as an execution result when the search history is searched by the search request input unit 3421 and the start address, input value, and loop counter value match. Is stored.
  • the loop representative history 3730 includes an identifier field 3731, a start address field 3732, an input value link field 3733, a save count field 3735, and a save history address field 3736.
  • the identifier field 3731 is a field for identifying the function history, the loop individual history, and the loop representative history similarly to the identifier field 3711 shown in FIG. This identifier field 3731 stores 2 bits (10) indicating that it is a loop representative history.
  • the identifier field 3731 is a head field in the loop representative history 3730, and is a field held at the start address of the loop representative history 3730, for example.
  • the start address field 3732 is a field for storing the start address of the loop, similarly to the start address field 3722 shown in FIG.
  • the function of the start address field 3732 is the same as that of the start address field 3722 of FIG. 66 (b), and a detailed description thereof will be omitted here.
  • the input value link field 3733 is a field for storing the address of the input value of the loop stored using the link structure, similarly to the input value link field 3723 shown in FIG.
  • the function of the input value link field 3733 is the same as that of the input value link field 3723 shown in FIG. 66 (b), and thus detailed description thereof is omitted here.
  • the save count field 3735 is a field for storing a value indicating the number of save histories saved in the main storage unit 3130. This save count field 3735 is supplied to the history restoring unit 3520 as save history position information when the execution history is searched and the start address and input value of the search request match the start address and input value of the loop representative history. The number of save histories to be stored is stored.
  • the save history address field 3736 is a field for storing a save history address.
  • the save history address is an address where the save history saved in the main storage unit 3130 is stored.
  • the history restoring unit 3520 stores the save history position information as save history position information.
  • the supplied save history address is stored.
  • this save history address field 3736 stores the start address of the first save history when a plurality of save histories in the repeated reuse section are saved at consecutive addresses.
  • FIG. 66 (d) shows a field configuration example of the repetitive reuse section save history 3740.
  • the save history 3740 includes a loop counter value field 3744 and an execution result link field 3747.
  • the loop counter value field 3744 is a field for storing a value indicating how many times the loop is executed as in the loop counter value field 3724 shown in FIG. 66 (b). This loop counter value field 3744 stores a value that becomes the loop counter value field 3724 when the history restoring unit 3520 restores the loop individual history.
  • the execution result link field 3747 is a field for storing the address of the loop execution result stored using the link structure, similarly to the execution result link field 3727 shown in FIG. In the execution result link field 3747, a value that becomes the execution result link field 3727 when the loop individual history is restored by the history restoration unit 3520 is stored.
  • the data structure of the function history, loop individual history, loop representative history, and save history is not limited to this.
  • the input value and the execution result may be held as they are in the function history, loop individual history, loop representative history, and save history without using a link structure.
  • FIG. 67 is a conceptual diagram showing a data structure example of an input value link and an execution result link in the embodiment of the present invention.
  • the input value link field 3713 shown in FIG. 66A and the data structure of the input value storage area 3760 for storing the input value are shown.
  • a function is assumed in which three arguments are input values.
  • the input value storage area 3760 is an area of the history memory 3430 different from the area where the function history, loop individual history, and loop individual history are stored.
  • the input value storage area 3760 is an area for holding input values of function history and loop individual history.
  • a first argument value 3761, a second argument value 3763, and a third argument value 3765 are shown in the left column as three arguments.
  • link addresses 3762, 3764 and 3766 stored together with the three arguments are shown.
  • the first argument value 3761, the second argument value 3763, and the third argument value 3765 are areas in which the argument values of three arguments that are input values specified by the input value link field 3713 are respectively held. That is, the first argument value 3761 holds the argument value of the first argument, the second argument value 3763 holds the argument value of the second argument, and the third argument value In 3765, the argument value of the third argument is held.
  • the first argument value 3761 holds the argument used first in the function reuse section
  • the second argument value 3766 holds the second used argument
  • the third argument value 3765 Holds the third argument used.
  • the address of the first argument value 3761 is an address stored in the input value link field 3713.
  • the link address 3762, the link address 3764, and the link address 3766 are concatenated and stored in the first argument value 3761, the second argument value 3763, and the third argument value 3765, respectively, and are areas for storing the addresses of the next arguments.
  • the link address 3762 that is concatenated and stored in the first argument value 3761 stores the address of the second argument value 3763.
  • “0” indicating that there is no link destination is stored in the link address 3762, the link address 3764, and the link address 3766 when there is no next argument.
  • “0” is stored in the link address 3766 that is concatenated and stored in the third argument value 3765 because there is no fourth argument.
  • the input value storage area 3760 holds the link address that specifies the storage location of the next argument for each argument of the input value of the execution history.
  • the input value link field 3713 is referred to when the start address of the search request matches the start address of the function history 3710, and the input value of the search request is set for each argument in order from the first argument value 3761. Compared with the argument.
  • the search is terminated by “0” of the link address 3766, and the process proceeds to an execution result output process.
  • the input value of the execution history is saved in the link structure, so that the useless area of the storage area can be reduced and the input value can be efficiently held.
  • the input value link field 3723 and the input value link field 3733 are not described because the input values are stored using a link structure in the same manner as the input value link field 3713.
  • the execution result link field 3717, the execution result link field 3727, and the execution result link field 3747 are also stored in the same way as the input value link field 3713, and the description of h is omitted.
  • the input value storage area 3760 is an area in the history memory 3430 in order to speed up the search, but the present invention is not limited to this. For example, by securing the input value storage area 3760 in the main storage unit 3130, more execution history and individual loop history can be held in the history memory 3430.
  • FIG. 68 is a diagram showing specific examples of the execution history, loop representative history, and save history in the history memory 3430 and the main storage unit 3130 when the history control unit 3510 saves the loop individual history in the embodiment of the present invention. is there.
  • the area for registering the function history, loop individual history, and loop representative history in the history memory 3430 has a capacity capable of storing 10 histories regardless of the data amount.
  • the area for storing the save history in the main storage unit 3130 has a capacity capable of saving six save histories regardless of the data amount.
  • the function history that is the execution history of the function reuse section, the loop individual history that is the execution history of the repeated reuse section, and the loop representative history that is the representative history of the repeated reuse section are described. Three histories are expressed as history information.
  • 68A is an example of the execution history, loop representative history, and save history in the history memory 3430 and the main storage unit 3130 before the history control unit 3510 operates.
  • an execution history table 3811 and a save history table 3812 are shown.
  • the execution history table 3811 represents history information registered in the history memory 3430.
  • the order indicating the order registered in the history memory 3430 is illustrated in order from “1” to “10”. This ranking indicates that the smaller the numerical value is, the earlier it is registered in the history memory 3430.
  • history information registered in the history memory 3430 is shown.
  • the identifiers shown in (a) to (d) of FIG. 66 and the function or loop that is the basis of the history information are shown.
  • the loop individual history a value indicating how many times the loop individual history is executed in the repeated execution is further shown.
  • the history information (00 (funcA)) with the rank “1” indicates the function history (00) of the function A (funcA).
  • the history information (01 (loopF (1))) with the rank “7” indicates the loop individual history (01) related to the first execution (1) of the loop F (loopF).
  • the history information (01 (loopF (2))) of the rank “8” indicates the loop individual history (01) related to the second execution (2) of the loop F (loopF) executed repeatedly. Yes.
  • the save history table 3812 represents the save history saved in the main storage unit 3130.
  • the ranks in the save history table 3812 indicate ranks indicating the order registered in the main storage unit 3130, and here, ranks from “1” to “6” are illustrated. This ranking means that the smaller the numerical value, the older and registered at an earlier time.
  • the save history in the save history table 3812 indicates the save history saved in the main storage unit 3130. Here, it is shown that no save history is saved in the main storage unit 3130.
  • the history control unit 3510 detects that there is no free space for registering a new execution history in the history memory 3430, the loop individual history of the repeated reuse section that is repeatedly executed from the history memory 3430. Start evacuation.
  • 68 (b) is an example of history information and save history in the history memory 3430 and the main storage unit 3130 after the history control unit 3510 operates.
  • an execution history table 3821 and a save history table 3822 are shown.
  • the execution history table 3821 represents history information in the history memory 3430 after the loop individual history in the execution history table 3811 shown in FIG.
  • the loop individual history (01 (loopF (1)) in the order of “7”, the loop individual history (01 (loopF (2)) in the order of “8”, and “ The loop individual history (01 (loopF (3)) with the rank of 9 ” has been deleted.
  • the loop representative history (10 (loopF)) has the rank of“ 7 ”. Is shown in
  • the save history table 3822 represents a save history saved in the main storage unit 3130 after the history control unit 3510 operates.
  • the loop history is generated repeatedly based on the loop individual history (01 (loopF (1))) of the rank “7” in the execution history table 3811.
  • a save history (loopF (1)) including an execution result of the first execution of the loop F is shown.
  • a save history (loopF (2)) including the execution result of the second execution is shown.
  • the execution result of the loop individual history of the loop executed repeatedly can be saved in the main storage unit 3130.
  • FIG. 69 is a diagram showing a specific example of the execution history, loop representative history, and save history in the history memory 3430 and the main storage unit 3130 when the history individual history is restored by the history restoration unit 3520 according to the embodiment of the present invention. is there.
  • history memory 3430 and main storage unit 3130 have the same functions as history memory 3430 and main storage unit 3130 shown in FIG.
  • LRU Least Recently Used
  • FIG. 69 (a) is an example of history information and save history in the history memory 3430 and the main storage unit 3130 before the loop individual history is restored based on the save history.
  • an execution history table 3831 and a save history table 3832 are shown.
  • the execution history table 3831 shows history information registered in the history memory 3430 before the history restoring unit 3520 restores the loop individual history.
  • the execution history table 3831 shows a state in which a new execution history is stored in the free space of the execution history table 3821 shown in FIG. As the new execution history, the function history 00 (funcC) of the function C is registered in the rank “9”, and the function history 00 (funcD) of the function D is stored in the rank “10”.
  • the save history table 3832 represents the save history saved in the main storage unit 3130 in the same manner as the save history table 3822 shown in FIG.
  • the history restoration unit 3520 starts restoring the individual loop history from the saved history.
  • FIG. 69B is an example of history information and save history in the history memory 3430 and the main storage unit 3130 after the loop individual history is restored from the saved history by the history restoring unit 3520.
  • FIG. Here, an execution history table 3841 and a save history table 3842 are shown.
  • the execution history table 3841 shows history information registered in the history memory 3430 after the history restoring unit 3520 restores the loop individual history.
  • the execution history table 3841 shows a state where the loop individual history is restored from the save history of the save history table 3832 shown in FIG. 69A and added to the execution history of the execution history table 3831.
  • execution history table 3841 the execution histories 00 (funcA) and 01 (loopA (1)) corresponding to the ranks “1” and “2” in the execution history table 3831 are deleted, and “3” to “6” are deleted. The order of execution history is moved up from “1” to “4”.
  • the execution history 01 (loopF (1)) based on the save history (loopF (1)) in the rank “1” in the save history table 3832 is restored and registered.
  • the execution histories 01 (loopF (2)) and 01 (loopF (3)) are restored and registered.

Abstract

 履歴メモリ430は、関数の識別情報ごとに関数の入力値および実行結果を関連付けて実行履歴として保持する。命令デコーダ320は、フェッチ部310からの関数を予告する予告命令に含まれる関数の識別情報を実行履歴検索部410に供給する。また、命令デコーダ320は、予告命令の後に読み出される命令のうち、関数の入力値を設定する入力値設定命令に基づいて、入力選択部332から出力される入力値を実行履歴検索部410に取得させる。実行履歴検索部410は、関数の呼出し命令の前に、その取得された識別情報および入力値と一致する実行履歴を検索する。実行結果出力部420は、実行履歴検索部410により検出された実行結果を実行部330に出力する。フェッチ部310は、関数の次に読み出すべき命令を読み出す。

Description

データ処理装置、データ処理方法、プログラム変換処理装置およびプログラム変換処理方法、プログラム変換処理装置、データ処理装置、プログラム変換処理方法およびデータ処理方法、データ処理装置、データ処理方法、プログラム解析処理装置およびプログラム解析処理方法、データ処理装置、履歴保存装置、データ処理方法およびプログラム、並びに、コンパイル処理装置、データ処理装置、コンパイル処理方法およびプログラム
 本発明は、データ処理装置に関し、特に複数回実行される命令区間の実行結果を再利用するデータ処理装置およびその処理方法、ならびに、このデータ処理装置に対応するプログラムに変換するデータ変換処理装置およびその処理方法に関する。また、本発明は、プログラム変換処理装置に関し、特に実行結果が再利用される命令区間の呼出し命令を再利用命令に変換するプログラム変換処理装置、データ処理装置、および、これらにおける処理方法に関する。さらに、本発明は、データ処理装置に関し、特に複数回実行される命令区間の実行結果を再利用するデータ処理装置およびその処理方法、ならびに、このデータ処理装置に対応するプログラムに変換するデータ変換処理装置およびその処理方法に関する。また、本発明は、データ処理装置に関し、特に実行結果が再利用される命令区間を実行するデータ処理装置、履歴保存装置、および、これらにおける処理方法ならびに当該方法をコンピュータに実行させるプログラムに関する。さらに、本発明は、コンパイル処理装置に関し、特にハッシュ関数によって生成されたハッシュ値を用いて、実行結果が再利用される命令区間を識別するコンパイル処理装置、データ処理装置、および、これらにおけるコンパイル処理方法およびプログラムに関する。
 従来からCPU(Central Processing Unit)などのマイクロプロセッサにおいて、演算処理の高速化技術に関する研究開発が盛んに行われている。この演算処理の高速化技術として、値再利用技術という手法が考案されている。例えば、この値再利用技術をループの命令区間に適用したデータ処理装置が提案されている(例えば、特許文献1参照。)。
 この値再利用技術では、プログラムの一部分である命令区間のうち、その命令区間における入力値が同じであれば実行結果も同じとなる命令区間における入力値と、その実行結果である出力値とを関連付けて再利用表に登録する。その後、同じ命令区間を再度実行する場合に、同一の入力値が再利用表に登録されていれば、その入力値に対応する出力値を再利用表から出力することによって、過去に実行された命令区間の実行結果を再利用する。このように、複数回実行される命令区間のうち、過去に実行された命令区間の実行結果を再利用することができる命令区間をここでは再利用区間という。
 また、プログラムの処理速度を高速化するために種々の技術が開発されている。近年、その技術を用いた装置の一つとして、値再利用(メモ化:Memoization)と呼ばれる命令区間の実行結果を再利用する技法を用いた区間再利用装置が提案されている(例えば、特許文献1参照。)。この区間再利用装置は、プログラムの所定の命令区間における入力値および実行結果を保存しておくことによって、同じ命令区間を再び実行する際に入力値が一致する場合には、保存していた実行結果である出力値を出力する装置である。
 この区間再利用装置において実行結果の検索を高速化するための装置の一つとして、検索時の索引として用いられるキャッシュインデックスを、ハッシュ関数を用いて生成する装置が提案されている(例えば、非特許文献1参照。)。このハッシュ関数を用いてキャッシュインデックスを生成する区間再利用装置は、アッカーマン関数の2つの入力の値をハッシュ関数の入力とすることによって、キャッシュインデックスであるハッシュ値を算出する。そして、この区間再利用装置は、その生成したキャッシュインデックスに基づいてアッカーマン関数の実行結果を保存し、実行結果を検索する場合にはその生成したキャッシュインデックスを索引として用いて実行結果を検索する。
特許第3855076号公報(図1) 特開2004-258905号公報(図1)
Stephen E. Richardson著、「Caching Function Results Faster Arithmetic by Avoiding Unnecessary Computation」、Sun Microsystems Laboratories, Inc.,1992年
 上述の従来技術では、再利用区間における処理が再度実行されたときに、その命令区間の入力値が再利用表に登録されていれば、その再利用区間の処理を省略することができるため、命令区間の実行に要する時間を短縮することができる。しかしながら、この場合、再利用区間の処理において入力値が使用されるまでは、その再利用区間の入力値が再利用表に登録されているか否かの判断を行うことができない。このため、入力値が使用されるまで再利用表の検索を行うことができないことから、実行結果の再利用によって短縮することができる期間が制限されてしまう。
 上記の従来技術では、同じ命令区間を再び実行して実行結果を出力する前に保存していた実行結果を出力することによって、その命令区間の実行時間を削減することができる。しかしながら、このような区間再利用装置は、再び実行されない命令区間における実行結果も保存するため、実行結果を保存するメモリの浪費や実行結果の無駄な検索が多くなることによって値再利用の効率が悪くなることが考えられる。
 しかしながら、このような区間再利用装置では、実行結果を保存しておくメモリが満杯の場合には新たな実行履歴を登録するために古い実行結果を削除することから、その削除された実行結果の再利用ができないという問題が生じる。すなわち、このような区間再利用装置では、実行結果を保存しておくメモリから実行結果が削除されることに起因する値再利用の効率の低下が生じる場合が考えられる。
 上記の従来技術では、アッカーマン関数の2つの入力の値から生成したキャッシュインデックスを用いて実行結果を検索することによって、実行結果の検索に要する時間を削減することができる。しかしながら、このような区間再利用装置では、実行結果を保存しておくメモリのサイズに合わせた単一のハッシュ関数を用いているため、必要なキャッシュインデックスの数に応じてハッシュ関数を選択することはできないという問題が生じる。
 このような区間再利用装置では、例えば、保持させる実行結果の数に対してハッシュ値(キャッシュインデックス)のビット長が不要に長いために検索に時間が掛かる場合がある。この検索に時間が掛かることにより、このような区間再利用装置では、値再利用の効率の低下が生じてしまう。
 本発明はこのような状況に鑑みてなされたものであり、実行結果の再利用による再利用区間の処理時間をさらに短縮させることを目的とする。
 また、本発明はこのような状況に鑑みてなされたものであり、値再利用の効率を改善することを目的とする。
 さらに、本発明はこのような状況に鑑みてなされたものであり、値再利用(メモ化)を行う際、実行結果を保存しておくメモリから実行結果を退避させることにより、値再利用の効率を改善することを目的とする。
 また、本発明はこのような状況に鑑みてなされたものであり、値再利用(メモ化)を行う際、実行結果を保存しておくメモリに保持させるデータのビット長を短縮させることにより、値再利用の効率を改善することを目的とする。
 第1の本発明は、上記課題を解決するためになされたものであり、その第1の側面は、複数回実行される命令区間である再利用区間が含まれる命令列に基づく処理を実行する実行部と、上記再利用区間を識別するための識別情報ごとに上記再利用区間における入力値および実行結果を関連付けて実行履歴として保持する履歴メモリと、上記再利用区間における処理の実行を予告する予告命令に基づいて上記再利用区間の入力値を取得して上記取得された入力値と上記予告命令により特定された上記識別情報とに基づいて上記実行履歴における上記実行結果を検索する実行履歴検索部と、上記予告命令によって識別された上記再利用区間における処理が実行されるときに上記実行履歴検索部により上記実行結果が抽出された場合には上記抽出された実行結果を上記実行部に出力する実行結果出力部とを具備するデータ処理装置およびその処理方法である。これにより、再利用区間の実行前において予告命令に基づいて再利用区間の入力値を取得し、その取得された入力値と予告命令により特定された識別情報とに基づいて履歴メモリにおける実行結果を検索させて、予告命令によって識別された再利用区間における処理が実行されるときに、実行結果が抽出された場合には、その抽出された実行結果を実行部に出力させるという作用をもたらす。
 また、この第1の側面において、上記実行履歴検索部は、上記予告命令から上記再利用区間の先頭アドレスが呼び出される呼出し命令の直前の命令までの命令群のうち上記再利用区間の入力値を設定するための入力値設定命令に基づいて入力値を取得するようにしてもよい。これにより、実行履歴検索部により、予告命令の後に続く入力値設定命令によって設定されたデータを再利用区間の入力値として取得させるという作用をもたらす。
 また、この第1の側面において、上記実行履歴検索部は、上記取得された入力値と上記予告命令に含まれる上記識別情報とに基づいて上記実行履歴における上記実行結果を検索するようにしてもよい。これにより、実行履歴検索部により、予告命令に含まれる識別情報と、予告命令に基づいて取得された入力値とを用いて履歴メモリにおける実行結果を検索させるという作用をもたらす。
 また、この第1の側面において、上記履歴メモリは、上記識別情報である上記再利用区間の先頭アドレスごとに上記再利用区間における入力値および実行結果を関連付けて上記実行履歴として保持し、上記実行部は、上記先頭アドレスを参照するための参照情報を含む上記予告命令に基づいて上記先頭アドレスを上記実行履歴検索部に出力し、上記実行履歴検索部は、上記識別情報として上記実行部から出力された上記先頭アドレスと上記再利用区間の入力値とに基づいて上記実行履歴における上記実行結果を検索するようにしてもよい。これにより、予告命令に含まれる参照情報に基づいて再利用区間の先頭アドレスを実行部から出力させ、その実行部から出力させた再利用区間の先頭アドレスと、予告命令に基づいて取得された入力値とを用いて履歴メモリにおける実行結果を検索させるという作用をもたらす。
 また、この第1の側面において、上記予告命令は、上記識別情報である上記再利用区間の先頭アドレスを設定するための予告設定命令であり、上記履歴メモリは、上記再利用区間の先頭アドレスごとに上記再利用区間における入力値および実行結果を関連付けて上記実行履歴として保持し、上記実行部は、上記先頭アドレスの設定先が示された設定情報を含む上記予告設定命令に基づいて上記先頭アドレスを上記設定先に設定し、上記実行履歴検索部は、上記予告設定命令に基づいて上記再利用区間の入力値を取得して上記取得された入力値と上記実行部により設定された上記先頭アドレスとに基づいて上記実行履歴における上記実行結果を検索するようにしてもよい。これにより、実行履歴検索部により、再利用区間の先頭アドレスを設定する予告設定命令によって設定された先頭アドレスと、予告設定命令に基づいて取得された入力値とに基づいて履歴メモリにおける実行履歴を検索させるという作用をもたらす。
 また、この第1の側面において、上記履歴メモリは、上記実行履歴を削除する際の優先度と上記優先度に対応する上記再利用区間における入力値および実行結果とを関連付けて上記実行履歴として上記識別情報ごとに保持し、上記実行履歴検索部は、上記予告命令に含まれる上記優先度に基づいて上記履歴メモリにおける上記実行履歴を削除するようにしてもよい。これにより、実行履歴検索部により、実行履歴ごとに付与された優先度に基づいて、履歴メモリにおける実行履歴を削除させるという作用をもたらす。
 また、この第1の側面において、上記実行部は、上記実行履歴検索部により上記実行履歴における上記実行結果が上記履歴メモリから抽出されない場合には上記予告命令によって識別された上記再利用区間における処理を実行し、上記実行履歴検索部は、上記予告命令に基づいて取得された上記入力値と上記実行部により実行された実行結果と上記識別情報とを上記履歴メモリに保持させるようにしてもよい。これにより、履歴メモリから実行結果が抽出されない場合には、実行履歴検索部により、予告命令に基づいて取得された入力値と、その入力値に基づいて実行された実行結果と、識別情報とを履歴メモリに保持させるという作用をもたらす。
 また、この第1の側面において、上記履歴メモリは、上記再利用区間である関数を識別するための上記識別情報ごとに上記関数における入力値および実行結果を関連付けて上記実行履歴として保持し、上記実行履歴検索部は、上記関数の実行を予告する予告命令に基づいて上記関数の入力値を取得して上記取得された入力値と上記予告命令により特定された上記識別情報とに基づいて上記実行履歴における上記実行結果を検索し、実行結果出力部は、上記予告命令によって識別された上記関数が実行されるときに上記実行履歴検索部により上記実行結果が抽出された場合には上記抽出された実行結果を上記実行部に出力するようにしてもよい。これにより、実行履歴検索部により、関数の実行を予告する予告命令に基づいて関数の入力値を取得して、その取得された入力値と予告命令により特定された識別情報とを用いてこれらのパラメータに関連付けられた実行結果を履歴メモリから抽出し、関数が実行されるときに、実行結果部により、その抽出された実行結果を実行部に出力させるという作用をもたらす。
 また、本発明の第2の側面は、プログラムのうち複数回実行される命令区間の各々の実行結果が互いに一致する度合いを示す再利用度を上記命令区間の使用態様に基づいて上記命令区間ごとに生成する再利用度生成部と、上記複数の命令区間のうち上記再利用度に基づいて選択された再利用区間における入力値を設定する入力値設定命令の直前に上記再利用区間における入力値の設定を予告する予告命令を生成する予告命令生成部とを具備するプログラム変換処理装置およびその処理方法である。これにより、再利用度生成部において命令区間の使用態様に基づいて命令区間ごとの再利用度を生成し、その生成された再利用度に基づいて選択された再利用区間における入力値設定命令の直前に、予告命令生成部により再利用区間の実行を予告する予告命令を生成させるという作用をもたらす。
 また、この第2の側面において、上記予告命令生成部は、上記再利用度に基づいて選択された複数の上記再利用区間を識別するための識別情報を含む上記予告命令を生成するようにしてもよい。これにより、上記予告命令生成部により、上記再利用度に基づいて選択された複数の再利用区間を互いに識別するための識別情報を含む予告命令を生成させるという作用をもたらす。
 また、この第2の側面において、上記予告命令生成部は、上記再利用区間の先頭アドレスを設定するためのアドレス設定命令の後に上記先頭アドレスを参照するための参照情報を含む上記予告命令を生成するようにしてもよい。これにより、アドレス設定命令の後に、予告命令生成部により、そのアドレス設定命令により設定された再利用区間の先頭アドレスを参照するための参照情報を含む予告命令を生成させるという作用をもたらす。
 また、この第2の側面において、上記予告命令生成部は、上記再利用区間の先頭アドレスを設定するために上記先頭アドレスの設定先が示された設定情報を含むアドレス設定命令として上記予告命令を生成するようにしてもよい。これにより、再利用区間の先頭アドレスを設定するための予告命令を生成させるという作用をもたらす。
 また、この第2の側面において、上記予告命令生成部は、上記再利用度生成部により生成された上記再利用度に応じて付与された優先度を含む上記予告命令を生成するようにしてもよい。これにより、予告命令生成部により、履歴メモリの実行履歴を削除するための優先度を含む予告命令を生成させるという作用をもたらす。
 第2の本発明は、上記課題を解決するためになされたものであり、その第1の側面は、プログラムにおける命令区間の使用態様を解析する解析部と、上記命令区間の実行結果が再び利用される度合いを示す再利用度を上記解析の結果に基づいて生成する再利用度生成部と、上記命令区間の呼出し命令を上記再利用度に基づいて再利用命令に変換する命令変換部とを具備するプログラム変換処理装置およびプログラム変換処理方法である。これにより、実行結果が再び利用される度合いを示す再利用度に基づいて命令区間の呼び出し命令を再利用命令に変換させるという作用をもたらす。
 また、この第1の側面において、上記解析部は、上記使用態様として上記命令区間の入力値の個数を解析し、上記再利用度生成部は、上記解析の結果に基づいて上記再利用度を生成するようにしてもよい。これにより、命令区間の入力値の個数に基づいて再利用度を生成させるという作用をもたらす。
 また、この第1の側面において、上記解析部は、上記使用態様として上記命令区間の入力値が採り得る値の組合せを解析し、上記再利用度生成部は、上記解析の結果に基づいて上記再利用度を生成するようにしてもよい。これにより、命令区間の入力値の採り得る値の組み合わせに基づいて再利用度を生成させるという作用をもたらす。
 また、この第1の側面において、上記解析部は、上記使用態様として上記命令区間の呼び出される回数を解析し、上記再利用度生成部は、上記解析の結果に基づいて上記再利用度を生成するようにしてもよい。これにより、命令区間の呼び出される回数に基づいて再利用度を生成させるという作用をもたらす。
 また、この第1の側面において、上記命令区間は関数であり、上記解析部は上記使用態様として上記関数の入力値および呼び出される回数を解析し、上記再利用度生成部は、上記解析の結果に基づいて上記再利用度を生成するようにしてもよい。これにより、関数の入力値および呼び出される回数に基づいて再利用度を生成させるという作用をもたらす。
 また、この第1の側面において、上記命令区間はループであり、上記解析部は上記使用態様として上記ループの入力値および呼び出される回数を解析し、上記再利用度生成部は、上記解析の結果に基づいて上記再利用度を生成するようにしてもよい。これにより、ループの入力値および呼び出される回数に基づいて再利用度を生成させるという作用をもたらす。
 また、この第1の側面において、上記解析部は、上記使用態様として上記命令区間の上記入力値がメモリアクセスを伴うか否かを解析し、上記再利用度生成部は、上記命令区間の上記入力値がメモリアクセスを伴う場合には当該メモリアクセスを伴わない上記入力値を用いる場合と比較して低い上記度合いを示す上記再利用度を生成するようにしてもよい。これにより、メモリアクセスを伴う入力値がある命令区間に対して低い再利用度を生成させるという作用をもたらす。
 また、この第1の側面において、上記命令変換部は、上記再利用度と上記命令区間の上記実行結果を保持するためのデータである実行履歴のデータ量と上記実行履歴が保持される履歴メモリの容量とに基づいて、上記命令区間の上記データ量の総和が上記履歴メモリの容量以内となるように上記再利用度が最も高い上記命令区間から順に上記呼出し命令を上記再利用命令に変換するようにしてもよい。これにより、実行履歴のデータ量の総和が履歴メモリの容量以内となるように再利用度が最も高い命令区間から順に呼出し命令を再利用命令に変換させるという作用をもたらす。
 また、この第1の側面において、上記実行履歴が上記履歴メモリに保持される際の優先度を上記再利用度に基づいて生成する優先度生成部をさらに具備し、上記命令変換部は、上記命令区間の呼出し命令を上記優先度が含まれる上記再利用命令に変換するようにしてもよい。これにより、実行結果を再利用する命令区間の呼出し命令を優先度が含まれる再利用命令に変換させるという作用をもたらす。
 また、本発明の第2の側面は、複数の命令区間のうち実行結果が再び利用される再利用区間を指定する再利用命令により呼び出された上記再利用区間における処理を実行し、上記再利用区間の区間識別情報と上記再利用区間の入力値と上記再利用区間の実行結果とを実行履歴として出力する実行部と、上記実行履歴を保持する履歴メモリとを具備するデータ処理装置およびデータ処理方法である。これにより、再利用命令により呼び出された再利用区間の実行履歴を保持させるという作用をもたらす。
 また、この第2の側面において、上記実行部は、上記複数の命令区間のうち再び利用される度合いに基づいて抽出された命令区間を指定する上記再利用命令により呼び出された上記再利用区間における処理を実行し、上記実行履歴を出力するようにしてもよい。これにより、実行結果が再利用される度合いに基づいて決定された再利用区間の実行履歴を出力させるという作用をもたらす。この場合において、上記再利用区間は関数であり、上記実行部は、上記区間情報と上記再利用区間の入力値と上記再利用区間の実行結果として上記関数の開始アドレスと上記関数の入力値と上記関数の実行結果とを出力するようにしてもよい。これにより、関数の開始アドレスと入力値と実行結果とを出力させるという作用をもたらす。この場合において、上記再利用区間はループであり、上記実行部は、上記区間情報と上記再利用区間の入力値と上記再利用区間の実行結果として上記ループの開始アドレスと上記ループの入力値と上記ループの実行結果とを出力するようにしてもよい。これにより、ループの開始アドレスと入力と実行結果とを出力させるという作用をもたらす。
 また、この第2の側面において、上記区間識別情報と上記再利用区間の入力値とを用いて上記履歴メモリから上記実行結果が検索された場合には上記実行結果を出力する履歴検索部をさらに具備するようにしてもよい。これにより、履歴メモリにおいて実行結果が検索された場合には、実行結果を出力させるという作用をもたらす。
 また、この第2の側面において、上記実行結果が再利用される度合いの順位を示す優先度および上記実行履歴の上記履歴メモリにおけるアドレスを優先度情報として保持する優先度テーブルと、上記優先度テーブルから上記優先度が最も低い上記優先度情報を消去候補情報として検索する最低優先度履歴検索部と、上記実行部が上記履歴メモリに新たな実行履歴を保持しようとしている場合には上記消去候補情報の上記優先度と上記新たな実行履歴の上記優先度とを比較する優先度比較部と、上記消去候補情報の上記優先度が上記新たな実行履歴の上記優先度より低い場合には上記消去候補情報の上記アドレスに基づいて上記実行履歴を上記履歴メモリから消去する消去部とをさらに具備するようにしてもよい。これにより、新たな実行履歴の優先度より消去候補情報の優先度が低い場合には、消去候補情報が指し示す実行履歴を履歴メモリから消去させるという作用をもたらす。この場合において、上記履歴メモリの空き容量を管理する履歴メモリ管理部をさらに具備し、上記優先度比較部は、上記新たな実行履歴のデータ量が上記履歴メモリの空き容量よりも大きい場合には上記消去候補情報の上記優先度と上記新たな実行履歴の上記優先度とを比較するようにしてもよい。これにより、新たな実行履歴のデータ量が履歴メモリの空き容量よりも大きい場合に優先度を比較させるという作用をもたらす。
 第3の本発明は、上記課題を解決するためになされたものであり、その第1の側面は、複数の命令区間が含まれる命令列に基づく処理を実行部と、上記命令区間を呼び出すための呼出し命令が実行される前に上記命令区間の入力値を設定するための入力値設定命令のアドレスである入力値設定命令アドレスを上記命令区間の区間識別情報ごとに保持する入力値設定命令アドレステーブルと、上記区間識別情報ごとに上記命令区間における入力値および実行結果を関連付けて実行履歴として保持する履歴メモリと、上記入力値設定命令アドレスにより特定された上記入力値設定命令から上記呼出し命令までの命令群のうちの上記入力値設定命令に基づいて上記実行部から出力された入力値と上記入力値設定命令アドレスに対応する上記区間識別情報とを用いて上記実行履歴における上記実行結果を検索する実行履歴検索部と、上記入力値設定命令アドレスによって特定される上記呼出し命令が実行されるときに上記実行履歴検索部により上記実行結果が抽出された場合には上記抽出された実行結果を上記実行部に出力する実行結果出力部とを具備するデータ処理装置およびその処理方法である。これにより、命令区間の実行前までに、入力値設定命令アドレステーブルにおける入力値設定命令アドレスにより特定された入力値設定命令に基づく入力値と、その入力値設定命令アドレスに関連付けられた区間識別情報とを用いて履歴メモリにおける実行結果を検索し、入力値設定命令アドレスによって特定される呼出し命令が実行されるときに、実行履歴検索部により実行結果が抽出された場合には、その実行結果を実行部に出力させるという作用をもたらす。
 また、この第1の側面において、上記入力値設定命令アドレステーブルは、上記複数の命令区間のうち複数回実行される命令区間である再利用区間の入力値を設定するための上記入力値設定命令の上記入力値設定命令アドレスを上記再利用区間の上記区間識別情報ごとに保持し、実行履歴検索部は、上記再利用区間における上記命令群のうちの上記入力値設定命令に基づいて上記実行部から出力された上記入力値と上記入力値設定命令アドレスに対応する上記区間識別情報とを用いて上記再利用区間における上記実行結果を検索し、実行結果出力部は、上記入力値設定命令アドレスによって特定される上記再利用区間の上記呼出し命令が実行されるときに上記実行履歴検索部により上記実行履歴における上記再利用区間の上記実行結果が抽出された場合には上記抽出された実行結果を上記実行部に出力するようにしてもよい。これにより、複数回実行される命令区間である再利用区間の呼出し命令の実行前までに、入力値設定命令アドレスにより特定される入力値設定命令により取得される入力値と、その入力値設定命令アドレスに対応する区間識別情報とを用いて履歴メモリにおける実行結果を検索し、入力値設定命令アドレスによって特定される再利用区間の呼出し命令が実行されるときに、実行履歴検索部により実行結果が抽出された場合には、その実行結果を実行部に出力させるという作用をもたらす。
 また、この第1の側面において、上記入力値設定命令に基づいて設定された入力値のうち上記呼出し命令により呼び出された上記命令区間において参照された入力値に対応する上記入力値設定命令アドレスと上記区間識別情報とを上記入力値設定命令アドレステーブルに出力する入力値設定命令アドレス出力部をさらに具備するようにしてもよい。これにより、入力値設定命令アドレス出力部により、呼出し命令前までの入力値設定命令により設定された入力値のうち、その呼出し命令の命令区間において参照された入力値が設定された入力値設定命令の入力値設定命令アドレスと区間識別情報とを出力させるという作用をもたらす。この場合において、上記入力値設定命令アドレス出力部は、上記命令区間において参照された複数の入力値に対応する上記入力値設定命令のうち最先の上記入力値設定命令の上記入力値設定命令アドレスと上記区間識別情報である上記命令区間の先頭アドレスとを出力するようにしてもよい。これにより、入力値設定命令アドレス出力部により、関数の命令区間において参照された複数の入力値を設定する入力値設定命令のうち、最先の入力値設定命令の入力値設定命令アドレスとその命令区間の先頭アドレスとを出力させるという作用をもたらす。
 また、この第1の側面において、上記入力値設定命令アドレステーブルは、上記命令区間における複数の入力値を設定するための入力値設定命令のうち最先の上記入力値設定命令の上記入力値設定命令アドレスを上記区間識別情報ごとに保持するようにしてもよい。これにより、入力値設定命令アドレステーブルにより、命令区間における複数の入力値設定命令のうち、最先に実行された入力値設定命令の入力値設定命令アドレスを、区間識別情報ごとに保持させるという作用をもたらす。
 また、この第1の側面において、上記実行部は、上記実行履歴検索部により上記実行履歴における上記実行結果が上記履歴メモリから抽出されない場合には上記入力値設定命令アドレスによって特定された上記命令区間における処理を実行し、上記実行履歴検索部は、上記入力値設定命令に基づいて上記実行部から出力された入力値と上記実行部により実行された実行結果と上記入力値設定命令アドレスに対応する上記区間識別情報とを上記履歴メモリに保持させるようにしてもよい。これにより、実行履歴検索部において実行結果が履歴メモリから抽出されない場合には、入力値設定命令アドレスによって特定された命令区間における処理を実行部により実行して、実行履歴検索部により、入力値設定命令に基づいて取得された入力値と、実行部により実行された命令区間における処理の実行結果と、入力値設定命令アドレステーブルにおける入力値設定命令アドレスに対応する区間識別情報とを履歴メモリに保持させるという作用をもたらす。
 また、この第1の側面において、上記入力値設定命令アドレステーブルは、上記命令区間である関数の上記入力値設定命令の上記入力値設定命令アドレスを上記区間識別情報である上記関数の先頭アドレスごとに保持し、上記履歴メモリは、上記関数の先頭アドレスごとに上記関数における入力値および実行結果を関連付けて上記実行履歴として保持し、上記実行履歴検索部は、上記命令群のうちの上記入力値設定命令に基づいて上記実行部から出力された上記関数の上記入力値と上記入力値設定命令アドレスに対応する上記関数の先頭アドレスとを用いて上記実行結果を検索し、上記実行結果出力部は、上記入力値設定命令アドレスによって特定される上記関数の上記呼出し命令が実行されるときに上記実行履歴検索部により上記関数の上記実行結果が抽出された場合には上記抽出された実行結果を上記実行部に出力するようにしてもよい。これにより、関数の呼出し命令の実行前までに、入力値設定命令アドレスにより特定された入力値設定命令に基づいて設定された入力値と、その入力値設定命令アドレスに関連付けられた区間識別情報とを用いて履歴メモリにおける関数の実行結果を検索し、入力値設定命令アドレスによって特定される呼出し命令が実行されるときに、実行履歴検索部により実行結果が抽出された場合には、その関数の実行結果を実行部に出力させるという作用をもたらす。
 また、本発明の第2の側面は、プログラムのうち複数回実行される命令区間における処理の実行ごとの入力値が互いに一致する度合いを示す再利用度を上記命令区間の使用態様に基づいて上記命令区間ごとに生成する再利用度生成部と、上記複数の命令区間のうち上記再利用度に基づいて抽出された再利用区間における入力値を設定するための入力値設定命令の入力値設定命令アドレスと上記再利用区間を識別するための区間識別情報とが関連付けられた再利用区間情報を生成する再利用区間情報生成部とを具備するプログラム解析処理装置およびその処理方法である。これにより、複数回実行される命令区間の各々の実行結果が互いに一致する度合いを示す再利用度に基づいて複数の命令区間のうち再利用区間が抽出されて、再利用区間情報生成部により、その再利用区間における入力値設定命令の入力値設定命令アドレスと、再利用区間の区間識別情報とが関連付けられた再利用区間情報を生成させるという作用をもたらす。
 第4の本発明は、上記課題を解決するためになされたものであり、その第1の側面は、命令区間を実行して実行結果を出力する実行部と、上記命令区間のうち実行結果が再び利用される再利用区間の区間識別情報と入力値と実行結果とを実行履歴として保持し、上記保持した実行結果が再び利用される場合には上記区間識別情報および上記入力値に基づいて上記実行履歴が検索される履歴メモリと、上記再利用区間のうち実行が反復される反復再利用区間の各回の上記実行結果を上記履歴メモリから退避させるための退避履歴を保持する退避履歴保持部と、上記反復再利用区間の上記実行履歴に基づいて上記退避履歴を上記退避履歴保持部に供給し、上記退避履歴の供給の際に上記退避履歴の基となった上記実行履歴を上記履歴メモリから消去して上記退避履歴を指し示す情報を含む代表履歴を上記履歴メモリに保持させる履歴制御部とを備えるデータ処理装置およびその処理方法ならびに当該方法をコンピュータに実行させるプログラムである。これにより、再利用区間の実行が反復される反復再利用区間の実行結果を履歴メモリから退避履歴保持部に退避させるという作用をもたらす。
 また、この第1の側面において、上記履歴制御部は、上記履歴メモリに保持させる新たな上記実行履歴のデータ量が上記履歴メモリの空き容量よりも大きい場合には上記退避履歴を上記退避履歴保持部に供給するようにしてもよい。これにより、実行履歴のデータ量が履歴メモリの空き容量よりも大きい場合には、反復再利用区間の実行結果を履歴メモリから退避履歴保持部に退避させるという作用をもたらす。
 また、この第1の側面において、上記退避履歴および上記代表履歴に基づいて上記実行履歴を上記履歴メモリに復元する履歴復元部と、上記区間識別情報および上記入力値に基づいて上記復元された上記実行履歴を上記履歴メモリから検索した場合には上記復元された上記実行履歴に基づいて上記実行結果を出力する履歴検索部とをさらに備えるようにしてもよい。これにより、退避履歴および代表履歴に基づいて復元した実行履歴を用いて実行結果を再利用させるという作用をもたらす。この場合において、上記履歴検索部は、上記区間識別情報および上記入力値に基づいて検索された上記実行履歴が上記代表履歴であった場合には上記復元部に上記実行履歴の復元を開始させるようにしてもよい。これにより、履歴検索部において代表履歴が検索された場合には、復元部に反復再利用区間の実行履歴を復元させるという作用をもたらす。この場合において、上記履歴制御部は、上記退避履歴の個数を示す退避カウントをさらに含む上記代表履歴を生成し、上記履歴復元部は、上記代表履歴における上記退避履歴を指し示す情報および上記退避カウントに基づいて上記退避履歴を上記退避履歴保持部から抽出して上記実行履歴を復元させるようにしてもよい。これにより、代表履歴における退避履歴を指し示す情報および退避カウントに基づいて退避履歴を退避履歴保持部から抽出させるという作用をもたらす。
 また、この第1の側面において、上記実行部は、上記再利用区間の上記実行結果を供給する場合には上記反復再利用区間の上記実行履歴と上記反復再利用区間以外の上記実行履歴と上記代表履歴とを識別するための識別子をさらに出力し、上記履歴メモリは、上記識別子を上記実行履歴としてさらに保持し、上記履歴制御部は、上記識別子を用いて識別した上記実行履歴に基づいて上記退避履歴を供給し、上記識別子をさらに含む上記代表履歴を生成させるようにしてもよい。これにより、識別子を用いて実行履歴を識別させるという作用をもたらす。
 また、この第1の側面において、上記反復再利用区間はサブルーチンであり、上記実行部は、上記サブルーチンの開始アドレスを上記区間識別情報として出力するようにしてもよい。これにより、サブルーチンの開始アドレスを区間識別情報として出力させるという作用をもたらす。
 また、この第1の側面において、上記反復再利用区間はループであり、上記実行部は、上記ループの開始アドレスを上記区間識別情報として出力するようにしてもよい。これにより、ループの開始アドレスを上記区間識別情報として出力させるという作用をもたらす。この場合において、上記実行部は、上記反復再利用区間の上記実行結果を出力する場合には何回目の実行による上記実行結果であるかを示すカウンタ値をさらに出力し、上記履歴メモリは、上記カウンタ値を上記実行履歴としてさらに保持し、上記履歴制御部は、上記カウンタ値を含む上記退避履歴を出力するようにしてもよい。これにより、カウンタ値を含む実行履歴および退避履歴を保持させるという作用をもたらす。
 また、本発明の第2の側面は、実行結果が再び利用される再利用区間の区間識別情報と入力値と実行結果とを実行履歴として保持し、上記保持した実行結果が再び利用される場合には上記区間識別情報および上記入力値に基づいて上記実行履歴が検索される履歴メモリと、上記再利用区間のうち実行が反復される反復再利用区間の各回の上記実行結果を退避履歴として上記履歴メモリから外部の記憶部に退避させ、上記退避の際に上記退避履歴の基となった上記実行履歴を上記履歴メモリから消去して上記退避履歴を指し示す情報を含む代表履歴を上記履歴メモリに保持させる履歴制御部とを備える履歴保存装置である。これにより、実行が反復される反復再利用区間の実行結果を履歴メモリから外部の記憶部に退避させるという作用をもたらす。
 第5の本発明は、上記課題を解決するためになされたものであり、その第1の側面は、プログラムにおける複数の命令区間の使用態様を解析して上記命令区間のうち実行結果が再び利用される再利用区間を判別する解析部と、上記再利用区間の開始アドレスのビット幅より狭いビット幅の値により上記再利用区間を識別する区間識別値を生成するための区間識別値生成関数の候補である候補関数を用いることによって、上記区間識別値の候補である候補値を上記候補関数に関連付けて上記開始アドレスから生成する候補値生成部と、上記候補値生成部により生成された上記候補値を上記関連付けられた候補関数ごとに候補値リストとして保持する候補値テーブルと、上記候補値が全て互いに異なる上記候補値リストを抽出し、この抽出された候補値リストのうち上記候補値のビット幅に基づいて選択された候補値リストの上記関連付けられた候補関数を上記区間識別値生成関数として出力する区間識別値生成関数出力部と、上記区間識別値生成関数が埋め込まれた機械語プログラムを上記解析されたプログラムおよび上記区間識別値生成関数に基づいて生成する機械語プログラム生成部とを具備するコンパイル処理装置およびその処理方法ならびに当該方法をコンピュータに実行させるプログラムである。これにより、候補関数から選択した区間識別値生成関数をプログラムに埋め込ませるという作用をもたらす。
 また、この第1の側面において、上記候補関数は、ハッシュ関数であり、上記区間識別値生成関数出力部は、上記抽出された候補値リストのうち上記候補値のビット幅に基づいて選択された候補値リストの上記関連付けられたハッシュ関数を上記区間識別値生成関数として出力するようにしてもよい。これにより、ハッシュ関数をプログラムに埋め込ませるという作用をもたらす。この場合において、上記ハッシュ関数は、上記開始アドレスの最下位ビットから所定の数のビットにおける値を上記候補値とするハッシュ関数であり、上記区間識別値生成関数出力部は、上記抽出された候補値リストのうち上記候補値のビット幅に基づいて選択された候補値リストの上記関連付けられたハッシュ関数を上記区間識別値生成関数として出力するようにしてもよい。これにより、最下位ビットから所定の数のビットにおける値をハッシュ値として算出するハッシュ関数をプログラムに埋め込ませるという作用をもたらす。
 また、この第1の側面において、上記区間識別値生成関数出力部は、上記抽出された候補値リストのうちビット幅が最も狭い上記候補値の候補値リストの上記関連付けられた候補関数を上記区間識別値生成関数として出力するようにしてもよい。これにより、全て互いに異なる候補値を生成する候補関数のうちビット幅が最も狭い候補値を生成する候補関数を区間識別値生成関数として出力させるという作用をもたらす。
 また、この第1の側面において、上記区間識別値生成関数出力部は、上記区間識別値生成関数として上記区間識別値生成関数を識別するための識別子を出力し、上記機械語プログラム生成部は、上記識別子が埋め込まれた機械語プログラムを生成するようにしてもよい。これにより、区間識別値生成関数を識別するための識別子が埋め込まれたプログラムを生成させるという作用をもたらす。
 また、本発明の第2の側面は、複数の命令区間を実行して実行結果を出力する実行部と、上記命令区間のうち実行結果が再び利用される再利用区間の開始アドレスのビット幅より狭いビット幅の値により上記再利用区間を識別する区間識別値とその上記再利用区間の入力値とその上記再利用区間の実行結果とを実行履歴として保持する履歴メモリと、上記区間識別値および上記入力値に基づいて上記履歴メモリから上記実行履歴を検索し、上記実行履歴が検索された場合には上記実行結果を出力する履歴検索部とを具備するデータ処理装置である。これにより、区間識別値と入力値と実行結果とを実行履歴として履歴メモリに保持させるという作用をもたらす。
 また、この第2の側面において、上記実行部が上記再利用区間を実行したときに上記開始アドレスを出力した場合には、上記区間識別値を生成するための区間識別値生成関数を用いて上記開始アドレスから上記区間識別値を生成する区間識別値生成部をさらに具備し、上記実行部は、上記区間識別値生成部に上記区間識別値生成関数を供給し、上記履歴メモリは、上記区間識別値生成部により生成された上記区間識別値と上記入力値と上記実行結果とを上記実行履歴として保持し、上記履歴探索部は、上記区間識別値と上記入力値とに基づいて上記履歴メモリから上記実行履歴を検索し、上記実行履歴が検索された場合には上記実行結果を出力するようにしてもよい。これにより、区間識別値生成部により開始アドレスから生成された区間識別値と、実行部から供給された入力値および実行結果とを実行履歴として履歴メモリに保持させるという作用をもたらす。この場合において、上記実行部は、上記区間識別値生成関数を上記区間識別値生成部に供給し、上記区間識別値生成部は、上記実行部が上記再利用区間を実行したときに上記開始アドレスを出力した場合には、上記実行部から供給された上記区間識別値生成関数を用いて上記開始アドレスから上記区間識別値を生成するようにしてもよい。これにより、実行部から供給された区間識別値生成関数を用いて開始アドレスから区間識別値を生成させるという作用をもたらす。この場合において、上記実行部は、上記区間識別値生成関数を識別する識別子を上記区間識別値生成部に供給し、上記区間識別値生成部は、上記区間識別値生成関数の候補である候補関数から上記区間識別値生成関数を上記識別子に基づいて選択し、上記実行部が上記再利用区間を実行したときに上記開始アドレスを出力した場合には上記選択した区間識別値生成関数を用いて上記開始アドレスから上記区間識別値を生成するようにしてもよい。これにより、実行部から供給された識別値に基づいて候補関数から区間識別値生成関数を選択し、その選択した区間識別値を用いて開始アドレスから区間識別値を生成させるという作用をもたらす。
 また、この第2の側面において、上記実行部は、上記区間識別値が含まれる命令により上記再利用区間を実行した場合には上記区間識別値を上記履歴メモリに供給し、上記履歴メモリは、上記区間識別値と上記入力値と上記実行結果とを上記実行履歴として保持し、上記履歴探索部は、上記区間識別値と上記入力値とに基づいて上記履歴メモリから上記実行履歴を検索し、上記実行履歴が検索された場合には上記実行結果を出力するようにしてもよい。これにより、実行部から供給された区間識別値と入力値と実行結果とを実行履歴として履歴メモリに保持させるという作用をもたらす。
 また、本発明の第3の側面は、プログラムにおける複数の命令区間の使用態様を解析して上記命令区間のうち実行結果が再び利用される再利用区間を判別する解析部と、上記再利用区間の開始アドレスのビット幅より狭いビット幅の値により上記再利用区間を識別する区間識別値を生成するための区間識別値生成関数の候補である候補関数を用いることによって、上記区間識別値の候補である候補値を上記候補関数に関連付けて生成する候補値生成部と、上記候補値生成部により生成された上記候補値を上記関連付けられた候補関数ごとに候補値リストとして保持する候補値テーブルと、上記候補値が全て互いに異なる上記候補値リストを抽出し、この抽出された候補値リストのうち上記候補値のビット幅に基づいて選択された候補値リストの上記候補値を上記区間識別値として出力する区間識別値出力部と、上記再利用区間を呼び出す命令を上記区間識別値が含まれる区間識別値付命令に変換する命令変換部と、上記再利用区間が上記区間識別値付命令により呼び出される機械語プログラムを上記区間識別値付命令が含まれるソースプログラムに基づいて生成する機械語プログラム生成部とを具備するコンパイル処理装置である。これにより、区間識別値付命令が含まれるプログラムを生成させるという作用をもたらす。
 また、この第3の側面において、上記候補値生成部は、上記開始アドレスの所定の順序に従って付与された番号を入力の値とする上記候補関数を用いることによって上記候補値を生成するようにしてもよい。これにより、開始アドレスの所定の順序に従って付与された番号から候補値を生成させるという作用をもたらす。
 また、この第3の側面において、上記候補値生成部は、上記開始アドレスを入力の値とする上記候補関数を用いることによって上記候補値を生成するようにしてもよい。これにより、開始アドレスから候補値を生成させるという作用をもたらす。
 また、本発明の第4の側面は、複数の命令区間を実行して実行結果を出力する実行部と、上記再利用区間の開始アドレスのビット幅より狭いビット幅の値により上記再利用区間を識別する区間識別値を生成するための区間識別値生成関数の候補である候補関数を用いることによって、上記区間識別値の候補である候補値を上記候補関数に関連付けて上記開始アドレスから生成する候補値生成部と、上記候補値生成部により生成された上記候補値を上記関連付けられた候補関数ごとに候補値リストとして保持する候補値テーブルと、上記候補値が全て互いに異なる上記候補値リストを抽出し、この抽出された候補値リストのうち上記候補値のビット幅に基づいて選択された候補値リストの上記関連付けられた候補関数を区間識別値生成関数として出力する区間識別値生成関数出力部と、上記実行部が上記再利用区間を実行したときに上記開始アドレスが出力された場合には上記区間識別値生成関数を用いて上記開始アドレスから上記区間識別値を生成する区間識別値生成部と、上記再利用区間の上記区間識別値と入力値と実行結果とを実行履歴として保持する履歴メモリと、上記区間識別値および上記入力値に基づいて上記履歴メモリから上記実行履歴を検索し、上記実行履歴が検索された場合には上記実行結果を出力する履歴検索部とを具備するデータ処理装置である。これにより、区間識別値生成関数出力部が出力した区間識別値生成関数を用いて開始アドレスから区間識別値を生成させて、この生成された区間識別値と実行部から供給された入力値および実行結果とを実行履歴として履歴メモリに保持させるという作用をもたらす。
 第1の本発明によれば、実行結果の再利用による再利用区間における処理時間をさらに短縮することができるという優れた効果を奏し得る。
 第2の本発明によれば、値再利用の効率を改善することができるという優れた効果を奏し得る。
 第3の本発明によれば、実行結果の再利用による再利用区間の処理時間を短縮させることができるという優れた効果を奏し得る。
 第4の本発明によれば、値再利用(メモ化)を行う際、実行結果を保存しておくメモリから実行結果を退避させることにより、値再利用の効率を改善することができるという優れた効果を奏し得る。
 第5の本発明はこのような状況に鑑みてなされたものであり、値再利用(メモ化)を行う際、実行結果を保存しておくメモリに保持させるデータのビット長を短縮させることにより、値再利用の効率を改善することを目的とする。
本発明の第1の実施の形態におけるデータ処理装置の一構成例を示すブロック図である。 本発明の第1の実施の形態におけるデータ処理部300および実行結果再利用処理部400の一構成例を示すブロック図である。 本発明の第1の実施の形態における履歴メモリ430のデータ構造の一例を示す概念図である。 本発明の第1の実施の形態におけるデータ処理装置100において識別情報を含む予告命令を受け付けた場合におけるデータ処理装置100の動作概要を示す概念図である。 本発明の第1の実施の形態におけるデータ処理装置100により実行されるプログラムの一部を例示する図である。 予告命令の実行により関数における処理時間が短縮される例を示す概念図である。 本発明の第1の実施の形態におけるデータ処理装置100の実行結果再利用方法の処理手順の一例を示すフローチャートである。 本発明の第2の実施の形態におけるデータ処理装置100において参照情報を含む予告命令を受け付けた場合におけるデータ処理装置100の動作概要を示す概念図である。 本発明の第2の実施の形態におけるデータ処理装置100により実行されるプログラムの一部を例示する図である。 本発明の第3の実施の形態におけるデータ処理装置100において予告設定命令を受け付けた場合におけるデータ処理装置100の動作概要を示す概念図である。 本発明の第3の実施の形態におけるデータ処理装置100により実行されるプログラムの一部を例示する図である。 本発明の第4の実施の形態におけるプログラム変換処理装置の一機能構成例を示すブロック図である。 本発明の第4の実施の形態におけるプログラム変換処理装置500により生成される予告命令のデータフォーマットを例示する図である。 本発明の第4の実施の形態におけるプログラム変換処理装置500の予告命令生成処理方法の処理手順の一例を示すフローチャートである。 本発明の第4の実施の形態における識別情報を含む予告命令についての予告命令処理(ステップS940)の処理手順の一例を示すフローチャートである。 本発明の第4の実施の形態における参照情報を含む予告命令についての予告命令処理(ステップS950)の処理手順の一例を示すフローチャートである。 本発明の第4の実施の形態における予告設定命令についての予告命令処理(ステップS960)の処理手順の一例を示すフローチャートである。 本発明の第1の実施の形態におけるコンパイル処理装置1500の構成例を示すブロック図である。 本発明の第1の実施の形態において再利用候補区間抽出部1611が再利用候補区間を抽出する際に、再利用候補区間から除外される関数の一例を示す模式図である。 本発明の第1の実施の形態における再利用候補区間解析部1612により引数の個数を使用態様として解析する場合における再利用度生成部1621による再利用度の生成例を示す模式図である。 本発明の第1の実施の形態における再利用候補区間解析部1612により引数の型を使用態様として解析する場合における再利用度生成部1621による再利用度の生成例を示す模式図である。 本発明の第1の実施の形態における再利用候補区間解析部1612により定数と変数とで異なる引数を使用態様として解析する場合における再利用度生成部1621による再利用度の生成例を示す模式図である。 本発明の第1の実施の形態における再利用候補区間解析部1612により引数の採る値の組合せを使用態様として解析する場合における再利用度生成部1621による再利用度の生成例を示す模式図である。 本発明の第1の実施の形態における再利用候補区間解析部1612により関数の呼び出される回数を使用態様として解析する場合における再利用度生成部1621による再利用度の生成例を示す模式図である。 本発明の第1の実施の形態における再利用候補区間解析部1612によりメモリアクセスを伴う引数の有無を使用態様として解析する場合における再利用度生成部1621による再利用度の生成例を示す模式図である。 本発明の第1の実施の形態におけるプログラム変換処理部1600の第1の動作例を示すプログラムの模式図である。 本発明の第1の実施の形態における関数の呼出し命令および関数の再利用命令の一例を示す概念図である。 本発明の第1の実施の形態におけるコンパイル処理装置1500によるコンパイル処理の処理手順を示すフローチャートである。 本発明の第2の実施の形態におけるデータ処理装置1100の構成例を示すブロック図である。 本発明の第2の実施の形態におけるプロセッサコア1300および履歴管理部1400の構成例を示すブロック図である。 本発明の第2の実施の形態における履歴メモリ1430のデータ構造の一例を示す概念図である。 本発明の第2の実施の形態におけるプロセッサコア1300により処理されるプログラムおよび履歴管理部1400により保存される実行履歴の一例を示す概念図である。こ 本発明の第2の実施の形態におけるプロセッサコア1300および履歴管理部1400による関数の実行処理の処理手順を示すフローチャートである。 本発明の第3の実施の形態におけるコンパイル処理装置1500の構成例を示すブロック図である。 本発明の第3の実施の形態におけるプログラム変換処理部1600による複数の引数が入力値である関数を含むプログラムの変換例を示す模式図である。 本発明の第3の実施の形態における引数の型は同じだが使用態様が異なる関数を含むプログラムのプログラム変換処理部1600による変換例を示す模式図である。 本発明の第3の実施の形態における関数の呼出し命令および関数の再利用命令の一例を示す概念図である。 本発明の第1の実施の形態におけるコンパイル処理装置1500によるコンパイル処理の処理手順を示すフローチャートである。 本発明の第4の実施の形態におけるプロセッサコア1300および履歴管理部1400の構成例を示すブロック図である。 本発明の第4の実施の形態における履歴メモリ1430のデータ構造の一例を示す概念図である。 本発明の第4の実施の形態における優先度テーブル1450のデータ構造の一例を示す概念図である。 本発明の第4の実施の形態におけるプロセッサコア1300により処理されるプログラムおよび履歴管理部1400により保存される実行履歴の一例を示す概念図である。 本発明の第4の実施の形態におけるプロセッサコア1300および履歴管理部1400による関数の実行処理の処理手順を示すフローチャートである。 本発明の第4の実施の形態における履歴管理部1400による実行履歴の登録処理(ステップS1950)の処理手順例を示すフローチャートである。 本発明の第1の実施の形態におけるデータ処理装置の一構成例を示すブロック図である。 本発明の第1の実施の形態におけるデータ処理部2300および実行結果再利用処理部2400の一構成例を示すブロック図である。 本発明の第1の実施の形態における履歴メモリ2430のデータ構造の一例を示す概念図である。 本発明の第1の実施の形態におけるデータ処理装置2100による1回目の関数の実行における区間識別情報および実行履歴の登録手法を示す概念図である。 本発明の第1の実施の形態におけるデータ処理装置2100による実行結果再利用処理に関する手法の一例を示す概念図である。 実行結果再利用処理により関数の処理時間が短縮される例を示す概念図である。 本発明の第1の実施の形態におけるデータ処理装置2100による2回目以降の関数の実行における実行履歴の登録手法を示す概念図である。 本発明の第1の実施の形態におけるデータ処理装置2100による実行結果再利用方法の処理手順の一例を示すフローチャートである。 本発明の第2の実施の形態におけるプログラム解析処理装置の機能構成例を示すブロック図である。 本発明の第2の実施の形態におけるプログラム解析処理装置2600のプログラム解析処理方法の処理手順の一例を示すフローチャートである。 本発明の第3の実施の形態におけるデータ処理装置2100の一構成例を示すブロック図である。 本発明の第3の実施の形態におけるデータ処理装置2100による入力値設定命令アドレステーブル2820に対する入力値設定命令アドレスおよび区間識別情報の登録例を示す概念図である。 本発明の第3の実施の形態におけるデータ処理装置2100による実行結果再利用方法の処理手順の一例を示すフローチャートである。 本発明の第3の実施形態におけるデータ処理装置2100による実行履歴検索処理(ステップS2960)の処理手順例を示すフローチャートである。 本発明の第4の実施の形態におけるデータ処理装置2100の外部に履歴データ記憶部を設けた場合における集積回路の一構成例を示すブロック図である。 本発明の第4の実施の形態におけるデータ処理装置2100による履歴データ転送方法の処理手順を示すフローチャートである。 本発明の実施の形態におけるデータ処理装置3100の構成例を示すブロック図である。 本発明の実施の形態におけるプロセッサコア3300と履歴管理部3400と履歴変換部3500との構成例を示すブロック図である。 本発明の実施の形態における履歴制御部3510の構成例を示すブロック図である。 本発明の実施の形態における退避履歴生成部3600の構成例を示すブロック図である。 本発明の実施の形態における履歴復元部3520の構成例を示すブロック図である。 本発明の実施の形態における関数履歴、ループ個別履歴、ループ代表履歴および退避履歴のデータ構造例を示す模式図である。 本発明の実施の形態における入力値リンクおよび実行結果リンクのデータ構造例を示す概念図である。 本発明の実施の形態における履歴制御部3510によるループ個別履歴の退避の際の、履歴メモリ3430および主記憶部3130における実行履歴、ループ代表履歴および退避履歴の具体例を示す図である。 本発明の実施の形態における履歴復元部3520によるループ個別履歴の復元の際の、履歴メモリ3430および主記憶部3130における実行履歴、ループ代表履歴および退避履歴の具体例を示す図である。 本発明の実施の形態における新たな実行履歴が登録されるときの履歴メモリ3430における履歴情報と主記憶部3130における退避履歴との具体例を示す図である。 本発明の実施の形態における履歴制御部3510によるループ個別履歴の退避処理の処理手順例を示すフローチャートである。 本発明の実施の形態における履歴制御部3510によるループ個別履歴の連履歴探索退避処理(ステップS3930)の処理手順例を示すフローチャートである。 本発明の実施の形態における履歴復元部3520によるループ個別履歴の復元処理の処理手順例を示すフローチャートである。 本発明の実施の形態における実行結果登録処理(ステップS3970)の処理手順例を示すフローチャートである。 本発明の実施の形態における実行結果出力処理(ステップS3980)の処理手順例を示すフローチャートである。 本発明の第1の実施の形態におけるコンパイル処理装置4100の構成例を示すブロック図である。 本発明の第1の実施の形態における再利用命令判別部4120が解析するプログラムの一例を示す概念図である。 本発明の第1の実施の形態におけるハッシュ関数決定部4200の構成例を示すブロック図である。 本発明の第1の実施の形態における候補ハッシュ値生成部4230が生成するハッシュ値の一例を示す概念図である。 本発明の第1の実施の形態におけるハッシュ値テーブル4240に保持されるハッシュ値の一例を示す概念図である。 本発明の第1の実施の形態におけるハッシュ関数指定命令の一例を示す概念図である。 本発明の第1の実施の形態におけるコンパイル処理装置4100によるコンパイル処理の処理手順を示すフローチャートである。 本発明の第1の実施の形態におけるハッシュ関数決定部4200によるハッシュ関数決定処理(ステップS4920)の処理手順例の前半を示すフローチャートである。 本発明の第1の実施の形態におけるハッシュ関数決定部4200によるハッシュ関数決定処理(ステップS4920)の処理手順例の後半を示すフローチャートである。 本発明の第2の実施の形態におけるデータ処理装置4300の構成例を示すブロック図である。 本発明の第2の実施の形態におけるプロセッサコア4400とハッシュ変換部4500と履歴管理部4600との構成例を示すブロック図である。 本発明の第2の実施の形態における履歴メモリ4630のデータ構造の一例を示す概念図である。 本発明の第2の実施の形態におけるデータ処理装置4300による命令処理方法の処理手順例を示すフローチャートである。 本発明の第3の実施の形態におけるコンパイル処理装置4100の構成例を示すブロック図である。 本発明の第3の実施の形態におけるハッシュ値決定部4700の構成例を示すブロック図である。 本発明の第3の実施の形態におけるハッシュ値テーブル4740に保持されるハッシュ値の一例を示す概念図である。 本発明の第3の実施の形態における関数の呼出し命令および関数の再利用命令の一例を示す概念図である。 本発明の第3の実施の形態におけるコンパイル処理装置4100によるコンパイル処理の処理手順を示すフローチャートである。 本発明の第3の実施の形態におけるハッシュ値決定部4700によるハッシュ値決定処理(ステップS4960)の処理手順例の前半を示すフローチャートである。 本発明の第3の実施の形態におけるハッシュ値決定部4700によるハッシュ値決定処理(ステップS4960)の処理手順例の後半を示すフローチャートである。 本発明の第4の実施の形態におけるデータ処理装置4300の構成例を示すブロック図である。 本発明の第4の実施の形態におけるプロセッサコア4400および履歴管理部4600の構成例を示すブロック図である。 本発明の第4の実施の形態におけるデータ処理装置4300による命令処理方法の処理手順例を示すフローチャートである。 本発明の第5の実施の形態におけるデータ処理装置4300の構成例を示すブロック図である。 本発明の第5の実施の形態におけるプロセッサコア4400とハッシュ変換部4500と履歴管理部4600との構成例を示すブロック図である。 本発明の第5の実施の形態におけるデータ処理装置4300による命令処理方法の処理手順例を示すフローチャートである。 本発明の第5の実施の形態におけるプログラム実行処理(ステップS4990)の処理手順例を示すフローチャートである。
 以下、図面を参照して、第1の本発明の実施の形態乃至第5の本発明の実施の形態について説明する。
 最初に、第1の本発明であるデータ処理装置、データ処理方法、プログラム変換処理装置およびプログラム変換処理方法について図1乃至図17を参照して説明する。
 以下、第1の本発明を実施するための形態(以下、実施の形態と称する)について説明する。
説明は以下の順序により行う。
 1.第1の実施の形態(データ処理制御:識別情報を含む予告命令による実行結果の再利用処理の例)
 2.第2の実施の形態(データ処理制御:参照情報を含む予告命令による実行結果の再利用処理の例)
 3.第3の実施の形態(データ処理制御:予告設定命令による実行結果の再利用処理の例)
 4.第4の実施の形態(プログラム変換制御:予告命令を含むプログラムの生成例)
 <1.第1の実施の形態>
 [データ処理装置の構成例]
 図1は、本発明の第1の実施の形態におけるデータ処理装置の一構成例を示すブロック図である。ここでは、集積回路を構成するデータ処理装置100と、バス120と、主記憶部130とが示されている。この集積回路は、主記憶部130からバス120を介して読み出される命令列に従って、データ処理装置100により処理を実行するものである。
 データ処理装置100は、一次キャッシュ200と、データ処理部300と、実行結果再利用処理部400とを備える。なお、データ処理装置100は、特許請求の範囲に記載のデータ処理装置の一例である。一次キャッシュ200は、バス120を介して主記憶部130から命令およびデータを読み出す際、または、書き込む際の処理によって生じる遅延時間を軽減するためのメモリである。この一次キャッシュ200は、例えば、DRAM(Dynamic Random Access Memory)により実現される。
 この一次キャッシュ200は、命令キャッシュ210およびデータキャッシュ220を備える。命令キャッシュ210は、主記憶部130から読み出された過去の命令を一時的に保持するものである。この命令キャッシュ210は、データ処理部300からの要求に従って、その保持された命令を、命令線219を介してデータ処理部300に出力する。
 また、この命令キャッシュ210は、データ処理部300から要求された命令を保持している場合には、その保持している複数の命令のうち、その要求された命令をデータ処理部300に出力する。一方、データ処理部300から要求された命令を保持していない場合には、命令キャッシュ210は、データ処理部300により主記憶部130から読み出された命令を保持するとともにデータ処理部300に出力する。
 データキャッシュ220は、主記憶部130から読み出された過去のデータを一時的に保持するものである。このデータキャッシュ220は、データ処理部300からの要求に従って、その保持されたデータを、データ線229を介してデータ処理部300に出力する。また、このデータキャッシュ220は、データ処理部300から要求されたデータを保持している場合には、保持している複数のデータのうち、その要求されたデータをデータ処理部300に出力する。
 一方、データ処理部300から要求されたデータを保持していない場合には、データキャッシュ220は、データ処理部300により主記憶部130から読み出されたデータを保持する。また、データキャッシュ220は、主記憶部130に書き戻すためのデータがデータ処理部300から供給された場合には、そのデータを保持する。
 データ処理部300は、主記憶部130から読み出された命令に基づく処理を実行するものである。このデータ処理部300は、例えば、命令キャッシュ210を介して主記憶部130から命令を読み出して、その読み出された命令に従って、主記憶部130に記憶されたデータを、データキャッシュ220を介して読み出す。そして、データ処理部300は、例えば、その読み出されたデータを用いて演算命令に基づく演算処理を実行する。
 また、データ処理部300は、例えば、関数の処理を実行する場合には、データキャッシュ220から読み出された関数における引数の入力値を用いて関数の演算処理を実行して、その演算処理の結果である実行結果をデータキャッシュ220に出力する。このとき、データ処理部300は、関数における入力値および実行結果を実行結果再利用処理部400に出力する。また、このデータ処理部300は、例えば、プロセッサコアにより実現される。
 実行結果再利用処理部400は、過去に実行された命令区間の入力値と、再び実行される命令区間の入力値とが一致した場合には、その過去に実行された命令区間の実行結果を再利用するものである。ここでは、複数回実行される命令区間のうち、過去に実行された命令区間の実行結果を再利用することができる命令区間を再利用区間という。すなわち、この再利用区間とは、複数回実行される命令区間のうち、命令区間における入力値が同じであれば実行結果も同じとなる命令区間のことである。
 この実行結果再利用処理部400は、複数回実行される再利用区間における入力値および実行結果を実行履歴として保持する。また、この実行結果再利用処理部400は、再び実行される再利用区間の入力値と、その保持された実行履歴の入力値とが同一である場合には、その保持された実行履歴における実行結果をデータ処理部300に出力する。これとともに、実行結果再利用処理部400は、その再利用区間における処理をスキップするための指示をデータ処理部300に通知する。
 実行結果再利用処理部400は、例えば、再利用区間である関数の引数の入力値と、その保持された実行履歴における入力値とが同一である場合には、その保持された実行履歴における実行結果をデータ処理部300に出力する。これとともに、実行結果再利用処理部400は、その関数における処理をスキップするための指示をデータ処理部300に通知する。
 バス120は、データ処理装置100と主記憶部130との間の通信を行うものである。このバス120は、主記憶部130に記憶されているプログラムをデータ処理装置100に転送する。また、このバス120は、データ処理装置100から出力されたデータを主記憶部130に転送する。
 主記憶部130は、データ処理装置100に処理を実行させるためのプログラムを記憶するものである。ここでは、このプログラムは、ABI(Application Binary Interface)の規定に基づいて生成されたプログラムを想定する。このプログラムは、例えば、SPARC(Scalable Processor Architecture) ABIに基づいて生成されるものである。これにより、データ処理装置100において、関数における入力値および実行結果が格納される場所を特定することができるため、実行結果の再利用を実現することができる。
また、この主記憶部130に記憶されているプログラムには、再利用区間である関数が実行される前に、関数における処理の実行を予告する予告命令が挿入されている。
 [データ処理部300および実行結果再利用処理部400の構成例]
 図2は、本発明の第1の実施の形態におけるデータ処理部300および実行結果再利用処理部400の一構成例を示すブロック図である。ここでは、主記憶部130に予告命令が挿入されたプログラムが記憶されていることを想定している。
 データ処理部300は、フェッチ部310と、命令デコーダ320と、実行部330と、レジスタファイル340とを備える。この実行部330は、ロードユニット331と、入力選択部332と、演算回路333と、ストアユニット334とを備える。また、実行結果再利用処理部400は、実行履歴検索部410と、実行結果出力部420と、履歴メモリ430とを備える。
 フェッチ部310は、命令キャッシュ210に保持された命令、または、主記憶部130に記憶されている命令を、命令線219を介して読み出すものである。このフェッチ部310は、プログラムカウンタからの指示に従って、命令キャッシュ210から命令を読み出す。
 また、フェッチ部310は、例えば、再利用区間である関数の呼出し命令の実行を予告する予告命令を読み出した後に、その関数における引数の入力値を設定するための入力値設定命令を読み出す。そして、その入力値設定命令の後に、フェッチ部310は、その関数を呼び出す呼出し命令を読み出す。すなわち、フェッチ部310は、再利用区間である関数の呼出し命令を読み出す前に、その関数に対応する予告命令および入力値設定命令を読み出す。
 また、フェッチ部310は、その読み出された命令を命令デコーダ320に供給する。また、実行履歴検索部410により実行結果が抽出された場合には、フェッチ部310は、例えば、実行結果を設定するための命令を、実行履歴検索部410からの通知に基づいて命令デコーダ320に供給する。
 命令デコーダ320は、フェッチ部310から供給された命令を解読(デコード)して、その解読内容に基づいて、実行部330、レジスタファイル340および実行履歴検索部410を制御するものである。この命令デコーダ320は、関数の実行を予告する予告命令を受け付けた場合には、その予告命令により特定される識別情報を実行履歴検索部410に供給する。ここにいう識別情報とは、複数の再利用区間である関数を互いに識別するための情報であり、履歴メモリ430に保持された実行履歴を検索するための検索キーとして用いられるものである。すなわち、命令デコーダ320は、予告命令によって、予告命令により特定される再利用区間である関数を実行する前に、その関数を識別するための識別情報を実行履歴検索部410に保持される。
 命令デコーダ320は、例えば、識別情報を含む予告命令を受け付けたときは、その識別情報を履歴メモリ430に入力させるために、その識別情報を実行履歴検索部410に供給する。また、その識別情報として関数の先頭アドレスを用いる場合において、レジスタファイル340に関数の先頭アドレスが既に格納されているときは、命令デコーダ320は、その関数の先頭アドレスを参照するための参照情報を含む予告命令により識別情報を特定する。
 このとき、命令デコーダ320は、その予告命令に含まれる参照情報に基づいて、レジスタファイル340に格納された関数の先頭アドレスを実行履歴検索部410に出力させる。すなわち、命令デコーダ320は、実行部330に対し、参照情報を含む予告命令に基づいて、識別情報である関数の先頭アドレスを実行履歴検索部410に出力させる。
 また、識別情報として関数の先頭アドレスを用いる場合において、関数の先頭アドレスをレジスタファイル340に設定するためのアドレス設定命令を予告命令とするときは、命令デコーダ320は、その予告命令に含まれる設定情報に基づいて識別情報を特定する。
 このとき、命令デコーダ320は、入力選択部332を介して、その予告命令に指定された設定情報が示すレジスタファイル340における設定先に、関数の先頭アドレスを設定する。これとともに、命令デコーダ320は、入力選択部332から出力される関数の先頭アドレスを取得するように実行履歴検索部410に指示する。このようなアドレス設定命令である予告命令を、ここでは予告設定命令という。したがって、命令デコーダ320は、実行部330に対し、関数の先頭アドレスの設定先が示された設定情報を含む予告設定命令に基づいて、識別情報である関数の先頭アドレスを設定先に設定させるとともに、実行履歴検索部410に出力させる。
 また、命令デコーダ320は、関数の実行を予告する予告命令の後に受け付けた命令が、関数における引数の入力値を設定するための入力値設定命令であるか否かを判断する。この命令デコーダ320は、例えば、ABIの規定に基づいて入力値設定命令であるか否かを判断する。
 この例において、MIPS(Microprocessor without Interlocked Pipeline Stages)のABIの規定に基づく判断例について簡単に説明する。MIPSの規定では、引数の入力値が全て整数である場合には、4つのレジスタ4乃至7に入力値が格納され、引数が5つ以上のときには、5つ目以上の引数の入力値が主記憶部130のスタック領域にスタックされる。具体的には、5つ目以上の引数の入力値は、レジスタファイル340におけるレジスタ29に格納されたスタックポイント値に16以上の値を加算した値に対応するスタック領域にスタックされる。
 したがって、命令デコーダ320は、例えば、ロードワード命令(lw)に示された転送先レジスタがレジスタ4乃至7である場合には、関数における引数の入力値を設定する入力値設定命令と判断する。また、命令デコーダ320は、引数が5以上であり、その引数の全ての入力値が整数である場合において、ストアワード命令(sw)に示された転送先レジスタがレジスタ29であり、かつ、オフセット値が「16」以上を示すときは、入力値設定命令と判断する。
 そして、入力値設定命令と判断された場合には、命令デコーダ320は、入力選択部332から出力されるデータを引数の入力値として取得させるための取得信号を実行履歴検索部410に供給する。すなわち、命令デコーダ320は、予告命令から、関数を呼び出すための呼出し命令の直前の命令までの命令群のうち、関数の入力値を設定するための入力値設定命令に基づいて、引数の入力値を実行履歴検索部410に取得させるように制御する。
 また、この命令デコーダ320は、例えば、主記憶部130から読み出された関数の入力値を設定するための入力値設定命令を受け付けた場合には、ロードユニット331から読み出された入力値をレジスタファイル340に格納するように制御する。これとともに、命令デコーダ320は、実行履歴検索部410に対し取得信号を供給する。
 また、命令デコーダ320は、例えば、レジスタファイル340に格納された関数の入力値を設定するための入力値設定命令を受け付けた場合には、レジスタファイル340における1つのレジスタに格納された入力値を他のレジスタに転送するように制御する。これとともに、命令デコーダ320は、実行履歴検索部410に対し取得信号を供給する。
 そして、命令デコーダ320は、入力値設定命令の後に、関数の先頭アドレスを呼び出すための呼出し命令を受け付けた場合には、関数に用いられる全ての入力値の設定が終了した旨を示す入力値終了信号を実行履歴検索部410に供給する。すなわち、この命令デコーダ320は、識別情報に対応する関数を呼び出すための呼出し命令を受け付けた場合には、入力値終了信号を実行履歴検索部410に供給する。また、命令デコーダ320は、実行履歴を削除する際の優先度が予告命令に含まれる場合には、その優先度を実行履歴検索部410に供給する。
 実行部330は、命令デコーダ320からの制御に従って処理を実行するものである。すなわち、この実行部330は、複数回実行される命令区間である再利用区間が含まれる命令列に基づく処理を実行する。また、実行部330は、例えば、参照情報を含む予告命令が命令デコーダ320に供給された場合には、参照情報に示されたレジスタに格納された関数の先頭アドレスを識別情報として実行履歴検索部410に出力する。
 また、実行部330は、例えば、予告設定命令が命令デコーダ320に供給された場合には、予告設定命令に含まれる関数の先頭アドレスの設定先を示す設定情報に基づいて、関数の先頭アドレスを設定先に設定する。すなわち、実行部330は、予告設定命令の設定情報に基づいて関数の先頭アドレスをレジスタファイル340に設定するとともに、関数の先頭アドレスを識別情報として実行履歴検索部410に出力する。
 また、この実行部330は、再利用区間である関数の入力値および実行結果をレジスタファイル340または主記憶部130に出力するとともに、実行履歴検索部410に供給する。なお、実行部330は、特許請求の範囲に記載の実行部の一例である。
 ロードユニット331は、命令デコーダ320からの制御に従って、主記憶部130またはデータキャッシュ220からデータを読み出して、その読み出されたデータを入力選択部332に供給するものである。このロードユニット331は、例えば、命令デコーダ320からの制御に従って、主記憶部130またはデータキャッシュ220から関数における引数の入力値を読み出して、その読み出された入力値を入力選択部332に供給する。
 入力選択部332は、命令デコーダ320からの制御に従って、実行結果出力部420、演算回路333、レジスタファイル340および実行結果出力部420から出力されたデータのうち、いずれか1つのデータを選択するものである。この入力選択部332は、その選択されたデータを、レジスタファイル340および実行履歴検索部410に出力する。すなわち、入力選択部332は、命令デコーダ320の制御に従って、実行結果出力部420、演算回路333、レジスタファイル340および実行結果出力部420の出力のうち、いずれかをレジスタファイル340および実行履歴検索部410に出力する。
 この入力選択部332は、例えば、命令デコーダ320に入力値設定命令としてロード命令が供給された場合には、命令デコーダ320の制御に従って、ロードユニット331からのデータを、レジスタファイル340および実行履歴検索部410に出力する。また、この入力選択部332は、命令デコーダ320に入力値設定命令としてムーブ命令が供給された場合には、命令デコーダ320の制御に従って、レジスタファイル340から出力されたデータを、レジスタファイル340および実行履歴検索部410に出力する。
 また、入力選択部332は、演算処理を実行するための演算命令が命令デコーダ320に供給された場合には、命令デコーダ320の制御に従って、演算回路333から出力された演算結果を実行結果として、レジスタファイル340に出力する。また、この入力選択部332は、実行履歴検索部410により実行結果が抽出された場合には、命令デコーダ320からの制御に従って、実行結果出力部420から出力された実行結果をレジスタファイル340に出力する。
 演算回路333は、命令デコーダ320からの制御に従って、演算処理を実行するものである。この演算回路333は、例えば、乗算、除算または積和などの演算処理を実行するための演算命令が命令デコーダ320に供給された場合には、命令デコーダ320の制御に従って、レジスタファイル340に格納されたデータを用いて演算処理を実行する。また、演算回路333は、その演算処理による演算結果を実行結果として、入力選択部332を介してレジスタファイル340に格納する。
 ストアユニット334は、命令デコーダ320からの制御に従って、レジスタファイル340に格納されたデータ、または、実行結果出力部420から出力された実行結果を主記憶部130に書き戻すためのものである。このストアユニット334は、主記憶部130にデータを書き戻すためのストア命令が命令デコーダ320に供給された場合には、命令デコーダ320からの制御に従って、書き戻すべきデータを、データ線229を介してデータキャッシュ220に出力する。また、このストアユニット334は、実行履歴検索部410により実行結果が抽出された場合には、実行結果出力部420から出力された実行結果を、データ線229を介して主記憶部130およびデータキャッシュ220に書き戻す。
 レジスタファイル340は、実行部330から出力されたデータを保持するものである。このレジスタファイル340は、複数のレジスタ、例えば、32個のレジスタ0乃至31により構成される。このレジスタファイル340は、命令デコーダ320からの制御に従って、実行部330から出力されたデータを、複数のレジスタのうち、1つのレジスタに格納する。
 また、このレジスタファイル340は、例えば、命令デコーダ320からの制御に従って、複数のレジスタのうち1つのレジスタに格納されたデータを実行結果として実行部330または実行部330を介して実行履歴検索部410に出力する。また、このレジスタファイル340は、例えば、命令デコーダ320からの制御に従って、複数のレジスタのうち1つのレジスタに格納された関数の先頭アドレスを識別情報として実行部330を介して実行履歴検索部410に出力する。
 実行履歴検索部410は、履歴メモリ430において識別情報ごとに保持された再利用区間における入力値および実行結果である実行履歴のうち、予告命令に基づいて取得された識別情報および入力値と同一の実行履歴における実行結果を検索するものである。この実行履歴検索部410は、予告命令に基づいて特定された識別情報および入力値を保持して、その保持された識別情報および入力値を履歴メモリ430に出力することによって、実行履歴の検索を行う。
 この実行履歴検索部410は、命令デコーダ320の指示に従って、予告命令により特定される識別情報を取得する。この実行履歴検索部410は、例えば、識別情報を含む予告命令が命令デコーダ320に供給された場合には、命令デコーダ320から出力された識別情報を保持する。また、この実行履歴検索部410は、例えば、参照情報を含む予告命令が命令デコーダ320に供給された場合には、命令デコーダ320からの制御に従って、レジスタファイル340から出力された関数の先頭アドレスを識別情報として取得する。
 さらに、この実行履歴検索部410は、例えば、予告設定命令が命令デコーダ320に供給された場合には、命令デコーダ320からの制御に従って、入力選択部332を介して、レジスタファイル340に格納される関数の先頭アドレスを識別情報として取得する。その識別情報が取得された後に、実行履歴検索部410は、入力値設定命令が命令デコーダ320に供給されるたびに、命令デコーダ320から出力される取得信号に基づいて関数の入力値を取得する。
 すなわち、実行履歴検索部410は、実行部330から出力された識別情報である関数の先頭アドレスと、その関数の入力値とに基づいて、履歴メモリ430に保持された実行履歴における実行結果を検索する。そして、実行履歴検索部410は、関数を呼び出す呼出し命令が命令デコーダ320に供給された場合には、命令デコーダ320からの入力値終了信号に基づいて、履歴メモリ430に対する検索を終了する。
 実行履歴検索部410は、履歴メモリ430から実行結果が抽出された場合には、その実行結果を実行結果出力部420に出力する。これとともに、実行履歴検索部410は、関数の処理を省略するための省略信号として、その抽出された実行結果における格納場所に関する情報をフェッチ部310に供給する。
 一方、履歴メモリ430から実行結果が抽出されない場合には、実行履歴検索部410は、実行部330において予告命令により識別された関数における処理が実行された後に、実行部330から出力された実行結果を取得する。そして、実行履歴検索部410は、その関数の実行結果と、予告命令に基づいて取得された識別情報および入力値とを履歴メモリ430に保持させる。すなわち、履歴メモリ430から実行結果が抽出されない場合には、実行履歴検索部410は、予告命令の後に実行される関数の実行結果と、予告命令により保持された関数の識別情報および入力値を履歴メモリ430に登録する。
 この例において、関数における処理の実行を終了するためのリターン命令が命令デコーダ320に供給された場合には、命令デコーダ320の制御によって、実行履歴検索部410は、レジスタファイル340に格納される実行結果を取得する。これにより、実行履歴検索部410は、予告命令により特定された関数の識別情報に対応する入力値および実行結果を関連付けて履歴メモリ430に保持させることができる。
 また、実行履歴を削除する際の優先度が予告命令に含まれる場合には、実行履歴検索部410は、命令デコーダ320からの優先度と、優先度に対応する関数の入力値および実行結果とを関連付けて実行履歴として識別情報ごとに履歴メモリ430に保持させる。この場合において、実行履歴検索部410は、履歴メモリ430に保持された優先度に基づいて、履歴メモリ430における実行履歴を削除する。すなわち、実行履歴検索部410は、優先度が最も大きい識別情報に関連付けられた実行履歴から順番に、履歴メモリ430における実行履歴を削除する。なお、実行履歴検索部410は、特許請求の範囲に記載の実行履歴検索部の一例である。
 実行結果出力部420は、実行履歴検索部410によって履歴メモリ430から実行結果が抽出された場合には、その実行結果を、入力選択部332を介してレジスタファイル340に、または、ストアユニット334に出力するものである。この実行結果出力部420は、実行結果の格納場所によって、ストアユニット334または入力選択部332に実行結果のデータを出力する。なお、実行結果出力部420は、特許請求の範囲に記載の実行結果出力部の一例である。
 履歴メモリ430は、識別情報ごとに識別情報に対応する入力値および実行結果を関連付けて実行履歴として保持するものである。この履歴メモリ430は、例えば、連想メモリ(CAM:Content Addressable Memory)により実現される。この例において、履歴メモリ430は、実行結果を検索するための検索キーである識別情報が実行履歴検索部410から入力されることによって、その識別情報に関連付けられた実行履歴の検索を開始する。
 また、この履歴メモリ430は、実行履歴検索部410から順次供給された入力値と、履歴メモリ430に保持されている入力値とが全て一致する場合には、その保持された入力値に関連付けられた実行結果を実行履歴検索部410に出力する。すなわち、実行履歴検索部410から入力された識別情報および入力値と同一の実行履歴が履歴メモリ430から検出されることによって、実行履歴検索部410により履歴メモリ430から実行結果が抽出される。なお、履歴メモリ430は、特許請求の範囲に記載の履歴メモリの一例である。
 また、履歴メモリ430は、例えば、実行履歴検索部410から供給された優先度と、優先度に対応する関数の入力値および実行結果とを関連付けて実行履歴として識別情報ごとに保持する。また、この連想メモリにより実現される履歴メモリ430は、例えば、実行履歴における入力値のパターンを木構造により保持する。ここで、履歴メモリ430におけるデータ構造の例について図面を参照して以下に説明する。
 [履歴メモリ430のデータ構造例]
 図3は、本発明の第1の実施の形態における履歴メモリ430のデータ構造の一例を示す概念図である。ここでは、履歴メモリ430により、複数の関数を互いに識別する識別情報ごとに保持された実行履歴のうち、1つの識別情報における実行履歴を木構造により保持する構成が示されている。この例では、引数がn個であり、かつ、実行結果である出力をm個の格納先に返す関数を想定している。また、ここでは、関数の先頭アドレスである関数アドレスを識別情報として用いることとする。
 この例では、木構造における関数ルート440と、第1の引数ノード451および452と、第nの引数ノード461乃至464と、第1の出力ノード471乃至474と、第mの出力ノード481乃至484とが示されている。
 関数ルート440には、識別情報である関数アドレスと、第1の引数ノード451を指し示すポインタとが示されている。
 第1および第nの引数ノード451、452および461乃至464には、履歴メモリ430に保持されている実行履歴における引数の入力値として、引数の値を示す入力データと、その引数の型と、その引数の格納場所を示す種類とが示されている。ここにいう格納場所とは、レジスタファイル340のレジスタ番号または主記憶部130のメモリアドレスのことをいう。
 さらに、第1および第nの引数ノード451、452および461乃至464には、比較対象の入力値が互いに一致した場合に次の引数における引数ノードを指し示す右ポインタと、不一致の場合に同一の引数における他の引数ノードを指し示す下ポインタとが示されている。また、第nの引数ノード461乃至464の各々に、第1および第mの出力ノード471乃至474および481乃至484がそれぞれ連結されている。
 第1および第mの出力ノード471乃至474および481乃至484には、履歴メモリ430に保持されている実行履歴における実行結果として、実行結果の値を示す出力データと、その実行結果の格納場所を示す種類と、その実行結果の型とが示されている。さらに、第1の出力ノード471乃至474には、次の出力ノードを指し示す右ポインタが示されている。この第1および第mの出力ノード471乃至474および481乃至484は、連結リストを構成している。また、第mの出力ノード481乃至484の右ポインタには、出力ノードの終端を表わすヌルが示されている。
 このような木構造において、関数ルート440に示された関数アドレスと一致する関数アドレスが実行履歴検索部410から入力されると、関数ルート440のポインタによって指し示された第1の引数ノード451において入力値の比較処理が実行される。ここにいう入力値の比較処理とは、第1の引数ノード451に示された入力データ、種類および型である入力値と、実行履歴検索部410からの入力値とを比較することである。
 このとき、例えば、第1の引数ノード451に示された入力値と実行履歴検索部410からの入力値とが一致した場合には、第1の引数ノード451の右ポインタにより指し示された次の引数ノードにおいて入力値の比較処理が実行される。一方、第1の引数ノード451に示された入力値と、実行履歴検索部410からの入力値とが一致しない場合には、第1の引数ノード451の下ポインタにより指し示された第1の引数ノード452において入力値の比較処理が実行される。
 このようにして、各引数ノードにおける比較処理による結果に基づいて右または下ポインタの指し示す引数ノードが選択され、その選択された引数ノードにおいて入力値の比較処理が順次実行される。例えば、第nの引数ノード461に示された入力値と、実行履歴検索部410からの入力値とが互いに一致した場合には、第nの引数ノード461の右ポインタにより第1の出力ノード471が指し示される。そして、第1の出力ノード471に保持された出力データ、種類および型を示す実行結果から順番に、第m番の出力ノード481に保持された実行結果までが実行履歴検索部410に順次出力される。
 このように、履歴メモリ430を識別情報ごとに木構造により構成することによって、同じ引数の入力値を重複して保持させる必要が無いため、記憶領域を節約することができる。また、識別情報ごとにデータ構造を分けることによって、検索速度の低下を抑制することができる。
 [識別情報を含む予告命令によるデータ処理装置100の動作例]
 図4は、本発明の第1の実施の形態におけるデータ処理装置100において識別情報を含む予告命令を受け付けた場合におけるデータ処理装置100の動作概要を示す概念図である。図4の(a)は、アセンブリ言語により記述された命令列の一部を例示する図である。図4の(a)には、インデックス(index)を指定する予告命令(noticeCall)と、関数(func)を呼び出すコール命令(Call)とが示されている。
 図4の(b)は、履歴メモリ430における識別情報ごとの実行履歴検索データの一例を示す概念図である。図4の(b)には、インデックス(index)により示される識別情報(インデックス0乃至k)の列431と、実行履歴検索データ(実行履歴検索データ0乃至k)の列432との対応が示されている。ここにいう実行履歴検索データは、図3に示した木構造により構成される検索データのことを示す。
 この場合において、予告命令(noticeCall)が命令デコーダ320に供給されることによって、インデックス(index)により示される識別情報「インデックスk」が、命令デコーダ320から実行履歴検索部410に供給される。そして、実行履歴検索部410により、識別情報「インデックスk」が履歴メモリ430に入力されることによって、この識別情報(インデックスk)によって識別される関数(func)における「実行履歴検索データk」に基づいて、実行履歴の検索が開始される。
 その後、関数における引数の入力値を設定する入力値設定命令に基づいて、実行履歴検索部410において、関数(func)の引数の入力値が取得され、その取得された入力値が履歴メモリ430に順次入力される。これにより、識別情報「インデックスk」に対応する実行履歴検索データ(実行履歴検索データk)に保持された入力値と、実行履歴検索部410からの入力値との比較が順次行われる。
 そして、コール命令(call)が命令デコーダ320に供給されることによって、実行履歴検索部410により取得された識別情報および入力値と一致する実行履歴の有無が履歴メモリ430から実行履歴検索部410に通知される。すなわち、実行履歴検索部410により、実行履歴検索データkによる検索結果として関数(func)の再利用できる実行結果の有無がコール命令(call)に基づいて参照される。
 このとき、履歴メモリ430から実行結果が出力された場合には、関数(func)の実行が省略される。一方、実行結果が出力されない場合には、関数(func)が実行されて、その実行された実行結果と、実行履歴検索部410によって既に取得された識別情報および入力値とが履歴メモリ430に保持される。
 このように、データ処理装置100は、関数(func)のコール命令(call)を実行する前において、予告命令(noticeCall)に基づいて関数(func)の引数の入力値を取得する。そして、その関数(func)の入力値と、履歴メモリ430に保持された関数(func)の入力値との比較を終了させる。次に、識別情報を含む予告命令によるデータ処理装置100におけるより具体的な動作例について、MIPSによる命令コードを示す図面を参照して説明する。
 [識別情報を含む予告命令による動作例]
 図5は、本発明の第1の実施の形態におけるデータ処理装置100により実行されるプログラムの一部を例示する図である。図5の(a)は、再利用区間として選択された関数のソースプログラムの一部の例を示す図である。図5の(b)は、図5の(a)に示したソースプログラムがMIPSのアセンブリ言語により変換された命令列の一部を例示する図である。
 図5の(a)の上段には、5つの引数(a乃至e)を持つ関数(func)の呼出しが記述されている。下段には、イント(int)型の関数(func)の定義が記述されている。この関数(func)は、イント(int)型の引数として、第1の引数(a)、第2の引数(b)、第3の引数(c)、第4の引数(d)および第5の引数(e)を持つ。このようなソースプログラムに対し、MIPSのアセンブリ言語により変換するとともに予告命令の挿入処理を施すことによって生成された命令列の一部が図5の(b)に示されている。
 図5の(b)には、第1の命令列(noticeCall)、第2の命令列(lw)、第3の命令列(lw)、第4の命令列(move)、第5の命令列(move)、第6の命令列(sw)、第7の命令列(lw)および第8の命令列(jalr)が示されている。ここでは、第1乃至第5引数の入力値A乃至Eが全て整数であることを想定している。
 第1の命令列において、インデックス(index)を指定する予告命令(noticeCall)が実行される。これにより、命令デコーダ320により供給されたインデックス(index)により示された識別情報が実行履歴検索部410から履歴メモリ430に入力されることによって、実行履歴の検索が行われる。
 第2の命令列において、ロードワード命令(lw)が実行される。これにより、レジスタ28(R28)に格納されている基準アドレスにオフセット値「1000」が加算され、その加算された値によって指定される主記憶部130のメモリアドレスに記憶されたデータ(第1の引数の入力値A)がレジスタ4(R4)に転送される。
 このロードワード命令(lw)は、そのロードワード命令(lw)に示された転送先レジスタ番号が「R4」であることから、命令デコーダ320により、引数の入力値を設定する入力値設定命令であると判断される。このため、レジスタ4(R4)に転送される入力値Aが実行履歴検索部410にも供給されて、履歴メモリ430に保持されている第1の引数の入力値と比較される。このとき、履歴メモリ430に保持された第1の引数の入力値のうち、入力値Aが保持されていれば、第2の引数の入力値の比較処理に進む。一方、入力値Aが保持されていない場合には、実行履歴の検索を終了する。
 第3の命令列において、ロードワード命令(lw)が実行される。これにより、レジスタ28(R28)に格納されている基準アドレスにオフセット値「1004」が加算され、その加算された値によって指定される主記憶部130のメモリアドレスに記憶されたデータ(第2の引数の入力値B)がレジスタ5(R5)に転送される。
 このロードワード命令(lw)は、そのロードワード命令(lw)に示される転送先レジスタ番号が「R5」であることから、命令デコーダ320により、引数の入力値を設定する入力値設定命令であると判断される。このため、レジスタ5(R5)に格納される入力値Bが実行履歴検索部410にも供給され、履歴メモリ430に保持されている第2の引数の入力値と比較される。このとき、履歴メモリ430に保持された第2の引数の入力値のうち、入力値Bが保持されていれば、第3の引数の入力値の比較処理に進む。一方、入力値Bが保持されていない場合には、実行履歴の検索を終了する。
 第4の命令列において、ムーブ命令(move)が実行される。これにより、レジスタ10(R10)に格納されているデータ(第3の引数の入力値C)がレジスタ6(R6)に転送される。このムーブ命令(move)は、その転送先レジスタ番号が「R6」であることから、命令デコーダ320により、引数の入力値を設定する入力値設定命令であると判断される。このため、レジスタ6(R6)に格納される入力値Cが実行履歴検索部410にも供給され、履歴メモリ430に保持されている第3の引数の入力値と比較される。
 このとき、履歴メモリ430に保持された第3の引数の入力値のうち入力値Cが保持されていれば、第4の引数の入力値の比較処理に進む。一方、入力値Cが保持されていない場合には、実行履歴の検索を終了する。
 第5の命令列において、ムーブ命令(move)が実行される。これにより、レジスタ11(R11)に格納されているデータ(第4の引数の入力値D)がレジスタ7(R7)に転送される。このムーブ命令(move)は、そのムーブ命令(move)に示される転送先レジスタ番号が「R7」であることから、命令デコーダ320により、引数の入力値を設定する入力値設定命令であると判断される。このため、レジスタ7(R7)に格納される入力値Dが実行履歴検索部410にも供給され、履歴メモリ430に保持されている第4の引数の入力値と比較される。
 このとき、履歴メモリ430に保持された第4の引数の入力値のうち入力値Dが保持されていれば、第5の引数の入力値の比較処理に進む。一方、入力値Dが保持されていない場合には、実行履歴の検索を終了する。
 第6の命令列において、ストアワード命令(sw)が実行される。これにより、レジスタ29(R29)に格納されているスタックポインタの値に「16」が加算され、その加算された値のメモリアドレスにレジスタ12(R12)に格納されているデータ(第5の引数の入力値E)が転送される。このストアワード命令(sw)は、そのストアワード命令(sw)に示される転送先レジスタ番号が「R29」であり、オフセット値が「16」以上であることから、命令デコーダ320により、引数の入力値を設定する入力値設定命令であると判断される。
 これにより、主記憶部130に転送された入力値Eが実行履歴検索部410にも供給され、履歴メモリ430に保持されている第5の引数の入力値と比較される。このとき、履歴メモリ430に保持された第5の引数の入力値のうち、入力値Eが保持されていれば、全ての引数の入力値A乃至Eが一致する実行履歴における実行結果が実行履歴検索部410に出力される。一方、入力値Aが保持されていない場合には、実行履歴の検索を終了する。
 第7の命令列において、ロードワード命令(lw)が実行される。これにより、レジスタ28(R28)に格納されている基準アドレスに、オフセット値「2000」が加算され、その加算された値のメモリアドレスに記憶されたデータ(関数funcの先頭アドレス)がレジスタ25(R25)に転送される。
 このロードワード命令(lw)は、そのロードワード命令(lw)に示される転送先レジスタ番号が「R25」であることから、命令デコーダ320により、引数の入力値を設定する入力値設定命令でないと判断される。このため、実行履歴検索部410により、入力選択部332から出力されたデータは取得されない。
 第8の命令列において、ジャンプ命令(jalr)が実行される。これにより、レジスタ25(R25)に格納されている関数(func)の先頭アドレスの命令が読み出される。このとき、命令デコーダ320により、関数(func)における全ての第1乃至第5引数の入力値の設定が終了したことを示す入力値終了信号が実行履歴検索部410に通知される。
 このとき、履歴メモリ430から実行結果が出力されていれば、実行履歴検索部410により、その実行結果が実行結果出力部420に出力されるとともに、関数(func)の処理を省略するための省略信号がフェッチ部310に供給される。一方、履歴メモリ430から実行結果が出力されていなければ、実行履歴検索部410により、関数(func)の実行後の実行結果と、予告命令に基づいて取得された識別情報および入力値とが履歴メモリ430に登録される。
 次に、履歴メモリ430に保持された実行履歴と、実行履歴検索部410により取得された識別情報および入力値とが一致した場合において予告命令により関数の処理時間が短縮される例について以下に図面を参照して説明する。
 [データ処理装置100による関数処理の時間短縮例]
 図6は、予告命令の実行により関数における処理時間が短縮される例を示す概念図である。図6の(a)は、予告命令のないプログラムの処理を実行する従来のデータ処理装置における実行結果の再利用による短縮時間を示す概念図である。図6の(b)は、本発明の第1の実施の形態におけるデータ処理装置100における実行結果の再利用による短縮時間を示す概念図である。
 図6の(a)および(b)では、上位ルーチンにおいて2つの引数を持つ関数がコール命令(call)によって呼び出され、その関数における処理の終了に伴うリターン命令(return)によって下位ルーチンから復帰する例が示されている。また、ここでは、左から右に時間が経過することとする。
 図6の(a)には、上位ルーチンにおける入力値A設定321および入力値B設定322と、下位ルーチンにおける入力値A使用323および入力値B使用324とが示されている。
 入力値A設定321および入力値B設定322は、関数における引数の入力値が設定されるタイミングを示す。これは、図1で述べたとおり、ABIの規定に従って記述されたプログラムによる処理手順である。また、入力値A使用323および入力値B使用324は、下位ルーチンである関数の処理において引数である入力値が使用されるタイミングを示す。
 この場合には、下位ルーチンにおいて2つの引数が全て使用(入力値B使用324)されるまで、関数の引数である入力値AおよびBを特定することができない。このため、関数の引数である入力値AおよびBが、履歴メモリ430に保持されている入力値と全て一致したときであっても、入力値B使用324からリターン命令(return)までの短縮期間t1だけしか関数の処理時間を削減することができない。
 図6の(b)には、図6の(a)に示したタイミングに加えて予告命令421が示されている。この予告命令421は、命令デコーダ320によって予告命令がデコードされるタイミングを示す。予告命令421以外は、図6の(a)と同様のものを示しているため、図6の(a)と同一符号を付してここでの説明を省略する。
 この場合には、関数を識別するための識別情報が予告命令421により特定されるため、履歴メモリ430の検索キーである識別情報を履歴メモリ430に入力することによって、関数の実行履歴の検索が開始される。そして、実行履歴検索部410により、引数の入力値AおよびBを設定するための2つの入力値設定命令に基づいて取得された入力値AおよびBが、履歴メモリ430に供給される。
 その後、コール命令(call)に基づいて、その取得された入力値AおよびBと、履歴メモリ430に保持されている入力値とが全て一致したか否かが判断される。そして、全て一致した場合には、関数である下位ルーチン(callからreturnまで)の処理に要する短縮期間t2が削減される。
 このように、データ処理装置100は、予告命令に含まれる識別情報および引数の入力値を予告命令に基づいて取得することによって、実行履歴検索期間tにおいて履歴メモリ430に対する実行結果の検索を終了させることができる。これにより、履歴メモリ430に保持された実行結果が再利用できる場合には、短縮することができる期間(短縮期間t2)を、従来の短縮期間t1よりも長くすることができる。
 [データ処理装置100の動作例]
 次に本発明の実施の形態におけるデータ処理装置100の動作について図面を参照して説明する。
 図7は、本発明の第1の実施の形態におけるデータ処理装置100の実行結果再利用方法の処理手順の一例を示すフローチャートである。
 まず、命令デコーダ320により、フェッチ部310から供給された予告命令が解読される(ステップS911)。そして、命令デコーダ320により、予告命令により特定された識別情報である履歴メモリ430の検索キーが実行履歴検索部410に供給されることによって、実行履歴検索部410において識別情報が取得される。すなわち、実行履歴検索部410により、予告命令に含まれる識別情報が取得されて、その取得された識別情報が実行履歴検索部410から履歴メモリ430に入力される(ステップS912)。これにより、履歴メモリ430における識別情報に対応する複数の実行履歴の検索が開始される。なお、ステップS912は、特許請求の範囲に記載の取得手順の一例である。
 続いて、フェッチ部310により、予告命令の次に実行されるべき命令が読み出される(ステップS913)。この後、命令デコーダ320により、フェッチ部310から読み出された命令が、関数の第1の引数の入力値を設定するための入力値設定命令か否かが判断される(ステップS914)。
 そして、入力値設定命令であると判断された場合には、命令デコーダ320により、入力値設定命令によって設定された引数の入力値が実行履歴検索部410に供給されることによって、実行履歴検索部410において引数の入力値が取得される(ステップS921)。なお、ステップS921は、特許請求の範囲に記載の取得手順の一例である。
 続いて、実行履歴検索部410により取得された引数の入力値が、履歴メモリ430における識別情報に関連付けられた引数の入力値と一致するか否かが判断される(ステップS922)。そして、両者の入力値が一致しない場合には、ステップS913の処理に戻る。
 一方、両者の入力値が一致した場合には、履歴メモリ430において、次の引数の入力値を比較するための次の引数ノードにポインタが進められて(ステップS923)、ステップS913の処理に戻る。すなわち、複数の引数ノードのうち、実行履歴検索部410からの入力値と一致する引数ノードがあれば、その引数ノードの右ポインタによって、次の引数ノードが指し示される。
 このようにして、全ての引数の入力値が設定されるまで、ステップS913、S914、S921乃至S923における一連の処理が繰り返し実行される。なお、ステップS922およびS923は、特許請求の範囲に記載の実行履歴検索手順の一例である。
 一方、ステップS914の処理において入力値設定命令でないと判断された場合には、命令デコーダ320により、フェッチ部310から読み出された命令が、関数を呼び出す呼出し命令であるか否かが判断される(ステップS915)。そして、呼出し命令でないと判断された場合には、ステップS913の処理に戻る。
 一方、呼出し命令と判断された場合には、入力値設定命令により設定された入力値が、履歴メモリ430における識別情報に関連付けられた入力値と全て一致したか否かが判断される(ステップS916)。そして、全ての入力値が一致した場合には、実行結果再利用処理が実行される(ステップS924)。すなわち、実行履歴検索部410により取得された識別情報および入力値に対応する履歴メモリ430における実行結果が、実行結果出力部420から出力される。そして、主記憶部130またはレジスタファイル340に書き戻されて、呼び出される関数の処理を終了する。なお、S924は、特許請求の範囲に記載の実行結果出力手順の一例である。
 一方、全ての入力値が一致しない場合には、呼び出された関数が実行される(ステップS917)。そして、実行履歴検索部410により、実行された関数の実行結果が取得される(ステップS918)。続いて、実行履歴検索部410により、その取得された実行結果と、ステップS912およびS921により取得された入力値とを履歴メモリ430に登録される(ステップS919)。
 このように、本発明の第1の実施の形態では、関数の実行を予告する予告命令によって、関数の識別情報と、その予告命令の後に実行される入力値設定命令により設定される入力値とを、関数の実行前に特定することができる。これにより、関数が呼び出されるときに、その特定された識別情報および入力値と一致する履歴メモリ430における実行履歴を抽出することができる。また、履歴メモリ430から実行履歴における実行結果が抽出された場合には、呼出し命令により呼び出される関数の実行を省略することができるため、実行結果の再利用による関数の処理時間を大幅に削減することができる。
 なお、本発明の第1の実施の形態では、履歴メモリ430の検索キーである識別情報を予告命令に含める例について説明したが、識別情報を関数の先頭アドレスとし、関数の先頭アドレスを参照するための参照情報を予告命令に含めるようにしてもよい。そこで、参照情報を含む予告命令に基づいて履歴メモリ430における実行履歴を検索する例を第2の実施の形態として以下に図面を参照して説明する。
 <第2の実施の形態>
 [参照情報を含む予告命令によるデータ処理装置100の動作例]
 図8は、本発明の第2の実施の形態におけるデータ処理装置100において参照情報を含む予告命令を受け付けた場合におけるデータ処理装置100の動作概要を示す概念図である。ここでは、履歴メモリ430の検索キーである識別情報として関数の先頭アドレスである関数アドレスを用いることを想定している。
 図8の(a)は、アセンブリ言語により記述された命令列の一部を例示する図である。図8の(a)には、関数アドレスをレジスタ25(R25)に設定するロードワード命令(lw)と、参照情報(R25)を含む予告命令(noticeCall)とが示されている。また、ここでは、レジスタ25(R25)に格納された関数を呼び出すコール命令(Call)が示されている。
 このように、予告命令(noticeCall)の参照情報には、関数アドレスが格納されているレジスタ番号(R25)が示される。また、このような参照情報を含む予告命令を生成する場合には、コンパイル処理において、関数アドレスを設定するロードワード命令(lw)を予告命令の前に生成することを想定している。
 図8の(b)は、履歴メモリ430における識別情報である関数アドレスごとの実行履歴検索データの一例を示す概念図である。図8の(b)には、参照情報(R25)に示されるレジスタ25(R25)に格納されている関数アドレス(関数アドレス0乃至k)の列433と、実行履歴検索データ(実行履歴検索データ0乃至k)の列434との対応表が示されている。ここにいう実行履歴検索データは、図3に示した木構造によって構成される検索データのことを示す。
 この場合において、命令デコーダ320は、予告命令(noticeCall)に含まれる参照情報(R25)に基づいて、レジスタ25(R25)に格納されている「関数アドレス1」を実行履歴検索部410に出力させる。すなわち、実行部330は、参照情報を含む予告命令に基づいて関数アドレス「関数アドレス1」を実行履歴検索部410に出力する。そして、実行履歴検索部410により、その「関数アドレス1」が履歴メモリ430に入力されることによって、その関数アドレス1に対応する実行履歴検索データ1に基づいて、実行履歴の検索が開始される。
 その後、関数における引数の入力値を設定するための入力値設定命令に基づいて、実行履歴検索部410において、関数における引数の入力値が保持され、その保持された入力値が履歴メモリ430に順次入力される。これにより、関数アドレス(関数アドレス1)に対応する実行履歴検索データ(実行履歴検索データ1)に保持された入力値と、実行履歴検索部410からの入力値との比較が順次行われる。
 そして、コール命令(call)が命令デコーダ320に供給されることによって、実行履歴検索部410により取得された関数アドレスおよび入力値と一致する実行履歴の有無が、履歴メモリ430から実行履歴検索部410に通知される。すなわち、実行履歴検索部410により、関数アドレス1に対応する実行履歴検索データ1による検索結果として、再利用できる実行結果の有無がコール命令(call)に基づいて参照される。
 このとき、履歴メモリ430から実行結果が出力された場合には、関数の実行が省略される。一方、実行結果が出力されない場合には、関数の処理がそのまま実行されて、その実行された実行結果と、実行履歴検索部410によって既に保持されている識別情報および入力値とが履歴メモリ430に登録される。
 このように、データ処理装置100は、関数(関数アドレス1)のコール命令(call)の実行前に、予告命令(noticeCall)に含まれる参照情報に基づいて、履歴メモリ430の検索キーである識別情報(関数アドレス1)を取得することができる。次に、参照情報を含む予告命令によるデータ処理装置100におけるより具体的な動作例について、MIPSによる命令コードを示す図面を参照して説明する。
 [参照情報を含む予告命令によるデータ処理装置100の具体的な動作例]
 図9は、本発明の第2の実施の形態におけるデータ処理装置100により実行されるプログラムの一部を例示する図である。図9の(a)は、再利用区間として選択された関数のソースプログラムの一部の例を示す図である。図5の(b)は、図5の(a)に示したソースプログラムがMIPSのアセンブリ言語により変換された命令列の一部を例示する図である。
 図9の(a)の上段には、5つの引数(a乃至e)を持つ関数(func)の呼出しが記述されている。下段には、イント(int)型の関数(func)の定義が記述されている。この関数(func)は、イント(int)型の引数として、第1の引数(a)、第2の引数(b)、第3の引数(c)、第4の引数(d)および第5の引数(e)を持つ。このようなソースプログラムに対し、MIPSのアセンブリ言語により変換するとともに予告命令の挿入処理を施すことによって生成された命令列の一部が図9の(b)に示されている。
 図9の(b)には、第1の命令列(lw)、第2の命令列(noticeCall)、第3の命令列(lw)、第4の命令列(lw)、第5の命令列(move)、第6の命令列(move)、第7の命令列(sw)、および第8の命令列(jalr)が示されている。ここでは、関数の引数の入力値A乃至Eが全て整数であることを想定している。
 第1の命令列において、ロードワード命令(lw)が実行される。これにより、レジスタ28(R28)に格納されている基準アドレスに、オフセット値「2000」が加算され、その加算された値のメモリアドレスに記憶されたデータ(関数funcの先頭アドレス)がレジスタ25(R25)に転送される。このように、主記憶部130から読み出された関数の先頭アドレスをレジスタファイル340に設定するロードワード命令を、ここではアドレス設定命令という。
 第2の命令列において、参照情報(R25)を含む予告命令(noticeCall)が実行される。これにより、命令デコーダ320の制御により、参照情報(R25)に基づいて、レジスタ25に格納された識別情報である関数アドレスが実行履歴検索部410に出力される。すなわち、実行部330により、参照情報を含む予告命令に基づいて関数アドレスが実行履歴検索部410に出力される。そして、実行履歴検索部410により、その関数アドレスが履歴メモリ430に入力されることによって、実行履歴の検索が行われる。
 第3の命令列において、ロードワード命令(lw)が実行される。これにより、レジスタ28(R28)に格納されている基準アドレスにオフセット値「1000」が加算され、その加算された値である主記憶部130のメモリアドレスに記憶されたデータ(第1の引数の入力値A)がレジスタ4(R4)に転送される。
 このロードワード命令(lw)は、そのロードワード命令(lw)に示される転送先レジスタ番号が「R4」であることから、命令デコーダ320により、引数の入力値を設定する入力値設定命令であると判断される。このため、レジスタ4(R4)に転送される入力値Aが実行履歴検索部410にも供給され、履歴メモリ430に保持されている第1の引数の入力値と比較される。このとき、履歴メモリ430に保持された第1の引数の入力値のうち、入力値Aが保持されていれば、第2の引数の入力値の比較処理に進む。一方、入力値Aが保持されていない場合には、実行履歴の検索を終了する。
 第4の命令列において、ロードワード命令(lw)が実行される。これにより、レジスタ28(R28)に格納されている基準アドレスにオフセット値「1004」が加算され、その加算された値である主記憶部130のメモリアドレスに記憶されたデータ(第2の引数の入力値B)がレジスタ5(R5)に転送される。
 このロードワード命令(lw)は、そのロードワード命令(lw)に示された転送先レジスタ番号が「R5」であることから、命令デコーダ320により、引数の入力値を設定する入力値設定命令であると判断される。このため、レジスタ5(R5)に格納される入力値Bが実行履歴検索部410にも供給され、履歴メモリ430に保持されている第2の引数の入力値と比較される。このとき、履歴メモリ430に保持された第2の引数の入力値のうち、入力値Bが保持されていれば、第3の引数の入力値の比較処理に進む。一方、入力値Bが保持されていない場合には、実行履歴の検索を終了する。
 第5の命令列において、ムーブ命令(move)が実行される。これにより、レジスタ10(R10)に格納されているデータ(第3の引数の入力値C)が、レジスタ6(R6)に転送される。このムーブ命令(move)は、そのムーブ命令(move)に示された転送先レジスタ番号が「R6」であることから、命令デコーダ320により、引数の入力値を設定する入力値設定命令であると判断される。このため、レジスタ6(R6)に格納される入力値Cが実行履歴検索部410にも供給され、履歴メモリ430に保持されている第3の引数の入力値と比較される。
 このとき、履歴メモリ430に保持された第3の引数の入力値のうち入力値Cが保持されていれば、第4の引数の入力値の比較処理に進む。一方、入力値Cが保持されていない場合には、実行履歴の検索を終了する。
 第6の命令列において、ムーブ命令(move)が実行される。これにより、レジスタ11(R11)に格納されているデータ(第4の引数の入力値D)がレジスタ7(R7)に転送される。このムーブ命令(move)は、そのムーブ命令(move)に示された転送先レジスタ番号が「R7」であることから、命令デコーダ320により、引数の入力値を設定する入力値設定命令であると特定される。このため、レジスタ7(R7)に格納される入力値Dが実行履歴検索部410にも供給され、履歴メモリ430に保持されている第4の引数の入力値と比較される。
 このとき、履歴メモリ430に保持された第4の引数の入力値のうち入力値Dが保持されていれば、第5の引数の入力値の比較処理に進む。一方、入力値Dが保持されていない場合には、実行履歴の検索を終了する。
 第7の命令列において、ストアワード命令(sw)が実行される。これにより、レジスタ29(R29)に格納されているスタックポインタの値に「16」が加算され、その加算された値のメモリアドレスにレジスタ12(R12)に格納されているデータ(第5の引数の入力値E)が転送される。このストアワード命令(sw)は、そのストアワード命令(sw)に示された転送先レジスタ番号が「R29」であり、オフセット値が「16」以上であることから、命令デコーダ320により、引数の入力値を設定する入力値設定命令であると判断される。
 これにより、主記憶部130に転送された入力値Eが実行履歴検索部410にも供給され、その供給された入力値Eと、履歴メモリ430に保持されている第5の引数の入力値とが比較される。このとき、履歴メモリ430に保持された第5の引数の入力値のうち、入力値Eが保持されていれば、全ての引数の入力値A乃至Eが一致する実行履歴における実行結果が実行履歴検索部410に出力される。一方、入力値Aが保持されていない場合には、実行履歴の検索を終了する。
 第8の命令列において、ジャンプ命令(jalr)が実行される。これにより、レジスタ25(R25)に格納されている関数(func)の先頭アドレスの命令が読み出される。このとき、命令デコーダ320により、関数(func)における全ての第1乃至第5引数の入力値の設定が終了したことを示す入力値終了信号が、実行履歴検索部410に通知される。
 このとき、履歴メモリ430から実行結果が出力されていれば、実行履歴検索部410により、その実行結果が実行結果出力部420に出力されるとともに、関数(func)の処理を省略するための省略信号がフェッチ部310に供給される。一方、履歴メモリ430から実行結果が出力されていなければ、実行履歴検索部410により、関数(func)の実行後の実行結果と、予告命令に基づいて取得された識別情報および入力値とが履歴メモリ430に登録される。
 このように、本発明の第2の実施の形態では、実行履歴検索部410は、予告命令により識別される関数が実行される前において、予告命令に含まれる参照情報に基づいて関数の先頭アドレスを識別情報として取得することができる。これにより、実行履歴検索部410は、識別情報として実行部330から出力された再利用区間である関数の先頭アドレスと、関数の入力値とに基づいて、履歴メモリ430に保持された実行履歴における実行結果を検索することができる。
 すなわち、実行結果再利用処理部400は、参照情報を含む予告命令によって、実行履歴検索部410において識別情報および入力値を取得することができるため、関数の実行前に、履歴メモリ430に保持された実行履歴を検索することができる。
 なお、ここでは、参照情報を含む予告命令により関数アドレスを取得する例について説明したが、関数アドレスを設定するためのアドレス設定命令を予告命令とする予告設定命令を用いるようにしてもよい。次に、予告設定命令を契機に履歴メモリ430に保持された実行履歴を検索する例を第3の実施の形態として以下に図面を参照して説明する。
 <第3の実施の形態>
 [参照情報を含む予告命令によるデータ処理装置100の動作例]
 図10は、本発明の第3の実施の形態におけるデータ処理装置100において予告設定命令を受け付けた場合におけるデータ処理装置100の動作概要を示す概念図である。ここでは、履歴メモリ430の検索キーである識別情報として関数の先頭アドレスである関数アドレスを用いることを想定している。
 図10の(a)は、アセンブリ言語により記述された命令列の一部を例示する図である。図10の(a)には、関数アドレスをレジスタ25(R25)に設定する予告設定命令(memolw)と、レジスタ25(R25)に格納された関数アドレスに対応する関数を呼び出すコール命令(Call)が示されている。
 このように、予告設定命令(memolw)を用いることによって、第2の実施の形態と比べて、関数アドレスをレジスタ25(R25)に設定するアドレス設定命令(lw)を省略することができる。
 図10の(b)は、履歴メモリ430における識別情報である関数アドレスごとの実行履歴検索データの一例を示す概念図である。図10の(b)には、予告設定命令(memolw)によってレジスタ25(R25)に設定される関数アドレス(関数アドレス0乃至k)の列435と、実行履歴検索データ(実行履歴検索データ0乃至k)の列436との対応表が示されている。ここにいう実行履歴検索データは、図3に示した木構造によって構成される検索データのことを示す。
 この場合において、命令デコーダ320は、予告設定命令(memolw)に指定された設定情報に示されたレジスタ25(R25)に「関数アドレス1」を設定するとともに、実行履歴検索部410に「関数アドレス1」を取得させる。すなわち、実行部330は、関数の先頭アドレスの設定先(R25)を示す設定情報を含む予告設定命令(memolw)基づいて、関数の先頭アドレス「関数アドレス1」を設定先(R25)に設定する。
 そして、実行履歴検索部410により、その「関数アドレス1」が履歴メモリ430に入力されることによって、その関数アドレス1に対応する「実行履歴検索データ1」に基づいて、実行履歴の検索が開始される。
 その後、関数における引数の入力値を設定するための入力値設定命令に基づいて、実行履歴検索部410において、引数の入力値が取得され、その取得された入力値が履歴メモリ430に順次入力される。これにより、関数アドレス(関数アドレス1)に対応する実行履歴検索データ(実行履歴検索データ1)に保持された入力値と、実行履歴検索部410からの入力値との比較が順次行われる。
 そして、コール命令(call)が命令デコーダ320に供給されることによって、実行履歴検索部410により取得された関数アドレス(関数アドレス1)および入力値と一致する実行履歴の有無が履歴メモリ430から実行履歴検索部410に通知される。すなわち、実行履歴検索部410により、関数アドレス1に対応する実行履歴検索データ1による検索結果がコール命令(call)に基づいて参照される。
 このとき、履歴メモリ430から実行結果が出力された場合には、関数の実行が省略される。一方、実行結果が出力されない場合には、関数の処理が実行されて、その実行された実行結果と、実行履歴検索部410によって既に取得された識別情報である関数アドレスおよび入力値とが履歴メモリ430に保持される。
 このように、データ処理装置100は、関数(関数アドレス1)のコール命令(call)を実行する前に、予告設定命令(memolw)により設定される関数アドレス(関数アドレス1)を実行履歴検索部410において取得することができる。次に、予告設定命令によるデータ処理装置100におけるより具体的な動作例について、MIPSによる命令コードを示す図面を参照して説明する。
 [予告設定命令によるデータ処理装置100の具体的な動作例]
 図11は、本発明の第3の実施の形態におけるデータ処理装置100により実行されるプログラムの一部を例示する図である。図11の(a)の上段には、5つの引数(a乃至e)を持つ関数(func)の呼出しが記述されている。下段には、イント(int)型の関数(func)の定義が記述されている。この関数(func)は、イント(int)型の引数として、第1の引数(a)、第2の引数(b)、第3の引数(c)、第4の引数(d)および第5の引数(e)を持つ。
 このようなソースプログラムに対し、MIPSのアセンブリ言語により変換するとともに予告命令の挿入処理を施すことによって生成された命令列の一部が図11の(b)に示されている。
 図11の(b)には、第1の命令列(memolw)、第2の命令列(lw)、第3の命令列(lw)、第4の命令列(move)、第5の命令列(move)、第6の命令列(sw)、および第7の命令列(jalr)が示されている。ここでは、関数の引数の入力値A乃至Eが全て整数であることを想定している。
 第1の命令列において、予告設定命令(memolw)が実行される。これにより、レジスタ28(R28)に格納されている基準アドレスに、オフセット値「2000」が加算され、その加算された値のメモリアドレスに記憶されたデータ(関数funcの先頭アドレス)がレジスタ25(R25)に転送される。すなわち、実行部330は、予告設定命令に含まれる関数の先頭アドレスの設定先を示す設定情報を基づいて、関数の先頭アドレスを設定先に設定する。
 これとともに、命令デコーダ320により供給される取得信号に基づいて、入力選択部332から出力される関数アドレスが実行履歴検索部410により取得される。そして、実行履歴検索部410によりその関数アドレスが履歴メモリ430に入力されることによって、実行履歴の検索が行われる。
 第2の命令列において、ロードワード命令(lw)が実行される。これにより、レジスタ28(R28)に格納されている基準アドレスにオフセット値「1000」が加算され、その加算された値である主記憶部130のメモリアドレスに記憶されたデータ(第1の引数の入力値A)がレジスタ4(R4)に転送される。
 このロードワード命令(lw)は、そのロードワード命令(lw)に示された転送先レジスタ番号が「R4」であることから、命令デコーダ320により、引数の入力値を設定する入力値設定命令であると判断される。このため、レジスタ4(R4)に転送される入力値Aが実行履歴検索部410にも供給され、履歴メモリ430に保持されている第1の引数の入力値と比較される。
 このとき、履歴メモリ430に保持された第1の引数の入力値のうち、入力値Aが保持されていれば、第2の引数の入力値の比較処理に進む。一方、入力値Aが保持されていない場合には、実行履歴の検索を終了する。
 第3の命令列において、ロードワード命令(lw)が実行される。これにより、レジスタ28(R28)に格納されている基準アドレスにオフセット値「1004」が加算され、その加算された値である主記憶部130のメモリアドレスに記憶されたデータ(第2の引数の入力値B)がレジスタ5(R5)に転送される。
 このロードワード命令(lw)は、そのロードワード命令(lw)に示された転送先レジスタ番号が「R5」であることから、命令デコーダ320により、引数の入力値を設定する入力値設定命令であると判断される。このため、レジスタ5(R5)に格納される入力値Bが実行履歴検索部410にも供給され、履歴メモリ430に保持されている第2の引数の入力値と比較される。
 このとき、履歴メモリ430に保持された第2の引数の入力値のうち、入力値Bが保持されていれば、第3の引数の入力値の比較処理に進む。一方、入力値Bが保持されていない場合には、実行履歴の検索を終了する。
 第4の命令列において、ムーブ命令(move)が実行される。これにより、レジスタ10(R10)に格納されているデータ(第3の引数の入力値C)がレジスタ6(R6)に転送される。このムーブ命令(move)は、その転送先レジスタ番号が「R6」であることから、命令デコーダ320により引数の入力値を設定する入力値設定命令であると判断される。これにより、レジスタ6(R6)に格納される入力値Cが実行履歴検索部410にも供給されるため、実行履歴検索部410に供給された入力値Cと、履歴メモリ430に保持されている第3の引数の入力値とが比較される。
 このとき、履歴メモリ430に保持された第3の引数の入力値のうち入力値Cが保持されていれば、第4の引数の入力値の比較処理に進む。一方、入力値Cが保持されていない場合には、実行履歴の検索を終了する。
 第5の命令列において、ムーブ命令(move)が実行される。これにより、レジスタ11(R11)に格納されているデータ(第4の引数の入力値D)がレジスタ7(R7)に転送される。このムーブ命令(move)は、そのムーブ命令(move)に示された転送先レジスタ番号が「R7」であることから、命令デコーダ320により、引数の入力値を設定する入力値設定命令であると特定される。このため、レジスタ7(R7)に格納される入力値Dが実行履歴検索部410にも供給され、履歴メモリ430に保持されている第4の引数の入力値と比較される。
 このとき、履歴メモリ430に保持された第4の引数の入力値のうち入力値Dが保持されていれば、第5の引数の入力値の比較処理に進む。一方、入力値Dが保持されていない場合には、実行履歴の検索を終了する。
 第6の命令列において、ストアワード命令(sw)が実行される。これにより、レジスタ29(R29)に格納されているスタックポインタの値に「16」が加算され、その加算された値のメモリアドレスにレジスタ12(R12)に格納されているデータ(第5の引数の入力値E)が転送される。このストアワード命令(sw)は、そのストアワード命令(sw)に示された転送先レジスタ番号が「R29」であり、オフセット値が「16」以上であることから、命令デコーダ320により、引数の入力値を設定する入力値設定命令であると判断される。
 これにより、主記憶部130に転送された入力値Eが実行履歴検索部410にも供給され、その供給された入力値Eと、履歴メモリ430に保持されている第5の引数の入力値とが比較される。このとき、履歴メモリ430に保持された第5の引数の入力値のうち、入力値Eが保持されていれば、全ての引数の入力値A乃至Eが一致する実行履歴における実行結果が実行履歴検索部410に出力される。一方、入力値Aが保持されていない場合には、実行履歴の検索を終了する。
 第7の命令列において、ジャンプ命令(jalr)が実行される。これにより、レジスタ25(R25)に格納されている関数(func)の先頭アドレスの命令が読み出される。このとき、命令デコーダ320により、関数(func)における全ての第1乃至第5引数の入力値の設定が終了したことを示す入力値終了信号が実行履歴検索部410に通知される。
 このとき、履歴メモリ430から実行結果が出力されていれば、実行履歴検索部410により、その実行結果が実行結果出力部420に出力されるとともに、関数(func)の処理を省略するための省略信号がフェッチ部310に供給される。一方、履歴メモリ430から実行結果が出力されていなければ、実行履歴検索部410により、関数(func)の実行後の実行結果と、予告命令に基づいて取得された識別情報および入力値とが履歴メモリ430に登録される。
 このように、本発明の第3の実施の形態では、実行履歴検索部410は、関数の実行前において、その関数に対応する予告設定命令に基づいて設定される関数アドレスを識別情報として取得することができる。これにより、実行履歴検索部410は、実行部330により設定された関数の先頭アドレスと、予告設定命令により取得された関数の入力値とに基づいて、履歴メモリ430における実行結果を検索することができる。
 すなわち、実行結果再利用処理部400は、予告設定命令によって、実行履歴検索部410において識別情報および入力値を取得することができるため、関数の実行前に、履歴メモリ430に保持された実行履歴を検索することができる。
 このように、本発明の第1乃至3の実施の形態では、主記憶部130に記憶されたプログラムに含まれる予告命令に基づいて、関数の実行結果の再利用による処理時間を大幅に短縮することができる。次に、このような予告命令をプログラムに挿入するプログラム変換装置について図面を参照して説明する。
 <4.第4の実施の形態>
 [プログラム変換装置の構成例]
 図12は、本発明の第4の実施の形態におけるプログラム変換処理装置の一機能構成例を示すブロック図である。プログラム変換処理装置500は、ソースプログラム記憶部510と、予告命令挿入コード生成部600と、オブジェクトプログラム記憶部520とを備える。なお、プログラム変換処理装置500は、特許請求の範囲に記載のプログラム変換処理装置の一例である。
 ソースプログラム記憶部510は、コンパイル処理の対象となるソースプログラムを記憶するものである。このソースプログラムは、実行結果が再び利用される再利用区間が含まれるソースプログラムである。このソースプログラム記憶部510は、その記憶されたソースプログラムを予告命令挿入コード生成部600に供給する。
 予告命令挿入コード生成部600は、ソースプログラム記憶部510からのソースプログラムをコンパイルすることによって、予告命令を挿入するための処理を施した後に、機械語プログラムであるオブジェクトプログラムを生成するものである。この予告命令挿入コード生成部600は、その生成されたオブジェクトプログラムをオブジェクトプログラム記憶部520に記憶させる。この予告命令挿入コード生成部600は、プログラム解析部610と、プログラム最適化処理部620と、コード生成部630とを備える。
 プログラム解析部610は、ソースプログラム記憶部510から読み出したソースプログラムに基づいて形態素解析や構文解析などの解析処理を実行するものである。このプログラム解析部610は、解析または最適化に適した形式の中間コードによって表現された中間表現によるプログラムを生成して、その生成されたプログラムに解析処理を実行する。
 また、このプログラム解析部610は、再利用候補区間抽出部611および再利用候補区間解析部612を備える。再利用候補区間抽出部611は、複数の命令区間のうち、実行結果を再利用する再利用区間の候補となる再利用候補区間をプログラムから抽出するものである。この再利用候補区間抽出部611は、例えば、複数回実行される命令区間である複数の関数のうち、再利用候補区間となる関数を抽出する。
 また、再利用候補区間抽出部611は、再利用候補区間の入力値が同じでも異なる実行結果になるため、実行結果が再利用できない関数を再利用候補区間から除外する。この再利用候補区間抽出部611は、例えば、命令区間に分岐命令を含むような関数を再利用候補区間から除外する。この再利用候補区間抽出部611は、その抽出された再利用候補区間の識別情報をプログラムとともに再利用候補区間解析部612に供給する。
 再利用候補区間解析部612は、再利用候補区間抽出部611により抽出された再利用候補区間の使用態様を解析するものである。この再利用候補区間解析部612は、例えば、関数における引数の個数および型と、その1つの関数が実行される回数とを使用態様として関数ごとに解析する。この例において、再利用候補区間解析部612は、例えば、関数の処理内容から引数の採り得る範囲の数を使用態様の解析結果として出力する。この再利用候補区間解析部612は、その解析結果を、再利用候補区間の識別情報およびプログラムとともにプログラム最適化処理部620に供給する。
 プログラム最適化処理部620は、再利用候補区間解析部612から供給されたプログラムに基づいて、プログラムの実行速度を向上させるための最適化、および、コードサイズを削減するための最適化などを行うプログラム最適化処理を実行するものである。このプログラム最適化処理部620は、再利用度生成部621と、再利用区間選択部622と、予告命令生成処理部623とを備える。
 再利用度生成部621は、再利用候補区間解析部612から供給された解析結果に基づいて、再利用候補区間の実行結果が再び利用される度合いを示す再利用度を生成するものである。すなわち、再利用度生成部621は、複数回実行される命令区間の各々の実行結果が互いに一致する度合いを示す再利用度を、命令区間の使用態様に基づいて命令区間ごとに生成する。
 この再利用度生成部621は、例えば、再利用候補区間が実行される実行回数に応じて再利用度を生成する。この場合において、再利用度生成部621は、例えば、実行回数が大きいほど再利用度を大きく設定する。また、この再利用度生成部621は、例えば、再利用候補区間の入力値が採り得る範囲の数に応じて再利用度を生成する。この場合には、再利用度は、例えば、組合せの数の逆数に定数を乗算することによって算出される。このため、再利用候補区間の再利用度が大きいほど、再利用される度合いが高い再利用候補区間であることを意味する。
 この再利用度生成部621は、その生成された再利用度を、プログラムおよび再利用候補区間の識別情報とともに再利用区間選択部622に供給する。なお、再利用度生成部621は、特許請求の範囲に記載の再利用度生成部の一例である。
 再利用区間選択部622は、再利用度生成部621から供給された再利用候補区間の再利用度に基づいて、複数の再利用候補区間のうち、再利用区間を選択するものである。この再利用区間選択部622は、例えば、再利用度に関する一定の閾値(再利用閾値)以上である再利用候補区間を再利用区間として選択する。
 また、再利用区間選択部622は、例えば、履歴メモリ430における識別情報ごとの実行履歴を削除する際の優先度を再利用度に基づいて生成する。この例において、再利用区間選択部622は、再利用度が高いほど優先度が低くなるように優先度を生成する。また、再利用区間選択部622は、その選択された再利用区間に関する識別情報および優先度を、プログラムとともに予告命令生成処理部623に供給する。
 予告命令生成処理部623は、再利用区間選択部622により選択された再利用区間を呼び出すための呼出し命令の前に、その再利用区間を特定するための情報を含む予告命令を生成するものである。この予告命令生成処理部623は、その予告命令から呼出し命令の直前の命令までに、再利用区間の入力値を設定するための入力値設定命令を生成する。
 すなわち、予告命令生成処理部623は、複数の命令区間のうち、再利用度に基づいて選択された再利用区間における入力値を設定する入力値設定命令の直前に、再利用区間における入力値の設定を予告する予告命令を生成する。この予告命令生成処理部623は、例えば、再利用区間である関数の呼出し命令の前に予告命令を挿入するとともに、その予告命令と呼出し命令との間に入力値設定命令を生成する。
 また、予告命令生成処理部623は、例えば、呼出し命令の前において、その呼出し命令によって呼び出される関数の識別情報が含まれる予告命令を生成する。すなわち、予告命令生成処理部623は、再利用度に基づいて選択された複数の再利用区間を互いに識別するための識別情報を含む予告命令を生成する。この予告命令生成処理部623は、例えば、図5の(b)に表わしたように、インデックス(index)により示される識別情報を含む予告命令(noticeCall)を生成する。
 また、予告命令生成処理部623は、例えば、呼出し命令の前に、その呼出し命令の実行のためにレジスタファイル340に予め設定された関数の先頭アドレスを参照するための参照情報が含まれる予告命令を挿入する。この場合、予告命令生成処理部623は、参照情報を含む予告命令の前に、関数の先頭アドレスをレジスタファイル340に設定するためのアドレス設定命令を生成する。すなわち、予告命令生成処理部623は、再利用区間の先頭アドレスを設定するためのアドレス設定命令の後に、その先頭アドレスを参照するための参照情報を含む予告命令を生成する。この例において、予告命令生成処理部623は、例えば、図9の(b)に示すように参照情報(R25)を含む予告命令(noticeCall)を生成する。
 その他の例として、予告命令生成処理部623は、呼出し命令の前に、その呼出し命令の飛越し先である関数の先頭アドレスの設定先を示す設定情報が含まれる予告命令を予告設定命令として生成する。すなわち、予告命令生成処理部623は、再利用区間の先頭アドレスを設定するために、関数の先頭アドレスの設定先が示された設定情報を含むアドレス設定命令として予告命令を生成する。この例において、予告命令生成処理部623は、例えば、図11の(b)に示すように予告設定命令(memolw)を生成する。
 また、予告命令生成処理部623は、例えば、識別情報を含む予告命令、または、参照情報を含む予告命令を生成するにあたり、再利用区間選択部622により生成された優先度をさらに含めた予告命令を、呼出し命令の前に生成する。すなわち、予告命令生成処理部623は、再利用度生成部621により生成された再利用度に応じて付与された優先度を含む予告命令を生成する。
 また、この予告命令生成処理部623は、その生成された予告命令を含む最適化されたプログラムをコード生成部630に供給する。なお、予告命令生成処理部623は、特許請求の範囲に記載の予告命令生成処理部の一例である。
 コード生成部630は、予告命令生成処理部623から供給された最適化されたプログラムに基づいて、機械語プログラムのコードであるオブジェクトプログラムを生成するものである。このコード生成部630は、その生成したオブジェクトプログラムをオブジェクトプログラム記憶部520に供給する。
 オブジェクトプログラム記憶部520は、コード生成部630から供給されたオブジェクトプログラムを記憶するものである。このオブジェクトプログラム記憶部520に記憶されたオブジェクトプログラムが、図1に示した主記憶部130に記憶される。
 このように、予告命令生成処理部623を設けることによって、再利用区間の呼出し命令の実行前にその呼出し命令の実行を予告する予告命令が実行されるプログラムを生成することができる。また、再利用度生成部621を設けることによって、複数回実行される命令区間の使用態様に基づいて再利用度が生成されるため、複数の命令区間のうち、実行結果が再利用される確率の高い命令区間を再利用区間として選択することができる。
 [予告命令のデータフォーマットの例]
 図13は、本発明の第4の実施の形態におけるプログラム変換処理装置500により生成される予告命令のデータフォーマットを例示する図である。ここでは、MIPSの規定による32ビット命令のデータフォーマットに基づく予告命令の例について示す。
 図13の(a)は、識別情報を含む予告命令のデータフォーマットを示す図である。図13の(b)は、参照情報を含む予告命令のデータフォーマットを示す図である。図13の(c)は、予告設定命令のデータフォーマットを示す図である。
 図13の(a)には、オペレーションコード711、インデックス712、優先度713および機能コード714を表わすフィールドがそれぞれ示されている。オペレーションコード711には、特殊命令(SPECIAL)を示す「000000」が26乃至31ビットに格納される。
 インデックス712には、再利用区間選択部622により選択された複数の関数を互いに識別するための識別情報が10乃至25ビットに格納される。優先度713には、履歴メモリ430における実行履歴を削除する際の優先度が6乃至9ビットに格納される。この優先度713には、再利用区間選択部622により生成された優先度の値が格納される。機能コード714には、予告命令(noticeCall)として「000101」が0乃至5ビットに格納される。
 図13の(b)には、オペレーションコード721、優先度722、転送先レジスタ723および機能コード724を表わすフィールドがそれぞれ示されている。オペレーションコード711には、特殊命令(SPECIAL)を示す「000000」が26乃至31ビットに格納される。
 優先度722には、履歴メモリ430の実行履歴を削除する際の優先度が11乃至25ビットに格納される。この優先度722には、再利用区間選択部622により生成された優先度の値が格納される。転送先レジスタ723には、参照情報として、関数の先頭アドレスが格納されているレジスタ番号が6乃至10ビットに格納される。機能コード724には、予告命令(noticeCall)として「000101」が0乃至5ビットに格納される。
 図13の(c)には、オペレーションコード731、基準レジスタ732、転送先レジスタ733およびオフセット734を表わすフィールドがそれぞれ示されている。オペレーションコード731には、予告設定命令(memolw)を示す「011111」が26乃至31ビットに格納される。
 基準レジスタ732には、基準アドレスが格納されているレジスタ番号(R25)が21乃至25ビットに格納される。転送先レジスタ733には、設定先を示す設定情報として、関数を呼び出すための関数の先頭アドレスが設定されるレジスタ番号が16乃至20ビットに格納される。オフセット734には、基準アドレスに対するオフセット値が0乃至15ビットに格納される。
 このような予告命令または予告設定命令が、関数を呼び出すための呼出し命令の前に、予告命令生成処理部623によって生成される。
 [プログラム変換処理装置500の動作例]
 次に本発明の第4の実施の形態におけるプログラム変換処理装置500の動作について図面を参照して説明する。
 図14は、本発明の第4の実施の形態におけるプログラム変換処理装置500の予告命令生成処理方法の処理手順の一例を示すフローチャートである。
 まず、再利用候補区間抽出部611により、ソースプログラム記憶部510からソースプログラムが読み出される(ステップS931)。そして、再利用候補区間抽出部611により、複数回実行される命令区間である複数の関数のうち、再利用候補区間となる関数が抽出される(ステップS932)。
 続いて、再利用候補区間解析部612により、再利用候補区間抽出部611において抽出された再利用候補区間の使用態様が解析される(ステップS933)。この後、再利用度生成部621により、再利用候補区間の使用態様に基づいて再利用候補区間ごとに再利用度が生成される(ステップS934)。なお、ステップS934は、特許請求の範囲に記載の再利用度生成手順の一例である。
 そして、再利用区間選択部622により、再利用候補区間ごとの再利用度に基づいて再利用区間が選択される(ステップS935)。次に、予告命令生成処理部623により、再利用区間を呼び出す呼出し命令の前に予告命令を生成して、その生成された予告命令から呼出し命令の間に入力値設定命令を生成する予告命令生成処理が実行される(ステップS940)。なお、ステップS940は、特許請求の範囲に記載の予告命令生成手順の一例である。
 その後、コード生成部630により、予告命令生成処理部623から供給された最適化されたプログラムに基づいて、オブジェクトプログラムが生成される(ステップS936)。次に、図13の(a)乃至(c)に示した予告命令ごとの予告命令生成処理の処理手順例について以下に図面を参照して説明する。
 [識別情報を含む予告命令における予告命令生成処理例]
 図15は、本発明の第4の実施の形態における識別情報を含む予告命令についての予告命令処理(ステップS940)の処理手順の一例を示すフローチャートである。
 まず、予告命令生成処理部623により、再利用区間の呼出し命令の前に、識別情報を含む予告命令が生成される(ステップS942)。例えば、図5の(b)に示した第1の命令列のように、インデックス(index)を指定する予告命令(noticeCall)が生成される。
 次に、予告命令生成処理部623により、識別情報を含む予告命令の後に、再利用区間の入力値を設定するための入力値設定命令が生成される(ステップS943)。例えば、図5の(b)に示した第2乃至第6の命令列のように、入力値設定命令(2つのロードワード命令、2つのムーブ命令およびストアワード命令)が生成される。
 そして、予告命令生成処理部623により、入力値設定命令の後に、再利用区間の先頭アドレスを設定するためのアドレス設定命令が生成される(ステップS944)。例えば、図5の(b)に示した第7の命令列のように、アドレス設定命令(ロードワード命令)が生成される。
 その後、予告命令生成処理部623により、アドレス設定命令の後に、再利用区間の呼出し命令が生成される(ステップS945)。例えば、図5の(b)に示した第8の命令列のように、呼出し命令(ジャンプ命令)が生成される。
 予告命令生成処理部623により、ステップS942乃至S945の一連の処理が全ての再利用区間を対象に施されるまで繰り返し行われ(ステップS946)、全ての再利用区間に対する処理が終了することによって、予告命令生成処理が終了する。
 [参照情報を含む予告命令における予告命令生成処理例]
 図16は、本発明の第4の実施の形態における参照情報を含む予告命令についての予告命令処理(ステップS950)の処理手順の一例を示すフローチャートである。
 まず、予告命令生成処理部623により、再利用区間の先頭アドレスを設定するためのアドレス設定命令が生成される(ステップS951)。例えば、図9の(b)に示した第1の命令列のように、アドレス設定命令(ロードワード命令)が生成される。
 そして、予告命令生成処理部623により、アドレス設定命令の後に、参照情報を含む予告命令が生成される(ステップS952)。例えば、図9の(b)に示した第2の命令列のように、参照情報(R25)を示す予告命令(noticeCall)が生成される。
 次に、予告命令生成処理部623により、参照情報を含む予告命令の後に、再利用区間の入力値を設定するための入力値設定命令が生成される(ステップS943)。例えば、図9の(b)に示した第3乃至第7の命令列のように、入力値設定命令(2つのロードワード命令、2つのムーブ命令およびストアワード命令)が生成される。
 その後、予告命令生成処理部623により、入力値設定命令の後に、再利用区間の呼出し命令が生成される(ステップS945)。例えば、図9の(b)に示した第8の命令列のように、呼出し命令(ジャンプ命令)が生成される。
 予告命令生成処理部623により、ステップS951、S952、S943およびS945の一連の処理が全ての再利用区間を対象に施されるまで繰り返し行われる(ステップS946)。そして、全ての再利用区間に対する処理が終了することによって、予告命令生成処理が終了する。
 [予告設定命令における予告命令生成処理例]
 図17は、本発明の第4の実施の形態における予告設定命令についての予告命令処理(ステップS960)の処理手順の一例を示すフローチャートである。
 まず、予告命令生成処理部623により、再利用区間の先頭アドレスを設定するための予告設定命令が生成される(ステップS961)。例えば、図11の(b)に示した第1の命令列のように、予告設定命令(memolw)が生成される。
 次に、予告命令生成処理部623により、予告設定命令の後に、再利用区間の入力値を設定するための入力値設定命令が生成される(ステップS943)。例えば、図11の(b)に示した第2乃至第6の命令列のように、入力値設定命令(2つのロードワード命令、2つのムーブ命令およびストアワード命令)が生成される。
 その後、予告命令生成処理部623により、入力値設定命令の後に、再利用区間の呼出し命令が生成される(ステップS946)。例えば、図11の(b)に示した第7の命令列のように、呼出し命令(ジャンプ命令)が生成される。
 予告命令生成処理部623により、ステップS961、S943およびS945の一連の処理が全ての再利用区間を対象に施されるまで繰り返し行われる(ステップS946)。そして、全ての再利用区間に対する処理が終了することによって、予告命令生成処理が終了する。
 このように、本発明の第4の実施の形態では、再利用区間の呼出し命令の前に予告命令を生成することによって、データ処理装置100による実行結果の再利用による再利用区間の処理時間を削減することができる。また、再利用度に基づいて選択された再利用区間に予告命令生成処理を施すことによって、データ処理装置100における実行結果の再利用率を向上させることができる。
 このように、本発明の実施の形態によれば、再利用区間における処理の実行を予告する予告命令に基づいてその再利用区間の実行結果の再利用処理を行うことによって、再利用区間の処理時間を大幅に削減することができる。
 次に、第2の本発明であるプログラム変換処理装置、データ処理装置、プログラム変換処理方法およびデータ処理方法について、図18乃至図44を参照して説明する。
 以下、第2の本発明を実施するための形態(以下、実施の形態と称する)について説明する。説明は以下の順序により行う。
 1.第1の実施の形態(コンパイル処理制御:実行履歴のデータ量の総和が履歴メモリの容量以内となるように呼出し命令を再利用命令に変換する例)
 2.第2の実施の形態(データ処理制御:実行履歴のデータ量の総和が履歴メモリの容量以内となるように変換された再利用命令に基づいて実行履歴を保持する例)
 3.第3の実施の形態(コンパイル処理制御:優先度を含む再利用命令に変換する例)
 4.第4の実施の形態(データ処理制御:優先度を含む再利用命令に基づいて実行履歴を保持する例)
 <1.第1の実施の形態>
 [コンパイル処理装置1500の構成例]
 図18は、本発明の第1の実施の形態におけるコンパイル処理装置1500の構成例を示すブロック図である。このコンパイル処理装置1500は、ソースプログラム記憶部1510と、再利用アシストコンパイル処理部1520と、オブジェクトプログラム記憶部1530とを備える。また、ここでは、コンパイル処理装置1500が処理する命令区間は関数を想定するものとする。
 ソースプログラム記憶部1510は、コンパイルを行うソースプログラムを記憶するものである。このソースプログラムは、例えば、実行結果が再び利用される再利用区間が含まれるソースプログラムである。このソースプログラム記憶部1510は、記憶したソースプログラムを再利用アシストコンパイル処理部1520に供給する。
 再利用アシストコンパイル処理部1520は、ソースプログラム記憶部1510から読み出したソースプログラムをコンパイルすることによって、再利用命令を付した後に、機械語プログラムであるオブジェクトプログラムを生成するものである。ここにいう再利用命令とは、再利用区間と再利用しない区間とを再利用される度合いに基づいて区別することによって、再利用区間が呼出された際に実行結果を再利用するための処理をデータ処理装置に行わせる命令である。この再利用アシストコンパイル処理部1520は、その生成したオブジェクトプログラムをオブジェクトプログラム記憶部1530に供給する。この再利用アシストコンパイル処理部1520は、プログラム変換処理部1600およびコード生成部1522を備える。
 プログラム変換処理部1600は、ソースプログラム記憶部1510から読み出されたソースプログラムを解析して、最適化することによって、ソースプログラムを再利用命令が含まれる効率の高いプログラムに変換するものである。このプログラム変換処理部1600は、ソースプログラム解析部1610および最適化部1620を備える。なお、プログラム変換処理部1600は、特許請求の範囲に記載のプログラム変換処理装置の一例である。
 ソースプログラム解析部1610は、ソースプログラム記憶部1510から読み出されたソースプログラムに基づいて形態素解析や構文解析などを行うものである。また、このソースプログラム解析部1610は、解析や最適化に適した形式の中間コードのプログラムを生成した後に、その生成されたプログラムの解析を行う。このソースプログラム解析部1610は、再利用候補区間抽出部1611および再利用候補区間解析部1612を備える。
 再利用候補区間抽出部1611は、複数の命令区間のうち、実行結果を再利用する再利用区間の候補となる再利用候補区間をプログラムから抽出するものである。この再利用候補区間抽出部1611は、関数およびループなどの複数回呼び出される可能性がある命令区間を再利用候補区間として抽出する。
 また、この再利用候補区間抽出部1611は、入力値が同じでも異なる実行結果になる関数などの実行結果が再利用できる可能性が無い関数を、再利用候補区間から除外する。また、再利用候補区間抽出部1611は、例えば、システムコールを含む関数をこの除外される関数として除外する。この再利用候補区間抽出部1611は、抽出した再利用候補区間の識別情報をプログラムとともに再利用候補区間解析部1612に供給する。
 再利用候補区間解析部1612は、再利用候補区間抽出部1611により抽出された再利用候補区間に関する使用態様を解析するものである。この再利用候補区間解析部1612は、例えば、関数およびループの入力値である引数に関する内容と、関数およびループの呼出し回数に関する内容とを使用態様として解析する。また、再利用候補区間解析部1612は、例えば、関数およびループの処理内容に基づいて引数の採り得る値の組合せを解析することによって、推定組合せ値を解析結果として出力する。
 また、この再利用候補区間解析部1612は、最適化部1620において実行結果を再利用するためのデータである実行履歴のデータ量を予測する場合には、再利用候補区間を実行した結果である実行結果に関する内容を解析する。この再利用候補区間解析部1612は、この解析の結果を、再利用候補区間の識別情報およびプログラムとともに最適化部1620に供給する。なお、再利用候補区間解析部1612は、特許請求の範囲に記載の解析部の一例である。また、再利用候補区間は、特許請求の範囲に記載の命令区間の一例である。
 最適化部1620は、再利用候補区間解析部1612から供給されたプログラムに基づいて、実行速度の向上のための最適化およびコードサイズの削減のための最適化などのプログラム最適化処理を行うものである。この最適化部1620は、再利用度生成部1621および再利用命令変換部1623を備える。
 再利用度生成部1621は、再利用候補区間解析部1612から供給された解析結果に基づいて、再利用候補区間の実行結果が再び利用される度合いを示す再利用度を生成するものである。この再利用度生成部1621は、例えば、再利用候補区間の入力値が採り得る値の組合せに応じて再利用度を生成する。この場合には、再利用候補区間の入力値が採り得る値の組合せが少ないほど再利用される度合いは高くなるため、入力値が採り得る値の組合せを分母とする再利用度を生成する。
 この再利用度生成部1621は、その生成した再利用度を再利用候補区間の識別情報およびプログラムとともに再利用命令変換部1623に供給する。なお、再利用度生成部1621は、特許請求の範囲に記載の再利用度生成部の一例である。
 再利用命令変換部1623は、再利用度生成部1621から供給された再利用度に基づいて、実行結果を再利用させる再利用候補区間の呼出し命令を再利用命令に変換するものである。この再利用命令変換部1623は、その変換した命令を含む最適化されたプログラムをコード生成部1522に供給する。
 また、再利用命令変換部1623は、例えば、再利用度と、再利用候補区間の実行履歴のデータ量の予測値と、実行履歴が登録される履歴メモリの容量とに基づいて、実行結果を再利用させる再利用区間の呼出し命令を再利用命令に変換する。この例において、再利用命令変換部1623は、再利用候補区間の入力値の採り得る値の組合せと、入力値の個数と、実行結果の個数と、入力値および実行結果のビット数とに応じて実行履歴のデータ量の予測値を生成する。そして、再利用命令変換部1623は、実行履歴のデータ量の予測値の総和が履歴管理部の容量以内となるように、再利用度が最も高い再利用候補区間から順に呼出し命令を再利用命令に変換する。なお、再利用命令変換部1623は、特許請求の範囲に記載の命令変換部の一例である。
 コード生成部1522は、再利用命令変換部1623から供給された最適化されたプログラムに基づいて、機械語プログラムのコードであるオブジェクトプログラムを生成するものである。このコード生成部1522は、その生成したオブジェクトプログラムをオブジェクトプログラム記憶部1530に供給する。
 オブジェクトプログラム記憶部1530は、コード生成部1522から供給されたオブジェクトプログラムを記憶するものである。
 このように、コンパイル処理装置1500は、関数の実行結果が再利用される度合いに応じて関数の呼出し命令を再利用命令に変換することによって、再利用される関数と再利用されない関数とが区別できるプログラムを生成する。
 なお、ここでは、コンパイル処理装置1500は、関数を再利用対象とする例について説明したが、ループに関しても同様に再利用対象とすることができる。例えば、再利用候補区間解析部1612は、ループに関しても関数と同様に解析し、再利用度生成部1621は、再利用候補区間解析部1612の解析結果に基づいて再利用度を生成する。
 なお、ここでは、便宜上、再利用候補区間解析部1612が再利用候補区間の使用態様を関数毎に解析する例について説明したが、より詳細に使用態様を解析するために関数の呼出し命令毎に解析するものとしてもよい。また、再利用度生成部1621についても再利用度を関数毎に生成する例について説明したが、より詳細に解析するために関数の呼出し命令毎に生成するものとしてもよい。この場合において、再利用命令変換部1623は、関数は同じであっても関数の呼出し命令毎に異なる再利用度に基づいて、関数の呼出し命令毎に呼出し命令を再利用命令に変換する。
 [再利用候補区間抽出部1611が再利用候補区間から除外する関数の例]
 図19は、本発明の第1の実施の形態において再利用候補区間抽出部1611が再利用候補区間を抽出する際に、再利用候補区間から除外される関数の一例を示す模式図である。ここでは、再利用候補区間抽出部1611により再利用候補区間から除外される関数が各枠の中にC言語のコードにより示されている。
 図19の(a)には、再利用候補区間から除外される関数として、システムコールを含む関数(funcA)が示されている。このシステムコールを含む関数(funcA)は、入力値が同じ場合でも実行される度に実行結果が異なる可能性が高い。このため、システムコールを含む関数(funcA)は、再利用区間として用いることができない。したがって、再利用候補区間抽出部1611は、再利用候補区間からシステムコールを含む関数を除外する。
 図19の(b)には、再利用候補区間から除外される関数として、乱数発生関数(rand)が示されている。この乱数発生関数(rand)は、呼出す度にランダムな値を実行結果として出力する関数である。このため、再利用候補区間抽出部1611は、再利用候補区間から乱数発生関数を除外する。
 このように、再利用候補区間抽出部1611は、ソースプログラムを解析する段階において実行結果が再利用される可能性が低い関数を再利用候補区間から除外する。
 [再利用候補区間解析部1612によって解析される命令区間の使用態様および再利用度生成部1621において生成される再利用度の一例]
 次に、本発明の第1の実施の形態における再利用候補区間解析部1612により解析される命令区間の使用態様の一例および再利用度生成部1621により生成される再利用度の関係例について次図を参照して説明する。ここでは、再利用候補区間は関数であると想定する。また、再利用度が大きいものほど再利用される度合いが大きく、再利用命令変換部1623において優先的に呼出し命令が再利用命令に変換されるものとする。
 [引数の個数に基づく再利用度の生成例]
 図20は、本発明の第1の実施の形態における再利用候補区間解析部1612により引数の個数を使用態様として解析する場合における再利用度生成部1621による再利用度の生成例を示す模式図である。
 図20の(a)は、引数の個数が異なる関数の一例を示す模式図である。ここには、再利用候補区間抽出部1611において抽出された再利用候補区間のうち、入力値である引数の型は同じだが引数の個数は異なる3つの関数(funcA乃至C)が示されている。
 この3つの関数としては、int(integer)型の1個の変数を引数とする関数(funcA)と、int型の2個の変数を引数とする関数(funcB)と、int型の3個の変数を引数とする関数(funcC)とがC言語のコードにより示されている。
 この3つの関数(funcA乃至C)を解析する場合において、再利用候補区間解析部1612は、その3つの関数(funcA乃至C)における引数の個数について関数毎に解析を行う。そして、再利用度生成部1621は、再利用候補区間解析部1612が解析した引数の個数に基づいて再利用度を生成する。
 図20の(b)は、図20の(a)において示した関数の解析結果に基づいて生成される再利用度の一例を示す模式図である。ここには、図20の(a)において示した3つの関数(funcA乃至C)の再利用度の度合いの順序関係が示されている。ここでは、引数が1個の関数(funcA)の再利用度が1番高く、引数が2個の関数(funcB)の再利用度が2番目に高く、引数が3個の関数(funcC)の再利用度が1番低いことが示されている。
 このように、引数の型は同じだが引数の個数は異なる複数の関数については、引数の個数が少ない関数ほど入力値が一致する度合いは高くなるため、再利用度生成部1621は、引数の個数が最も少ない関数から順に高い度合いを示す再利用度を生成する。
 なお、ここでは、再利用度生成部1621は入力値の個数に応じて再利用度を生成する場合について説明したが、これに限定されるものではない。例えば、複数の引数を入力値とする関数について再利用度を生成する場合には、再利用度生成部1621はそれぞれの引数が採り得る値の組合せに基づいて入力値の組合せを求め、この入力値の組合せの数に応じて再利用度を生成する場合などが考えられる。
 [引数の型に基づく再利用度の生成例]
 図21は、本発明の第1の実施の形態における再利用候補区間解析部1612により引数の型を使用態様として解析する場合における再利用度生成部1621による再利用度の生成例を示す模式図である。
 図21の(a)は、引数の型が異なる関数の一例を示す模式図である。ここには、再利用候補区間抽出部1611において抽出された再利用候補区間のうち、引数の個数は同じだが引数の型は異なる3つの関数(funcA乃至C)が示されている。
 この3つの関数として、ここでは、1ビットのバイナリ数値データであるbool(Boolean)型の1個の変数を引数とする関数(funcA)がC言語のコードにより示されている。さらに、16ビットのバイナリ文字データであるchar型の1個の変数を引数とする関数(funcB)と、32ビットのバイナリ数値データであるint型の1個の変数を引数とする関数(funcC)とがC言語のコードにより示されている。
 この3つの関数(funcA乃至C)を解析する場合において、再利用候補区間解析部1612は、この3つの関数における引数の型について関数毎に解析を行う。そして、再利用度生成部1621は、再利用候補区間解析部1612が解析した引数の型に基づいて再利用度を生成する。
 図21の(b)は、図21の(a)において示した関数の解析結果に基づいて生成される再利用度の一例を示す模式図である。ここには、図21の(a)において示した3つの関数(funcA、funcB、および、funcC)の再利用度の度合いの順序関係が示されている。ここでは、bool型の1個の変数を引数とするfuncAの再利用度が1番高く、char型の1個の変数を引数とするfuncBの再利用度が2番目に高く、int型の1個の変数を引数とするfuncCの再利用度が1番低いことが示されている。
 このように、引数の個数は同じだが引数の型は異なる複数の関数については、引数の表現力(引数が採り得る値の組合せ)が低い関数ほど入力値が一致する度合いは高くなる。このため、再利用度生成部1621は、引数の表現力が最も低い関数から順に高い度合いを示す再利用度を生成する。この引数の表現力は、引数の型のビット数から判断することができる。したがって、再利用度生成部1621は、引数の型のビット数が最も少ないものを最も表現力が低い引数と判断し、順に引数の表現力を判断する。
 [引数に定数を含む関数に対する再利用度の生成例]
 図22は、本発明の第1の実施の形態における再利用候補区間解析部1612により定数と変数とで異なる引数を使用態様として解析する場合における再利用度生成部1621による再利用度の生成例を示す模式図である。
 図22の(a)は、引数が定数および変数のいずれである関数の一例を示す模式図である。ここには、引数の個数は同じだが定数の引数および変数の引数として異なる2つの関数を含むメインプログラム(main)が示されている。この2つの関数として、ここでは、1個の定数(0)と複数の変数を引数とする関数(funcA)と、1個のint型の変数(a)とfuuncAと同じ複数の変数を引数とする関数(funcB)とがC言語のコードにより示されている。
 この2つの関数(funcAおよびB)を解析する場合において、再利用候補区間解析部1612は、この2つの関数における引数が定数および変数のいずれであるかについて関数毎に解析を行う。そして、再利用度生成部1621は、再利用候補区間解析部1612が解析した結果に基づいて再利用度を生成する。
 図22の(b)は、図22の(a)において示した関数の解析結果に基づいて生成される再利用度の一例を示す模式図である。ここには、図22の(a)において示した2つの関数(funcAおよびB)の再利用度の度合いの順序関係が示されている。ここでは、1個の定数(0)と複数の変数を引数とする関数(funcA)の再利用度は、1個のint型の変数(a)と第1の関数と同じ複数の変数を引数とする関数(funcB)の再利用度よりも高ことが示されている。
 ここでは、定数が関数の引数に含まれる場合には、定数である引数は1つの値しか入力値とならないため引数の個数から除外することができる。このため、定数の引数の数が増えるほど入力値が一致する度合いは高くなり実行結果が再利用される度合いは高くなる。このため、再利用度生成部1621は、引数の個数は同じだが定数が引数として含まれる複数の関数について、定数の引数が最も多い関数から順に高い度合いを示す再利用度を生成する。
 なお、ここでは、定数である引数を引数の個数から除外することによって再利用度を生成したが、これだけに限定されるものではない。例えば、定数は入力値の採り得る値を「1」とし、定数の採り得る値と各変数の採り得る値とを掛け合わせることによって、入力値全体の採り得る値の組合せを生成して、その生成された組合せに応じて再利用度を生成する場合などが考えられる。
 [引数の採る値の組合せに対する再利用度の生成例]
 図23は、本発明の第1の実施の形態における再利用候補区間解析部1612により引数の採る値の組合せを使用態様として解析する場合における再利用度生成部1621による再利用度の生成例を示す模式図である。
 図23の(a)は、引数の採る値の組合せが異なる関数の一例を示す模式図である。ここには、再利用候補区間抽出部1611において抽出された再利用候補区間のうち、引数の個数および型は同じだが引数が採る値が限定されている2つの関数が示されている。
 この2つの関数の一方として、ここでは、1個のint型の変数を引数と定義しているが関数が呼び出される段階で「2」および「3」の2つの値に引数が採る値が限定されている関数(funcA)がC言語のコードにより示されている。他方の関数として、1個のint型の変数を引数と定義しているが関数が呼び出される段階で「2」、「3」、「4」、または、「5」の4つの値に引数が採る値が限定される関数(funcB)がC言語のコードにより示されている。
 この2つの関数(funcAおよびB)を解析する場合において、再利用候補区間解析部1612は、この2つの関数における引数の採る値の組合せについて関数毎に解析を行う。そして、再利用度生成部1621は、再利用候補区間解析部1612が解析した引数の型に基づいて再利用度を生成する。
 図23の(b)は、図23の(a)において示した関数の解析結果に基づいて生成される再利用度の一例を示す模式図である。ここには、図23の(a)において示した2つの関数(funcAおよびB)の再利用度の度合いの順序関係が示されている。ここでは、「2」および「3」の2つの値に引数が採る値が限定される関数(funcA)の再利用度は、「2」、「3」、「4」、または、「5」の4つの値に引数が採る値が限定される関数(funcB)の再利用度よりも高ことが示されている。
 このように、引数の個数および型は同じだが引数の採る値の組合せは異なる複数の関数がある場合には、引数の採る値の組合せがより少ない関数ほど実行結果が再利用される確率は高くなる。このため、再利用度生成部1621は、引数の個数および型は同じだが引数の採る値の組合せは異なる複数の関数について再利用度を生成する場合には、引数の採り得る値の組合せが最も少ない関数から順に高い度合いを示す再利用度を生成する。
 [関数の呼出し回数に基づく再利用度の生成例]
 図24は、本発明の第1の実施の形態における再利用候補区間解析部1612により関数の呼び出される回数を使用態様として解析する場合における再利用度生成部1621による再利用度の生成例を示す模式図である。
 図24の(a)は、関数の呼び出される回数が異なる関数の一例を示す模式図である。ここには、再利用候補区間抽出部1611において抽出された再利用候補区間のうち、呼び出される回数が異なる2つの関数が示されている。
 この2つの関数として、ここでは、1回呼び出される関数(funcA)と、3回呼び出される関数(funcB)とがC言語のコードにより示されている。
 この2つの関数(funcAおよびB)を解析する場合において、再利用候補区間解析部1612は、この2つの関数における呼び出される回数について関数毎に解析を行う。そして、再利用度生成部1621は、再利用候補区間解析部1612が解析した呼び出される回数に基づいて再利用度を生成する。
 図24の(b)は、図24の(a)において示した関数の解析結果に基づいて生成される再利用度の一例を示す模式図である。ここには、図24の(a)において示した2つの関数(funcAおよびB)の再利用度の度合いの順序関係が示されている。ここでは、3回呼び出される関数(funcB)の再利用度は、1回呼び出される関数(funcA)の再利用度よりも高いことが示されている。
 このように、引数の個数および型は同じだが関数が呼び出される回数は異なる複数の関数がある場合には、呼び出される回数がより多い関数ほど実行結果が再利用される確率は高くなる。このため、再利用度生成部1621は、引数は同じだが関数が呼び出される回数は異なる複数の関数について、呼び出される回数が最も多い関数から順に高い度合いを示す再利用度を生成する。
 [メモリアクセスを伴う引数の有無による再利用度の生成例]
 図25は、本発明の第1の実施の形態における再利用候補区間解析部1612によりメモリアクセスを伴う引数の有無を使用態様として解析する場合における再利用度生成部1621による再利用度の生成例を示す模式図である。
 図25の(a)は、引数の設定においてメモリアクセスを伴う関数の一例を示す模式図である。ここには、再利用候補区間抽出部1611において抽出された再利用候補区間のうち、メモリアクセスを伴う引数の有無が異なる2つの関数が示されている。
 この2つの関数のうちの一方として、ここでは、ポインタを備えメモリ領域のアドレスを指定する1個の変数およびその他の複数の変数を引数とする関数(funcA)がC言語のコードにより示されている。他方の関数として、1個のint型の変数およびfuncAと同じその他の複数の変数を引数とする関数(funcB)がC言語のコードにより示されている。
 この2つの関数(funcAおよびB)を解析する場合において、再利用候補区間解析部1612は、この2つの関数におけるメモリアクセスを伴うか否かについて解析を行う。そして、再利用度生成部1621は、再利用候補区間解析部1612が解析した結果に基づいて再利用度を生成する。
 図25の(b)は、図25の(a)において示した関数の解析結果に基づいて生成される再利用度の一例を示す模式図である。ここには、図25の(a)において示した2つの関数(funcAおよびfuncB)の再利用度の度合いの順序関係が示されている。ここでは、1個のint型の変数およびfuncAと同じその他の複数の変数を引数とするfuncBの再利用度は、メモリ領域のアドレスを指定する1個の変数およびその他の複数の変数を引数とするfuncAの再利用度よりも高いことが示されている。
 このように、ポインタを備えメモリ領域のアドレスを指定する引数は、その指定しているアドレスおよび指定先のアドレスの値が2つとも一致しないと実行結果を再利用することができない。すなわち、引数の個数および型は同じだが引数のポインタの有無は異なる複数の関数が再利用候補区間である場合には、ポインタを備える引数がより少ない関数ほど実行結果が再利用される確率は高くなる。
 このため、再利用度生成部1621は、ポインタを備えメモリ領域のアドレスを指定する引数の個数が異なる複数の関数について再利用度を生成する場合には、ポインタを備える引数が最も少ない関数から順に高い度合いを示す再利用度を生成する。すなわち、再利用度生成部1621は、関数がポインタを備える変数によりメモリアドレスを指定してメモリアクセスを伴う変数を引数とする場合にはポインタを備える変数を引数とする関数と比較して低い度合いを示す再利用度を生成する。
 この図22乃至27において示すように、再利用候補区間解析部1612は、再利用候補区間の使用態様を解析し、再利用度生成部1621はその解析結果に基づいて再利用度を生成する。
 なお、図22乃至27では、再利用候補区間解析部1612は、再利用候補区間の使用態様を関数毎に解析し、再利用度生成部1621は関数毎に再利用度を生成する場合について説明したが、これだけに限定されるものではない。例えば、再利用候補区間解析部1612は、関数の呼出し命令毎に呼び出される関数の使用態様を解析し、再利用度生成部1621は関数の呼出し命令毎に再利用度を生成する場合などが考えられる。
 [本発明の第1の実施の形態におけるプログラム変換処理部1600の動作例]
 次に、本発明の第1の実施の形態におけるプログラム変換処理部1600の動作について図面を参照して説明する。
 図26は、本発明の第1の実施の形態におけるプログラム変換処理部1600の第1の動作例を示すプログラムの模式図である。ここでは、再利用候補区間解析部1612は、図20乃至図25において示した使用態様を解析するものと想定する。さらに、ここでは、再利用候補区間解析部1612は、再利用候補区間の処理内容を解析することによって引数の採り得る値の組合せが推測できる場合には、その推測した推測組合せ値を解析結果として出力するものとする。
 また、図26では、再利用命令変換部1623は、再利用度と、プログラムに書き込まれた実行履歴が登録される履歴メモリの容量と、予測される実行履歴のデータ量とに基づいて命令区間の呼出し命令を再利用命令に変換するものとする。さらに、ここでは、命令区間は関数であり、呼出し命令はアセンプリ言語で表現した場合の「call」命令を想定し、再利用命令はアセンブリ言語で「memocall」と表現することを想定する。そして、ここでは、各関数の実行結果は、入力値と同じ型の1個の変数であることを想定する。
 図26の(a)には、データ処理装置1100が容量の小さい履歴メモリを備える場合におけるプログラム変換処理部1600の動作例が示されている。ここでは、右矢印に対して左側にある枠の中には、プログラム変換処理部1600に処理される前のソースプログラムの一例がC言語により示されている。また、右矢印に対して右側にある枠の中には、プログラム変換処理部1600に処理されたプログラムの一例がアセンブリ言語により示されている。
 なお、図26の(a)では、履歴メモリは、1個のbool型の変数を引数とすることによって、1個のbool型の実行結果を出力する関数の実行履歴を5個ほど保持するのに十分な容量であるとする。さらに、履歴メモリは、1個のchar型の変数を引数とすることによって1個のchar型の実行結果を出力する関数の実行履歴は、1個も保持できない容量であると想定する。
 ソースプログラムには、プログラムのメインの関数(funcX)と、そのメインの関数により呼び出される3つの関数とが示されている。この3つの関数として、bool型の1個の変数を引数とする関数(funcA)と、char型の1個の変数を引数とする関数(funcB)と、int型の1個の変数を引数とする関数(funcC)とが表されている。
 まず、プログラム変換処理部1600の再利用候補区間抽出部1611は、ソースプログラムから再利用候補区間を抽出する。このソースプログラムにおいては、bool型の引数を持つ関数(funcA)、char型の引数を持つ関数(funcB)およびint型の引数を持つ関数(funcC)が再利用候補区間として抽出される。
 次に、再利用候補区間解析部1612は、抽出された3つの関数(funcA乃至C)の使用態様を解析する。これにより、funcAの引数がbool型の1個の変数と解析され、funcBの引数がchar型の1個の変数と解析され、funcCの引数がint型の1個の変数と解析される。
 また、再利用候補区間解析部1612は、関数の処理内容に基づいて引数の採り得る値の組合せを推定する。このプログラムにおいて、再利用候補区間解析部1612は、funcBに関しては、実行結果が50個と推定し、funcAおよびfuncCについては、実行結果が推定できなかったとする解析結果を出力することを想定する。
 この場合において、再利用度生成部1621は、再利用候補区間解析部1612からの解析結果に基づいて再利用度を生成する。この再利用度生成部1621は、例えば、bool型の引数を持つ関数(funcA)に関しては、bool型の1個の変数が引数であるため、その引数に関する解析結果から、最大2個の実行履歴を生成する関数と判断する。
 また、再利用度生成部1621は、char型の引数を持つ関数(funcB)に関しては、char型の1個の変数が引数であるため、その引数に関する解析結果から、最大216個の実行履歴を生成すると判断する。さらに、int型の引数を持つ関数(funcC)に関しては、int型の1個の変数が引数であるため、引数に関する解析結果から、最大232個の実行履歴を生成する関数と判断する。これらの判断とともに、再利用度生成部1621は、関数の処理内容に基づいて推定された推定組合せ値を用いて実行履歴の量を判断する。
 その結果、この再利用度生成部1621は、bool型の引数を持つ関数(funcA)は実行履歴が最大2個と、char型の引数を持つ関数(funcB)は実行履歴が最大50個と、int型の引数を持つ関数(funcC)は実行履歴が最大232個と判断する。これにより、再利用度生成部1621は、bool型の引数を持つfuncAの再利用度が1番高く、char型の引数を持つfuncBの再利用度が2番目に高く、int型の引数を持つfuncCの再利用度が1番低い度合いの再利用度を生成する。
 次に、再利用命令変換部1623は、再利用度に基づいて命令区間の呼出し命令を再利用命令に変換する。この場合において、再利用命令変換部1623は、履歴メモリの容量をプログラムに書き込まれたコードより検出する。また、再利用命令変換部1623は、再利用候補区間である3つの関数(funcA乃至C)の予測される実行履歴のデータ量を、入力値が採り得る値の組合せと、実行結果の個数と、入力値および実行結果のビット数より関数毎に予測する。
 そして、再利用命令変換部1623は、再利用度が最も高い関数から順に履歴メモリに登録される関数を設定する。この時、再利用命令変換部1623は、再利用候補区間の予測される実行履歴のデータ量の総和が履歴メモリの容量以内になるように履歴メモリに保持する関数を設定し、その関数の呼出し命令(call)を再利用命令(memocall)に変換する。
 その結果、この再利用命令変換部1623は、bool型の引数を持つfuncAに関しては、全ての実行履歴を履歴メモリに登録できると解析して、funcAの呼出し命令(call)を再利用命令(memocall)に変換する。次に、この再利用命令変換部1623は、再利用命令に変換した関数(funcA)の実行履歴のデータ量を履歴メモリ保持させた場合には、char型の引数を持つfuncBの実行履歴は1個も登録できないと判断する。そのため、再利用命令変換部1623は、funcBの呼出し命令(call)は再利用命令(memocall)に変換しない。
 また、再利用命令変換部1623は、char型の引数を持つfuncBと同様に、int型の引数を持つfuncCに関してもfuncCの実行履歴は1個も保持できないと判断し、funcCの呼出し命令(call)も変換しない。
 このようにして、プログラム変換処理部1600は、bool型の引数を持つfuncAについては再利用命令(memocall)により呼び出し、他の2つの関数(funcBおよびC)については呼出し命令(call)により呼び出すプログラムを生成する。
 図26の(b)には、データ処理装置1100が容量の大きい履歴メモリ1430を備える場合におけるプログラム変換処理部1600の動作例が示されている。ここでは、右矢印に対して左側にある枠の中には、図26の(a)と同様に、プログラム変換処理部1600に処理される前のソースプログラムの一例がC言語により示されている。また、右矢印に対して右側にある枠の中には、プログラム変換処理部1600に処理されたプログラムの一例がアセンブリ言語により示されている。
 なお、ここでは、履歴メモリは、1個のchar型の変数を引数とすることによって、1個のchar型の実行結果を出力する関数の実行履歴を55個ほど保持するのに十分な容量であるとする。
 再利用候補区間抽出部1611、再利用候補区間解析部1612、および、再利用度生成部1621の動作は、図26の(a)において示した動作と同じ働きであるので詳細な説明を省略する。
 この場合において、再利用度生成部1621により再利用度が生成された後に、再利用命令変換部1623は、図26の(a)と同様に、関数の呼出し命令(call)を再利用命令(memocall)に変換する。
 その結果、再利用命令変換部1623は、まず、bool型の引数を持つ関数(funcA)に関しては全ての実行履歴を履歴メモリに登録できると解析し、funcAの呼出し命令(call)を再利用命令(memocall)に変換する。次に、この再利用命令変換部1623は、再利用命令に変換した関数(funcA)の実行履歴のデータ量を差し引いた履歴メモリにはchar型の引数を持つfuncBの実行履歴は全て登録できると解析する。この解析により、再利用命令変換部1623は、funcBの呼出し命令(call)を再利用命令(memocall)に変換する。また、この再利用命令変換部1623は、再利用命令に変換した関数(funcAおよびB)の実行履歴のデータ量を差し引いた履歴メモリにはint型の引数を持つfuncCの実行履歴は2個しか登録できないと解析する。この解析により、再利用命令変換部1623は、funcCの呼出し命令(call)は変換しない。
 このようにして、プログラム変換処理部1600は、bool型の引数を持つfuncAおよびchar型の引数を持つfuncBは再利用命令(memocall)により呼び出し、funcCは呼出し命令(call)により呼び出すプログラムを生成する。
 なお、ここでは、再利用区間は関数であり、呼出し命令はアセンプリ言語で表現した場合の「call」命令を想定し、再利用命令はアセンブリ言語で「memocall」と表現することを想定したが、これに限定されるものではない。例えば、再利用区間はループであり、呼出し命令はアセンブリ言語で表現した場合の「branch」命令を想定し、再利用命令はアセンブリ言語で「memoLoop」と表現する場合などが考えられる。
 [本発明の第1の実施の形態における再利用命令の一例]
 次に、本発明の第1の実施の形態におけるコンパイル処理装置1500が生成する再利用命令について図面を参照して説明する。
 図27は、本発明の第1の実施の形態における関数の呼出し命令および関数の再利用命令の一例を示す概念図である。ここでは、再利用命令を処理するデータ処理装置のプロセッサコアはMIPSにより構成されることを想定する。また、ここでは、左端は最上位ビット(MSB)を示し、右端は最下位ビット(LSB)を示している。
 図27の(a)には、MIPS命令セットにおける関数の呼出し命令(call)であるJALR(Jump And Link Register)命令が示されている。MIPS命令セットは32ビットの固定長の命令セットであり、このJALR命令は、32個のビット(0乃至31番)のビット列により表現されるものである。
 このJALR命令は、オペコードフィールド1710と、関数番地フィールド(rs)1720と、第1未使用フィールド1730と、戻り番地フィールド(rd)1740と、第2未使用フィールド1750と、機能指定フィールド1760とから構成される。
 オペコードフィールド1710は、命令の種別を指定するフィールドである。このオペコードフィールド1710は、第26乃至第31番目のビットから構成されるビット列である。このオペコードフィールド1710には、SPECIAL命令として「000000」のビット列が格納される。
 関数番地フィールド(rs)1720は、関数の番地を格納するレジスタを指定するフィールドである。この関数番地フィールド(rs)1720は、第21乃至第25番目のビットから構成されるビット列である。
 第1未使用フィールド1730は、JALR命令では使用されないフィールドである。この第1未使用フィールド1730は、第16乃至第20番目のビット列である。この第1未使用フィールド1730は、JALR命令では「00000」のビット列が格納される。
 戻り番地フィールド(rd)1740は、関数からの戻り番地を指定するフィールドである。この戻り番地フィールド(rd)1740は、第11乃至第15番目のビットから構成されるビット列である。この戻り番地フィールド(rd)1740は、JALR命令では31番レジスタを指すビット列(11111)が格納される。
 第2未使用フィールド1750は、JALR命令では使用されないフィールドである。この第2未使用フィールド1750は、第6乃至第10番目のビットから構成されるビット列である。この第2未使用フィールド1750は、JALR命令では「00000」のビット列が格納される。
 機能指定フィールド1760は、オペコードフィールド1710により指定された命令が複数の機能を含む場合には、その複数の機能のうち1つの機能を指定するフィールドである。この機能指定フィールド1760は、第0乃至第5番目のビットから構成されるビット列である。この機能指定フィールド1760は、JALR命令では「001001」のビット列が格納される。
 図27の(b)には、関数の再利用命令の一例が示されている。この再利用命令は、32個のビット(0乃至31番)のビット列により表現されるものである。この再利用命令は、オペコードフィールド1710と、関数番地フィールド(rs)1720と、第1再利用フィールド1731と、戻り番地フィールド(rd)1740と、第2再利用フィールド1751と、機能指定フィールド1760とから構成される。なお、ここでは、第1再利用フィールド1731および第2再利用フィールド1751以外の構成は、図27の(a)と同様のものであるため、図27の(a)と同符号を付してここでの説明を省略する。
 第1再利用フィールド1731および第2再利用フィールド1751は、共に再利用命令であることを示すフィールドである。この第1再利用フィールド1731および第2再利用フィールド1751は、JALR命令における第1未使用フィールド1730および第2未使用フィールド1750のビット列を「00000」以外のビット列に変更したものである。ただし、この第1再利用フィールド1731および第2再利用フィールド1751は、一方のビット列が「00000」以外ならば再利用命令を指し示し、他方のビット列が「00000」であってもよい。
 このように、JALR命令の第11乃至第15番目あるいは第6乃至第10番目のビット列のいずれかにおいて「00000」の代わりに「00001乃至11111」のビット列が格納されていた場合には、その命令は再利用命令となる。
 [本発明の第1の実施の形態におけるコンパイル処理装置1500の動作例]
 次に、本発明の第1の実施の形態におけるコンパイル処理装置1500の処理について図面を参照して説明する。
 図28は、本発明の第1の実施の形態におけるコンパイル処理装置1500によるコンパイル処理の処理手順を示すフローチャートである。
 まず、コンパイル処理装置1500により、ソースプログラム記憶部1510からソースプログラムが読み出される(ステップS1911)。次に、再利用候補区間抽出部1611により、再利用候補区間が抽出される(ステップS1912)。
 そして、再利用候補区間解析部1612により、再利用候補区間の使用態様が解析される(ステップS1913)。なお、ステップS1913は、特許請求の範囲に記載の解析手順の一例である。
 次に、再利用度生成部1621により、再利用候補区間の解析結果に基づいて再利用度が生成される(ステップS1914)。なお、ステップS1914は、特許請求の範囲に記載の再利用度生成手順の一例である。
 続いて、再利用命令変換部1623により、再利用度に基づいて再利用候補区間の呼出し命令が再利用命令に変換される(ステップS1916)。これは、関数が再利用候補区間である場合には、関数の呼出し命令(call)が再利用命令(memoCall)に変換されることを意味する。なお、ステップS1915は、特許請求の範囲に記載の命令変換手順の一例である。
 そして、コード生成部1522により、変換された命令を含むプログラムに基づいて機械語プログラムのコードであるオブジェクトプログラムが生成される(ステップS1917)。
 このように、本発明の第1の実施の形態によれば、再利用度を生成することによって、再利用される再利用候補区間の呼出し命令を実行結果が再利用される度合いに基づいて再利用命令に変換することが出来る。
 <2.第2の実施の形態>
 [データ処理装置1100の構成例]
 図29は、本発明の第2の実施の形態におけるデータ処理装置1100の構成例を示すブロック図である。このデータ処理装置1100は、バス1120を介して主記憶部1130と相互に接続されている。また、ここでは、データ処理装置1100が処理する命令区間は関数を想定するものとする。
 データ処理装置1100は、プログラムデータにおける各処理を実行するものである。このデータ処理装置1100は、例えば、一般的なコンピュータにおいてはCPU(Central Processing Unit)により実現される。このデータ処理装置1100は、一次キャッシュ1200と、プロセッサコア1300と、履歴管理部1400とを備える。ここでは、データ処理装置1100は、本発明の第1の実施の形態におけるコンパイル処理装置1500により生成された再利用命令を含むプログラムを処理するものとする。
 一次キャッシュ1200は、プロセッサコア1300がバス1120を介して入出力する情報を一時的に保持するものである。この一次キャッシュ1200は、命令キャッシュ1210およびデータキャッシュ1220を備える。
 命令キャッシュ1210は、プロセッサコア1300において実行される命令を一時的に保持するものである。この命令キャッシュ1210は、プロセッサコア1300が頻繁に実行する命令を一時的に保持することによってプロセッサコア1300から主記憶部1130へのアクセスを軽減させて、プロセッサコア1300におけるデータの入力待ち時間を軽減させる。この命令キャッシュ1210は、主記憶部1130から供給された再利用命令をプロセッサコア1300に供給する。
 データキャッシュ1220は、プロセッサコア1300の入力データおよび出力データを一時的に保持するものである。このデータキャッシュ1220は、使用頻度の高いプロセッサコア1300の入力データを一時的に保持することによりプロセッサコア1300から主記憶部1130へのアクセスを軽減させて、プロセッサコア1300におけるデータの入力待ち時間を軽減させる。このデータキャッシュ1220は、主記憶部1130から供給された関数の入力値および関数の開始アドレスをプロセッサコア1300に出力する。
 プロセッサコア1300は、プログラムの命令に従って演算を実行するものである。このプロセッサコア1300は、例えば、MIPS(Microprocessor without Interlocked Pipeline Stages)プロセッサにより実現される。このプロセッサコア1300は、命令キャッシュ1210およびデータキャッシュ1220から入力される命令と入力データと関数の開始アドレスとに基づいて命令を実行し、その結果の実行結果を出力する。このプロセッサコア1300は、入力される命令が再利用区間を指定する再利用命令である場合において履歴管理部1400から実行結果が供給されないときには、この命令を実行した結果である実行結果をデータキャッシュ1220および履歴管理部1400に出力する。
 またプロセッサコア1300は、入力される命令が再利用区間を指定する再利用命令である場合において履歴管理部1400から実行結果が供給されたときには、再利用区間における処理を中止して、この再利用区間を呼出したルーチンに戻る。
 履歴管理部1400は、再利用区間の実行結果を保持して管理するものである。この履歴管理部1400は、プロセッサコア1300から供給された再利用区間の区間識別情報と入力値と実行結果とを実行履歴として保持する。ここでいう区間識別情報とは、再利用区間を特定するための情報であり、例えば、関数やループの開始アドレスである。すなわち、この履歴管理部1400は、区間識別情報、入力値、および、実行結果として、関数の開始アドレス、入力値、および、実行結果を保持する。また、この履歴管理部1400は、プロセッサコア1300から関数の開始アドレスおよび入力値が供給された場合には、この開始アドレスおよび入力値を含んでいる実行履歴を検索する。
 バス1120は、データ処理装置1100および主記憶部1130へのデータのやりとりを行うためのバスである。
 主記憶部1130は、データ処理装置1100が動作するために必要なデータを保持するものである。この主記憶部1130は、例えば、RAM(Random Access Memory)などが考えられる。この主記憶部1130は、記憶しているデータを、バス1120を介してデータ処理装置1100に出力する。
 このように、本発明の第2の実施の形態によれば、データ処理装置1100に履歴管理部1400を設けることによって、複数の命令区間のうち実行結果が再利用される度合いに基づいて抽出された再利用区間の実行結果を再利用することができる。
 [プロセッサコア1300および履歴管理部1400の構成例]
 図30は、本発明の第2の実施の形態におけるプロセッサコア1300および履歴管理部1400の構成例を示すブロック図である。ここでは、プロセッサコア1300および履歴管理部1400の機能は、図29と同様のものであるため、同一の符号を付してここでの説明を省略する。
 プロセッサコア1300は、フェッチ部1310と、命令デコーダ1320と、実行部1330と、レジスタファイル1340とを備える。
 フェッチ部1310は、命令キャッシュ1210から主記憶部1130からの命令を読み出すものである。このフェッチ部1310は、その読み出した命令を一時的に保持して、その保持されている命令のうち、実行部1330に実行させるための命令を命令デコーダ1320に供給する。このフェッチ部1310は、例えば、一時的に保持している命令のうち、実行部1330において実行される再利用命令を命令デコーダ1320に供給する。このフェッチ部1310は、例えば、主記憶部1130に記憶された再利用命令を命令デコーダ1320に供給する。
 命令デコーダ1320は、フェッチ部1310から供給された命令を解析することによってプロセッサコア1300の構成部位を制御する制御信号を生成するものである。この命令デコーダ1320は、例えば、命令を解析することによって実行部1330およびレジスタファイル1340を制御する制御信号を生成して、その生成された制御信号を実行部1330およびレジスタファイル1340に供給する。
 この命令デコーダ1320は、フェッチ部1310から再利用命令が供給された場合には、この再利用命令を解析することによって、実行部1330およびレジスタファイル1340の各々を制御する制御信号を実行部1330およびレジスタファイル1340に供給する。
 実行部1330は、命令デコーダ1320から供給された制御信号に基づいて、命令デコーダ1320において解析した命令を実行するものである。この実行部1330は、命令デコーダ1320から再利用命令に基づく制御信号が供給された場合には、再利用命令が指定する再利用区間の処理を開始する。また、この再利用区間の処理の開始とともに、実行部1330は、レジスタファイル1340から取得した再利用区間の区間識別情報を信号線1309を介して履歴管理部1400に出力する。そして、実行部1330は、レジスタファイル1340から供給される再利用区間の入力値に基づいて再利用区間における処理を実行するとともに、再利用区間の入力値を信号線1309を介して履歴管理部1400に出力する。
 また、実行部1330は、履歴管理部1400から再利用区間の実行結果が供給された場合には、再利用区間の処理を中止するとともに、実行結果を履歴管理部1400から受け取ったことを知らせる信号をフェッチ部1310に供給する。この時、実行部1330は、実行結果をレジスタファイル1340に出力する。
 一方、実行部1330は、履歴管理部1400から再利用区間の実行結果が供給されない場合には、再利用区間の処理を最後まで行い、実行結果を履歴管理部1400およびレジスタファイル1340に出力する。なお、実行部1330は、特許請求の範囲に記載の実行部の一例である。
 レジスタファイル1340は、データキャッシュ1220から供給されたデータおよび実行部1330から供給された実行結果を一時的に保持するものである。このレジスタファイル1340は、例えば、命令デコーダ1320から再利用命令に基づく制御信号が供給された場合には、再利用区間の入力値を実行部1330に供給する。
 履歴管理部1400は、履歴対象データ保持部1410と、履歴検索部1420と、履歴メモリ1430と、履歴登録部1440とを備える。
 履歴対象データ保持部1410は、実行部1330から供給されたデータを一時的に保持するものである。この履歴対象データ保持部1410は、実行部1330から区間識別情報および入力値が供給された際には、これらを検索要求として履歴検索部1420に供給する。例えば、履歴対象データ保持部1410は、再利用区間が関数である場合には、実行部1330から供給された関数の開始アドレスおよび入力値を検索要求として履歴検索部1420に供給する。
 また、この履歴対象データ保持部1410は、実行部1330から区間識別情報と、入力値と、実行結果とが供給されることによって、実行履歴を登録する条件が整った場合には、これらを実行履歴として履歴登録部1440に供給する。
 履歴検索部1420は、履歴対象データ保持部1410から供給された検索要求に基づいて実行履歴を検索し、実行履歴が検索された場合には実行結果を出力するものである。この履歴検索部1420は、検索要求入力部1421および実行結果出力部1422を備える。なお、履歴検索部1420は、特許請求の範囲に記載の履歴検索部の一例である。
 検索要求入力部1421は、履歴対象データ保持部1410から供給された検索要求に基づいて履歴メモリ1430から実行履歴を検索するものである。この検索要求入力部1421は、例えば、関数の再利用命令が命令デコーダ1320において解析された場合には、この関数の開始アドレスおよび入力値を履歴メモリ1430に供給することによって、実行履歴の検索を開始する。
 実行結果出力部1422は、履歴メモリ1430において実行履歴が検索された場合に実行結果を履歴メモリ1430から抽出し、その抽出した実行結果を実行部1330に出力するものである。この実行結果出力部は、その抽出した実行結果を信号線1409を介して実行部1330に供給する。
 履歴メモリ1430は、履歴登録部1440から供給された実行履歴を保持するものである。この履歴メモリ1430は、例えば、履歴検索部1420から検索要求が供給された場合において、この検索要求と一致する実行履歴を保持しているときは、この実行履歴の実行結果を実行結果出力部1422に供給する。また、この履歴メモリ1430は、履歴登録部1440から実行履歴が供給された場合には、この実行履歴を保持する。この履歴メモリ1430は、例えば、連想メモリ(CAM:Content Addressable Memory)により実現される。なお、履歴メモリ1430は、特許請求の範囲に記載の履歴メモリの一例である。
 履歴登録部1440は、履歴対象データ保持部1410から供給された実行履歴を履歴メモリ1430に保存させるデータ構造に変換し、この実行履歴を履歴メモリ1430に登録するものである。この履歴登録部1440は、例えば、関数を指定する再利用命令が命令デコーダ1320において解析された際に、履歴検索部1420により実行履歴が検索されない場合には、関数の開始アドレス、入力値および実行結果を実行履歴として履歴メモリ1430に登録する。
 このように、プロセッサコア1300および履歴管理部1400は、関数の実行結果が再利用される度合いに応じて関数の呼出し命令が再利用命令に変換されたプログラムを実行することができる。なお、ここでは、プロセッサコア1300および履歴管理部1400は、関数を再利用対象とする例について説明したが、ループに関しても同様に再利用対象とすることができる。
 [履歴メモリ1430のデータ構造例]
 図31は、本発明の第2の実施の形態における履歴メモリ1430のデータ構造の一例を示す概念図である。ここでは、履歴メモリ1430により、区間識別情報ごとに保持された実行履歴のうち、1つの区間識別情報における実行履歴を木構造により保持する構成が示されている。この例では、引数がn個であり、かつ、実行結果である出力をm個の格納先に返す関数を想定している。また、ここでは、関数の先頭アドレスである関数の開始アドレスを区間識別情報として用いることとする。
 この例では、木構造における関数ルート1810と、第1の引数ノード1821および1822と、第nの引数ノード1831乃至1834と、第1の出力ノード1841乃至1844と、第mの出力ノード1851乃至1854とが示されている。
 関数ルート1810には、区間識別情報である関数の開始アドレスと、第1の引数ノード1821を指し示すポインタとが示されている。
 第1および第nの引数ノード1821、1822および1831乃至1834には、履歴メモリ1430に保持されている実行履歴における引数の入力値として、引数の値を示す入力値と、その引数の型と、その引数の格納場所を示す種類とが示されている。ここにいう格納場所とは、レジスタ番号または主記憶部1130のメモリアドレスのことをいう。
 さらに、第1および第nの引数ノード1821、1822および1831乃至1834には、比較対象の入力値が互いに一致した場合に次の引数の引数ノードを指し示す右ポインタと、不一致の場合に同一の引数における他の引数ノードを指し示す下ポインタとが示されている。また、第nの引数ノード1831乃至1834の各々は、第1および第mの出力ノード1841乃至1844および1851乃至1854にそれぞれ連結されている。
 第1および第mの出力ノード1841乃至1844および1851乃至1854には、履歴メモリ1430に保持されている実行履歴における実行結果として、実行結果の値を示す出力値と、その実行結果の格納場所を示す種類と、その実行結果の型とが示されている。さらに、第1の出力ノード1841乃至1844には、次の出力ノードを指し示す右ポインタが示されている。すなわち、第1および第mの出力ノード1841乃至1844および1851乃至1854は、連結リストを構成している。また、第mの出力ノード1851乃至1854には、出力ノードの終端を表わすヌルが示されている。
 このような木構造において、関数ルート1810に示された関数の開始アドレスと一致する関数の開始アドレスが履歴検索部1420から入力されると、関数ルート1810のポインタによって指し示された第1の引数ノード1821において入力値の比較処理が実行される。ここにいう入力値の比較処理とは、第1の引数ノード1821に示された入力値、種類および型である入力値と、履歴検索部1420からの入力値とを比較することである。
 このとき、例えば、第1の引数ノード1821に示された入力値と履歴検索部1420からの入力値とが一致した場合には、第1の引数ノード1821の右ポインタにより指し示された次の引数ノードにおいて入力値の比較処理が実行される。一方、第1の引数ノード1821に示された入力値と、履歴検索部1420からの入力値とが一致しない場合には、第1の引数ノード1821の下ポインタにより指し示された第1の引数ノード1822において入力値の比較処理が実行される。
 このようにして、各引数ノードにおける比較処理による結果に基づいて右または下ポインタの指し示す引数ノードが選択され、その選択された引数ノードにおいて入力値の比較処理が順次実行される。そして、例えば、第nの引数ノード1831に示された入力値と履歴検索部1420からの入力値とが互いに一致した場合には、第nの引数ノード1831の右ポインタの指し示す第1の出力ノード1841の実行結果が履歴検索部1420に出力される。そして、最後に、第m番の出力ノード1851の実行結果が履歴検索部1420に出力される。
 このように、履歴メモリ1430を識別情報ごとに木構造により構成することによって、同じ引数の入力値を重複して保持させる必要が無いため、記憶領域を節約することができる。また、識別情報ごとにデータ構造を分けることによって、検索速度の低下を抑制することができる。
 [本発明の第2の実施の形態におけるプロセッサコア1300および履歴管理部1400により保存される実行履歴の一例]
 図32は、本発明の第2の実施の形態におけるプロセッサコア1300により処理されるプログラムおよび履歴管理部1400により保存される実行履歴の一例を示す概念図である。ここでは、従来技術を用いて実行履歴を保存する場合と、本発明の第2の実施の形態により実行履歴を保存する場合とが表されている。なお、ここでは、変換されたプログラムの実行は、ここで示したプログラムの上から順に実行されるものと想定する。
 図32の(a)は、従来技術によるソースプログラムの変換例を示す模式図である。ここでは、右矢印に対して左側にある枠の中には、ソースプログラムがC言語により示されている。また、右矢印に対して右側にある枠の中には、従来技術により変換されたプログラムの一例がアセンブリ言語により示されている。
 ソースプログラムには、プログラムのメインの関数(funcX)と、そのメインの関数により呼び出される6つの関数とが示されている。この6つの関数として、char型の2個の変数を引数とする関数(funcA)と、char型の1個の変数およびint型の1個の変数を引数とする関数(funcB)と、char型の1個の変数を引数とする関数(funcC)とが示されている。さらに、bool型の1個の変数を引数とする関数(funcD)と、int型の2個の変数を引数とする関数(funcE)と、int型の1個の変数を引数とする関数(funcF)とが示されている。
 このソースプログラムは、関数を再利用区間として指定する場合には全ての関数を再利用の対象とする従来技術のコンパイル処理装置により、全ての関数が再利用の対象とされるプログラムに変換される。その結果、右矢印に対して右側にある枠の中に示すように、funcA乃至Gを呼出し命令(call)で呼び出し、funcA乃至Gの実行結果を全て再利用するプログラムを生成する。
 図32の(b)は、図32の(a)の右矢印の右側にある枠の中に示したプログラムを上から順に1回ずつ実行した場合における履歴メモリに保存される実行履歴の一例を示す模式図である。なお、ここでは、実行履歴が保存される履歴メモリは、便宜上、入力値および出力値の型や個数を問わず、2つの関数に関する実行履歴を保存できるものとする。また、新たな実行履歴を保存する際に、履歴メモリの空き容量が無い場合には、最も長い期間未使用だった実効履歴を履歴メモリから消去した後に、新たな実行履歴を履歴メモリに保存するものとする。さらに、ここでは、図32の(a)において示した変換されたプログラムの呼出し命令を、上から順に1回ずつ実行するものとする。
 従来技術を用いる場合では、図32の(a)の右矢印の右側にある変換されたプログラムに基づいて、6つの関数(funcA乃至F)が再利用命令(cal)により呼び出される。最初に、char型の2個の変数を引数とするfuncAが再利用区間として呼び出され、funcAの実行履歴が履歴メモリに保存される。次に、char型の1個の変数およびint型の1個の変数を引数とするfuncBが再利用区間として呼び出された後に実行履歴が保存される。
 その後、履歴メモリには空き容量が無い状態でchar型の1個の変数を引数とするfuncCが再利用区間として呼び出される。この時、従来技術のデータ処理装置では、最も長い期間未使用だったfuncAの実行履歴を履歴メモリから消去するとともに、funcCの実行履歴を保存する。
 そして、funcCのときと同様にして、bool型の1個の変数を引数とするfuncDのときには、funcBの実行履歴の代わりにfuncDの実行履歴が保存される。そして、int型の2個の変数を引数とするfuncEのときには、funcCの実行履歴の代わりにfuncEの実行履歴が保存される。最後に、int型の1個の変数を引数とする関数funcFが再利用区間として呼び出されると、最も長い期間未使用だったfuncDの実行履歴が履歴メモリから消去されるとともに、funcFの実行履歴が保存される。
 このようにして、図32の(a)の変換されたプログラムの呼出し命令を上から順に1回ずつ実行すると、図32の(b)において示したように、2つの関数(funcEおよびfuncF)の実行履歴が履歴メモリに保存される。
 このように、従来技術を用いる場合では、常に再利用される確率が高い実行履歴が履歴メモリに保存されているわけではない。このため、実行するプログラムによっては、全く再利用されない関数の実行履歴が履歴メモリに保存され、再利用の効果が得られない場合が生じる。
 図32の(c)は、本発明の第1の実施の形態によるソースプログラムの変換例を示す模式図である。なお、ここでは、再利用度生成部1621は、関数の入力値が採り得る値の組合せに基づいて再利用度を生成することを想定する。また、履歴メモリ1430は、便宜上、入力値および出力値の型や個数を問わず、2つの関数に関する実行履歴を保存できるものとする。
 ここでは、右矢印に対して左側にある枠の中には、図32の(a)において示したソースプログラムと同様のソースプログラムがC言語により示されている。また、右矢印に対して右側にある枠の中には、本発明の第1の実施の形態により変換されたプログラムの一例がアセンブリ言語により示されている。
 このソースプログラムは、まず、6つの関数(funcA乃至F)における引数の個数および型について関数毎に再利用候補区間解析部1612により解析される。その後、再利用度生成部1621は、再利用候補区間解析部1612が解析した引数の個数および型に基づいて再利用度を生成する。
 この時、再利用度生成部1621は、関数毎の入力値が採り得る値の組合せに基づいて再利用度を生成する。この再利用度生成部1621は、例えば、関数の入力値が採り得る値の組合せとして入力値の総ビット数を算出する場合には、算出した入力値の総ビット数に基づいて再利用度を生成する。この場合において、この再利用度生成部1621は、char型の2個の変数を引数とする関数(funcA)については入力値の組合せは「16+1+16=32」により32ビットと判断する。さらに、char型の1個の変数およびint型の1個の変数を引数とする関数(funcB)については、入力値の組合せは「16+1=17」により17ビットと判断する。また、char型の1個の変数を引数とする関数(funcC)については、入力値の組合せは16ビットと判断する。そして、bool型の1個の変数を引数とする関数(funcD)については、入力値の組合せは1ビットと判断する。さらに、int型の2個の変数を引数とする関数(funcE)については、入力値の組合せは「32+32=64」により64ビットと判断する。int型の1個の変数を引数とする関数(funcF)については、入力値の組合せは32ビットと判断する。
 その結果、再利用度生成部1621は、入力値の組合せの逆数に基づいて、bool型の1個の変数を引数とするfuncDには1番高い再利用度を生成し、char型の1個の変数を引数とするfuncCには2番目に高い再利用度を生成する。さらに、再利用度生成部1621は、char型の1個の変数およびint型の1個の変数を引数とするfuncBには、3番目に高い再利用度を生成する。また、char型の2個の変数を引数とするfuncAおよびint型の1個の変数を引数とするfuncFには、4番目に高い再利用度を生成する。そして、int型の2個の変数を引数とするfuncEには、1番低い再利用度を生成する。
 そして、再利用命令変換部1623は、再利用度が最も高い関数から順に履歴メモリ1430に保持する関数を設定する。この結果、再利用命令変換部1623は、bool型の1個の変数を引数とするfuncDおよびchar型の1個の変数を引数とするfuncCの呼出し命令(call)を再利用命令(memocall)に変換する。
 図32の(d)には、図32の(c)の右矢印の右側にある枠の中に示したプログラムを上から順に1回ずつ実行した場合における履歴メモリに保存される実行履歴の一例が示されている。なお、履歴メモリ1430は、便宜上、入力値および出力値の型や個数を問わず、2つの関数に関する実行履歴を登録できるものとする。
 本発明の第2の実施の形態におけるプロセッサコア1300は、図32の(c)において示した変換されたプログラムに基づいて、再利用命令(memoCall)で呼び出されるfuncCおよびfuncDの実行履歴を履歴管理部1400に出力する。その結果、funcAおよびfuncBの実行履歴が履歴メモリ1430に保存される。
 このように、本発明の第2の実施の形態によれば、実行結果が再利用される確率が高い関数を選択して履歴メモリ1430に保存することができる。
 [本発明の第2の実施の形態におけるプロセッサコア1300および履歴管理部1400の動作例]
 次に、本発明の第2の実施の形態におけるプロセッサコア1300および履歴管理部1400の処理について図面を参照して説明する。
 図33は、本発明の第2の実施の形態におけるプロセッサコア1300および履歴管理部1400による関数の実行処理の処理手順を示すフローチャートである。
 まず、フェッチ部1310およびレジスタファイル1340に、関数を参照する命令およびその関数の入力値が読み出される(ステップS1931)。次に、命令デコーダ1320によって、関数を参照する命令がデコードされる(ステップS1932)。続いて、デコードした命令が再利用命令か否かが解析される(ステップS1933)。解析の結果、デコードした命令が再利用命令でない場合には、実行部1330によって、レジスタファイル1340から供給される入力値に基づいてその関数が実行され、実行結果が出力される(ステップS1940)。そして、関数の実行処理は終了する。
 一方、デコードした命令が再利用命令である場合には、検索要求入力部1421によって、実行部1330から供給された関数の開始アドレスおよび入力値を用いて履歴メモリ1430から実行履歴が検索される(ステップS1934)。
 次に、実行履歴があるか否かが判断される(ステップS1935)。実行履歴が履歴メモリ1430にある場合には、実行結果出力部1422によって、実行結果が出力される(ステップS1938)。続いて、実行部1330は、実行結果が出力された関数の実行を中止させる(ステップS1939)。そして、関数の実行は終了する。
 一方、実行履歴が履歴メモリ1430に保持されていない場合には、実行部1330によって、レジスタファイル1340から供給される入力値に基づいてその関数が実行され、実行結果が出力される(ステップS1936)。そして、履歴登録部1440によって、実行履歴が履歴メモリ1430に登録される(ステップS1937)。なお、このステップS1936およびステップS1937は、特許請求の範囲に記載の実行手段の一例である。そして、関数の実行は終了する。
 このように、本発明の第2の実施の形態によれば、再利用区間の呼出し命令が再利用候補区間の再利用度に従って再利用命令に変換されたプログラムに基づいて、実行結果の再利用の効果が高い再利用区間の実行履歴のみを履歴メモリ1430に保持することができる。
 <3.第3の実施の形態>
 [本発明の第3の実施の形態におけるコンパイル処理装置1500の構成例]
 図34は、本発明の第3の実施の形態におけるコンパイル処理装置1500の構成例を示すブロック図である。このコンパイル処理装置1500は、図18において示したコンパイル処理装置1500の構成に加えて優先度生成部1622を備えている。ここでは、優先度生成部1622以外の構成は、図18と同様のものであるため、図18と同符号を付してここでの各部の構成の詳細な説明を省略する。
 優先度生成部1622は、再利用度生成部1621から供給された再利用度に基づいて、実行履歴が履歴メモリ1430に保持されるための優先度を生成するものである。この優先度生成部1622は、例えば、再利用度が高い再利用候補区間から順に高い値の優先度を生成する。この優先度生成部1622は、生成した優先度を、再利用度、再利用候補区間の識別情報、および、プログラムとともに再利用命令変換部1623に供給する。なお、優先度生成部1622は、特許請求の範囲に記載の優先度生成部の一例である。
 再利用命令変換部1623は、優先度生成部1622から供給された再利用度および優先度に基づいて、再利用候補区間の呼出し命令を優先度が含まれる再利用命令に変換するものである。この再利用命令変換部1623は、例えば、再利用度および優先度が算出された全ての再利用候補区間の呼出し命令を、優先度が含まれる再利用命令に変換する。この再利用命令変換部1623は、その変換した命令を含む最適化されたプログラムをコード生成部1522に供給する。
 なお、第3の実施の形態では、優先度生成部1622は、再利用度の順序に応じて優先度を生成するものを想定するが、これに限定されるものではない。例えば、優先度生成部1622は、再利用度と、再利用候補区間の実行履歴のデータ量の予測値と、履歴メモリ1430の容量とに基づいて、再利用候補区間の優先度を生成するものなどが考えられる。この場合において、優先度生成部1622は、図18において示した再利用命令変換部1623と同様に実行履歴のデータ量の予測値を生成する。そして、優先度生成部1622は、履歴メモリ1430から実行履歴が削除されるタイミングを考慮し、効率の良い実行履歴の入れ替えが出来るように優先度を生成する。
 なお、ここでは、コンパイル処理装置1500は、関数を再利用対象とする例について説明したが、ループに関しても同様に再利用対象とすることができる。
 なお、第3の実施の形態では、便宜上、再利用候補区間解析部1612は、再利用候補区間の使用態様を関数毎に解析するが、より詳細に解析するために関数の呼出し命令毎に解析するものとしてもよい。この場合において、再利用度生成部1621は、関数の呼出し命令毎に再利用度を生成し、優先度生成部1622は、呼び出される関数は同じであっても関数の呼出し命令毎に異なる優先度を生成する。そして、再利用命令変換部1623は、呼び出される関数は同じであっても関数の呼出し命令毎に異なる優先度が含まれる再利用命令に変換する。
 [本発明の第3の実施の形態におけるプログラム変換処理部1600の動作例]
 次に、本発明の第3の実施の形態におけるプログラム変換処理部1600の動作について次図を参照して説明する。
 図35は、本発明の第3の実施の形態におけるプログラム変換処理部1600による複数の引数が入力値である関数を含むプログラムの変換例を示す模式図である。
 図35の(a)は、引数の型は同じだが引数の個数は異なる複数の関数を含むプログラムのプログラム変換処理部1600による変換例を示す模式図である。なお、再利用候補区間解析部1612および再利用度生成部1621については、図20において示した動作例と同様の動作をすることを想定し、ここでの詳細な説明を省略する。
 図35の(a)の右矢印に対して左側に位置する枠の中には、プログラム変換処理部1600に処理される前のソースプログラムの一例がC言語により示されている。また、右矢印に対して右側に位置する枠の中には、プログラム変換処理部1600に処理されたプログラムの一例がアセンブリ言語により示されている。
 ソースプログラムには、プログラムのメインの関数(funcX)と、そのメインの関数により呼び出される3つの関数とが示されている。この3つの関数として、int型の1個の変数を引数とする関数(funcA)と、int型の2個の変数を引数とする関数(funcB)と、int型の3個の変数を引数とする関数(funcC)とが示されている。
 このソースプログラムは、再利用候補区間解析部1612および再利用度生成部1621によって、図20において示した動作例と同様に解析および再利用度の生成がされる。これにより、引数が1個の関数(funcA)の再利用度が1番高く、引数が2個の関数(funcB)の再利用度が2番目に高く、引数が3個の関数(funcC)の再利用度が1番低い再利用度が生成される。
 次に、優先度生成部1622により3つの関数(funcA乃至funcC)の優先度が生成される。優先度生成部1622は、再利用度に基づいて優先度を生成することにより、再利用度が1番高い関数(funcA)には1番高い優先度(3)を生成し、再利用度が2番目に高い関数(funcB)には2番目に高い優先度(2)を生成する。また、優先度生成部1622は、再利用度が1番低い関数(funcC)には1番低い優先度(1)を生成する。
 そして、再利用命令変換部1623は、実行結果を再利用させる再利用区間の呼出し命令を優先度が含まれる再利用命令に優先度に基づいて変換する。この図35の(a)の場合においては、再利用命令変換部1623は、履歴メモリの容量を考慮しないため、優先度が生成された全ての関数の呼出し命令を優先度が含まれる再利用命令に変換する。その結果、この再利用命令変換部1623は、3つの関数(funcA乃至C)の呼出し命令を優先度が含まれる再利用命令に変換する。
 このようにして、プログラム変換処理部1600は、右矢印に対して右側にある枠の中に示すようなプログラムを生成する。このプログラムにより、int型の1個の変数を引数とするfuncAは優先度(3)を含む再利用命令(memoCall)により呼び出される。int型の2個の変数を引数とするfuncBは優先度(2)を含む再利用命令(memocall)により呼び出され、int型の3個の変数を引数とするfuncCは優先度(1)を含む再利用命令(memocall)により呼び出される。
 図35の(b)は、引数の型および引数の個数が異なる複数の関数を含むプログラムのプログラム変換処理部1600による変換例を示す模式図である。ここでは、再利用候補区間解析部1612は、引数の個数および引数の型を使用態様として解析することを想定する。また、再利用度生成部1621は、関数の入力値が採り得る値の組合せに基づいて再利用度を生成することを想定する。
 図35の(b)の右矢印に対して左側に位置する枠の中には、プログラム変換処理部1600に処理される前のソースプログラムの一例がC言語により示されている。また、右矢印に対して右側に位置する枠の中には、プログラム変換処理部1600に処理されたプログラムの一例がアセンブリ言語により示されている。
 ソースプログラムには、プログラムのメインの関数(funcX)と、そのメインの関数により呼び出される4つの関数(funcA乃至D)とが示されている。この4つの関数として、int型の1個の変数を引数とする関数(funcA)と、int型の2個の変数を引数とする関数(funcB)と、bool型の2個の変数を引数とする関数(funcC)とが示されている。さらに、この4つの関数として、bool型の3個の変数を引数とする関数(funcD)が示されている。
 このソースプログラムは、まず、4つの関数(funcA乃至D)における引数の個数および型について、関数毎に再利用候補区間解析部1612により解析される。その後、再利用度生成部1621は、再利用候補区間解析部1612が解析した引数の個数および型に基づいて再利用度を生成する。
 この時、再利用度生成部1621は、関数毎の入力値が採り得る値の組合せに基づいて再利用度を生成する。この再利用度生成部1621は、例えば、関数の入力値が採り得る値の組合せとして入力値の総ビット数を算出する場合には、算出した入力値の総ビット数に基づいて再利用度を生成する。この場合において、この再利用度生成部1621は、int型の1個の変数を引数とする関数(funcA)については入力値の組合せは32ビットと判断する。さらに、int型の2個の変数を引数とする関数(funcB)については、入力値の組合せは「32+32=64」により64ビットと判断する。
 また、bool型の2個の変数を引数とする関数(funcC)については、入力値の組合せは「1+1=2」により2ビットと判断する。そして、bool型の3個の変数を引数とする関数(funcD)については、入力値の組合せは「1+1+1=3」により3ビットと判断する。
 その結果、再利用度生成部1621は、入力値の組合せの逆数を再利用度にして、bool型の2個の変数を引数とするfuncCの再利用度が1番高く、bool型の3個の変数を引数とするfuncDの再利用度が2番目に高い度合いの再利用度を生成する。さらに、再利用度生成部1621は、入力値の組合せの逆数を再利用度にして、int型の1個の変数を引数とするfuncAの再利用度が3番目に高く、int型の2個の変数を引数とするfuncBの再利用度が1番低い度合いの再利用度を生成する。
 次に、優先度生成部1622は、4つの関数(funcA乃至funcD)の優先度を生成する。この優先度生成部1622は、再利用度に基づいて優先度を生成することにより、再利用度が1番高い関数(funcC)には1番優先度が高い優先度(4)を生成し、再利用度が2番目に高い関数(funcD)には2番目に優先度が高い優先度(3)を生成する。また、優先度生成部1622は、再利用度が3番目に高い関数(funcA)には3番目に優先度が高い優先度(2)を生成し、再利用度が1番低い関数(funcB)には優先度が1番低い優先度(1)を生成する。
 そして、再利用命令変換部1623は、図35の(a)において示した再利用命令変換部1623と同様に、実行結果を再利用させる再利用区間の呼出し命令を優先度が含まれる再利用命令に優先度に基づいて変換する。
 このようにして、プログラム変換処理部1600は、右矢印に対して右側に位置する枠の中に示すようなプログラムを生成する。このプログラムにより、int型の1個の変数を引数とするfuncAは優先度(2)を含む再利用命令(memoCall)により呼び出される。さらに、int型の2個の変数を引数とするfuncBは優先度(1)を含む再利用命令(memoCall)により呼び出され、bool型の2個の変数を引数とするfuncCは優先度(4)を含む再利用命令(memoCall)により呼び出される。また、bool型の3個の変数を引数とするfuncCは優先度(3)を含む再利用命令(memoCall)により呼び出される。
 図36は、本発明の第3の実施の形態における引数の型は同じだが使用態様が異なる関数を含むプログラムのプログラム変換処理部1600による変換例を示す模式図である。
 図36の(a)は、引数の型は同じだが引数の使用態様が定数あるいは変数で異なる複数の関数を含むプログラムのプログラム変換処理部1600による変換例を示す模式図である。ここでは、再利用候補区間解析部1612は、引数が定数および変数のいずれであるかおよび引数の採り得る値の限定を使用態様として解析することを想定する。また、再利用度生成部1621は、関数の入力値が採り得る値の組合せに基づいて再利用度を生成することを想定する。
 図36の(a)の右矢印に対して左側に位置する枠の中には、プログラム変換処理部1600に処理される前のソースプログラムの一例がC言語により示されている。また、右矢印に対して右側に位置する枠の中には、プログラム変換処理部1600に処理されたプログラムの一例がアセンブリ言語により示されている。なお、ここでは、優先度生成部1622は、優先度として「1乃至9」の値を生成するものと想定する。
 ソースプログラムには、プログラムのメインの関数(funcX)と、そのメインの関数により呼び出される2つの関数(funcAおよびB)とが示されている。この2つの関数として、1個のint型の変数を引数と定義しているが関数が呼び出される段階で「2」および「3」の2つの値に引数が限定される関数(funcA)と、1個のint型の変数を引数とする関数(funcB)とが示されている。
 このソースプログラムは、まず、2つの関数(funcAおよびB)における引数が定数および変数のいずれであるか、および、引数の採り得る値の限定について関数毎に再利用候補区間解析部1612により解析される。そして、再利用度生成部1621は、再利用候補区間解析部1612が解析した引数の個数および型に基づいて再利用度を生成する。
 その結果、再利用度生成部1621は、1個のint型の変数を引数と定義しているが関数が呼び出される段階で「2」および「3」の2つの値に引数が限定されるfuncAの再利用度が1番高い度合いの再利用度を生成する。さらに、再利用度生成部1621は、1個のint型の変数を引数とするfuncBの再利用度が1番低い度合いの再利用度を生成する。
 次に、優先度生成部1622は、2つの関数(funcAおよびB)の優先度を生成する。この優先度生成部1622は、再利用度に基づいて優先度を生成することにより、再利用度が1番高い関数(funcA)には1番優先度が高い優先度(9)を生成し、再利用度が1番低い関数(funcB)には1番優先度が低い優先度(1)を生成する。
 そして、再利用命令変換部1623は、図35において示した再利用命令変換部1623と同様に、実行結果を再利用させる再利用区間の呼出し命令を優先度が含まれる再利用命令に優先度に基づいて変換する。
 このようにして、プログラム変換処理部1600は、右矢印に対して右側に位置する枠の中に示すようなプログラムを生成する。このプログラムにより、1個のint型の変数を引数と定義しているが関数が呼び出される段階で「2」および「3」の2つの値に引数が限定されるfuncAは優先度(9)を含む再利用命令(memoCall)により呼び出される。さらに、1個のint型の変数を引数とするfuncBは優先度(1)を含む再利用命令(memoCall)により呼び出される。
 図36の(b)は、関数の呼び出される回数が異なる複数の関数を含むプログラムのプログラム変換処理部1600による変換例を示す模式図である。ここでは、再利用候補区間解析部1612および再利用度生成部1621は、図24において示した動作例と同様の動作をすることを想定する。また、ここでは、優先度生成部1622は、優先度として「1乃至5」の値を生成するものとする。
 図36の(b)の右矢印に対して左側に位置する枠の中には、プログラム変換処理部1600に処理される前のソースプログラムの一例がC言語により示されている。また、右矢印に対して右側に位置する枠の中には、プログラム変換処理部1600に処理されたプログラムの一例がアセンブリ言語により示されている。
 ソースプログラムには、プログラムのメインの関数(funcX)と、そのメインの関数により呼び出される2つの関数(funcAおよびB)とが示されている。この2つの関数のうちfuncAは、1個のint型の変数を引数とする関数であり、メインの関数(funcX)において3回呼び出される関数である。funcBは、1個のint型の変数を引数とする関数であり、メインの関数(funcX)において1回呼び出される関数である。
 このソースプログラムは、再利用候補区間解析部1612および再利用度生成部1621によって、図24において示した動作例と同様に解析および再利用度の生成がされる。これにより、1個のint型の変数を引数とする関数であり、メインの関数(funcX)において3回呼び出される関数(funcA)に関しては、1番高い度合いの再利用度が生成される。また、1個のint型の変数を引数とする関数であり、メインの関数(funcX)において1回呼び出される関数(funcB)に関しては、1番低い度合いの再利用度が生成される。
 次に、優先度生成部1622により2つの関数(funcA乃至funcC)の優先度が生成される。優先度生成部1622は、再利用度に基づいて優先度を生成することにより、再利用度が1番高い関数(funcA)には1番優先度が高い優先度(5)を生成し、再利用度が1番低い関数(funcB)には1番優先度が低い優先度(1)を生成する。
 そして、再利用命令変換部1623は、実行結果を再利用させる再利用区間の呼出し命令を優先度が含まれる再利用命令に図36の(a)と同様にして変換する。
 このようにして、プログラム変換処理部1600は、右矢印に対して右側に位置する枠の中に示すようなプログラムを生成する。すなわち、1個のint型の変数を引数とする関数であり、メインの関数(funcX)において3回呼び出されるfuncAは、優先度(5)を含む再利用命令(memoCall)により呼び出されるプログラムが生成される。また、1個のint型の変数を引数とする関数であり、メインの関数(funcX)において1回呼び出されるfuncBは、優先度(1)を含む再利用命令(memoCall)により呼び出されるプログラムが生成される。
 [本発明の第3の実施の形態における再利用命令の一例]
 次に、本発明の第3の実施の形態におけるコンパイル処理装置1500が生成する再利用命令について図面を参照して説明する。
 図37は、本発明の第3の実施の形態における関数の呼出し命令および関数の再利用命令の一例を示す概念図である。ここでは、データ処理装置1100のプロセッサコア1300は図27と同様にMIPSにより構成されることを想定する。また、ここでは、左端は最上位ビット(MSB)を示し、右端は最下位ビット(LSB)を示している。図37の(b)では、図27の(b)に示したMIPSにおける関数の再利用命令の第1再利用フィールド1731および第2再利用フィールド1751に替えて、第1再利用フィールド1732および1733と、第2再利用フィールド1752および1753とが示されている。なお、第1再利用フィールド1732および1733と、第2再利用フィールド1752および1753と以外の各フィールドの機能は、図27と同様のものであるため、図27と同符号を付してここでの各フィールドの説明を省略する。
 図37の(a)には、MIPS命令セットにおける関数の呼出し命令(call)であるJALR命令が示されている。本発明の第3の実施の形態において再利用されない関数の呼出し命令は、図27において示した本発明の第1の実施の形態と同様に、MIPS命令セットにおけるJALR命令が用いられる。
 図37の(b)には、本発明の第3の実施の形態における関数の再利用命令の一例が示されている。
 第1再利用フィールド1732および1733は、第2再利用フィールド1752および1753とともに優先度が含まれる再利用命令であることを示すフィールドである。この第1再利用フィールド1732および1733は、第2再利用フィールド1752および1753のビット列と連結させることによって、優先度を示す10ビットの数値を示すフィールドになる。
 例えば、第1再利用フィールド1732には、第2再利用フィールド1752とともに、優先度が最も低い再利用命令におけるビット列の値が格納されている。この第1再利用フィールド1732は、第2再利用フィールド1752と連結させることによって、10ビットのビット列(0000000001)となる。すなわち、この命令を処理するデータ処理装置において、このビット列(0000000001)は優先度(1)を示すと判断される。
 さらに、第1再利用フィールド1733には、第2再利用フィールド1753とともに、優先度が最も高い再利用命令におけるビット列の値が格納されている。この第1再利用フィールド1733は、第2再利用フィールド1753と連結させることによって、10ビットのビット列(1111111111)となる。すなわち、この命令を処理するデータ処理装置において、このビット列(1111111111)は優先度(1024)を示すと判断される。
 このように、第3の実施の形態における再利用命令変換部1623は、第1再利用フィールド1732乃至1733と、第2再利用フィールド1752乃至1753とを連結したビット列の示す値を変えることで、優先度の異なる再利用命令を生成することが出来る。
 [本発明の第3の実施の形態におけるコンパイル処理装置1500の動作例]
 次に、本発明の第3の実施の形態におけるコンパイル処理装置1500の処理について図面を参照して説明する。
 図38は、本発明の第1の実施の形態におけるコンパイル処理装置1500によるコンパイル処理の処理手順を示すフローチャートである。
 まず、コンパイル処理装置1500により、ソースプログラム記憶部1510からソースプログラムが読み出される(ステップS1911)。次に、再利用候補区間抽出部1611により、再利用候補区間が抽出される(ステップS1912)。
 そして、再利用候補区間解析部1612により、再利用候補区間の使用態様が解析される(ステップS1913)。なお、ステップS1913は、特許請求の範囲に記載の解析手順の一例である。
 次に、再利用度生成部1621により、再利用候補区間の解析結果に基づいて再利用度が生成される(ステップS1914)。なお、ステップS1914は、特許請求の範囲に記載の再利用度生成手順の一例である。
 続いて、優先度生成部1622により、再利用度に基づいて優先度が生成される(ステップS1915)。
 そして、再利用命令変換部1623により、再利用度および優先度に基づいて再利用候補区間の呼出し命令が優先度が含まれる再利用命令に変換される(ステップS1916)。これは、関数が再利用候補区間である場合には、関数の呼出し命令(call)が優先度が含まれる再利用命令(memoCall)に変換されることを意味する。なお、ステップS1915は、特許請求の範囲に記載の命令変換手順の一例である。
 そして、コード生成部1522により、変換された命令を含むプログラムに基づいて機械語プログラムのコードであるオブジェクトプログラムが生成される(ステップS1917)。
 このように、本発明の第3の実施の形態によれば、優先度を生成することによって、実行結果が再利用される度合いに基づいて、再利用される再利用候補区間の呼出し命令を履歴メモリに保存される優先度を含む再利用命令に変換することが出来る。
 <4.第4の実施の形態>
 [プロセッサコア1300および履歴管理部1400の構成例]
 図39は、本発明の第4の実施の形態におけるプロセッサコア1300および履歴管理部1400の構成例を示すブロック図である。ここでは、図30において示した構成に加えて、優先度テーブル1450、履歴メモリ容量管理部1460、および、低優先度履歴消去部1470を備えている。ここでは、優先度テーブル1450、履歴メモリ容量管理部1460、および、低優先度履歴消去部1470以外の構成の機能は、図30とほぼ同様のものであるため、図30と同符号を付してここでの詳細な説明を省略する。
 実行部1330は、命令デコーダ1320から優先度が含まれる再利用命令に基づく制御信号が供給された場合には、優先度が含まれる再利用命令が指定する再利用区間の処理を開始する。この処理の開始とともに、レジスタファイル1340から取得した再利用区間の区間識別情報および優先度を信号線1309を介して履歴管理部1400に出力する。
 また、履歴対象データ保持部1410は、実行履歴を登録するための情報が整った場合には、実行履歴とともに優先度を履歴登録部1440に供給する。
 履歴登録部1440は、新たな実行履歴を履歴メモリ1430に登録する場合には、優先度を履歴メモリ1430に供給する。また、この履歴登録部1440は、新たな実行履歴を履歴メモリ1430に登録する際に、履歴メモリ容量管理部1460から通知された履歴メモリの空き容量より新たな実行履歴の容量のほうが大きい場合には、登録を一時中断する。そして、この場合において、履歴登録部1440は、その登録を一時中断した実行履歴に関する優先度を低優先度履歴消去部1470に供給する。
 また、この履歴登録部1440は、既に登録された実行履歴に関する優先度よりも新たな実行履歴に関する優先度のほうが低いことを示す情報が低優先度履歴消去部1470から供給された場合には、新たな実行履歴は登録しない。
 優先度テーブル1450は、履歴メモリ1430に登録されている実行履歴に関する優先度および履歴メモリ1430における実行履歴のアドレスを優先度情報として保持するものである。この優先度テーブル1450は、例えば、履歴メモリ1430に新たな実行履歴が保持された場合には、履歴メモリ1430から供給されたその登録された実行履歴に関する優先度と、その登録された実行履歴のアドレス情報とを優先度情報として保持する。そして、この優先度テーブル1450は、例えば、履歴メモリ1430において実行履歴が消去された場合には、その消去された実行履歴に関する優先度情報を消去する。
 また、この優先度テーブル1450は、低優先度履歴消去部1470によって検索された最も低い優先度の優先度情報を消去候補情報として低優先度履歴消去部1470に供給する。なお、優先度テーブル1450は、特許請求の範囲に記載の優先度テーブルの一例である。
 履歴メモリ容量管理部1460は、履歴メモリ1430の空き容量を管理するものである。この履歴メモリ容量管理部1460は、例えば、履歴メモリ1430に新たな実行履歴が登録される度に、履歴メモリ1430の空き容量を測定する。さらに、この履歴メモリ容量管理部1460は、履歴メモリ1430から実行履歴が消去される度に、履歴メモリ1430の空き容量を測定する。この履歴メモリ容量管理部1460は、履歴メモリ1430の空き容量に関する情報を履歴登録部1440に供給する。
 低優先度履歴消去部1470は、履歴メモリ1430から消去候補情報が指し示す実行履歴を削除するものである。この低優先度履歴消去部1470は、最小値優先度履歴検索部1471と、優先度比較部1472と、消去部1473とを備える。
 最小値優先度履歴検索部1471は、優先度テーブル1450から最も低い優先度を含む優先度情報を消去候補情報として検索するものである。この最小値優先度履歴検索部1471は、検索された消去候補情報を優先度テーブル1450から抽出し、その抽出した消去候補情報を優先度比較部1472に供給する。なお、最小値優先度履歴検索部1471は、特許請求の範囲に記載の最低優先度履歴検索部の一例である。
 優先度比較部1472は、新たな実行履歴に関する優先度と、最小値優先度履歴検索部1471から供給された消去候補情報に含まれる優先度とを比較するものである。そして、この優先度比較部1472は、消去候補情報に含まれる優先度のほうが新たな実行履歴に関する優先度より低い場合には、この消去候補情報を消去部1473に供給する。
 また、この優先度比較部1472は、新たな実行履歴に関する優先度のほうが消去候補情報に含まれる優先度よりも低い場合には、新たな実行履歴の登録を中止させる情報を履歴登録部1440に供給する。なお、優先度比較部1472は、特許請求の範囲に記載の優先度比較部の一例である。
 消去部1473は、優先度比較部1472から供給された消去候補情報に基づいて履歴メモリ1430から実行履歴を消去するものである。この消去部1473は、優先度比較部1472から供給された消去候補情報に含まれているアドレスが指し示す実行履歴を履歴メモリ1430から消去する。なお、消去部1473は、特許請求の範囲に記載の消去部の一例である。
 [履歴メモリ1430のデータ構造例]
 図40は、本発明の第4の実施の形態における履歴メモリ1430のデータ構造の一例を示す概念図である。ここでは、履歴メモリ1430により、区間識別情報ごとに保持された実行履歴のうち、1つの区間識別情報における実行履歴を木構造により保持する構成が示されている。この例では、引数がn個であり、かつ、実行結果である出力をm個の格納先に返す関数を想定している。また、ここでは、関数の開始アドレスを区間識別情報として用いることとする。さらに、ここでは、m個目の出力のアドレスを優先度情報の登録された実行履歴のアドレスとすることとする。
 この例では、木構造における関数ルート1815と、第1の引数ノード1825および1826と、第nの引数ノード1835乃至1838と、第1の出力ノード1845乃至1848と、第mの出力ノード1855乃至1858とが示されている。
 関数ルート1815には、図31において示した第1の実施の形態における関数ルート1810と同様に、区間識別情報である関数の開始アドレスと、第1の引数ノード1825を指し示すポインタとが示されている。
 第1および第nの引数ノード1825、1826および1835乃至1838には、図31において示した第1の実施の形態における第1および第nの引数ノード1821、1822および1831乃至1834と同様に、引数の入力値と、型と、種類とが示されている。
 また、第1および第nの引数ノード1825、1826および1835乃至1838には、図31における第1の実施の形態の引数ノード1821、1822および1831乃至1834と同様に、右ポインタおよび下ポインタが示されている。さらに、第1および第nの引数ノード1825、1826および1835乃至1838には、履歴メモリ1430から消去される場合において、次の引数の引数ノードを指し示す消去ポインタが点線の矢印で示されている。また、第nの引数ノード1835乃至1838の各々は、第1の出力ノード1845乃至1848にそれぞれ連結されている。
 第1および第mの出力ノード1845乃至1848および1855乃至1858には、図31において示した第1の実施の形態の出力ノード1841乃至1844および1851乃至1854と同様に、実行履歴を実行した結果の出力値と、種類と、型とが示されている。また、第1の出力ノード1845乃至1848には、第1の実施の形態の出力ノード1841乃至1844と同様に、右ポインタが示されている。さらに、第1および第mの出力ノード1845乃至1848および1855乃至1858には、履歴メモリ1430から消去される場合において、次の引数の引数ノードを指し示す消去ポインタが点線の矢印で示されている。
 このような木構造における入力値の比較処理は、図31において示した第1の実施の形態における木構造における入力値の比較処理と同様であるため、ここでの詳細な説明を省略する。
 このような木構造において、履歴メモリ1430から実行履歴を消去する場合には、その実行履歴に関するm番目の出力ノードのアドレスが消去部1473から供給されると、そのアドレスの出力ノードから実行履歴の消去が開始される。この場合において、その指定されたm番目の出力ノードから1番目の出力ノードまでの出力ノードをそれぞれの消去ポインタを参照して抽出し、1番目の出力ノードの消去ポインタが指し示すn番目の入力ノードを参照するとともに出力ノードを消去する。
 次に、履歴メモリ1430から消去する実行履歴に関する入力ノードの消去をn番目の入力ノードから開始する。この場合において、消去ポインタにより指し示された入力ノードが、その消去ポインタを保持していたノード以外への右ポインタあるいは下ポインタを保持している場合には、その入力ノードは消去しない。
 そして、その消去しない入力ノードにおいて、消去された入力ノードを指し示すポインタが消去されることによって、入力ノードの消去を終了させる。また、1番目の入力ノードにおいて、消去された入力ノード以外を指し示す右ポインタまたは下ポインタが保持されていない場合には、関数ルート1815も消去させて実行履歴の消去を終了させる。
 例えば、m番目の出力ノードにおける出力ノード1855のアドレスが消去部1473から供給された場合には、その出力ノード1855からこの出力に関する実行履歴の消去が開始される。これにより、出力ノード1855から1番目の出力ノード1845まで消去ポインタを参照して抽出し、1番目の出力ノード1845の消去ポインタが指し示すn番目の入力ノード1835を参照するとともに、出力ノード1845から1855までの出力ノードを消去する。
 次に、n番目の入力ノード1835が出力ノード1845以外への右ポインタあるいは下ポインタを含んでいるか否か検出される。この場合においては、n番目の入力ノード1835は右ポインタにより1番目の出力ノード1845を指し示しているので、n番目の入力ノード1836を指し示す下ポインタがn番目の入力ノード1835に含まれているか否かが検出される。
 この場合において、n番目の入力ノード1836が履歴メモリ1430に保持されており、n番目の入力ノード1835に下ポインタが含まれているときには、n番目の入力ノード1835は消去しないで、n番目の入力ノード1835における右ポインタを消去する。そして、実行履歴の消去を終了させる。
 一方、n番目の入力ノード1836が履歴メモリ1430に保持されていないで、n番目の入力ノード1835に下ポインタが含まれていないときには、n番目の入力ノード1835の消去ポインタが指し示す入力ノードを参照するとともに入力ノード1835を消去する。そして、消去しない入力ノードを検出するか、入力ノードを全て消去して関数ルート1815を消去するまで入力ノードの消去が繰り返される。
 [優先度テーブル1450のデータ構造例]
 図41は、本発明の第4の実施の形態における優先度テーブル1450のデータ構造の一例を示す概念図である。ここでは、一例として、1乃至6の優先度と、この優先度を含む再利用命令により生成された実行履歴に関するアドレスとが示されている。
 優先度カラム1861には、優先度テーブル1450に登録されている優先度が示されている。この優先度カラム1861には、履歴メモリ1430に登録されている実行履歴に関する全ての優先度が格納される。例えば、1乃至6の優先度を含む再利用命令により生成された実行履歴が履歴メモリ1430に保持されている場合には、優先度カラム1861には1乃至6の優先度が格納されている。
 実行履歴最終出力アドレスカラム1862には、優先度カラム1861に示した優先度を含む再利用命令によって生成された履歴メモリ1430における実行履歴の最終出力アドレスが示されている。この最終出力アドレスは、例えば、図41において示したm番目の出力ノード1855乃至1858のアドレスである。
 この例において、例えば、優先度が「6」である再利用区間の実行履歴が履歴メモリ1430に新たに登録された場合には、優先度(6)および履歴メモリ1430におけるm番目の出力ノードのアドレスが、履歴メモリ1430から優先度テーブル1450に供給される。この場合において、優先度テーブル1450は、優先度カラム1861に優先度(6)が既に登録されているときには、その優先度(6)に対する実行履歴最終出力アドレスカラム1862に新たな優先度情報のm番目の出力ノードのアドレスを追加する。
 また、この場合において、優先度カラム1861に優先度(6)が未登録の場合には、新たに登録するとともに、その優先度(6)に対応する実行履歴最終出力アドレスカラム1862を生成して、新たな優先度情報のm番目の出力ノードのアドレスを登録する。
 [本発明の第4の実施の形態におけるプロセッサコア1300および履歴管理部1400により保存される実行履歴の一例]
 図42は、本発明の第4の実施の形態におけるプロセッサコア1300により処理されるプログラムおよび履歴管理部1400により保存される実行履歴の一例を示す概念図である。ここでは、従来技術を用いて実行履歴を保存する場合と、本発明の第4の実施の形態により実行履歴を保存する場合とが表されている。なお、ここでは、変換されたプログラムの実行は、ここで示したプログラムの上から順に実行されるものと想定する。
 図42の(a)には、従来技術によるソースプログラムの変換例を示す模式図である。ここでは、右矢印に対して左側にある枠の中には、従来技術により変換されるソースプログラムがC言語により示されている。また、右矢印に対して右側にある枠の中には、従来技術により変換されたプログラムの一例がアセンブリ言語により示されている。
 ソースプログラムには、プログラムのメインの関数(funcX)と、そのメインの関数により呼び出される7つの関数とが示されている。この7つの関数として、int型の1個の変数を引数とする関数(funcA)と、bool型の1個の変数を引数とする関数(funcB)と、int型の1個の変数およびbool型の1個の変数を引数とする関数(funcC)とが示されている。さらに、bool型の3個の変数を引数とする関数(funcD)と、char型の1個の変数を引数とする関数(funcE)と、bool型の2個の変数を引数とする関数(funcF)とが示されている。また、int型の2個の変数を引数とする関数(funcG)が示されている。
 このソースプログラムは、関数を再利用区間として指定する場合には全ての関数を再利用の対象とする従来技術のコンパイル処理装置により、全ての関数が再利用の対象とされるプログラムに変換される。その結果、右矢印に対して右側にある枠の中に示すように、funcA乃至Gを呼出し命令(call)で呼び出し、funcA乃至Gの実行結果を全て再利用するプログラムを生成する。
 図42の(b)は、図42の(a)の右矢印の右側にある枠の中に示したプログラムを上から順に1回ずつ実行した場合における履歴メモリ1430に保存される実行履歴の一例を示す模式図である。なお、ここでは、実行履歴が登録される履歴メモリは、便宜上、入力値および出力値の型や個数を問わず、3つの関数に関する実行履歴を登録できるものとする。また、図32の(a)と同様に、新たな実行履歴を登録する際に履歴メモリの空き容量が無い場合には、最も長い期間未使用だった実効履歴を履歴メモリから消去した後に新たな実行履歴を履歴メモリに登録するものとする。さらに図32の(a)と同様に、図42の(a)において示した変換されたプログラムの呼出し命令を、上から順に1回ずつ実行するものとする。
 従来技術における履歴メモリへの実行履歴の登録方法は、図32の(b)において示した方法と同様のものであるので、ここでの詳細な説明を省略する。図42の(a)の変換されたプログラムの呼出し命令を上から順に1回ずつ実行された結果、図42の(b)において示すように、funcE乃至Gの3つの関数の実行履歴が履歴メモリに登録される。
 このように、従来技術では、常に再利用される確率が高い実行履歴が履歴メモリに登録されているわけではない。すなわち、実行するプログラムによっては、全く再利用されない関数の実行履歴が履歴メモリに登録され、再利用の効果が出ない場合が生じる。
 図42の(c)は、本発明の第1の実施の形態によるソースプログラムの変換例を示す模式図である。ここでは、再利用度生成部1621は、関数の入力値が採り得る値の組合せに基づいて再利用度を生成することを想定する。
 ここでは、右矢印に対して左側にある枠の中には、図42の(a)において示したソースプログラムと同様のソースプログラムがC言語により示されている。また、右矢印に対して右側にある枠の中には、本発明の第3の実施の形態により変換されたプログラムの一例がアセンブリ言語により示されている。
 このソースプログラムは、図32の(c)において示したソースプログラムと同様に再利用候補区間解析部1612により解析され、そして、再利用度生成部1621により同様にして再利用度が生成される。
 その結果、bool型の1個の変数を引数とするfuncBに対して1番高い再利用度が生成され、bool型の2個の変数を引数とするfuncFに対して2番目に高い再利用度が生成される。また、bool型の3個の変数を引数とするfuncDに対して3番目に高い再利用度が生成され、char型の1個の変数を引数とするfuncEに対して4番目に高い再利用度が生成される。さらに、int型の1個の変数およびbool型の1個の変数を引数とするfuncCに対して5番目に高い再利用度が生成され、int型の1個の変数を引数とするfuncFには6番目に高い再利用度が生成される。そして、int型の2個の変数を引数とするfuncGには1番低い再利用度が生成される。
 次に、優先度生成部1622により7つの関数(funcA乃至G)の優先度が生成される。優先度生成部1622は、再利用度に基づいて優先度を生成することにより、再利用度が1番高い関数(funcB)には1番優先度が高い優先度(7)を生成し、再利用度が2番目に高い関数(funcF)には2番目に優先度が高い優先度(6)を生成する。さらに、優先度生成部1622は、再利用度が3番目に高い関数(funcD)には3番目に高い優先度(5)を生成し、再利用度が4番目に高い関数(funcE)には4番目に高い優先度(4)を生成する。また、再利用度が5番目に高い関数(funcC)には5番目に高い優先度(3)を生成し、再利用度が6番目に高い関数(funcA)には6番目に高い優先度(2)を生成する。そして、再利用度が1番低い関数(funcG)には1番低い優先度(1)を生成する。
 そして、再利用命令変換部1623は、実行結果を再利用させる再利用区間の呼出し命令を優先度が含まれる再利用命令に優先度に基づいて変換する。この図42の(c)の場合においては、再利用命令変換部1623は、履歴メモリの容量を考慮しないため、優先度が生成された全ての関数の呼出し命令を優先度が含まれる再利用命令に変換する。
 その結果、再利用命令変換部1623は、7つの関数(funcA乃至G)の呼出し命令(call)を優先度が含まれる再利用命令(memoCall)に変換したプログラムを生成する。
 図42の(d)には、図42の(c)の右矢印の右側にある枠の中に示したプログラムに基づいて登録される実行履歴の一例が示されている。なお、履歴メモリ1430は、便宜上、入力値および出力値の型や個数を問わず、3つの関数に関する実行履歴を登録できるものとする。また、ここでは、図42の(a)において示した変換されたプログラムの命令を、上から順に1回ずつ実行するものとする。
 本発明の第4の実施の形態におけるプロセッサコア1300は、図42の(a)において示した変換されたプログラムに基づいて、優先度が含まれる再利用命令(memoCall)により呼び出されるfuncA乃至Gの実行履歴を履歴管理部1400に出力する。まず、最初に、funcAが再利用区間として呼び出され、funcAの実行履歴が履歴メモリ1430に登録される。この時、図40において示した実行履歴のm番目の出力ノードのアドレスおよび優先度が履歴メモリ1430から優先度テーブル1450に供給されて、優先度テーブル1450に優先度情報として登録される。そして、funcAに続いて呼び出される2つの関数(funcBおよびC)もfuncAと同様に、再利用区間として呼び出された後に実行履歴が登録されるとともに、優先度テーブル1450に優先度情報が登録される。
 その後、履歴メモリには空き容量が無い状態で、funcDが再利用区間として呼び出される。この時、優先度比較部1472は、funcDの実行履歴に関する優先度(5)と、優先度テーブル1450から最小値優先度履歴検索部1471により検索された消去候補情報(funcAの優先度情報)の優先度(2)とを比較する。この結果、最小値優先度履歴検索部1471は、消去候補情報(funcAの優先度情報)を消去部1473に供給する。そして、消去部1473は、供給された消去候補情報に基づきfuncAの実行履歴を消去する。この時、優先度テーブル1450は、優先度テーブル1450から供給されるfuncAの実行履歴の消去情報に従ってfuncAの優先度情報を消去する。そして、履歴登録部1440は、履歴メモリ容量管理部1460から供給される履歴メモリ1430の空き情報に基づいて履歴メモリ1430の空き容量を確認した後に、funcDの実行履歴を履歴メモリ1430に登録する。また、このfuncDの実行履歴の登録に伴って、優先度テーブル1450にfuncDの実行履歴に関する優先度情報が登録される。
 次に、funcEが再利用区間として呼び出される。この時、優先度比較部1472は、funcDのときと同様に、funcEの実行履歴に関する優先度(4)と、消去候補情報(funcCの優先度情報)の優先度(3)とを比較する。この比較の結果、消去候補情報(funcCの優先度情報)の優先度(3)のほうが低いと判断され、funcDのときと同様に、funcCの実行履歴が履歴メモリ1430から消去され、新たにfuncEの実行履歴が履歴メモリ1430に登録される。
 そして、funcFが再利用区間として呼び出される。優先度比較部1472による比較の結果、funcFの実行履歴に関する優先度(6)より消去候補情報(funcEの優先度情報)の優先度(4)のほうが低いと判断される。そして、funcDおよびfuncEのときと同様に、funcEの実行履歴が履歴メモリ1430から消去され、新たにfuncFの実行履歴が履歴メモリ1430に登録される。
 最後に、funcGが再利用区間として呼び出される。優先度比較部1472による比較の結果、funcGの実行履歴に関する優先度(1)は、消去候補情報(funcDの優先度情報)の優先度(5)よりも低いと判断される。そして、優先度比較部1472は、funcGの実行履歴の登録を中止させる情報を履歴登録部1440に供給する。これにより、履歴登録部1440は、履歴メモリ1430へのfuncGの実行履歴の登録を中止する。
 このように、図42の(c)の変換されたプログラムの呼出し命令を上から順に1回ずつ実行された結果、図42の(d)において示すように、funcB、funcD、および、funcFの実行履歴が履歴メモリに登録される。
 このように、本発明の第4の実施の形態によれば、優先度に従って履歴メモリ1430に実行履歴を登録することにより、常に再利用される確率が高い関数を履歴メモリ1430に登録しておくことができる。
 [本発明の第4の実施の形態におけるプロセッサコア1300および履歴管理部1400の動作例]
 次に、本発明の第4の実施の形態におけるプロセッサコア1300および履歴管理部1400の処理について図面を参照して説明する。
 図43は、本発明の第4の実施の形態におけるプロセッサコア1300および履歴管理部1400による関数の実行処理の処理手順を示すフローチャートである。
 まず、フェッチ部1310およびレジスタファイル1340に、関数を参照する命令およびその関数の入力値が読み出される(ステップS1931)。次に、命令デコーダ1320によって、関数を参照する命令がデコードされる(ステップS1932)。続いて、デコードした命令が再利用命令か否かが解析される(ステップS1933)。解析の結果、デコードした命令が再利用命令でない場合には、実行部1330によって、レジスタファイル1340から供給される入力値に基づいてその関数が実行され、実行結果が出力される(ステップS1940)。そして、関数の実行処理は終了する。
 一方、デコードした命令が再利用命令である場合には、検索要求入力部1421によって、実行部1330から供給された関数の開始アドレスおよび入力値を用いて履歴メモリ1430から実行履歴が検索される(ステップS1934)。
 次に、実行履歴があるか否かが判断される(ステップS1935)。実行履歴が履歴メモリ1430にある場合には、実行結果出力部1422によって、実行結果が出力される(ステップS1938)。続いて、実行部1330は、実行結果が出力された関数の実行を中止させる(ステップS1939)。そして、関数の実行は終了する。
 一方、実行履歴が履歴メモリ1430にない場合には、実行部1330によって、レジスタファイル1340から供給される入力値に基づいてその関数が実行され、実行結果が出力される(ステップS1936)。そして、履歴登録部1440によって、履歴メモリ1430の空き容量に応じた実行履歴の登録処理が行われる(ステップS1950)。そして、関数の実行は終了する。
 次に、本発明の第4の実施の形態によるステップS1950の処理について図面を参照して説明する。
 図44は、本発明の第4の実施の形態における履歴管理部1400による実行履歴の登録処理(ステップS1950)の処理手順例を示すフローチャートである。
 まず、履歴登録部1440により、履歴メモリ容量管理部1460から供給された履歴メモリ1430の空き容量の情報に基づいて、新たな実行履歴を登録する空き容量が履歴メモリ1430にあるか否かが判断される(ステップS1951)。その空き容量が履歴メモリ1430に有る場合には、実行履歴が履歴メモリ1430に登録される(ステップS1952)。続いて、その実行履歴の優先度および履歴メモリ1430における最後の出力ノードのアドレスが優先度テーブル1450に登録される(ステップS1953)。そして、実行履歴の登録処理は終了する。
 一方、新たな実行履歴を登録する空き容量が履歴メモリ1430にない場合には、新たな実行履歴の優先度と、最小値優先度履歴検索部1471が検索した優先度が最小値の優先度情報の優先度とが優先度比較部1472により比較される(ステップS1954)。そして、新たな実行履歴の優先度が優先度情報の優先度よりも低い場合には、新たな実行履歴の履歴メモリ1430への登録は中止される(ステップS1955)。そして、実行履歴の登録処理は終了する。
 また、優先度情報の優先度よりも新たな実行履歴の優先度のほうが高い場合には、消去部1473によりその優先度情報が指し示す実行履歴が履歴メモリ1430から消去される(ステップS1956)。そして、ステップS1951に戻り、処理が繰り返される。
 このように、本発明の第4の実施の形態によれば、優先度に従って履歴メモリ1430に実行履歴を登録することにより、常に再利用される確率が高い関数を履歴メモリ1430に登録しておくことができる。
 このように、本発明の実施の形態によれば、再利用度に基づいて命令区間の呼び出し命令を再利用命令に変換することによって、再利用される確率の高い命令区間の実行履歴のみを履歴メモリ1430に保持することができる。これにより、実行履歴が再利用される効率を改善することができる。
 次に、第3の本発明であるデータ処理装置、データ処理方法、プログラム解析処理装置およびプログラム解析処理方法について図45乃至図60を参照して説明する。
 以下、第3の本発明を実施するための形態(以下、実施の形態と称する)について説明する。
説明は以下の順序により行う。
 1.第1の実施の形態(データ処理制御:入力値設定命令アドレスの事前登録の例)
 2.第2の実施の形態(プログラム解析処理:入力値設定命令アドレスの抽出例)
 3.第3の実施の形態(データ処理制御:プログラムの実行中における入力値設定命令アドレスの登録例)
 4.第4の実施の形態(履歴データ転送制御:プログラム実行ごとにデータ処理装置の外部から履歴データを履歴メモリに読み出す例)
 <1.第1の実施の形態>
 [データ処理装置の構成例]
 図45は、本発明の第1の実施の形態におけるデータ処理装置の一構成例を示すブロック図である。ここでは、集積回路を構成するデータ処理装置2100と、バス2120と、主記憶部2130とが示されている。この集積回路は、データ処理装置2100において、バス2120を介して読み出される主記憶部2130からの命令列に従って、処理を実行するものである。
 データ処理装置2100は、一次キャッシュ2200と、データ処理部2300と、実行結果再利用処理部2400と、検索開始命令アドレス管理部2500とを備える。なお、データ処理装置2100は、特許請求の範囲に記載のデータ処理装置の一例である。
 一次キャッシュ2200は、バス2120を介して主記憶部2130から命令およびデータを読み出す際、または、書き込む際の処理により生じる遅延時間を軽減するためのメモリである。この一次キャッシュ2200は、例えば、DRAM(Dynamic Random Access Memory)により実現される。
 この一次キャッシュ2200は、命令キャッシュ2210およびデータキャッシュ2220を備える。命令キャッシュ2210は、主記憶部2130から読み出された過去の命令を一時的に保持するものである。この命令キャッシュ2210は、データ処理部2300からの要求に従って、その保持された命令を、命令線2219を介してデータ処理部2300に出力する。
 この命令キャッシュ2210は、データ処理部2300から要求された命令を保持している場合には、その保持されている複数の命令のうち、その要求された命令をデータ処理部2300に出力する。一方、データ処理部2300から要求された命令を保持していない場合には、命令キャッシュ2210は、データ処理部2300によって主記憶部2130から読み出された命令を保持する。
 データキャッシュ2220は、主記憶部2130から読み出された過去のデータを一時的に保持するものである。このデータキャッシュ2220は、データ処理部2300からの要求に従って、その保持されたデータを、データ線2229を介してデータ処理部2300に出力する。
 このデータキャッシュ2220は、データ処理部2300から要求されたデータが保持されている場合には、その保持されている複数のデータのうち、その要求されたデータをデータ処理部2300に出力する。一方、データ処理部2300から要求されたデータが保持されていない場合には、データキャッシュ2220は、データ処理部2300により主記憶部2130から読み出されたデータを保持する。また、データキャッシュ2220は、主記憶部2130に書き戻すためのデータがデータ処理部2300から供給された場合には、そのデータを保持する。
 データ処理部2300は、主記憶部2130から読み出された命令に基づく処理を実行するものである。このデータ処理部2300は、例えば、命令キャッシュ2210を介して主記憶部2130から命令を読み出して、その読み出された命令に従って、データキャッシュ2220を介して主記憶部2130に記憶されたデータを読み出す。また、データ処理部2300は、例えば、その読み出されたデータを用いて、演算命令に基づく演算処理を実行する。
 また、データ処理部2300は、例えば、関数の命令区間における処理を実行する場合には、データキャッシュ2220からの関数における引数の入力値を用いて、その関数の演算処理を実行して、その演算処理の結果である実行結果をデータキャッシュ2220に出力する。このとき、データ処理部2300は、その関数における入力値および実行結果を実行結果再利用処理部2400に出力する。このデータ処理部2300は、例えば、プロセッサコアにより実現される。
 実行結果再利用処理部2400は、過去に実行された命令区間の入力値と、再び実行される命令区間の入力値とが一致した場合には、その過去に実行された命令区間の実行結果を再利用する実行結果再利用処理を実行するものである。ここでは、複数回実行される命令区間のうち、過去に実行された命令区間の実行結果を再利用することができる命令区間を再利用区間という。すなわち、この再利用区間とは、複数回実行される命令区間のうち、命令区間における入力値が同じであれば実行結果も同じとなる命令区間のことをいう。
 この実行結果再利用処理部2400は、複数回実行される再利用区間における入力値および実行結果を実行履歴として保持する。また、実行結果再利用処理部2400は、再び実行される再利用区間の入力値と、その保持された実行履歴における入力値とが同一である場合には、その保持された実行履歴における実行結果をデータ処理部2300に出力する。これとともに、実行結果再利用処理部2400は、その再利用区間における処理を省略(スキップ)するための指示をデータ処理部2300に通知する。
 この実行結果再利用処理部2400は、例えば、再利用区間である関数の引数の入力値と、その保持された実行履歴における入力値とが同一である場合には、その保持された実行履歴における実行結果をデータ処理部2300に出力する。これとともに、実行結果再利用処理部2400は、その関数における処理をスキップするための指示をデータ処理部2300に通知する。
 検索開始命令アドレス管理部2500は、実行結果再利用処理部2400における実行履歴の検索を開始する基準となる命令アドレスを管理するものである。この検索開始命令アドレス管理部2500は、実行結果再利用処理部2400において保持された実行履歴における入力値と、再利用区間の実行のために設定された入力値との比較を開始するタイミングを示す基準として命令アドレスを再利用区間ごとに管理する。また、検索開始命令アドレス管理部2500は、その管理された命令アドレスに基づいて、実行結果再利用処理部2400に実行履歴の検索の開始を指示する。
 バス2120は、データ処理装置2100と主記憶部2130との間の通信を行うものである。このバス2120は、主記憶部2130に記憶されているプログラムをデータ処理装置2100に転送する。また、このバス2120は、データ処理装置2100から出力されたデータを主記憶部2130に転送する。
 主記憶部2130は、データ処理装置2100に処理を実行させるためのプログラムを記憶するものである。ここでは、このプログラムは、ABI(Application Binary Interface)の規定に基づいて生成されたプログラムであることを想定する。このプログラムは、例えば、SPARC(Scalable Processor Architecture)_ABIに基づいて生成されるものである。このようなプログラムにおいては、データ処理装置2100によって、関数における入力値および実行結果が格納される場所を特定することができるため、実行結果の再利用を実現することができる。
 [データ処理部2300および実行結果再利用処理部2400の構成例]
 図46は、本発明の第1の実施の形態におけるデータ処理部2300および実行結果再利用処理部2400の一構成例を示すブロック図である。
 データ処理部2300は、フェッチ部2310と、命令デコーダ2320と、実行部2330と、レジスタファイル2340とを備える。この実行部2330は、ロードユニット2331と、入力選択部2332と、演算回路2333と、ストアユニット2334と、プログラムカウンタ2350とを備える。
 また、実行結果再利用処理部2400は、実行履歴検索部2410と、実行結果出力部2420と、履歴メモリ2430とを備える。さらに、検索開始命令アドレス管理部2500は、アドレス判定部2510および入力値設定命令アドレステーブル2520を備える。
 フェッチ部2310は、命令キャッシュ2210に保持されている命令、または、主記憶部2130に記憶されている命令を、命令線2219を介して読み出すものである。このフェッチ部2310は、プログラムカウンタ2350から出力される命令アドレスに従って、命令キャッシュ2210から命令を読み出す。
 このフェッチ部2310は、例えば、再利用区間である関数を呼び出すための呼出し命令の前に、その関数における引数の入力値を設定するための入力値設定命令を読み出す。そして、その入力値設定命令が読み出された後に、フェッチ部2310は、その関数の呼出し命令を読み出す。
 また、フェッチ部2310は、読み出された命令を命令デコーダ2320に供給する。また、履歴メモリ2430における実行結果を再利用するための関数省略信号が実行履歴検索部2410から供給された場合には、フェッチ部2310は、例えば、その実行結果を設定するための命令を命令デコーダ2320に供給する。
 命令デコーダ2320は、フェッチ部2310から供給された命令を解読(デコード)して、その解読内容に基づいて、実行部2330、レジスタファイル2340およびアドレス判定部2510を制御するものである。
 この命令デコーダ2320は、フェッチ部2310から入力値設定命令が供給された場合には、実行データ保持部2440に関数の引数の入力値を保持させるために、入力値設定信号をアドレス判定部2510に供給する。この場合において、命令デコーダ2320は、フェッチ部2310から供給された命令が、関数における引数の入力値を設定するための入力値設定命令であるか否かを判断する。この命令デコーダ2320は、例えば、ABIの規定に基づいて、フェッチ部2310からの命令が入力値設定命令であるか否かを判断する。ここで、MIPS(Microprocessor without Interlocked Pipeline Stages)のABIの規定に基づく判断例について簡単に説明する。
 MIPSの規定では、例えば、引数の入力値が全て整数である場合において、引数が4個以下のときには、レジスタファイル2340におけるレジスタ4番乃至7番に入力値が格納される。また、引数が5個以上のときには、5番目以上の引数の入力値が主記憶部2130におけるスタック領域にスタックされる。具体的には、5番目以上の引数の入力値は、レジスタファイル2340のレジスタ29番に格納されたスタックポイント値に16以上の値が加算された値に対応する主記憶部2130のスタック領域にスタックされる。
 したがって、命令デコーダ2320は、例えば、ロードワード命令(lw)に示された転送先レジスタがレジスタ4番乃至7番である場合には、入力値設定命令と判断する。また、命令デコーダ2320は、引数が5個以上であり、かつ、その全ての引数が整数である場合には、ストアワード命令(sw)に示された転送先レジスタがレジスタ29番であり、かつ、そのオフセット値が「16」以上となるため、入力値設定命令と判断する。
 このようにして、命令デコーダ2320は、フェッチ部2310から供給された命令に示されるデータの格納先に基づいて、その命令が入力値設定命令であるか否かを判断する。そして、入力値設定命令と判断された場合には、命令デコーダ2320は、入力選択部2332から出力されるデータを引数の入力値として実行データ保持部2440に保持させるために、入力値設定信号をアドレス判定部2510に供給する。
 この命令デコーダ2320は、例えば、主記憶部2130から読み出された関数の入力値を設定するための入力値設定命令を受け付けた場合には、ロードユニット2331から読み出された入力値をレジスタファイル2340に格納するように制御する。これとともに、命令デコーダ2320は、アドレス判定部2510に対し入力値設定信号を供給する。
 また、命令デコーダ2320は、例えば、レジスタファイル2340に格納されているデータを関数の入力値として設定するための入力値設定命令を受け付けた場合には、レジスタファイル2340における1つのレジスタに格納された入力値を他のレジスタに転送させる。これとともに、命令デコーダ2320は、アドレス判定部2510に対し入力値設定信号を供給する。
 また、命令デコーダ2320は、入力値設定命令の後に、関数を呼び出すための呼出し命令を受け付けた場合には、関数の先頭アドレスにジャンプする旨を示す関数呼出し信号をアドレス判定部2510に供給する。すなわち、この命令デコーダ2320は、関数の呼出し命令を受け付けた場合には、履歴メモリ2430における実行結果の再利用処理を実行するタイミングを通知するために、関数呼出し信号をアドレス判定部2510に供給する。
 また、命令デコーダ2320は、例えば、MIPSの規定に基づいて、フェッチ部2310からの命令に示されるデータの格納場所により、その命令が、関数の引数である入力値を参照するための入力値参照命令か否かを判断する。この命令デコーダ2320は、入力値参照命令を受け付けた場合には、入力値参照信号をアドレス判定部2510に供給する。また、命令デコーダ2320は、関数の戻り命令を受け付けた場合には、アドレス判定部2510に関数戻り信号を供給する。
 また、命令デコーダ2320は、MIPSの規定に基づいて、フェッチ部2310からの命令に示される格納場所によってその命令が、関数の実行による実行結果を設定するための実行結果設定命令か否かを判断する。この命令デコーダ2320は、実行結果設定命令を受け付けた場合には、実行データ保持部2440に保持させるために、実行結果設定信号をアドレス判定部2510に供給する。
 また、命令デコーダ2320は、関数の戻り命令を受け付けた場合には、アドレス判定部2510に関数戻り信号を供給する。また、命令デコーダ2320は、フェッチ部2310から供給された命令に基づいて、プログラムカウンタ2350の値を設定する。
 実行部2330は、命令デコーダ2320からの制御に従って処理を実行するものである。この実行部2330は、複数の命令区間を含む命令列に基づく処理を実行する。すなわち、この実行部2330は、複数回実行される命令区間である再利用区間が含まれる命令列に基づく処理を実行する。この実行部2330は、再利用区間である関数の入力値および実行結果を、レジスタファイル2340または主記憶部2130に出力するとともに、実行データ保持部2440に供給する。
 この実行部2330は、例えば、入力値設定命令の実行により、関数の呼出し命令の前にその関数の入力値を、レジスタファイル2340または主記憶部2130に設定するとともに、実行データ保持部2440に出力する。この実行部2330は、例えば、入力値設定命令により設定された入力値を、入力値参照命令の実行によって参照するとともに、実行データ保持部2440にその参照した入力値を出力する。この実行部2330は、例えば、関数における引数の数値、引数の型および引数の格納場所を入力値として実行データ保持部2440に出力する。なお、実行部2330は、特許請求の範囲に記載の実行部の一例である。
 ロードユニット2331は、命令デコーダ2320からの制御に従って、主記憶部2130またはデータキャッシュ2220からデータを読み出して、その読み出されたデータを入力選択部2332に供給するものである。このロードユニット2331は、例えば、命令デコーダ2320からの制御に従って、主記憶部2130またはデータキャッシュ2220から関数における引数の入力値を読み出して、その読み出された入力値を入力選択部2332に供給する。
 入力選択部2332は、命令デコーダ2320からの制御に従って、実行結果出力部2420、演算回路2333、レジスタファイル2340および実行結果出力部2420から出力されたデータのうちいずれか1つのデータを選択するものである。
 この入力選択部2332は、その選択されたデータを、レジスタファイル2340および実行データ保持部2440に出力する。すなわち、この入力選択部2332は、命令デコーダ2320の制御に従って、実行結果出力部2420、演算回路2333、レジスタファイル2340および実行結果出力部2420の出力のうち、いずれかをレジスタファイル2340および実行データ保持部2440に出力する。
 この入力選択部2332は、例えば、入力値設定命令としてロードワード命令が命令デコーダ2320に供給された場合には、命令デコーダ2320の制御に従って、ロードユニット2331からのデータを、レジスタファイル2340および実行データ保持部2440に出力する。
 また、この入力選択部2332は、例えば、入力値設定命令としてムーブ命令が供給された場合には、命令デコーダ2320の制御に従って、レジスタファイル2340におけるデータを、レジスタファイル2340および実行データ保持部2440に出力する。
 また、入力選択部2332は、演算処理を実行するための演算命令が命令デコーダ2320に供給された場合には、命令デコーダ2320の制御に従って、演算回路2333から出力された演算結果を実行結果として、レジスタファイル2340に出力する。また、この入力選択部2332は、実行履歴検索部2410により実行結果が抽出された場合には、命令デコーダ2320からの制御に従って、実行結果出力部2420から出力された実行結果をレジスタファイル2340に出力する。
 演算回路2333は、命令デコーダ2320からの制御に従って、演算処理を実行するものである。この演算回路2333は、例えば、乗算、除算または積和などの演算処理を実行するための演算命令が命令デコーダ2320に供給された場合には、命令デコーダ2320の制御に従って、レジスタファイル2340に格納されたデータを用いて演算処理を実行する。また、演算回路2333は、その演算処理による演算結果を実行結果として、入力選択部2332を介してレジスタファイル2340に格納する。
 ストアユニット2334は、命令デコーダ2320からの制御に従って、レジスタファイル2340に格納されたデータ、または、実行結果出力部2420から出力された実行結果を主記憶部2130に書き戻すためのものである。このストアユニット2334は、主記憶部2130にデータを書き戻すためのストアワード命令が命令デコーダ2320に供給された場合には、命令デコーダ2320からの制御に従って、書き戻すべきデータを、データ線2229を介してデータキャッシュ2220に出力する。
 また、このストアユニット2334は、実行履歴検索部2410により履歴メモリ2430から実行結果が抽出された場合には、実行結果出力部2420から出力された実行結果を、データ線2229を介して主記憶部2130およびデータキャッシュ2220に書き戻す。
 レジスタファイル2340は、実行部2330から出力されたデータを格納するものである。このレジスタファイル2340は、複数のレジスタ、例えば、レジスタ0番乃至31番の32個のレジスタにより構成される。このレジスタファイル2340は、命令デコーダ2320からの制御に従って、実行部2330から出力されたデータを、複数のレジスタのうち1つのレジスタに格納する。
 また、このレジスタファイル2340は、例えば、命令デコーダ2320からの制御に従って、複数のレジスタのうち1つのレジスタに格納された実行結果を実行部2330に、または実行部2330を介して実行履歴検索部2410に出力する。
 プログラムカウンタ2350は、命令デコーダ2320からの制御によってカウント値が設定されるものである。このプログラムカウンタ2350は、例えば、命令デコーダ2320からの制御によって、1つの命令が実行されるたびにカウント値を1つ増加させる。また、このプログラムカウンタ2350は、命令デコーダ2320からの制御によって、関数の呼出し命令が実行された場合には、レジスタファイル2340に格納された関数の先頭アドレスが設定される。このプログラムカウンタ2350は、そのカウント値を、主記憶部2130のメモリアドレスを示す命令アドレスとしてアドレス判定部2510に出力する。
 アドレス判定部2510は、入力値設定命令アドレステーブル2520に登録された入力値設定命令アドレスに基づいて、履歴メモリ2430における実行履歴を検索させるために、実行履歴検索部2410および実行データ保持部2440を制御するものである。すなわち、アドレス判定部2510は、プログラムカウンタ2350から出力された命令アドレスが、入力値設定命令アドレステーブル2520に保持された入力値設定命令アドレスと一致した場合には、実行履歴の検索を開始させるものである。
 このアドレス判定部2510は、プログラムカウンタ2350から出力された命令アドレスと、入力値設定命令アドレステーブル2520に登録された入力値設定命令アドレスとが一致したか否かを判定する。そして、双方の命令アドレスが一致した場合には、アドレス判定部2510は、入力値設定命令アドレスにより特定された入力値設定命令に基づいて、実行部2330から出力された入力値を実行データ保持部2440に保持させる。
 これとともに、アドレス判定部2510は、入力値設定命令アドレステーブル2520におけるその一致した入力値設定命令アドレスと関連付けられた区間識別情報を実行データ保持部2440に保持させる。ここにいう区間識別情報とは、複数の再利用区間を互いに識別するための識別情報である。この区間識別情報として、例えば、再利用区間である関数の先頭アドレスを用いるようにしてもよい。
 また、双方の命令アドレスが一致した場合において、命令デコーダ2320から、関数呼出し信号が供給されるまでの間に入力値設定信号が供給されたときは、アドレス判定部2510は、実行部2330から出力された入力値を実行データ保持部2440に保持させる。すなわち、アドレス判定部2510は、関数呼出し信号が供給されるまでの間、命令デコーダ2320から供給された入力値設定信号に基づいて、関数における引数の入力値として実行部2330からの出力を実行データ保持部2440に保持させる。
 また、アドレス判定部2510は、命令デコーダ2320から関数呼出し信号が供給された場合には、履歴メモリ2430における実行結果の再利用処理を実行履歴検索部2410に指示する。また、アドレス判定部2510は、命令デコーダ2320から供給される実行結果設定信号に基づいて、関数の実行結果として実行部2330からの出力を実行データ保持部2440に保持させる。
 また、アドレス判定部2510は、命令デコーダ2320から供給される関数戻り信号に基づいて、実行データ保持部2440における区間識別情報、入力値および実行結果を履歴メモリ2430に新たに登録させるために、実行履歴検索部2410に登録の指示を行う。
 入力値設定命令アドレステーブル2520は、複数回実行される再利用区間である関数を識別するための区間識別情報ごとに、その関数における入力値を設定するための入力値設定命令のアドレスである入力値設定命令アドレスを保持するものである。ここにいうアドレスとは、入力値設定命令が、主記憶部2130に記憶されているメモリアドレスを示す。
 ここでは、入力値設定命令アドレステーブル2520には、例えば、コンパイラ装置またはプログラムの事前実行により、主記憶部2130に記憶されるプログラムを解析することによって抽出された再利用区間に関するデータが保持されていることを想定する。すなわち、入力値設定命令アドレステーブル2520には、実行結果が再利用される度合いが高い関数の入力設定命令アドレスと、その関数を識別するための区間識別情報とが関連付けて保持されている。
 この入力値設定命令アドレステーブル2520は、例えば、関数における入力値を設定するための入力値設定命令のうち、最初に入力値を設定する入力値設定命令の入力値設定命令アドレスを区間識別情報ごとに保持する。すなわち、この入力値設定命令アドレステーブル2520は、再利用区間の区間識別情報ごとに、その再利用区間における最先の入力値設定命令アドレスを保持する。このように、最先の入力値設定命令のみを保持させることによって、入力値設定命令アドレステーブル2520の容量を低減することができる。
 また、入力値設定命令アドレステーブル2520は、その保持されたデータをアドレス判定部2510に出力する。なお、入力値設定命令アドレステーブル2520に、再利用区間である関数が複数の引数を持つ場合には、区間識別情報ごとに、複数の入力値設定命令アドレスを保持させるようにしてもよい。また、入力値設定命令アドレステーブル2520は、特許請求の範囲に記載の入力値設定命令アドレステーブルの一例である。
 なお、入力値設定命令アドレステーブル2520に、区間識別情報ごとに実行履歴を削除する際の優先度をさらに保持させるようにしてもよい。この場合には、実行履歴検索部2410は、アドレス判定部2510からの優先度を履歴メモリ2430に登録する。そして、履歴メモリ2430の容量が一定の条件を超えた場合には、実行履歴検索部2410は、履歴メモリ2430に保持された優先度に基づいて、履歴メモリ2430における実行履歴を削除する。
 実行データ保持部2440は、アドレス判定部2510からの指示に従って、アドレス判定部2510からの区間識別情報と、実行部2330からの関数における入力値および実行結果とを保持するものである。この実行データ保持部2440は、その保持された区間識別情報と、関数における入力値および実行結果とを実行履歴検索部2410に出力する。
 実行履歴検索部2410は、実行データ保持部2440から出力された識別情報および関数の入力値に基づいて、履歴メモリ2430における実行履歴を検索するものである。この実行履歴検索部2410は、履歴メモリ2430において区間識別情報ごとに保持された再利用区間における入力値および実行結果である実行履歴のうち、実行データ保持部2440に保持された区間識別情報および入力値と同一の実行履歴における実行結果を抽出する。
 実行履歴検索部2410は、履歴メモリ2430から実行結果が抽出された場合において、アドレス判定部2510からの再利用処理の指示を受け付けたときは、その実行結果を実行結果出力部2420に出力する。これとともに、実行履歴検索部2410は、関数の処理を省略するための関数省略信号として、その抽出された実行結果における格納場所に関する情報をフェッチ部2310に供給する。
 一方、履歴メモリ2430から実行結果が抽出されない場合において、アドレス判定部2510からの再利用処理の指示を受け付けたときは、実行履歴検索部2410は、関数省略信号をフェッチ部2310に出力しない。そして、実行部2330における関数の実行によって、新たに生成された実行結果が実行データ保持部2440に保持された後に、実行履歴検索部2410は、実行データ保持部2440からの出力を履歴メモリ2430に登録する。
 すなわち、この実行履歴検索部2410は、アドレス判定部2510からの登録指示に基づいて、実行データ保持部2440に保持された区間識別情報、入力値および実行結果を履歴メモリ2430に保持させる。
 実行結果出力部2420は、実行履歴検索部2410によって履歴メモリ2430から実行結果が抽出された場合には、その実行結果を、入力選択部2332を介してレジスタファイル2340に、または、ストアユニット2334に出力するものである。この実行結果出力部2420は、履歴メモリ2430からの実行結果におけるデータの格納場所に従って、ストアユニット2334または入力選択部2332にその実行結果におけるデータを出力する。なお、実行結果出力部2420は、特許請求の範囲に記載の実行結果出力部の一例である。
 履歴メモリ2430は、区間識別情報ごとに、区間識別情報により識別される関数における入力値および実行結果を関連付けて実行履歴として保持するものである。この履歴メモリ2430は、例えば、連想メモリ(CAM:Content Addressable Memory)により実現される。この例において、履歴メモリ2430は、実行結果を検索するための検索キーである区間識別情報が実行履歴検索部2410から入力されることによって、その区間識別情報に関連付けられた実行履歴の検索を開始する。
 また、履歴メモリ2430は、実行履歴検索部2410から順次供給された入力値と、履歴メモリ2430に保持されている入力値とが全て一致する場合には、その履歴メモリ2430における入力値に関連付けられた実行結果を実行履歴検索部2410に出力する。すなわち、実行履歴検索部2410から入力された区間識別情報および入力値と同一の実行履歴が履歴メモリ2430から検出されることによって、実行履歴検索部2410により履歴メモリ2430から実行結果が抽出される。
 また、この連想メモリにより実現される履歴メモリ2430は、例えば、実行履歴における入力値のパターンを木構造により保持する。なお、履歴メモリ2430は、特許請求の範囲に記載の履歴メモリの一例である。
 このように、アドレス判定部2510および入力値設定命令アドレステーブル2520を設けることによって、再利用区間の最先の入力値設定命令を特定することができるため、再利用区間の実行前に、履歴メモリ2430における実行履歴の検索を行うことができる。次に、履歴メモリ2430におけるデータ構造の例について図面を参照して以下に説明する。
 [履歴メモリ2430のデータ構造例]
 図47は、本発明の第1の実施の形態における履歴メモリ2430のデータ構造の一例を示す概念図である。ここでは、履歴メモリ2430により、区間識別情報ごとに保持された実行履歴のうち、1つの区間識別情報における複数の実行履歴を木構造により保持する構成が示されている。この例では、引数がn個の関数であって、実行結果である出力をm個の格納先に返す関数を想定する。また、ここでは、関数の先頭アドレスである関数アドレスを区間識別情報とする。
 この例では、木構造における関数ルート2460と、第1の引数ノード2461および2462と、第nの引数ノード2471乃至2474と、第1の出力ノード2481乃至2484と、第mの出力ノード2491乃至2494とが示されている。
 関数ルート2460には、区間識別情報である関数アドレスと、第1の引数ノード2461を指し示すポインタとが示されている。
 第1および第nの引数ノード2461、2462および2471乃至2474には、履歴メモリ2430に保持されている実行履歴における引数の入力値として、引数の値を示す入力データと、その引数の型と、その引数の格納場所を示す種類とが示されている。ここにいう格納場所とは、レジスタファイル2340のレジスタ番号または主記憶部2130のメモリアドレスのことをいう。
 さらに、第1および第nの引数ノード2461、2462および2471乃至2474には、比較対象の入力値が互いに一致するときに、次の引数における引数ノードを指し示す右ポインタが示されている。一方、第1および第nの引数ノード2461、2462および2471乃至2474には、比較対象の入力値が不一致のときに、同一の引数における他の引数ノードを指し示す下ポインタが示されている。また、第nの引数ノード2471乃至2474の各々に、第1および第mの出力ノード2481乃至2484および2491乃至2494がそれぞれ連結されている。
 第1および第mの出力ノード2481乃至2484および2491乃至2494には、履歴メモリ2430に保持されている実行履歴における実行結果として、実行結果の値を示す出力データと、その実行結果の格納場所を示す種類と、その実行結果の型とが示されている。さらに、第1の出力ノード2481乃至2484には、次の出力における出力ノードを指し示す右ポインタが示されている。この第1および第mの出力ノード2481乃至2484および2491乃至2494は、連結リストを構成している。また、第mの出力ノード2491乃至2494の右ポインタには、出力ノードの終端を表わすヌルが示されている。
 このような木構造において、関数ルート2460に示された関数アドレスと一致する関数アドレスが実行履歴検索部2410から入力されると、関数ルート2460のポインタによって指し示された第1の引数ノード2461において入力値の比較処理が実行される。ここにいう入力値の比較処理とは、第1の引数ノード2461に示された入力データ、種類および型である入力値と、実行履歴検索部2410からの入力値とを比較することである。
 このとき、例えば、第1の引数ノード2461に示された入力値と、実行履歴検索部2410からの入力値とが一致した場合には、第1の引数ノード2461の右ポインタにより指し示された次の引数ノードにおいて入力値の比較処理が実行される。一方、第1の引数ノード2461に示された入力値と、実行履歴検索部2410からの入力値とが一致しない場合には、第1の引数ノード2461の下ポインタにより指し示された第1の引数ノード2462において入力値の比較処理が実行される。
 このようにして、各引数ノードにおける比較処理による比較結果に基づいて右または下ポインタの指し示す引数ノードが選択され、その選択された引数ノードにおいて入力値の比較処理が順次実行される。そして、第nの引数ノード2471に示された入力値と、実行履歴検索部2410からの入力値とが互いに一致した場合には、第nの引数ノード2471の右ポインタにより第1の出力ノード2481が指し示される。これにより、第1の出力ノード2481に保持された出力データ、種類および型を示す実行結果から順番に、第m番の出力ノード2491に保持された実行結果までが実行履歴検索部2410に順次出力される。
 このように、履歴メモリ2430を区間識別情報ごとに木構造により構成することによって、同じ引数の入力値を重複して保持する必要が無いため、履歴メモリ2430の記憶領域を節約することができる。また、区間識別情報ごとにデータ構造を分けることによって、検索速度の低下を抑制することができる。次に、この履歴メモリ2430に対する登録手法として、再利用区間である関数の1回目の実行における履歴メモリ2430に対する登録処理例について図面を参照して以下に説明する。
 [再利用区間の1回目の実行による履歴メモリ2430に対する登録例]
 図48は、本発明の第1の実施の形態におけるデータ処理装置2100による1回目の関数の実行における区間識別情報および実行履歴の登録手法を示す概念図である。図48の(a)は、入力値設定命令アドレステーブル2520のデータフォーマットの一例を示す図である。入力値設定命令アドレステーブル2520には、関数における最先の入力値設定命令アドレス2521と、その関数を識別するための区間識別情報である関数アドレス2522との対応関係が示されている。
 図48の(b)は、上位ルーチンにおいて2つの引数を持つ関数が呼出し命令(call)によって呼び出された後に、その関数の命令区間である下位ルーチンにおいて戻り命令(return)によって上位ルーチンに復帰する処理例を示す概念図である。ここでは、上位ルーチンにおける入力値A設定2321および入力値B設定2322と、下位ルーチンにおける入力値A参照2323、入力値B参照2324および実行結果C設定2325とが示されている。また、ここでは、左から右に時間が経過することとする。
 入力値A設定2321および入力値B設定2322は、2つの入力値設定命令に基づいて、再利用区間である関数における入力値Aおよび入力値Bが設定されるタイミングを示す。ここでは、入力値A設定命令アドレスに対応する入力値A設定命令に基づいて入力値Aが設定される。また、入力値B設定命令アドレスに対応する入力値B設定命令に基づいて入力値Bが設定される。このように、関数の呼出し命令(call)の前に、入力値設定命令によってその関数の引数の入力値が設定されるのは、図45で述べたとおり、主記憶部2130に記憶されたプログラムがABIの規定に基づいて生成されるからである。
 入力値A参照2323および入力値B参照2324は、下位ルーチンによる関数の処理において、入力値参照命令の実行によって関数の入力値が参照されるタイミングを示す。ここでは、入力値A設定命令および入力値B設定命令により設定された入力値Aおよび入力値Bが、2つの入力値参照命令に基づいてそれぞれ参照される。すなわち、関数の処理において、入力値参照命令の実行により、入力値Aおよび入力値Bが設定されたレジスタファイル2340におけるレジスタに格納された引数の数値が使用される。
 実行結果C設定2325は、関数の処理により生成された実行結果Cが主記憶部2130またはレジスタファイル2340に設定されるタイミングを示す。ここでは、実行結果設定命令に基づいて実行結果Cが設定される。
 図48の(c)は、履歴メモリ2430におけるデータフォーマットの一例を示す概念図である。ここでは、関数の区間識別情報である関数アドレス2431と、実行履歴検索データ2432との対応関係が示されている。実行履歴検索データ2432は、図47に示した木構造により構成される検索データであって、実行履歴における入力値および実行結果が関連付けられた情報を含む検索データである。
 このような場合において、入力値A設定2321では、アドレス判定部2510により、プログラムカウンタ2350から出力された命令アドレスが、入力値設定命令アドレステーブル2520における「入力値A設定命令アドレス」と一致したと判定される。
 これにより、その一致した入力値設定命令アドレス(入力値A設定命令アドレス)に対応する区間識別情報(関数アドレス1)が、履歴メモリ2430に入力される。すなわち、アドレス判定部2510により、区間識別情報(関数アドレス1)を実行データ保持部2440に保持させて、その保持された「関数アドレス1」が実行履歴検索部2410によって履歴メモリ2430に入力される。
 このとき、履歴メモリ2430において、アドレス判定部2510からの区間識別情報(関数アドレス1)と一致する区間識別情報が保持されていないため、その区間識別情報(関数アドレス1)が履歴メモリ2430に登録される。
 この後、入力値設定命令により設定された入力値Aおよび入力値Bと、実行結果設定命令により設定された実行結果Cが、区間識別情報(関数アドレス1)に関連付けられて履歴メモリ2430に登録される。すなわち、入力設定命令の実行による命令デコーダ2320からの入力値設定信号に基づいて、アドレス判定部2510によって、入力値Aおよび入力値Bが、実行データ保持部2440に保持される。その後、実行結果設定命令の実行による命令デコーダ2320からの実行結果設定信号に基づいて、実行結果Cが実行データ保持部2440に保持される。
 そして、戻り命令(return)による命令デコーダ2320からの関数戻り信号に基づいて、アドレス判定部2510から実行履歴検索部2410に実行履歴の登録が指示される。これにより、実行履歴検索部2410によって、実行データ保持部2440におけるデータ(入力値A、入力値Bおよび実行結果C)が履歴メモリ2430に登録される。
 このように、入力値設定命令アドレステーブル2520を設けることによって、入力値設定命令アドレステーブル2520に保持された入力値設定命令アドレスに対応する関数の実行履歴だけを履歴メモリ2430に登録することができる。これにより、再利用区間の入力値設定命令アドレスを事前に登録しておくことによって、実行結果が再利用される可能性の高い実行履歴だけを履歴メモリ2430に保持させることができる。このため、履歴メモリ2430の容量を有効に利用することができる。次に、履歴メモリ2430に保持された実行履歴における実行結果を再利用する例について次図を参照して簡単に説明する。
 [実行結果再利用処理の例]
 図49は、本発明の第1の実施の形態におけるデータ処理装置2100による実行結果再利用処理に関する手法の一例を示す概念図である。ここでは、図49の(a)および(c)は、図48の(a)および(c)に対応するため、ここでの説明を省略する。
 図49の(b)は、上位ルーチンにおいて2つの引数を持つ関数が呼出し命令(call)によって呼び出された後に、その関数の命令区間である下位ルーチンにおいて戻り命令(return)によって上位ルーチンに復帰する処理例を示す概念図である。
 ここでは、上位ルーチンにおける入力値A設定2321および入力値B設定2322と、関数の命令区間である下位ルーチンにおける入力値A参照2323、入力値B参照2324および実行結果C設定2325とが示されている。これらは図48に示したものと同様であるため、同一符号を付してここでの説明を省略する。また、ここでは、左から右に時間が経過することとする。
 このような場合において、入力値A設定2321では、アドレス判定部2510により、プログラムカウンタ2350から出力された命令アドレスが、入力値設定命令アドレステーブル2520における「入力値A設定命令アドレス」と一致したと判定される。これにより、その一致した入力値設定命令アドレス(入力値A設定命令アドレス)に対応する区間識別情報(関数アドレス1)が、履歴メモリ2430に入力される。すなわち、アドレス判定部2510により、区間識別情報(関数アドレス1)を実行データ保持部2440に保持させて、その保持された関数アドレス1が実行履歴検索部2410によって履歴メモリ2430に入力される。
 このとき、履歴メモリ2430には、アドレス判定部2510からの区間識別情報(関数アドレス1)と同一の「関数アドレス1」が既に保持されているため、これに関連付けられた「実行履歴検索データ1」による実行結果の検索が行われる。
 また、入力値A設定2321では、入力値A設定命令により設定された入力値Aが、履歴メモリ2430に入力される。そして、入力値B設定2322では、入力値B設定命令により設定された入力値Bが、履歴メモリ2430に入力される。すなわち、アドレス判定部2510からの指示により、命令デコーダ2320からの入力値設定信号に基づいて、入力値Aおよび入力値Bが、実行データ保持部2440に順次保持される。そして、実行履歴検索部2410により、実行データ保持部2440における入力値Aおよび入力値Bが実行履歴検索部2410に順次入力される。
 これにより、実行履歴検索部2410からの入力値Aおよび入力値Bと、履歴メモリ2430における「関数アドレス1」に対応する「実行履歴検索データ1」に保持された入力値との比較が順次行われる。ここでは、双方の入力値(入力値AおよびB)が一致するため、区間識別情報(関数アドレス1)および入力値(入力値Aおよび入力値B)に関連付けられた実行結果(実行結果C)が実行履歴検索部2410に供給される。すなわち、履歴メモリ2430に入力された区間識別情報(関数アドレス1)および入力値(入力値Aおよび入力値B)に関連付けられた実行結果(実行結果C)が履歴メモリ2430から出力される。
 この後、呼出し命令(call)による命令デコーダ2320からの関数呼出し信号に基づいて、アドレス判定部2510から実行履歴検索部2410に実行結果の再利用指示が通知されることによって、実行結果Cの再利用処理が実行される。すなわち、実行結果出力部2420により、入力値設定命令アドレスにより特定される呼出し命令が実行されるときに、実行履歴検索部2410により実行結果が抽出された場合には、その抽出された実行結果が実行部2330に出力される。
 このように、入力値設定命令アドレステーブル2520を設けることによって、関数アドレス1の関数に対する最初に実行される最先の入力値A設定命令を特定することができる。このため、入力値A設定命令から呼出し命令(call)までの命令群のうちの入力値A設定命令および入力値B設定命令に基づいて設定される入力値(入力値Aおよび入力値B)を特定することができる。これにより、入力値A設定命令アドレスにより特定される呼出し命令(call)の実行までの実行履歴検索期間Tsにおいて、履歴メモリ2430における区間識別情報(関数アドレス1)に対応する実行履歴の検索を行うことができる。
 また、実行履歴検索期間Tsにおいて関数アドレス1の実行履歴検索データ1により、実行履歴検索部2410からの入力値Aおよび入力値Bに関連付けられた実行結果Cが抽出されることによって、関数の実行に要する時間(短縮期間T1)を削減することができる。ここで、本発明の第1の実施の形態における短縮期間T1と、従来の実行結果再利用処理による短縮期間との差異について以下に図面を参照して簡単に説明する。
 [実行結果再利用処理によって短縮される短縮期間の例]
 図50は、実行結果再利用処理により関数の実行時間が短縮される例を示す概念図である。図50の(a)は、入力値設定命令アドレステーブル2520を設けない従来のデータ処理装置における実行結果の再利用による短縮期間を示す概念図である。図50の(b)は、本発明の第1の実施の形態におけるデータ処理装置2100における実行結果の再利用による短縮期間を示す概念図である。図50の(a)および(b)は、図49の(b)に示したものと同様であるため、同一符号を付してここでの説明を省略する。
 図50の(a)に示す従来技術の場合には、関数の命令区間である下位ルーチンにおいて2つの引数が入力値参照命令の実行によって全て参照(入力値A参照2323および入力値B参照2324)されるまで、関数の引数である入力値AおよびBを特定することができない。このため、関数の入力値AおよびBが、履歴メモリ2430における入力値と全て一致したときであっても、入力値B参照2324から戻り命令(return)までの短縮期間T2だけしか関数の実行期間を削減することができない。
 一方、図50の(b)に示す本発明の第1の実施の形態では、図49で述べたとおり、入力値設定命令アドレステーブル2520に基づいて特定された入力値A設定2321によって、入力値Aおよび入力値Bを特定することができる。すなわち、入力値A設定命令から呼出し命令(call)までの実行履歴検索期間Tsにおける入力値設定命令に基づいて、関数における引数の入力値を特定することができる。
 これにより、実行履歴検索期間Tsにおいて履歴メモリ2430における実行結果の検索を終了させることができるため、実行結果を再利用することができる場合には、関数の実行に要する全ての期間(短縮期間T1)を削減することができる。したがって、本発明の第1の実施の形態では、データ処理装置2100における実行結果再利用処理により、従来の短縮期間T2よりも長い短縮期間T1を削減することができる。次に、実行履歴検索部2410および履歴メモリ2430における両者の区間識別情報が一致した場合において、実行履歴検索部2410からの入力値と、履歴メモリ2430における入力値とが一致しないときの実行履歴の登録例について次図を参照して説明する。
 [再利用区間の2回目以降の実行による履歴メモリ2430に対する実行履歴の登録例] 図51は、本発明の第1の実施の形態におけるデータ処理装置2100による2回目以降の関数の実行における実行履歴の登録手法を示す概念図である。ここでは、図51の(a)乃至(c)は、図48の(a)乃至(c)に対応するため、ここでの詳細な説明を省略する。
 図51の(b)は、図48の(b)に示した関数の処理例を示す概念図である。ここでは、関数の引数である入力値が変数であり、履歴メモリ2430に保持されていない入力値が設定された場合を想定する。例えば、履歴メモリ2430における入力値Aの示す値が「3」であり、ここでの関数の実行により設定された入力値Aの示す値が「5」である場合が該当する。
 このような場合において、入力値A設定2321では、アドレス判定部2510により、プログラムカウンタ2350から出力された命令アドレスが、入力値設定命令アドレステーブル2520における「入力値A設定命令アドレス」と一致したと判定される。
 これにより、その一致した入力値設定命令アドレス(入力値A設定命令アドレス)に対応する区間識別情報(関数アドレス1)が、履歴メモリ2430に入力される。すなわち、アドレス判定部2510により、区間識別情報(関数アドレス1)を実行データ保持部2440に保持させて、その保持された「関数アドレス1」が実行履歴検索部2410によって履歴メモリ2430に入力される。
 このとき、履歴メモリ2430において、アドレス判定部2510からの区間識別情報(関数アドレス1)と一致する区間識別情報が既に保持されているため、これに関連付けられた「実行履歴検索データ1」による実行結果の検索が行われる。
 また、入力値A設定2321では、入力値A設定命令により設定された入力値Aが、履歴メモリ2430に入力される。このとき、実行履歴検索部2410からの入力値Aと、履歴メモリ2430における「実行履歴検索データ1」に保持された入力値とが一致しないため、実行履歴検索部2410からの入力値Aが「実行履歴検索データ1」に新たに登録される。
 また、入力値B設定2322では、入力値B設定命令により設定された入力値Bが、実行履歴検索部2410によって履歴メモリ2430に登録される。すなわち、入力値Aおよび入力値Bが関連付けられた「実行履歴検索データ1」が生成される。
 この後、下位ルーチンにおいて関数の処理が実行され、実行結果C設定2325において、実行結果設定命令により設定された実行結果Cが、実行履歴検索部2410によって履歴メモリ2430に登録される。すなわち、入力値A、入力値Bおよび実行結果Cが関連付けられた「実行履歴検索データ1」が生成される。
 このように、同一の関数に対する2回目以降の処理において、入力値設定命令によって設定された入力値が、履歴メモリ2430における入力値と一致しない場合には、関数が実行されて、その実行結果および入力値が履歴メモリ2430に新たに登録される。なお、ここでは、入力値設定命令によって特定された入力値を登録する例について説明したが、入力値参照命令の実行によって特定された入力値を履歴メモリ2430に登録するようにしてもよい。
 [データ処理装置2100の動作例]
 次に本発明の第1の実施の形態におけるデータ処理装置2100の動作について図面を参照して説明する。
 図52は、本発明の第1の実施の形態におけるデータ処理装置2100による実行結果再利用方法の処理手順の一例を示すフローチャートである。
 まず、フェッチ部2310により、主記憶部2130または命令キャッシュ2210から命令が読み出される(ステップS2911)。このとき、アドレス判定部2510により、プログラムカウンタ2350から出力される命令アドレスが、入力値設定命令アドレステーブル2520に登録された入力値設定命令アドレスと一致するか否かが判断される(ステップS2912)。そして、入力値設定命令アドレスと一致しない場合には、ステップS2911に戻り、入力値設定命令アドレスと一致するまで繰り返される。
 一方、入力値設定命令アドレスと一致した場合には、アドレス判定部2510により、その一致した入力値設定命令アドレスに関連付けられた区間識別情報を入力値設定命令アドレステーブル2520から取得される。そして、アドレス判定部2510により、その取得された区間識別情報が、実行データ保持部2440に保持される(ステップS2913)。
 続いて、実行履歴検索部2410により、履歴メモリ2430の検索キーとして、実行データ保持部2440に保持された区間識別情報が履歴メモリ2430に入力される(ステップS2914)。これにより、履歴メモリ2430における区間識別情報に対応する複数の実行履歴の検索が開始される。
 次に、命令デコーダ2320により、フェッチ部2310から読み出された命令が入力値設定命令であるか否かが判断される(ステップS2915)。そして、入力値設定命令であると判断された場合には、命令デコーダ2320からの入力値設定信号に基づいて、入力値設定命令により設定された入力値が、アドレス判定部2510の指示によって実行データ保持部2440に保持される。
 この後、実行履歴検索部2410により、実行データ保持部2440に保持された入力値が、履歴メモリ2430に入力される(ステップS2921)。なお、1回目のステップS2915の判断については、ここでは、必ず入力値設定命令と判断されるため、その判断を省略して、ステップS2921に進むようにしてもよい。
 続いて、実行履歴検索部2410からの区間識別情報に対応する履歴メモリ2430における実行履歴について、履歴メモリ2430により、実行履歴検索部2410からの入力値と、その実行履歴における入力値とが一致するか否かが判断される(ステップS2922)。そして、両者の入力値が一致しない場合には、ステップS2924の処理に進む。
 一方、両者の入力値が一致した場合には、履歴メモリ2430において、実行履歴における次の引数の入力値を比較するために、次の引数における引数ノードにポインタが進められる(ステップS2923)。すなわち、実行履歴検索部2410からの入力値と一致する引数ノードがあれば、その引数ノードの右ポインタによって、次の引数ノードが指し示される。次に、フェッチ部2310により、主記憶部2130または命令キャッシュ2210から命令が読み出され(ステップS2924)、ステップS2915の処理に戻る。
 一方、ステップS2915の処理において、入力値設定命令でないと判断された場合において、フェッチ部2310により読み出された命令が関数の呼出し命令であるか否かが判断される(ステップS2916)。そして、呼出し命令でない場合には、ステップS2924に進む。
 このようにして、関数における全ての引数の入力値が設定されるまで、ステップS2915、S2916およびS2921乃至S2924における一連の処理が繰り返し実行される。すなわち、入力値設定命令アドレステーブル2520により特定された入力値設定命令から呼出し命令までの関数の入力値設定命令に基づいて設定された入力値が実行データ保持部2440に保持されて、その保持された入力値が履歴メモリ2430に入力される。
 このように、プログラムカウンタ2350から出力される命令アドレスと一致する入力値設定命令アドレスに対応する区間識別情報が実行データ保持部2440に保持される。そして、その入力値設定命令アドレスにより特定された入力値設定命令から呼出し命令までの命令群のうちの入力値設定命令に基づいて、実行部から出力された入力値が実行データ保持部2440に保持される。これにより、実行履歴検索部2410によって、実行データ保持部2440における区間識別情報および入力値を用いて、履歴メモリ2430における実行履歴に関連付けられた実行結果が検索される。なお、ステップS2911乃至S2916およびS2921乃至S2924は、特許請求の範囲に記載の実行履歴検索手順の一例である。
 一方、ステップS2916において関数の呼出し命令と判断された場合には、実行データ保持部2440からの区間識別情報および入力値が、履歴メモリ2430における区間識別情報に関連付けられた入力値と全て一致したか否かが判断される(ステップS2917)。
 そして、実行履歴検索部2410からの区間識別情報および入力値が全て一致した場合には、実行結果再利用処理が実行される(ステップS2925)。すなわち、実行履歴検索部2410からの区間識別情報および入力値に対応する履歴メモリ2430における実行結果が、実行結果出力部2420から出力される。そして、主記憶部2130またはレジスタファイル2340に書き戻されて、関数の処理をスキップする。なお、S2925は、特許請求の範囲に記載の実行結果出力手順の一例である。
 一方、実行履歴検索部2410からの区間識別情報および入力値が全て一致しない場合には、呼出し命令により呼び出された関数が実行されて、その実行結果が実行データ保持部2440に保持される(ステップS2918)。そして、実行履歴検索部2410により、実行データ保持部2440に保持された実行結果と、ステップS2913およびS2921の処理によって保持された区間識別情報および入力値とが履歴メモリ2430に登録される(ステップS2919)。
 このように、本発明の第1の実施の形態では、入力値設定命令アドレステーブル2520によって、再利用区間である関数の呼出し命令前に、実行データ保持部2440に再利用区間の区間識別情報およびその入力値を保持させることができる。これにより、関数が呼び出される前に、実行履歴検索部2410によって、その実行データ保持部2440に保持された区間識別情報および入力値に基づいて、履歴メモリ2430における実行履歴を検索することができる。
 このため、実行履歴検索部2410からの区間識別情報および入力値と一致する履歴メモリ2430における実行履歴に関連付けられた実行結果が抽出された場合には、呼出し命令により呼び出される関数の実行を省略することができる。これにより、実行結果の再利用による関数の処理時間を大幅に削減することができる。
 <2.第2の実施の形態>
 [プログラム解析処理装置の構成例]
 図53は、本発明の第2の実施の形態におけるプログラム解析処理装置の機能構成例を示すブロック図である。プログラム解析処理装置2600は、ソースプログラム記憶部2610と、コンパイル処理部2620と、オブジェクトプログラム記憶部2660と、再利用区間情報記憶部2670とを備える。なお、プログラム解析処理装置2600は、特許請求の範囲に記載のプログラム解析処理装置の一例である。
 ソースプログラム記憶部2610は、コンパイル処理の対象となるソースプログラムを記憶するものである。このソースプログラムは、実行結果が再び利用される再利用区間が含まれるソースプログラムである。このソースプログラム記憶部2610は、その記憶されたソースプログラムをコンパイル処理部2620に供給する。
 コンパイル処理部2620は、ソースプログラム記憶部2610からのソースプログラムをコンパイルすることによって、機械語プログラムであるオブジェクトプログラムと、再利用区間情報とを生成するものである。ここにいう再利用区間情報とは、再利用区間ごとに、再利用区間における1番目の入力値設定命令の入力値設定命令アドレスと、その再利用区間を識別するための区間識別情報とが関連付けられた情報である。この再利用区間情報は、図46に示した検索開始命令アドレス管理部2500における入力値設定命令アドレステーブル2520に格納される。
 このコンパイル処理部2620は、生成されたオブジェクトプログラムをオブジェクトプログラム記憶部2660に、生成された再利用区間情報を再利用区間情報記憶部2670に記憶させる。このコンパイル処理部2620は、プログラム解析部2630と、プログラム最適化処理部2640と、コード生成部2650とを備える。
 プログラム解析部2630は、ソースプログラム記憶部2610から読み出されたソースプログラムに基づいて、形態素解析や構文解析などの解析処理を実行するものである。このプログラム解析部2630は、解析または最適化に適した形式の中間コードとして表現された中間表現によるプログラムを生成して、その生成された中間表現によるプログラムに対して解析処理を実行する。
 このプログラム解析部2630は、再利用候補区間抽出部2631および再利用候補区間解析部2632を備える。再利用候補区間抽出部2631は、プログラムに含まれる複数の命令区間のうち、実行結果が再利用される再利用区間の候補となる再利用候補区間を、そのプログラムから抽出するものである。この再利用候補区間抽出部2631は、再利用候補区間として関数の命令区間を抽出する。
 この再利用候補区間抽出部2631は、実行結果が再利用できない関数を再利用候補区間の対象から除外する。この再利用候補区間抽出部2631は、命令区間の入力値が全て同じであっても異なる実行結果になる関数、例えば、命令区間に分岐命令を含むような関数を再利用候補区間の対象から除外する。この再利用候補区間抽出部2631は、例えば、第1の関数の実行直後に第2の関数が実行されるため、第1の関数の呼出し命令の前に、第2の入力値設定命令が実行されるような第1および第2の関数を再利用候補区間の対象から除外する。また、再利用候補区間抽出部2631は、抽出された再利用候補区間を識別するための区間識別情報を、プログラムとともに再利用候補区間解析部2632に供給する。
 再利用候補区間解析部2632は、再利用候補区間抽出部2631により抽出された再利用候補区間の使用態様を解析するものである。この再利用候補区間解析部2632は、例えば、関数における引数の個数および型と、1つの関数が実行される回数とを使用態様として関数ごとに解析する。
 この再利用候補区間解析部2632は、例えば、関数における引数が採り得る範囲を使用態様の解析結果として出力する。この再利用候補区間解析部2632は、その解析結果を、再利用候補区間の区間識別情報およびプログラムとともにプログラム最適化処理部2640に供給する。
 プログラム最適化処理部2640は、再利用候補区間解析部2632から供給されたプログラムに基づいて、プログラムの実行速度を向上させるための最適化や、コードサイズを削減するための最適化などのプログラム最適化処理を実行するものである。このプログラム最適化処理部2640は、再利用度生成部2641と、再利用区間抽出部2642と、再利用区間情報生成部2643とを備える。
 再利用度生成部2641は、再利用候補区間解析部2632から供給された解析結果に基づいて、再利用候補区間の実行結果が再び利用される度合いを示す再利用度を生成するものである。すなわち、再利用度生成部2641は、複数回実行される命令区間における処理の実行ごとの入力値が互いに一致する度合いを示す再利用度を、命令区間の使用態様に基づいて命令区間ごとに生成する。
 この再利用度生成部2641は、例えば、1つの再利用候補区間が実行される実行回数に応じて再利用度を生成する。この場合において、再利用度生成部2641は、例えば、実行回数が大きいほど、再利用度を大きく設定する。また、再利用度生成部2641は、例えば、再利用候補区間の入力値が採り得る範囲に応じて、その再利用候補区間に対する再利用度を生成する。この場合には、再利用度は、例えば、その採り得る範囲の数の逆数に定数を乗算することによって算出される。これにより、再利用候補区間の再利用度が大きいほど、その再利用候補区間の実行結果は再利用される確率が高いことを示す。
 また、再利用度生成部2641は、生成された再利用候補区間に関する再利用度を、プログラムおよび再利用候補区間の区間識別情報とともに再利用区間抽出部2642に供給する。なお、再利用度生成部2641は、特許請求の範囲に記載の再利用度生成部の一例である。
 再利用区間抽出部2642は、再利用候補区間解析部2632により抽出された複数の再利用候補区間のうち、再利用度生成部2641からの各再利用候補区間に関する再利用度に基づいて、再利用区間を抽出するものである。この再利用区間抽出部2642は、例えば、再利用度に関する一定の閾値(再利用閾値)以上である再利用候補区間を再利用区間として抽出する。
 また、再利用区間抽出部2642は、その抽出された再利用区間に関する区間識別情報を、プログラムとともに再利用区間情報生成部2643に供給する。なお、再利用区間抽出部2642は、例えば、図46に示した履歴メモリ2430における区間識別情報ごとの実行履歴を削除する際の優先度を再利用度に基づいて生成するようにしてもよい。この場合、再利用区間抽出部2642は、再利用度が高いほど優先度が低くなるように優先度を生成する。
 再利用区間情報生成部2643は、再利用区間抽出部2642により抽出された再利用区間の区間識別情報と、その再利用区間における最先の入力値設定命令アドレスとを関連付けて再利用区間情報として生成するものである。この再利用区間情報生成部2643は、再利用区間抽出部2642により抽出された再利用区間における入力値設定命令のうち、時間軸上において最初に実行される最先の入力値設定命令のメモリアドレスである入力値設定命令アドレスを再利用区間ごとに抽出する。
 また、再利用区間情報生成部2643は、その抽出された最先の入力値設定命令アドレスおよび区間識別情報を再利用区間ごとに関連付けた再利用区間識別情報を生成する。また、再利用区間情報生成部2643は、その生成された再利用区間識別情報を再利用区間情報記憶部2670に記憶させる。なお、ここでは、再利用区間情報として、区間識別情報ごとに最先の入力値設定命令アドレスを関連付けて生成する例について説明したが、区間識別情報ごとに、全ての入力値設定命令アドレスを関連付けて生成するようにしてもよい。
 また、再利用区間情報生成部2643は、例えば、再利用区間抽出部2642から供給されたプログラムに対して、再利用区間における最先の入力値設定命令からその再利用区間の呼出し命令までの命令群の数が極力少なくなるように、命令コードを並び替える。これにより、図46に示した履歴メモリ2430における実行履歴の検索期間を短縮することができるため、データ処理装置2100における履歴メモリ2430による消費電力を低減することができる。
 また、再利用区間情報生成部2643は、その命令コードが並び替えられたプログラムをコード生成部2650に供給する。なお、再利用区間情報生成部2643は、特許請求の範囲に記載の再利用区間情報生成部の一例である。
 なお、再利用区間情報生成部2643は、再利用度生成部2641からの再利用度に基づいて、履歴メモリ2430の実行履歴を削除する際の優先度と、区間識別情報と、最先の入力値設定命令アドレスとを関連付けて再利用区間情報を生成するようにしてもよい。
 これにより、履歴メモリ2430の容量が一定の条件を超えた場合には、実行履歴検索部2410により、その優先度に従って履歴メモリ2430の実行履歴を削除させることができる。このため、再利用度の高い実行履歴を優先的に履歴メモリ2430に保持させることができる。
 コード生成部2650は、再利用区間情報生成部2643から供給されたプログラムに基づいて、機械語プログラムのコードであるオブジェクトプログラムを生成するものである。このコード生成部2650は、その生成されたオブジェクトプログラムをオブジェクトプログラム記憶部2660に記憶させる。
 オブジェクトプログラム記憶部2660は、コード生成部2650から出力されたオブジェクトプログラムを記憶するものである。このオブジェクトプログラム記憶部2660に記憶されたオブジェクトプログラムが、図45に示した主記憶部2130に記憶される。
 再利用区間情報記憶部2670は、再利用区間情報生成部2643から出力された再利用区間情報を記憶するものである。この再利用区間情報記憶部2670に記憶された再利用区間情報が図46に示した入力値設定命令アドレステーブル2520に転送される。
 このように、再利用度生成部2641を設けることによって、複数回実行される命令区間の使用態様に基づいて再利用度が生成されるため、複数の命令区間のうち、実行結果が再利用される確率の高い命令区間を再利用区間として抽出することができる。また、再利用区間情報生成部2643を設けることによって、その抽出された再利用区間ごとに再利用区間における入力値設定命令アドレスおよび区間識別情報が関連付けられた再利用区間情報を生成することができる。
 [プログラム解析処理装置2600の動作例]
 次に本発明の第2の実施の形態におけるプログラム解析処理装置2600の動作について図面を参照して説明する。
 図54は、本発明の第2の実施の形態におけるプログラム解析処理装置2600のプログラム解析処理方法の処理手順の一例を示すフローチャートである。
 まず、再利用候補区間抽出部2631により、ソースプログラム記憶部2610からソースプログラムが読み出される(ステップS2931)。そして、再利用候補区間抽出部2631により、プログラムに含まれる複数の関数である命令区間のうち、再利用候補区間となる関数が抽出される(ステップS2932)。
 続いて、再利用候補区間解析部2632により、再利用候補区間抽出部2631において抽出された再利用候補区間に関する使用態様が解析される(ステップS2933)。この後、再利用度生成部2641により、再利用候補区間解析部2632により解析された再利用候補区間の使用態様に基づいて、再利用候補区間ごとに再利用度が生成される(ステップS2934)。なお、ステップS2934は、特許請求の範囲に記載の再利用度生成手順の一例である。
 そして、再利用区間抽出部2642により、再利用候補区間ごとの再利用度に基づいて、再利用区間が抽出される(ステップS2935)。次に、再利用区間情報生成部2643により、再利用区間における最先の入力値設定命令アドレスと、その再利用区間の区間識別情報とが再利用区間ごとに関連付けられた再利用区間情報が生成される(ステップS2936)。そして、再利用区間情報生成部2643により、その生成された再利用区間情報が再利用区間情報記憶部2670に記憶される。なお、ステップS2936は、特許請求の範囲に記載の再利用区間情報生成手順の一例である。
 その後、コード生成部2650により、再利用区間情報生成部2643から供給されたプログラムに基づいてオブジェクトプログラムが生成されて、その生成されたオブジェクトプログラムがオブジェクトプログラム記憶部2660に記憶される(ステップS2937)。
 このように、本発明の第2の実施の形態では、再利用度の高い再利用区間である関数における入力値設定命令アドレスおよびその区間識別情報が関連付けられた再利用区間情報を生成することができる。これにより、図46に示した履歴メモリ2430において実行結果が再利用される可能性の高い関数に対する実行履歴が保持されるため、実行結果の再利用処理による実行時間の削減を向上させることができる。
 なお、本発明の第1および第2の実施の形態では、プログラム解析処理装置2600によって生成された再利用区間情報を、データ処理装置2100における入力値設定命令アドレステーブル2520に登録する例について説明したが、これに限られるものではない。例えば、データ処理装置2100において、主記憶部2130に記憶されたプログラムを実行しているときに、入力値設定命令アドレステーブル2520に再利用区間情報を登録するようにしてもよい。そこで、プログラムの実行中に入力値設定命令アドレステーブル2520に入力値設定命令アドレスおよび区間識別情報を登録するように改良したデータ処理装置2100を、第3の実施の形態として以下に説明する。
 <3.第3の実施の形態>
 [データ処理装置2100の構成例]
 図55は、本発明の第3の実施の形態におけるデータ処理装置2100の一構成例を示すブロック図である。ここでは、図45に示したデータ処理装置2100のうち、データ処理部2300、実行結果再利用処理部2700および検索開始命令アドレス管理部2800が示されている。ここでは、データ処理部2300は、図46と同じものであるため、図46と同一符号を付してここでの説明を省略する。
 実行結果再利用処理部2700は、実行履歴検索部2710と、実行結果出力部2720と、履歴メモリ2730と、実行データ保持部2740とを備える。実行履歴検索部2710、実行結果出力部2720、履歴メモリ2730および実行データ保持部2740は、図46に示した実行履歴検索部2410、実行結果出力部2420、履歴メモリ2430および実行データ保持部2440に対応する。また、実行結果出力部2720および履歴メモリ2730の構成は、図46に示した実行結果出力部2420および履歴メモリ2430と同様のものであるため、ここでの説明を省略する。
 検索開始命令アドレス管理部2800は、アドレス判定部2810と、入力値設定命令アドレステーブル2820と、入力値設定命令アドレス出力部2830と、設定入力値保持部2840と、検索開始命令決定部2850とを備える。アドレス判定部2810および入力値設定命令アドレステーブル2820は、図46に示したアドレス判定部2510および入力値設定命令アドレステーブル2520に対応する。
 ここでは、入力値設定命令アドレスおよび区間識別情報を入力値設定命令アドレステーブル2820に登録する機能を中心に説明する。また、入力値設定命令アドレステーブル2820に登録された入力値設定命令アドレスに基づいて、履歴メモリ2730における実行結果を検索する手法については、図46と同様の構成により実現されるため、ここでの説明を省略する。
 実行データ保持部2740は、アドレス判定部2810からの指示に従って、実行結果再利用処理に用いるデータを保持して、その保持されたデータを実行履歴検索部2710、設定入力値保持部2840および検索開始命令決定部2850に出力するものである。この実行データ保持部2740は、アドレス判定部2810からの入力値設定信号に基づく指示に従って、実行部2330からの出力を、設定入力値として保持する。
 この実行データ保持部2740は、時間軸上においてその設定入力値を保持した順番を、入力値設定命令により入力値が設定された設定順番として、その設定入力値とともに保持する。この実行データ保持部2740は、例えば、アドレス判定部2810からの入力値設定信号に基づく指示に従って、最初に保持した設定入力値を、1番目の設定入力値として保持する。
 また、実行データ保持部2740は、アドレス判定部2810からの関数呼出し信号に基づく指示に従って、その保持された設定入力値およびその設定順番を、設定入力値保持部2840に出力する。この実行データ保持部2740は、例えば、設定入力値に含まれる格納場所およびその設定順番を、設定入力値保持部2840に出力する。ここにいう格納場所とは、レジスタファイル2340のレジスタ番号または主記憶部2130のメモリアドレスのことをいう。
 このとき、実行データ保持部2740は、同一の格納場所を示す複数の設定入力値がある場合には、その複数の設定入力値のうち、最も大きい数(最大)の設定順番の設定入力値およびその設定順番だけを設定入力値保持部2840に出力する。すなわち、実行データ保持部2740は、同一の格納場所を示す複数の設定入力値がある場合には、その複数の設定入力値のうち、最後に設定された設定入力値およびその設定順番を出力する。あるいは、実行データ保持部2740は、同一の格納場所を示す設定入力値を設定入力値保持部2840に新たに保持させる場合には、その新たな設定入力値の設定順番を、既に保持されている設定入力値の設定順番の保持領域に重ねて保持させる(上書きする)。
 このように、同一の格納場所を示す複数の設定入力値のうち、最大の設定順番の設定入力値のみを設定入力値保持部2840に保持させることによって、関数の入力値として参照されなかった入力値設定命令を登録の対象から除外することができる。これは、命令デコーダ2320では、命令に示されたデータの格納先によってその命令が入力値設定命令か否かを判断するが、関数の命令区間以外では、関数の入力値が格納されるレジスタは、他の処理によっても参照される。このため、同一の格納場所を示す設定入力値のうち、関数の呼出し命令の直前に設定された設定入力値以外は、関数の入力値の設定ではないと判断できるからである。
 また、実行データ保持部2740は、アドレス判定部2810からの関数呼出し信号に基づく指示に従って、例えば、実行部2330からの出力を、関数の区間識別情報として保持する。この実行データ保持部2740は、アドレス判定部2810からの関数呼出し信号に基づく指示に従って、例えば、プログラムカウンタ2350からの命令アドレスを、関数の区間識別情報として保持する。
 また、実行データ保持部2740は、アドレス判定部2810からの入力値参照信号に基づく指示に従って、実行部2330からの出力を、参照入力値として保持する。また、実行データ保持部2740は、アドレス判定部2810からの実行結果設定信号に基づく指示に従って、実行部2330からの出力を、関数の実行結果として保持する。
 また、実行データ保持部2740は、アドレス判定部2810からの関数戻り信号に基づく指示に従って、その保持された区間識別情報および参照入力値を、検索開始命令決定部2850に出力する。この実行データ保持部2740は、例えば、アドレス判定部2810からの関数戻り信号に基づく指示に従って、参照入力値に示される格納場所を検索開始命令決定部2850に出力する。
 また、実行データ保持部2740は、アドレス判定部2810からの関数戻り信号に基づく指示に従って、その保持された区間識別情報、参照入力値および実行結果を、実行履歴検索部2710に出力する。
 また、実行データ保持部2740は、アドレス判定部2810からの関数戻り信号に基づく指示に従って、その保持されたデータを実行履歴検索部2710に出力した後に、実行データ保持部2740に保持されたデータを消去する。
 アドレス判定部2810は、プログラムに含まれる複数の命令区間である関数の入力値設定命令アドレスを入力値設定命令アドレス出力部2830に保持させるものである。このアドレス判定部2810は、命令デコーダ2320から供給される入力値設定信号に基づいて、プログラムカウンタ2350から出力された命令アドレスを、入力値命令アドレスとして入力値設定命令アドレス出力部2830に保持させる。これとともに、このアドレス判定部2810は、命令デコーダ2320からの入力値設定信号に基づいて、実行部2330から出力される入力値を、設定入力値として実行データ保持部2740に保持させる。
 また、アドレス判定部2810は、例えば、命令デコーダ2320から供給される関数呼出し信号に基づいて、関数の命令区間である先頭アドレスを区間識別情報として実行データ保持部2740に保持させる。このアドレス判定部2810は、例えば、命令デコーダ2320からの関数呼出し信号に基づいて、プログラムカウンタ2350からの命令アドレスを区間識別情報として実行データ保持部2740に保持させる。あるいは、このアドレス判定部2810は、例えば、命令デコーダ2320からの関数呼出し信号に基づいて、実行部2330から出力される関数の先頭アドレスを区間識別情報として実行データ保持部2440に保持させる。
 また、アドレス判定部2810は、命令デコーダ2320から供給される入力値参照信号に基づいて、実行部2330から出力される入力値を、参照入力値として実行データ保持部2740に保持させる。また、アドレス判定部2810は、命令デコーダ2320から供給される実行結果設定信号に基づいて、実行部2330から出力された実行結果を実行データ保持部2740に保持させる。
 入力値設定命令アドレステーブル2820は、命令区間である関数を識別するための区間識別情報ごとに、その関数における入力値を設定するための入力値設定命令のアドレスである入力値設定命令アドレスを保持するものである。この入力値設定命令アドレステーブル2820は、例えば、関数における入力値を設定するための入力値設定命令のうち、最初に入力値を設定する最先の入力値設定命令のアドレスを入力値設定命令アドレスとして区間識別情報ごとに保持する。
 また、入力値設定命令アドレステーブル2820は、その保持されたデータをアドレス判定部2810に出力する。なお、入力値設定命令アドレステーブル2820には、関数が複数の引数を持つ場合には、その関数の区間識別情報ごとに、複数の引数に対応する入力値設定命令アドレスを複数保持させるようにしてもよい。また、入力値設定命令アドレステーブル2820は、特許請求の範囲に記載の入力値設定命令アドレステーブルの一例である。
 入力値設定命令アドレス出力部2830は、アドレス判定部2810から供給された入力値設定命令アドレスと、検索開始命令決定部2850から供給された区間識別情報とを関連付けて入力値設定命令アドレステーブル2820に出力するものである。この入力値設定命令アドレス出力部2830は、アドレス判定部2810から供給された入力値設定命令アドレスを保持する。
 この入力値設定命令アドレス出力部2830は、時間軸上においてその入力値設定命令アドレスを保持した順番である設定順番を、その入力値設定命令アドレスとともに保持する。この実行データ保持部2740は、例えば、アドレス判定部2810から供給された最初の入力値設定命令アドレスを1番目の入力値設定命令アドレスとして保持する。
 また、入力値設定命令アドレス出力部2830は、その保持された入力値設定命令アドレスのうち、検索開始命令決定部2850により決定された設定順番の入力値設定命令アドレスと、検索開始命令決定部2850からの区間識別情報とを関連付けて出力する。すなわち、入力値設定命令アドレス出力部2830は、関数における入力値設定命令アドレスと、その関数の区間識別情報である関数の先頭アドレスとを関連付けて、関数ごとに入力値設定命令アドレステーブル2820に登録する。
 また、入力値設定命令アドレス出力部2830は、アドレス判定部2810からの関数戻り信号に基づく指示に従って、その保持されたデータを登録した後に、入力値設定命令アドレス出力部2830に保持されたデータを消去する。
 設定入力値保持部2840は、実行データ保持部2740から出力された設定入力値およびその設定順番を関連付けて保持するものである。この設定入力値保持部2840は、その保持された設定入力値およびその設定順番を検索開始命令決定部2850に出力する。
 検索開始命令決定部2850は、関数の実行における入力値参照命令の実行により参照された参照入力値に含まれる格納場所に基づいて、検索開始命令としてその関数における最先の入力値設定命令を決定するためのものである。この検索開始命令決定部2850は、関数の呼出し命令前の入力値設定命令に基づく設定入力値に含まれる格納場所と、呼出し命令後の入力値参照命令に基づく参照入力値に含まれる格納場所とに基づいて、最先の入力値設定命令の設定順番を特定する。
 この検索開始命令決定部2850は、例えば、設定入力値保持部2840における設定入力値のうち、実行データ保持部2740からの参照入力値の格納場所に基づいて、関数の命令区間において参照された設定入力値の設定順番が抽出される。そして、この検索開始命令決定部2850は、その抽出された設定入力値の設定順番のうち、最も小さい設定順番を特定する。
 すなわち、検索開始命令決定部2850は、命令デコーダ2320において入力値設定命令と判断された命令のうち、関数の命令区間において参照された入力値の格納場所に、最初に入力値を設定した入力値設定命令を、最先の入力値設定命令として特定する。
 また、検索開始命令決定部2850は、その特定された最も小さい設定順番を入力値設定命令アドレス出力部2830に通知する。これとともに、検索開始命令決定部2850は、実行データ保持部2740から出力された区間識別情報を入力値設定命令アドレス出力部2830に出力する。
 また、検索開始命令決定部2850は、実行データ保持部2740から参照入力値の格納場所が出力され場合には、入力値設定命令アドレス出力部2830に入力値設定命令アドレステーブル2820に対する入力値設定命令アドレスの登録を抑制する。これにより、入力値設定命令アドレステーブル2820に対する無駄な入力値設定命令アドレスの登録を低減することができる。
 実行履歴検索部2710は、アドレス判定部2810からの関数戻り信号に基づく登録指示に従って、実行データ保持部2740からの区間識別情報、参照入力値および実行結果を履歴メモリ2730に登録するものである。この実行履歴検索部2710の他の機能は、図46に示した実行履歴検索部2410と同様のものであるため、ここでの説明を省略する。
 このように、入力値設定命令アドレス出力部2830を設けることによって、主記憶部2130からのプログラムを実行している間において、入力値設定命令アドレステーブル2820に、入力値設定命令アドレスおよび区間識情報を登録することができる。すなわち、入力値設定命令アドレス出力部2830を設けることによって、入力値設定命令により保持された入力値設定命令アドレスと、その入力値設定命令により特定された命令区間の区間識別情報とを入力値設定命令アドレステーブル2820に出力することができる。
 また、入力値設定命令アドレス出力部2830は、検索開始命令決定部2850によって、入力値設定命令により設定された入力値のうち、呼出し命令により呼び出された命令区間において参照された入力値に対応する入力値設定命令アドレスを出力することができる。すなわち、入力値設定命令アドレス出力部2830は、命令区間において参照された複数の入力値に対応する入力値設定命令のうち、最先の入力値設定命令の入力値設定命令アドレスと区間識別情報である命令区間の先頭アドレスとを出力することができる。次に、入力値設定命令アドレステーブル2820に入力値設定命令アドレスおよび区間識別情報を登録する例について以下に図面を参照して説明する。
 [入力値設定命令アドレステーブル2820への登録例]
 図56は、本発明の第3の実施の形態におけるデータ処理装置2100による入力値設定命令アドレステーブル2820に対する入力値設定命令アドレスおよび区間識別情報の登録例を示す概念図である。図56の(a)は、入力値設定命令アドレステーブル2820のデータフォーマットの一例を示す図である。入力値設定命令アドレステーブル2820には、関数である命令区間における最先の入力値設定命令アドレス2821と、その関数を識別するための区間識別情報である関数アドレス2822との対応関係が示されている。
 図56の(b)は、入力値設定命令の実行のたびに保持された入力値設定命令アドレスおよび設定入力値との対応関係を示す図である。図56の(b)には、設定順番2811と、入力値設定命令アドレス2831と、設定入力値2841とが示されている。
 設定順番2811は、入力値設定命令が実行された順番を示す。入力値設定命令アドレス2831は、入力値設定命令に基づいて、入力値設定命令アドレス出力部2830に保持された、プログラムカウンタ2350からの命令アドレスを示す。設定入力値2841は、入力値設定命令に基づいて、設定入力値保持部2840に保持された入力値を示す。なお、この入力値は、入力値の格納場所を示す情報だけでもよい。入力値の格納場所が分かれば、関数における入力値が参照されたか否かを判断することができるからである。
 図56の(c)は、上位ルーチンにおいて2つの引数を持つ関数が呼出し命令(call)によって呼び出された後に、その関数の命令区間である下位ルーチンにおいて戻り命令(return)によって上位ルーチンに復帰する一連の処理例を示す概念図である。
 ここでは、関数の呼出し命令(call)311および戻り命令(retuen)312が示されている。また、上位ルーチンにおける入力値A設定2321および入力値B設定2322と、下位ルーチンにおける入力値A参照2323、入力値B参照2324および実行結果C設定2325とが示されている。これらは、図48の(b)に示したものと同様であるため、ここでの説明を省略する。
 図56の(d)は、履歴メモリ2730におけるデータフォーマットの一例を示す概念図である。ここでは、関数の区間識別情報である関数アドレス2731と、実行履歴検索データ2732との対応関係が示されている。実行履歴検索データ2732は、図47に示した木構造により構成される検索データであって、実行履歴における入力値および実行結果が関連付けられた情報を含む検索データである。
 このような場合において、入力値A設定2321では、アドレス判定部2810からの指示により、プログラムカウンタ2350から出力された命令アドレス(入力値A設定命令アドレス)が、入力値設定命令アドレス出力部2830に保持される。このとき、アドレス判定部2810からの指示により、実行データ保持部2740に保持された1番目の設定入力値(入力値A)が、設定入力値保持部2840に出力される。
 入力値B設定2322では、アドレス判定部2810の指示により、プログラムカウンタ2350から出力された命令アドレス(入力値B設定命令アドレス)が、入力値設定命令アドレス出力部2830に保持される。このとき、アドレス判定部2810からの指示により、実行データ保持部2740に保持された2番目の設定入力値(入力値B)が、設定入力値保持部2840に出力される。
 呼出し命令(call)311では、アドレス判定部2810からの指示により、実行データ保持部2740に区間識別情報(関数アドレス1)が保持される。入力値A参照2323、入力値B参照2324および実行結果C設定2325では、アドレス判定部2810の指示により、1番目の参照入力値(入力値A)、2番目の参照入力値(入力値B)および実行結果(実行結果C)が実行データ保持部2740に保持される。
 戻り命令(return)312では、アドレス判定部2810からの指示により、実行データ保持部2740における区間識別情報(関数アドレス1)、1番目および2番目の参照入力値(入力値Aおよび入力値B)が、検索開始命令決定部2850に出力される。これにより、検索開始命令決定部2850によって、1番目および2番目の参照入力値(入力値Aおよび入力値B)に対応する設定入力値保持部2840における1番目および2番目の設定入力値(入力値Aおよび入力値B)が抽出される。
 すなわち、実行データ保持部2740における参照入力値の格納場所に基づいて、設定入力値保持部2840における設定入力値のうち、関数の実行により参照された入力値が特定される。これは、命令デコーダ2320により入力値設定命令と判断された命令であっても、関数に対する入力値を設定する命令でない場合があるからである。例えば、レジスタ4番にデータを格納する命令は、命令デコーダ2320によって入力値設定命令と判断されるが、関数の命令区間外では、他の処理によっても使用される場合がある。
 そして、検索開始命令決定部2850によって、その抽出された設定入力値の設定順番(1および2)のうち、最も小さい設定順番(1)が選択される。すなわち、検索開始命令決定部2850により、関数における最先の入力値設定命令に基づいて設定された設定入力値に対応する設定順番(1)が選択される。
 これにより、検索開始命令決定部2850から設定順番(1)および区間識別情報(関数アドレス1)が、入力値設定命令アドレス出力部2830に供給される。そして、入力値設定命令アドレス出力部2830により、検索開始命令決定部2850からの設定順番(1)に対応する「入力値A設定命令アドレス」と、「関数アドレス1」とが関連付けられて入力値設定命令アドレステーブル2820に出力される。
 また、アドレス判定部2810からの指示により、実行データ保持部2740における区間識別情報(関数アドレス1)、参照入力値(入力値Aおよび入力値B)および実行結果(実行結果C)が、実行履歴検索部2710に出力される。そして、実行履歴検索部2710により、その出力されたデータが履歴メモリ2730に登録される。
 [データ処理装置2100の動作例]
 次に本発明の第3の実施の形態におけるデータ処理装置2100の動作について図面を参照して説明する。
 図57は、本発明の第3の実施の形態におけるデータ処理装置2100による実行結果再利用方法の処理手順の一例を示すフローチャートである。
 まず、フェッチ部2310により、主記憶部2130または命令キャッシュ2210から命令が読み出される(ステップS2941)。続いて、アドレス判定部2810により、プログラムカウンタ2350から出力される命令アドレスが、入力値設定命令アドレステーブル2820における入力値設定命令アドレスと一致するか否かが判断される(ステップS2942)。
 そして、プログラムカウンタ2350からの命令アドレスが入力値設定命令アドレスと一致する場合には、実行履歴検索処理(ステップS2960)が実行される。一方、入力値設定命令アドレスと一致しない場合には、命令デコーダ2320により、入力値設定命令か否かが判断される(ステップS2943)。
 そして、入力値設定命令と判断された場合には、アドレス判定部2810からの指示により、プログラムカウンタ2350からの命令アドレスが、入力値設定命令アドレスとして入力値設定命令アドレス出力部2830に保持される(ステップS2954)。続いて、アドレス判定部2810からの指示によって実行部2330からの出力が設定入力値として実行データ保持部2740に保持されて、その保持された設定入力値が、設定入力値保持部2840に保持される(ステップS2955)。
 一方、入力値設定命令でないと判断された場合には、命令デコーダ2320により、関数の呼出し命令か否かが判断される(ステップS2944)。そして、関数の呼出し命令でないと判断された場合には、ステップS2941に戻る。
 このようにして、関数の呼出し命令が読み出されるまでの間、入力値設定命令が読み出されるたびに、プログラムカウンタ2350からの命令が、入力値設定命令アドレス出力部2830に、設定入力値およびその設定順番が、設定入力値保持部2840に保持される。この場合において、設定入力値の格納場所が同一の設定入力値が、設定入力値保持部2840に既に保持されているときは、既に保持されている設定入力値およびその設定順番の保持領域に重ねて、新たな設定入力値およびその設定順番が保持される。
 一方、関数の呼出し命令でないと判断された場合には、アドレス判定部2810により、関数の先頭アドレスが、区間識別情報として実行データ保持部2740に保持される(ステップS2945)。次に、関数の命令区間において、フェッチ部2310により、主記憶部2130または命令キャッシュ2210から命令が読み出される(ステップS2946)。続いて、命令デコーダ2320により、その読み出された命令が入力値参照命令であるか否かが判断される(ステップS2947)。
 そして、入力値参照命令と判断された場合には、アドレス判定部2810からの指示により、実行部2330からの出力を、参照入力値としてその順番とともに実行データ保持部2740に保持されて(ステップS2956)、ステップS2946の処理に戻る。一方、入力値参照命令でないと判断された場合には、命令デコーダ2320により、読み出された命令が、実行結果設定命令か否かが判断される(ステップS2948)。
 そして、実行結果設定命令であると判断された場合には、アドレス判定部2810からの指示により、実行部2330からの出力を、実行結果として実行データ保持部2740に保持させて(ステップS2957)、ステップS2946の処理に戻る。一方、実行結果設定命令でないと判断された場合には、命令デコーダ2320により、読み出された命令が、関数の戻り命令であるか否かが判断される(ステップS2949)。
 そして、関数の戻り命令でないと判断された場合には、ステップS2946に戻り、関数の呼出し命令が読み出されるまで、参照入力値および実行結果が、実行データ保持部2740に保持される。
 一方、関数の呼出し命令と判断された場合には、検索開始命令決定部2850により、設定入力値保持部2840に保持された設定入力値のうち、実行データ保持部2740に保持された参照入力値に基づいて、関数における最先の設定入力値の設定順番が特定される。そして、入力値設定命令アドレス出力部2830における入力値設定命令アドレスのうち、検索開始命令決定部2850により特定された設定順番に対応する入力値設定命令アドレスが、最先の入力値設定命令アドレスとして抽出される。
 これにより、入力値設定命令アドレス出力部2830により、最先の入力値設定命令アドレスと、実行データ保持部2740からの区間識別情報とが関連付けられて入力値設定命令アドレステーブル2820に登録される(ステップS2951)。また、アドレス判定部2810からの登録指示により、実行履歴検索部2710によって実行データ保持部2740における区間識別情報、参照入力値および実行結果が、履歴メモリ2730に登録される(ステップS2952)。
 そして、履歴メモリ2730および入力値設定命令アドレステーブル2820への登録が終了した後に、実行データ保持部2740、設定入力値保持部2840および入力値設定命令アドレス出力部2830におけるデータが消去される(ステップS2953)。そして、実行結果再利用方法の処理を終了する。
 [データ処理装置2100における実行履歴検索処理の例]
 図58は、本発明の第3の実施形態におけるデータ処理装置2100による実行履歴検索処理(ステップS2960)の処理手順例を示すフローチャートである。
 まず、アドレス判定部2810により、プログラムカウンタ2350からの命令アドレスと一致する入力値設定命令アドレスに対応する区間識別情報が、入力値設定命令アドレステーブル2820から実行データ保持部2740に出力される(ステップS2963)。続いて、実行履歴検索部2710により、履歴メモリ2730の検索キーとして、実行データ保持部2740に保持された区間識別情報が履歴メモリ2730に入力される(ステップS2964)。これにより、履歴メモリ2730における区間識別情報に対応する複数の実行履歴の検索が開始される。
 次に、命令デコーダ2320により、フェッチ部2310から読み出された命令が、入力値設定命令であるか否かが判断される(ステップS2965)。そして、入力値設定命令であると判断された場合には、命令デコーダ2320からの入力値設定信号に基づいて、入力値設定命令により設定された入力値が、アドレス判定部2810によって実行データ保持部2740に保持される。
 この後、実行履歴検索部2710により、実行データ保持部2740に保持された入力値が、履歴メモリ2730に入力される(ステップS2971)。なお、1回目のステップS2965の判断については、ここでは、必ず入力値設定命令と判断されるため、その判断を省略して、ステップS2971に進むようにしてもよい。
 続いて、実行履歴検索部2710からの区間識別情報に対応する履歴メモリ2730における実行履歴について、履歴メモリ2730により、実行履歴検索部2710からの入力値と、その実行履歴における入力値とが一致するか否かが判断される(ステップS2972)。そして、両者の入力値が一致しない場合には、ステップS2974の処理に進む。
 一方、両者の入力値が一致した場合には、履歴メモリ2730において、実行履歴における次の引数の入力値を比較するために、次の引数における引数ノードにポインタが進められる(ステップS2973)。すなわち、実行履歴検索部2710からの入力値と一致する引数ノードがあれば、その引数ノードの右ポインタによって、次の引数ノードが指し示される。次に、フェッチ部2310により、主記憶部2130または命令キャッシュ2210から命令が読み出され(ステップS2974)、ステップS2915の処理に戻る。
 一方、ステップS2965の処理において、入力値設定命令でないと判断された場合において、フェッチ部2310により読み出された命令が関数の呼出し命令であるか否かが判断される(ステップS2966)。そして、関数の呼出し命令でない場合には、ステップS2974に進む。
 このようにして、関数における全ての入力値が設定されるまで、ステップS2965、S2966およびS2971乃至S2974における一連の処理が繰り返し実行される。すなわち、入力値設定命令アドレステーブル2820により特定された入力値設定命令から呼出し命令までの関数の入力値設定命令に基づいて設定された入力値が、実行データ保持部2740に保持されて、その保持された入力値が履歴メモリ2730に入力される。
 このように、プログラムカウンタ2350から出力される命令アドレスと一致する入力値設定命令アドレスに対応する区間識別情報が実行データ保持部2740に保持される。そして、その入力値設定命令アドレスにより特定された入力値設定命令から呼出し命令までの命令群のうちの入力値設定命令に基づいて実行部から出力された入力値が、実行データ保持部2740に保持される。
 これにより、実行履歴検索部2710によって、実行データ保持部2740における区間識別情報および入力値を用いて、履歴メモリ2730における実行履歴に関連付けられた実行結果が検索される。なお、ステップS2963乃至S2966およびS2971乃至S2974は、特許請求の範囲に記載の実行履歴検索手順の一例である。
 一方、ステップS2966において、関数の呼出し命令と判断された場合には、実行データ保持部2740における区間識別情報および入力値が、履歴メモリ2730における区間識別情報に関連付けられた入力値と全て一致したか否かが判断される(ステップS2967)。
 そして、実行履歴検索部2710からの区間識別情報および入力値が全て一致した場合には、実行結果再利用処理が実行される(ステップS2975)。すなわち、実行履歴検索部2710からの区間識別情報および入力値に対応する履歴メモリ2730における実行結果が、実行結果出力部2720から出力される。そして、主記憶部2130またはレジスタファイル2340に書き戻されて、関数の処理をスキップする。なお、S2975は、特許請求の範囲に記載の実行結果出力手順の一例である。
 一方、実行履歴検索部2710からの区間識別情報および入力値が全て一致しない場合には、呼出し命令により呼び出された関数が実行されて、その実行結果が実行データ保持部2740に保持される(ステップS2968)。そして、実行履歴検索部2710により、実行データ保持部2740に保持された実行結果と、ステップS2963およびS2971の処理によって保持された区間識別情報および入力値とが、履歴メモリ2730に登録される(ステップS2919)。
 このように、本発明の第3の実施の形態では、検索開始命令アドレス管理部2800は、プログラムの実行中において、関数における最先の入力値設定命令アドレスを入力値設定命令アドレステーブル2820に登録することができる。
 このように、本発明の実施の形態によれば、命令区間の呼出し命令の実行の前に、履歴メモリ2430または2730における実行履歴を検索することができるため、実行結果の再利用によるプログラムの処理時間を短縮することができる。また、入力値設定命令アドレステーブル2520および2720を設けることによって、プログラム自体に専用命令を埋め込むことなく、関数の呼出し命令の実行前に、履歴メモリ2430または2730における実行履歴を検索することができる。
 なお、本発明の実施の形態では、履歴メモリ2430または2730を、SRAM(Stati Random Access Memory)やROM(Read Only Memory)などの不揮発メモリにより実現するようにしてもよい。これにより、データ処理装置2100の電源がオフされた場合であっても、履歴メモリ2430または2730に保持された実行履歴は消失しないため、データ処理装置2100の起動直後においても、過去の実行結果を有効に利用することができる。このため、データ処理装置2100の起動直後における実行結果再利用処理による実行時間の削減効果の低下を抑制することができる。
 また、プログラムの実行後に、データ処理装置2100の外部に設けた記憶部に履歴メモリ2430または2730に保持された履歴データを転送するようにしてもよい。ここで、履歴データを記憶する記憶部をデータ処理装置2100の外部に設けた場合を、第4の実施の形態として、次図を参照して簡単に説明する。
 <4.第4の実施の形態>
 [データ処理装置2100の外部に履歴データ記憶部を設けた例]
 図59は、本発明の第4の実施の形態におけるデータ処理装置2100の外部に履歴データ記憶部を設けた場合における集積回路の一構成例を示すブロック図である。ここでは、図45に示した集積回路の構成に加えて履歴データ記憶部2140が示されている。この履歴データ記憶部2140以外の構成は、図45に示したものと同様であるため、ここでの説明を省略する。
 履歴データ記憶部2140は、主記憶部2130に記憶されたプログラムが実行された後に、データ処理装置2100から転送された履歴メモリ2430または2730における履歴データを記憶するものである。この履歴データ記憶部2140は、例えば、不揮発性メモリにより実現される。
 このように、不揮発性メモリにより実現される履歴データ記憶部2140をデータ処理装置2100の外部に設けて、履歴メモリ2430または2730の履歴データを転送することによって、電源オフによる履歴データの消失を回避することができる。次に、履歴データの転送方法について、次図を参照して簡単に説明する。
 図60は、本発明の第4の実施の形態におけるデータ処理装置2100による履歴データ転送方法の処理手順を示すフローチャートである。
 まず、アプリケーションが起動されて(ステップS2991)、データ処理部2300により、履歴データ記憶部2140に履歴データがあるか否かが判断される(ステップS2992)。
 そして、履歴データ記憶部2140に履歴データが記憶されている場合には、データ処理部2300により、その記憶された履歴データが履歴メモリ2430または2730に転送される(ステップS2993)。一方、履歴データが記憶されていない場合には、ステップS2994に進む。
 そして、データ処理部2300により、主記憶部2130に記憶されたプログラムであるアプリケーションが実行される(ステップS2994)。このアプリケーションの実行後に、データ処理部2300により、履歴データ記憶部2140および履歴メモリ2430または2730における両者の履歴データに基づいて、履歴データ記憶部2140に記憶させる新たに履歴データが再構築される(ステップS2995)。そして、その再構築された履歴データを履歴データ記憶部2140に記憶する。
 このように、プログラムの実行前に、履歴データ記憶部2140に記憶された過去の履歴データを履歴メモリ2430または2730に転送することによって、プログラムの起動直後における再利用処理による実行時間の短縮効果を向上させることができる。
 なお、本発明の実施の形態では、1つの関数の命令区間に対する実行結果に再利用の例について説明したが、関数の命令区間において、さらに複数回関数を呼び出すような多重構造の関数に対しても適用することができる。
 次に、第4の本発明であるデータ処理装置、履歴保存装置、データ処理方法およびプログラムについて図61乃至図75を参照して説明する。
 以下、第4の本発明を実施するための形態(以下、実施の形態と称する)について説明する。
説明は以下の順序により行う。
 1.データ処理装置の構成例(値再利用制御:反復再利用区間の実行履歴を退避する例)
 2.履歴情報のフィールド構成例(値再利用制御:関数履歴、ループ個別履歴、ループ代表履歴および退避履歴の例)
 3.履歴メモリに保持される履歴情報および主記憶部に保持される退避履歴の一例(値再利用制御:ループ個別履歴例を退避および復元させる例)
 4.データ処理装置の処理手順例(値再利用制御:ループ個別履歴例を退避および復元させる例)
 <1.データ処理装置の構成例>
 [データ処理装置3100の構成例]
 図61は、本発明の実施の形態におけるデータ処理装置3100の構成例を示すブロック図である。このデータ処理装置3100は、バス3120を介して主記憶部3130と相互に接続されている。また、ここでは、データ処理装置3100が処理を実行する命令区間は関数またはループであることを想定する。
 データ処理装置3100は、プログラムにおける各処理を実行するものである。このデータ処理装置3100は、例えば、一般的なコンピュータにおいてはCPU(Central Processing Unit)により実現される。このデータ処理装置3100は、一次キャッシュ3200と、プロセッサコア3300と、履歴管理部3400と、履歴変換部3500とを備える。
 一次キャッシュ3200は、プロセッサコア3300がバス3120を介して扱う情報を一時的に保持するものである。この一次キャッシュ3200は、命令キャッシュ3210およびデータキャッシュ3220を備える。
 命令キャッシュ3210は、プロセッサコア3300において実行される命令を一時的に保持するものである。この命令キャッシュ3210は、プロセッサコア3300が頻繁に実行する命令を一時的に保持することによって、プロセッサコア3300から主記憶部3130へのアクセスを軽減させ、プロセッサコア3300におけるデータの入力待ち時間を軽減させることができる。この命令キャッシュ3210は、主記憶部3130から供給された再利用命令をプロセッサコア3300に供給する。ここにいう再利用命令とは、命令区間のうち実行結果が再び利用される再利用区間を再び利用されない区間と区別することによって、再利用区間が呼出された際に実行結果を再利用するための処理をデータ処理装置に行わせる命令である。
 データキャッシュ3220は、プロセッサコア3300の入力データおよび出力データを一時的に保持するものである。このデータキャッシュ3220は、使用頻度の高いプロセッサコア3300の入力データを一時的に保持することによりプロセッサコア3300から主記憶部3130へのアクセスを軽減させて、プロセッサコア3300におけるデータの入力待ち時間を軽減させる。このデータキャッシュ3220は、主記憶部3130から供給された関数またはループの入力値および開始アドレスをプロセッサコア3300に出力する。なお、ここで、入力値とは、関数またはループの実行に必要な値として渡される値の引数で構成される値であり、例えば、3つの変数を引数とする関数の場合には、この3つの変数の値およびその変数のアドレスである。
 プロセッサコア3300は、プログラムの命令に従って演算を実行するものである。このプロセッサコア3300は、例えば、MIPS(Microprocessor without Interlocked Pipeline Stages)プロセッサにより実現される。プロセッサコア3300は、例えば、データキャッシュ3220から供給される関数またはループの入力値および開始アドレスに基づいて、命令キャッシュ3210から入力される関数またはループの区間における命令を実行し、その実行の結果を実行結果として出力する。このプロセッサコア3300は、入力される命令が再利用区間を指定する再利用命令である場合において履歴管理部3400から実行結果が供給されないときには、この命令を実行した結果である実行結果をデータキャッシュ3220および履歴管理部3400に出力する。
 また、プロセッサコア3300は、入力される命令が再利用区間を指定する再利用命令である場合において履歴管理部3400から実行結果が供給されたときには、再利用区間における処理を中止して、この再利用区間を呼び出したルーチンに戻って実行を継続する。
 履歴管理部3400は、再利用区間の実行結果を保持して管理するものである。この履歴管理部3400は、プロセッサコア3300から供給された再利用区間の区間識別情報と入力値と実行結果とを実行履歴として保持する。ここでいう区間識別情報とは、再利用区間を特定するための情報であり、例えば、関数またはループの開始アドレスである。すなわち、この履歴管理部3400は、区間識別情報、入力値、および、実行結果として、関数またはループの開始アドレス、入力値、および、実行結果を保持する。また、この履歴管理部3400は、プロセッサコア3300から関数またはループの開始アドレスおよび入力値が供給された場合には、この開始アドレスおよび入力値が含まれる実行履歴を検索する。
 履歴変換部3500は、履歴管理部3400により管理されている実行履歴を変換するものである。この履歴変換部3500は、履歴管理部3400に登録されている再利用区間のうち実行が反復される反復再利用区間の実行履歴を、主記憶部3130において保持される退避履歴に変換する。ここで、退避履歴とは、反復再利用区間の実行履歴の実行結果を主記憶部3130に退避させるためのデータである。また、この履歴変換部3500は、主記憶部3130において保持された退避履歴に基づいて実行履歴を復元する。この履歴変換部3500は、その退避履歴を主記憶部3130に保持させ、退避履歴を生成する基となった実行履歴を履歴管理部3400から消去し、退避履歴を指し示す情報を保持する代表履歴を履歴管理部3400に登録する。
 また、この履歴変換部3500は、その退避履歴に含まれる実行結果を再利用する場合には、退避履歴から実行履歴を復元するとともに代表履歴を消去し、履歴管理部3400に復元した実行履歴を登録する。
 バス3120は、データ処理装置3100の各部と主記憶部3130との間を相互に接続するバスである。
 主記憶部3130は、データ処理装置3100が動作するために必要なデータを保持するものである。この主記憶部3130は、履歴変換部3500から供給された退避履歴を保持する。また、この主記憶部3130は、データ処理装置3100に処理を実行させるためのプログラムを記憶する。この主記憶部3130は、例えば、RAM(Random Access Memory)などが考えられる。この主記憶部3130は、記憶しているデータを、バス3120を介してデータ処理装置3100に出力する。なお、主記憶部3130は、特許請求の範囲に記載の退避履歴保持部の一例である。
 [プロセッサコア3300と履歴管理部3400と履歴変換部3500との構成例]
 図62は、本発明の実施の形態におけるプロセッサコア3300と履歴管理部3400と履歴変換部3500との構成例を示すブロック図である。ここでは、プロセッサコア3300と履歴管理部3400と履歴変換部3500とに加えて、バス3120を介して履歴変換部3500と接続される主記憶部3130も示されている。ここでは、プロセッサコア3300と履歴管理部3400と履歴変換部3500と主記憶部3130との機能は、図61と同様のものであるため、同一の符号を付してここでの詳細な説明を省略する。
 また、これ以降の説明では、便宜上、繰り返し実行される区間である反復再利用区間はループであり、反復再利用区間以外の再利用区間は関数であることを想定する。この反復再利用区間以外の再利用区間は、関数再利用区間と表現することとする。そして、ループの実行結果をループ個別履歴と表現し、関数の実行結果を関数履歴と表現することとする。さらに、退避履歴を指し示す代表履歴は、ループ代表履歴と表現する。
 プロセッサコア3300は、フェッチ部310と、命令デコーダ3320と、実行部3330と、レジスタファイル3340とを備える。
 フェッチ部310は、命令キャッシュ3210または主記憶部3130からの命令を読み出すものである。このフェッチ部310は、その読み出した命令を一時的に保持して、その保持されている命令のうち、実行部3330に実行させるための命令を命令デコーダ3320に供給する。このフェッチ部310は、例えば、一時的に保持している命令のうち、実行部3330において実行される再利用命令を命令デコーダ3320に供給する。このフェッチ部310は、例えば、主記憶部3130に記憶された再利用命令を命令デコーダ3320に供給する。
 命令デコーダ3320は、フェッチ部310から供給された命令を解読(デコード)することによって、プロセッサコア3300における構成部位を制御する制御信号を生成するものである。この命令デコーダ3320は、例えば、命令を解読することによって実行部3330およびレジスタファイル3340を制御する制御信号を生成して、その生成された制御信号を実行部3330およびレジスタファイル3340に供給する。
 この命令デコーダ3320は、フェッチ部310から再利用命令が供給された場合には、その再利用命令を解析することによって、実行部3330およびレジスタファイル3340の各々を制御する制御信号を実行部3330およびレジスタファイル3340に供給する。
 実行部3330は、命令デコーダ3320から供給された制御信号に基づいて、命令デコーダ3320において解析した命令を実行するものである。この実行部3330は、命令デコーダ3320が再利用命令をデコードした場合、再利用命令が指定する再利用区間の処理を開始する。また、この再利用区間の処理の開始とともに、実行部3330は、レジスタファイル3340から取得した再利用区間の区間識別情報を、信号線3309を介して履歴管理部3400に出力する。そして、実行部3330は、レジスタファイル3340から供給される再利用区間の入力値に基づいて再利用区間における処理を実行するとともに、再利用区間の入力値を、信号線3309を介して履歴管理部3400に出力する。
 また、実行部3330は、履歴管理部3400から再利用区間の実行結果が供給された場合には、再利用区間の処理を中止するとともに、その実行結果を履歴管理部3400から供給された旨を通知する信号をフェッチ部310に供給する。この時、実行部3330は、実行結果をレジスタファイル3340に出力する。
 一方、実行部3330は、履歴管理部3400から再利用区間の実行結果が供給されない場合には、再利用区間の処理を最後まで実行して、その実行結果を履歴管理部3400およびレジスタファイル3340に出力する。さらに、この実行部3330は、反復再利用区間の実行結果が供給されない場合には、何回目の実行による実行結果であるのかを示すループカウンタ値を実行結果とともに履歴管理部3400に出力する。なお、ループカウンタ値は、特許請求の範囲に記載のカウンタ値の一例である。
 レジスタファイル3340は、データキャッシュ3220から供給されたデータおよび実行部3330から供給された実行結果を一時的に保持するものである。このレジスタファイル3340は、例えば、命令デコーダ3320から再利用命令に基づく制御信号が供給された場合には、再利用区間の入力値を実行部3330に供給する。
 履歴管理部3400は、再利用区間の実行結果を保持して管理するものであり、履歴対象データ保持部3410と、履歴検索部3420と、履歴メモリ3430と、履歴登録部3440と、履歴メモリ容量管理部3450と、消去部3460とを備える。
 履歴対象データ保持部3410は、実行部3330から供給されたデータを一時的に保持するものである。この履歴対象データ保持部3410は、実行部3330から区間識別情報および入力値が供給された際には、これらを検索要求として履歴検索部3420に供給する。この履歴対象データ保持部3410は、例えば、実行部3330において関数再利用区間が実行された場合には、実行部3330から供給された関数の開始アドレスおよび入力値を、検索要求として履歴検索部3420に供給する。また、履歴対象データ保持部3410は、実行部3330において反復再利用区間が実行された場合には、実行部3330から供給されたループの開始アドレス、入力値およびループカウンタ値を検索要求として履歴検索部3420に供給する。
 また、この履歴対象データ保持部3410は、実行部3330から区間識別情報と、入力値と、実行結果とが供給された場合には、実行履歴を登録する条件が整うため、これらを実行履歴として履歴登録部3440に供給する。例えば、履歴対象データ保持部3410は、実行部3330において関数再利用区間が実行された場合には、実行部3330から供給された関数の開始アドレスと入力値と実行結果とを実行履歴として履歴登録部3440に供給する。また、履歴対象データ保持部3410は、実行部3330において反復再利用区間が実行された場合には、ループの開始アドレスと入力値と実行結果とループカウンタ値とを実行履歴として履歴登録部3440に供給する。
 履歴検索部3420は、履歴対象データ保持部3410から供給された検索要求に基づいて実行履歴を検索するものである。この履歴検索部3420は、検索要求入力部3421および実行結果出力部3422を備える。
 検索要求入力部3421は、履歴対象データ保持部3410から供給された検索要求に基づいて履歴メモリ3430から実行履歴を検索するものである。この検索要求入力部3421は、例えば、反復再利用区間を指定する命令が命令デコーダ3320において解析された場合には、この命令により指定されたループの開始アドレス、入力値およびループカウンタ値を履歴メモリ3430に供給する。これにより、実行履歴の検索を開始する。
 実行結果出力部3422は、履歴メモリ3430において実行履歴が検索された場合に実行結果を履歴メモリ3430から抽出して、その抽出した実行結果を実行部3330に出力するものである。この実行結果出力部3422は、その抽出した実行結果を、信号線3409を介して実行部3330に供給する。
 また、この実行結果出力部3422は、履歴メモリ3430においてループ代表履歴が実行履歴として検索された場合には、退避履歴を指し示す退避履歴位置情報を、実行結果の代わりに履歴メモリ3430から抽出する。そして、その抽出した退避履歴に関する情報を履歴変換部3500に出力し、実行履歴の復元を開始させる。
 履歴メモリ3430は、履歴登録部3440から供給された実行履歴を保持するものである。この履歴メモリ3430は、例えば、履歴検索部3420から検索要求が供給された場合において、この検索要求と一致する実行履歴を保持しているときは、この実行履歴の実行結果を実行結果出力部3422に供給する。また、この履歴メモリ3430は、履歴検索部3420から検索要求が供給された場合において、この検索要求と一致するループ代表履歴を保持しているときは、このループ代表履歴の退避履歴位置情報を実行結果出力部3422に供給する。さらに、この履歴メモリ3430は、履歴登録部3440から実行履歴が供給された場合には、この実行履歴を保持する。
 また、この履歴メモリ3430は、履歴メモリ3430の使用状況に関する情報を履歴メモリ容量管理部3450に供給する。さらにこの履歴メモリ3430は、保持している実行履歴およびループ代表履歴を履歴変換部3500に供給する。この履歴メモリ3430は、例えば、連想メモリ(CAM:Content Addressable Memory)により実現される。
 履歴登録部3440は、履歴対象データ保持部3410から供給された実行履歴を履歴メモリ3430に保持させるためのデータ構造に変換して、その変換された実行履歴を履歴メモリ3430に登録するものである。この履歴登録部3440は、例えば、履歴検索部3420により関数履歴が検索されない場合には、関数の開始アドレス、入力値および実行結果を、実行履歴として履歴メモリ3430に登録する。また、この履歴登録部3440は、例えば、履歴検索部3420によりループ個別履歴が検索されない場合には、ループの開始アドレス、入力値、実行結果およびループカウンタ値を実行履歴として履歴メモリ3430に登録する。
 また、この履歴登録部3440は、履歴メモリ容量管理部3450から供給される履歴メモリ3430の空き容量に比べて新たに登録する実行履歴のデータ量の方が大きい場合には、登録を一時中断する。そして、この履歴登録部3440は、既に登録されている実行履歴のうち、前回の使用からの未使用期間が最も長い実行履歴を消去させるための消去開始情報を消去部3460に供給する。
 履歴メモリ容量管理部3450は、履歴メモリ3430の空き容量を管理するものである。この履歴メモリ容量管理部3450は、例えば、履歴メモリ3430に新たな実行履歴が登録される度に、履歴メモリ3430の空き容量を測定する。さらに、この履歴メモリ容量管理部3450は、履歴メモリ3430から実行履歴が消去される度に、履歴メモリ3430の空き容量を測定する。この履歴メモリ容量管理部3450は、履歴メモリ3430の空き容量に関する情報を履歴登録部3440に供給する。
 消去部3460は、履歴登録部3440から消去開始情報が供給された場合には、前回の使用からの未使用期間が最も長い実行履歴を消去するものである。
 履歴変換部3500は、履歴管理部3400により管理されている実行履歴を退避履歴に変換して主記憶部3130に保持させるものであり、履歴制御部3510と、履歴復元部3520と、退避領域管理部3530とを備える。
 履歴制御部3510は、履歴メモリ3430に保持されているループ個別実行履歴から退避履歴を生成して、主記憶部3130に退避するものである。この履歴制御部3510は、例えば、履歴メモリ3430から反復再利用区間の実行履歴を、信号線3490を介して抽出し、その実行履歴と、退避領域管理部3530から供給される主記憶部3130のアドレス情報とに基づいて退避履歴を主記憶部3130に退避させる。また、この履歴制御部3510は、例えば、履歴メモリ3430に保持させる新たな実行履歴のデータ量が履歴メモリ3430の空き容量より大きい場合に退避履歴の退避を開始する。
 そして、この履歴制御部3510は、退避履歴の基となったループ個別履歴を履歴メモリ3430から消去し、退避履歴位置情報を含むループ代表履歴をループ個別履歴の代わりに履歴メモリ3430に登録する。なお、ここでいう退避履歴位置情報とは、例えば、退避履歴の主記憶部3130における格納位置を指し示す主記憶部3130のアドレスである。このように、履歴制御部3510は、生成した退避履歴を、信号線3509を介して主記憶部3130に供給する。また、履歴制御部3510は、生成したループ代表履歴を、信号線3590を介して履歴メモリ3430に供給する。なお、履歴制御部3510および履歴メモリ3430から構成される装置は、特許請求の範囲に記載の履歴保存装置の一例である。
 履歴復元部3520は、実行結果出力部3422から供給された退避履歴位置情報に基づいて主記憶部3130から退避履歴を抽出して、その退避履歴に基づいて実行履歴を復元するものである。この履歴復元部3520は、例えば、主記憶部3130に退避した退避履歴の実行結果を再利用する場合には、実行結果出力部3422から供給された退避履歴の情報に基づいて主記憶部3130から信号線3139を介して退避履歴を抽出する。そして、この履歴復元部3520は、履歴メモリ3430から抽出したループ代表履歴と、主記憶部3130から抽出した退避履歴とに基づいて実行履歴を復元する。その後、この履歴復元部3520は、履歴メモリ3430に保持されているループ代表履歴を消去し、さらに履歴メモリ3430における退避履歴を保持する容量を確保した後に、復元した実行履歴を履歴メモリ3430に登録する。
 このように、この履歴復元部3520は、復元した実行履歴を、信号線3580を介して履歴メモリ3430に供給する。
 退避領域管理部3530は、主記憶部3130における退避履歴が保持される領域を管理するものである。この退避領域管理部3530は、例えば、退避履歴が保持される領域を主記憶部3130に確保し、履歴制御部3510が退避履歴を生成した場合には、主記憶部3130におけるその退避履歴の退避先のアドレスを履歴制御部3510に信号線3539を介して供給する。
 主記憶部3130は、この構成図においては退避履歴を保持するものである。なお、主記憶部3130は、特許請求の範囲に記載の退避履歴保持部の一例である。
 このように、本発明の実施の形態では、プロセッサコア3300と履歴管理部3400と履歴変換部3500とを設けることによって、反復再利用区間の実行履歴を主記憶部3130に退避させることができる。
 なお、ここでは、反復再利用区間がループである場合について説明したが、これに限定されるものではない。例えば、ループ以外の反復再利用区間として、再帰呼び出し(リカーシブコール)を伴うサブルーチンなどが考えられる。
 [履歴制御部3510の構成例]
 図63は、本発明の実施の形態における履歴制御部3510の構成例を示すブロック図である。履歴制御部3510は、退避履歴生成部3600と、ループ個別履歴消去部3512と、ループ代表履歴登録部3513とを備える。
 退避履歴生成部3600は、ループ個別履歴に基づいて退避履歴を生成するものである。この退避履歴生成部3600は、例えば、ループの反復された実行による実行結果を含むループ個別履歴を履歴メモリ3430から信号線3490を介して取得して、その取得したループ個別履歴に基づいて退避履歴を生成する。この時、この退避履歴生成部3600は、主記憶部3130におけるその退避履歴の退避先のアドレスを退避領域管理部3530から信号線3539を介して受け取る。そして、この退避履歴生成部3600は、その生成した退避履歴を、信号線3509を介して主記憶部3130に退避させる。
 また、この退避履歴生成部3600は、退避履歴位置情報を含むループ代表履歴を生成し、信号線3608を介してループ代表履歴登録部3513に供給する。さらに、この退避履歴生成部3600は、退避履歴の基となったループ個別履歴を、信号線3609を介してループ個別履歴消去部3512に供給する。
 ループ個別履歴消去部3512は、退避履歴の基となった実行履歴を消去するものである。このループ個別履歴消去部3512は、退避履歴生成部3600から供給された退避履歴の基となったループ個別履歴に基づいて、このループ個別履歴を履歴メモリ3430から信号線3592を介して消去する。また、このループ個別履歴消去部3512は、そのループ個別履歴の消去を通知する情報をループ代表履歴登録部3513に供給する。
 ループ代表履歴登録部3513は、ループ代表履歴を履歴メモリ3430に登録するものである。このループ代表履歴登録部3513は、例えば、退避履歴生成部3600からループ代表履歴が供給された場合に、ループ個別履歴消去部からループ個別履歴の消去を通知する情報が供給されたときは、ループ代表履歴を履歴メモリ3430に信号線3593を介して登録する。
 [退避履歴生成部3600の構成例]
 図64は、本発明の実施の形態における退避履歴生成部3600の構成例を示すブロック図である。退避履歴生成部3600は、先頭探索部3610と、連続探索部3620と、ループ個別履歴取得部3630と、退避履歴転送部3640と、ループ代表履歴生成部3650とを備える。
 先頭探索部3610は、反復再利用区間の1回目の実行に関するループ個別履歴を、履歴メモリ3430から信号線3491を介して探索するものである。この先頭探索部3610は、ループ個別履歴を探索した場合には、一旦動作を停止してその後のループ個別履歴の探索を連続探索部3620に処理させる。この先頭探索部3610は、その探索したループ個別履歴に関する位置情報を連続探索部3620に供給する。
 連続探索部3620は、先頭探索部3610から供給された反復再利用区間の1回目の実行に関するループ個別履歴の位置情報に基づいて、2回目以降の実行に関するループ個別履歴を、信号線3492を介して探索するものである。この連続探索部3620は、例えば、50回反復されたループにおいて、1回目のループ個別履歴の位置情報が先頭探索部3610から供給された場合には、2回目から50回目までのループ個別履歴を探索する。そして、この連続探索部3620は、51回目の実行履歴が探索されなかったときに、その50個のループ個別履歴を取得するための位置情報をループ個別履歴取得部3630に供給する。
 また、この連続探索部3620は、2回目以降のループ個別履歴が探索されなかった場合には、反復再利用区間は反復して実行されなかったと判断して、退避履歴の生成を中止する。そして、この連続探索部3620は、一端動作を停止して先頭探索部3610に反復再利用区間の1回目の実行に関するループ個別履歴の探索を再開させる。
 ループ個別履歴取得部3630は、連続探索部3620から供給されたループ個別履歴を取得するための位置情報に基づいて、ループ個別履歴を、信号線3493を介して履歴メモリ3430から取得するものである。このループ個別履歴取得部3630は、例えば、連続探索部3620から50回反復された反復再利用区間における50個のループ個別履歴に関する位置情報が供給された場合には、その50個のループ個別履歴を履歴メモリ3430から取得する。また、このループ個別履歴取得部3630は、その取得したループ個別履歴を、信号線3638および信号線3609を介して退避履歴転送部3640、ループ代表履歴生成部3650およびループ個別履歴消去部3512に供給する。
 退避履歴転送部3640は、ループ個別履歴取得部3630から供給されたループ個別履歴に基づいて退避履歴を生成して、その生成された退避履歴を主記憶部3130に転送するものである。この退避履歴転送部3640は、例えば、50回反復された反復再利用区間の50個のループ個別履歴が供給された場合には、50個の退避履歴を生成する。この退避履歴転送部3640は、退避領域管理部3530から信号線3539を介して供給される主記憶部3130のアドレスに基づいて退避履歴を主記憶部3130に退避させる。この退避履歴転送部3640は、生成した退避履歴を、信号線3509を介して主記憶部3130に転送する。
 ループ代表履歴生成部3650は、ループ個別履歴取得部3630から供給されたループ個別履歴に基づいてループ代表履歴を生成するものである。このループ代表履歴生成部3650は、退避領域管理部3530から信号線3539を介して供給される主記憶部3130のアドレスに基づいて、退避履歴位置情報が含まれるループ代表履歴を生成する。このループ代表履歴生成部3650は、その生成したループ代表履歴を、信号線3608を介してループ代表履歴登録部3513に供給する。
 [履歴復元部3520の構成例]
 図65は、本発明の実施の形態における履歴復元部3520の構成例を示すブロック図である。履歴復元部3520は、退避履歴取得部3521と、ループ個別履歴生成部3522と、登録領域確保部3523と、ループ個別履歴登録部3524とを備える。
 退避履歴取得部3521は、実行結果出力部3422から供給された退避履歴位置情報に基づいて主記憶部3130から退避履歴を取得するものである。この退避履歴取得部3521は、例えば、反復して50回実行された反復再利用区間の退避履歴を取得する場合には、実行結果出力部3422から信号線3408を介して供給された退避履歴位置情報に基づいて、その50個の退避履歴を主記憶部3130から取得する。この退避履歴取得部3521は、その取得した退避履歴をループ個別履歴生成部3522に供給する。
 ループ個別履歴生成部3522は、退避履歴からループ個別履歴を生成するものである。このループ個別履歴生成部3522は、信号線3408を介して供給された退避履歴位置情報に基づいて、その退避履歴位置情報を含むループ代表履歴を履歴メモリ3430から信号線3480を介して取得する。そして、このループ個別履歴生成部3522は、その取得したループ代表履歴と、退避履歴取得部3521から供給された退避履歴とに基づいて、ループ個別履歴を生成する。
 このループ個別履歴生成部3522は、その生成したループ個別履歴をループ個別履歴登録部3524に供給する。また、このループ個別履歴生成部3522は、ループ代表履歴と、ループ個別履歴のデータ量とを登録領域確保部3523に供給する。
 登録領域確保部3523は、ループ個別履歴を登録するために履歴メモリ3430の空き領域を確保するものである。この登録領域確保部3523は、ループ個別履歴生成部3522から供給されたループ代表履歴を、履歴メモリ3430から信号線3583を介して消去する。そして、この登録領域確保部3523は、ループ個別履歴生成部3522から供給されたループ個別履歴のデータ量に基づいて、履歴メモリ3430に全てのループ個別履歴を登録する空き容量があるか否か判断する。この登録領域確保部3523は、履歴メモリ3430にその空き容量が不足している場合には、信号線3583を介して空き容量を確保する。例えば、この登録領域確保部3523は、前回の使用からの未使用期間が最も長い実行履歴を消去して履歴メモリ3430における必要な空き容量を確保する。
 この登録領域確保部3523は、履歴メモリ3430における空き容量に関する情報をループ個別履歴登録部3524に供給する。
 ループ個別履歴登録部3524は、ループ個別履歴生成部3522から供給されたループ個別履歴を、信号線3584を介して履歴メモリ3430に登録するものである。このループ個別履歴登録部3524は、ループ個別履歴生成部3522から供給されたループ個別履歴を、登録領域確保部3523から供給された情報が指し示す履歴メモリ3430の空き容量に登録する。
 このように、本発明の実施の形態では、データ処理装置3100に履歴管理部3400および履歴変換部3500を設けることによって、実行が反復される反復再利用区間の実行履歴を退避履歴として主記憶部3130に退避することができる。
 <2.履歴情報のフィールド構成例>
 [実行履歴、ループ個別履歴および退避履歴のフィールド構成例]
 図66は、本発明の実施の形態における履歴メモリ3430に保持される関数履歴、ループ個別履歴およびループ代表履歴と、主記憶部3130に保持される退避履歴とのフィールド構成例を示す模式図である。
 図66の(a)には、関数再利用区間の実行履歴である関数履歴3710のフィールド構成例が示されている。この関数履歴3710は、識別子フィールド3711と、開始アドレスフィールド3712と、入力値リンクフィールド3713と、実行結果リンクフィールド3717とから構成される。
 識別子フィールド3711は、関数履歴と、ループ個別履歴と、ループ代表履歴とを識別するためのフィールドである。この識別子フィールド3711には、関数履歴であることを示す2ビット(00)が格納される。また、この識別子フィールド3711は、関数履歴3710における先頭のフィールドであり、例えば、その関数履歴3710の開始アドレスに保持されるフィールドである。
 開始アドレスフィールド3712は、関数の開始アドレスを格納するためのフィールドである。この開始アドレスフィールド3712に格納される関数の開始アドレスは、検索要求入力部3421により実行履歴が検索される場合には、検索要求の開始アドレスと比較される。
 入力値リンクフィールド3713は、リンク構造を用いて格納されている関数の入力値のアドレスを格納するためのフィールドである。この入力値リンクフィールド3713には、検索要求入力部3421により実行履歴が検索されて検索要求の開始アドレスが開始アドレスフィールド3712の開始アドレスと一致したときに、検索要求の入力値と比較される入力値を保持するアドレスが格納される。この入力値リンクフィールド3713には、例えば、3つの引数を入力値とする関数の場合には、3つの関数のうち1番目の引数の値である第1引数値が保持されているアドレスが格納される。
 実行結果リンクフィールド3717は、リンク構造を用いて格納されている関数の実行結果のアドレスを格納するためのフィールドである。この実行結果リンクフィールド3717には、検索要求入力部3421により実行履歴が検索されて開始アドレスおよび入力値が一致したときに、実行結果として出力される関数の実行結果が保持されているアドレスが格納される。例えば、3つの変数を出力値とする関数の場合には、3つの変数のうち1番目の変数の値が保持されているアドレスが実行結果リンクフィールド3717に格納される。
 図66の(b)には、反復再利用区間の実行履歴であるループ個別履歴3720のフィールド構成例が示されている。このループ個別履歴3720は、識別子フィールド3721と、開始アドレスフィールド3722と、入力値リンクフィールド3723と、ループカウンタ値フィールド3724と、実行結果リンクフィールド3727とから構成される。
 識別子フィールド3721は、図66の(a)において示した識別子フィールド3711と同様に、関数履歴と、ループ個別履歴と、ループ代表履歴とを識別するための識別子を格納するフィールドである。この識別子フィールド3721には、ループ個別履歴であることを示す2ビット(01)が格納される。また、この識別子フィールド3721は、ループ個別履歴3720における先頭のフィールドであり、例えば、そのループ個別履歴3720の開始アドレスに保持されるフィールドである。
 開始アドレスフィールド3722は、ループの開始アドレスを格納するためのフィールドである。この開始アドレスフィールド3722に格納されるループの開始アドレスは、検索要求入力部3421により実行履歴が検索される場合には、検索要求の開始アドレスと比較される。
 入力値リンクフィールド3723は、リンク構造を用いて格納されているループの入力値のアドレスを格納するためのフィールドである。この入力値リンクフィールド3723の機能は、図66の(a)において示した入力値リンクフィールド3713と同様のものであるので、ここでの詳細な説明を省略する。
 ループカウンタ値フィールド3724は、ループの何回目の実行による実行結果であるのかを示す値を格納するためのフィールドである。このループカウンタ値フィールド3724には、検索要求入力部3421により実行履歴が検索されて開始アドレスおよび入力値が一致したときに、検索要求のループカウンタ値と比較されるループカウンタ値が格納される。
 実行結果リンクフィールド3727は、リンク構造を用いて格納されているループの実行結果のアドレスを格納するフィールドである。この実行結果リンクフィールド3727には、検索要求入力部3421により実行履歴が検索されて開始アドレス、入力値、およびループカウンタ値が一致したときに、実行結果として出力されるループの実行結果が保持されているアドレスが格納される。
 図66の(c)には、反復再利用区間の代表履歴であるループ代表履歴3730のフィールド構成例が示されている。このループ代表履歴3730は、識別子フィールド3731と、開始アドレスフィールド3732と、入力値リンクフィールド3733と、退避カウントフィールド3735と、退避履歴アドレスフィールド3736とから構成される。
 識別子フィールド3731は、図66の(a)において示した識別子フィールド3711と同様に、関数履歴と、ループ個別履歴と、ループ代表履歴とを識別するためのフィールドである。この識別子フィールド3731には、ループ代表履歴であることを示す2ビット(10)が格納される。また、この識別子フィールド3731は、ループ代表履歴3730における先頭のフィールドであり、例えば、そのループ代表履歴3730の開始アドレスに保持されるフィールドである。
 開始アドレスフィールド3732は、図66の(b)において示した開始アドレスフィールド3722と同様に、ループの開始アドレスを格納するためのフィールドである。この開始アドレスフィールド3732の機能は、図66の(b)の開始アドレスフィールド3722と同様のものであるのでここでの詳細な説明を省略する。
 入力値リンクフィールド3733は、図66の(b)において示した入力値リンクフィールド3723と同様に、リンク構造を用いて格納されているループの入力値のアドレスを格納するためのフィールドである。この入力値リンクフィールド3733の機能は、図66の(b)において示した入力値リンクフィールド3723と同様のものであるのでここでの詳細な説明を省略する。
 退避カウントフィールド3735は、主記憶部3130に退避された退避履歴の個数を示す値を格納するためのフィールドである。この退避カウントフィールド3735には、実行履歴が検索されて検索要求の開始アドレスおよび入力値がループ代表履歴の開始アドレスおよび入力値と一致したときに、履歴復元部3520に退避履歴位置情報として供給される退避履歴の個数が格納される。
 退避履歴アドレスフィールド3736は、退避履歴アドレスを格納するためのフィールドである。ここでいう退避履歴アドレスとは、主記憶部3130に退避された退避履歴が格納されているアドレスである。この退避履歴アドレスフィールド3736には、実行履歴が検索されて検索要求の開始アドレスおよび入力値が、ループ代表履歴の開始アドレスおよび入力値と一致したときに、履歴復元部3520に退避履歴位置情報として供給される退避履歴アドレスが格納される。例えば、この退避履歴アドレスフィールド3736には、反復再利用区間の複数の退避履歴を連続したアドレスに保存した場合において、最初の退避履歴の開始アドレスが格納される。
 図66の(d)には、反復再利用区間の退避履歴3740のフィールド構成例が示されている。この退避履歴3740は、ループカウンタ値フィールド3744および実行結果リンクフィールド3747から構成される。
 ループカウンタ値フィールド3744は、図66の(b)において示したループカウンタ値フィールド3724と同様に、ループの何回目の実行による実行結果であるのかを示す値を格納するためのフィールドである。このループカウンタ値フィールド3744には、履歴復元部3520によりループ個別履歴が復元されるときに、ループカウンタ値フィールド3724となる値が格納される。
 実行結果リンクフィールド3747は、図66の(b)において示した実行結果リンクフィールド3727と同様に、リンク構造を用いて格納されているループの実行結果のアドレスを格納するフィールドである。この実行結果リンクフィールド3747には、履歴復元部3520によりループ個別履歴が復元されるときに、実行結果リンクフィールド3727となる値が格納される。
 なお、ここでは、実行履歴およびループ代表履歴のデータ長を固定長にして履歴メモリ3430における実行履歴およびループ代表履歴の登録や消去を容易にするために、また、実行履歴のデータ量を少なくするために、入力値および実行結果をリンク構造にした。しかしながら、関数履歴、ループ個別履歴、ループ代表履歴および退避履歴のデータ構造はこれに限定されるものではない。例えば、入力値および実行結果をリンク構造にしないで、関数履歴、ループ個別履歴、ループ代表履歴および退避履歴にそのまま保持させるようにしてもよい。
 [入力値リンクおよび実行結果リンクのデータ構造例]
 図67は、本発明の実施の形態における入力値リンクおよび実行結果リンクのデータ構造例を示す概念図である。
 ここでは、図66の(a)において示した入力値リンクフィールド3713と、入力値を格納する入力値格納領域3760のデータ構造とが示されている。この例では、3つの引数が入力値である関数を想定する。また、ここでは、入力値格納領域3760は、関数履歴、ループ個別履歴およびループ個別履歴が保存される領域とは異なる履歴メモリ3430の領域であることとする。
 入力値格納領域3760は、関数履歴およびループ個別履歴の入力値を保持する領域である。この入力値格納領域3760には、3つの引数として、第1引数値3761、第2引数値3763および第3引数値3765が左側のカラムに示されている。そして、この入力値格納領域3760の右側のカラムには、その3つの引数とともに保存されるリンクアドレス3762、3764および3766が示されている。
 第1引数値3761、第2引数値3763および第3引数値3765は、入力値リンクフィールド3713が指定する入力値である3つの引数の引数値がそれぞれ保持される領域である。すなわち、第1引数値3761には、第1番目とされた引数の引数値が保持され、第2引数値3763には、第2番目とされた引数の引数値が保持され、第3引数値3765には、第3番目とされた引数の引数値が保持される。例えば、第1引数値3761には関数再利用区間において1番最初に使用された引数が保持され、第2引数値3763には2番目に使用された引数が保持され、第3引数値3765には3番目に使用された引数が保持される。また、第1引数値3761のアドレスは、入力値リンクフィールド3713に格納されるアドレスである。
 リンクアドレス3762、リンクアドレス3764およびリンクアドレス3766は、第1引数値3761、第2引数値3763および第3引数値3765にそれぞれ連結して保存され、次の引数のアドレスを格納する領域である。例えば、第1引数値3761に連結して保存されるリンクアドレス3762は、第2引数値3763のアドレスを格納する。また、リンクアドレス3762、リンクアドレス3764およびリンクアドレス3766は、次の引数が無い場合には、リンク先が無いことを示す「0」が格納される。例えば、第3引数値3765に連結して保存されるリンクアドレス3766は、第4番目の引数が無いため「0」が格納される。
 このように、入力値格納領域3760には、実行履歴の入力値が引数毎に次の引数の保存場所を指定するリンクアドレスが保持される。実行履歴の検索のときには、検索要求の開始アドレスと関数履歴3710の開始アドレスが一致した場合に入力値リンクフィールド3713が参照されて、第1引数値3761から順に引数毎に検索要求の入力値の引数と比較される。そして、第3引数値3765まで一致するとリンクアドレス3766の「0」により検索を終了し、実行結果の出力過程に移行する。
 このように、本発明の実施の形態では、実行履歴の入力値をリンク構造で保存することにより、記憶領域の無駄な領域を減少させて効率よく入力値を保持させることができる。なお、入力値リンクフィールド3723および入力値リンクフィールド3733に関しては、入力値リンクフィールド3713と同様にリンク構造を用いて入力値が保存されるため説明を省略する。また、実行結果リンクフィールド3717、実行結果リンクフィールド3727および実行結果リンクフィールド3747に関しても、入力値リンクフィールド3713と同様にリンク構造を用いて実行結果が保存されるためh説明を省略する。
 なお、ここでは、3つの引数が入力値である関数を想定したが、引数の値が最大3つに限定されるものではない。リンクを繋げることで3つ以上の引数および変数に対応することができる。また、ここでは、入力値格納領域3760は、検索を高速にするために履歴メモリ3430における領域であることを想定したが、これに限定されるものではない。例えば、主記憶部3130に入力値格納領域3760を確保することにより、より多くの実行履歴およびループ個別履歴を履歴メモリ3430に保持させることができる。
 <3.履歴メモリに保持される履歴情報および主記憶部に保持される退避履歴の一例> [ループ個別履歴の退避の具体例]
 図68は、本発明の実施の形態における履歴制御部3510によるループ個別履歴の退避の際の、履歴メモリ3430および主記憶部3130における実行履歴、ループ代表履歴および退避履歴の具体例を示す図である。ここでは、履歴メモリ3430における関数履歴、ループ個別履歴およびループ代表履歴を登録する領域は、データ量と無関係に10個の履歴が格納できる容量であることを想定する。さらにここでは、主記憶部3130における退避履歴を保持させる領域は、データ量と無関係に6個の退避履歴を退避できる容量であることとする。また、これ以降の説明では、便宜上、関数再利用区間の実行履歴である関数履歴、反復再利用区間の実行履歴であるループ個別履歴、および、反復再利用区間の代表履歴であるループ代表履歴の3つの履歴を履歴情報と表現することとする。
 図68の(a)は、履歴制御部3510が動作する前の履歴メモリ3430および主記憶部3130における実行履歴、ループ代表履歴および退避履歴の一例である。ここには、実行履歴表3811および退避履歴表3812が示されている。
 実行履歴表3811は、履歴メモリ3430に登録されている履歴情報を表すものである。この実行履歴表3811における左側のカラムには、履歴メモリ3430に登録された順序を示す順位が「1」から「10」まで順に例示されている。この順位は、数値が小さいものほど先に履歴メモリ3430に登録されたことを示すものとする。
 実行履歴表3811における右側のカラムには、履歴メモリ3430に登録されている履歴情報が示されている。ここには、図66の(a)乃至(d)において示した識別子と、その履歴情報の基となった関数またはループとが示されている。また、ループ個別履歴の場合には、そのループ個別履歴が反復された実行において何回目の実行であるのかを示す値がさらに示されている。
 例えば、順位が「1」の履歴情報(00(funcA))は、関数A(funcA)の関数履歴(00)を示している。また、「7」の順位の履歴情報(01(loopF(1)))は、ループF(loopF)の1回目(1)の実行に関するループ個別履歴(01)を示している。また、「8」の順位の履歴情報(01(loopF(2)))は、反復して実行されたループF(loopF)の2回目(2)の実行に関するループ個別履歴(01)を示している。
 退避履歴表3812は、主記憶部3130に退避された退避履歴を表すものである。この退避履歴表3812における順位には、主記憶部3130に登録された順序を示す順位が示されており、ここでは、「1」から「6」までの順位が例示されている。この順位は、数値が少ないものほど古く、早い時点で登録されたことを意味している。
 退避履歴表3812における退避履歴には、主記憶部3130に退避された退避履歴が示されている。ここでは、主記憶部3130に退避履歴は1つも退避されていないことが示されている。
 この様な場合において、履歴制御部3510は、履歴メモリ3430に新たな実行履歴を登録する空き容量が無いことを検出すると、履歴メモリ3430から反復して実行された反復再利用区間のループ個別履歴の退避を開始する。
 図68の(b)は、履歴制御部3510が動作した後の履歴メモリ3430および主記憶部3130における履歴情報および退避履歴の一例である。ここには、実行履歴表3821および退避履歴表3822が示されている。
 実行履歴表3821は、図68の(a)で示した実行履歴表3811におけるループ個別履歴が退避された後の履歴メモリ3430における履歴情報を表すものである。
 実行履歴表3821では、実行履歴表3811の「7」の順位のループ個別履歴(01(loopF(1))と、「8」の順位のループ個別履歴(01(loopF(2))と、「9」の順位のループ個別履歴(01(loopF(3))とが削除されている。そして、その3つのループ個別履歴の代わりとして、ループ代表履歴(10(loopF))が「7」の順位に示されている。
 また、その3つのループ個別履歴がループ代表履歴(10(loopF))に代わったことにより、図68の(a)の実行履歴表3811における「10」の順位で示した関数Bの関数履歴(00(funcB))の順位が「8」に繰り上げられている。そして、実行履歴表3821における順位が「9」乃至「10」の実行履歴は存在しないことを意味する。
 退避履歴表3822は、履歴制御部3510が動作した後の主記憶部3130に退避された退避履歴を表すものである。
 この退避履歴表3822の「1」の順位には、実行履歴表3811の「7」の順位のループ個別履歴(01(loopF(1)))に基づいて生成された、反復して実行されたループFの1回目の実行の実行結果を含む退避履歴(loopF(1))が示されている。「2」の順位には、実行履歴表3811の「8」の順位において示したループ個別履歴(01(loopF(2)))に基づいて生成された、反復して実行されたループFの2回目の実行の実行結果を含む退避履歴(loopF(2))が示されている。
 そして、「3」の順位には、実行履歴表3811の「9」の順位において示したループ個別履歴(01(loopF(3)))に基づいて生成された、反復されたループFの3回目の実行の実行結果を含む退避履歴(loopF(3))が示されている。
 このように、本発明の実施の形態では、履歴制御部3510を設けることによって、反復して実行されるループのループ個別履歴の実行結果を主記憶部3130に退避させることができる。
 [ループ個別履歴の復元の具体例]
 図69は、本発明の実施の形態における履歴復元部3520によるループ個別履歴の復元の際の、履歴メモリ3430および主記憶部3130における実行履歴、ループ代表履歴および退避履歴の具体例を示す図である。ここでは、履歴メモリ3430および主記憶部3130は、図68において示した履歴メモリ3430および主記憶部3130と同様の機能であることを想定する。また、ここでは、空き容量が無い履歴メモリ3430に新たな実行履歴を登録する場合には、前回の使用からの未使用期間が最も長い実行履歴を削除する(LRU:Least Recently Used)ことにより空き容量を確保することとする。さらに、ここでは、実行履歴は登録されてから一度も使用されていないことを想定し、LRUにより削除される実行履歴は、順序が最も若い実行履歴であることとする。
 図69の(a)は、退避履歴に基づいてループ個別履歴が復元される前の履歴メモリ3430および主記憶部3130における履歴情報および退避履歴の一例である。ここには、実行履歴表3831および退避履歴表3832が示されている。
 実行履歴表3831は、履歴復元部3520がループ個別履歴を復元する前の履歴メモリ3430に登録されている履歴情報を示すものである。この実行履歴表3831には、図68の(b)において示した実行履歴表3821の空き容量に新たな実行履歴が格納された状態が示されている。この新たな実行履歴として、「9」の順位には関数Cの関数履歴00(funcC)が登録され、「10」の順位には関数Dの関数履歴00(funcD)が格納されている。
 退避履歴表3832は、図68の(b)において示した退避履歴表3822と同様に、主記憶部3130に退避された退避履歴を表すものである。
 この様な場合において、履歴検索部3420により履歴メモリ3430からループFに関するループ代表履歴が検索されると、履歴復元部3520は退避履歴からループ個別履歴の復元を開始する。
 図69の(b)は、履歴復元部3520により退避履歴からループ個別履歴が復元された後の履歴メモリ3430および主記憶部3130における履歴情報および退避履歴の一例である。ここには、実行履歴表3841および退避履歴表3842が示されている。
 実行履歴表3841は、履歴復元部3520がループ個別履歴を復元した後の履歴メモリ3430に登録されている履歴情報を示すものである。この実行履歴表3841には、図69の(a)で示した退避履歴表3832の退避履歴からループ個別履歴が復元されて実行履歴表3831の実行履歴に加えられた状態が示されている。
 この実行履歴表3841では、実行履歴表3831における順位「1」および「2」に対応する実行履歴00(funcA)および01(loopA(1))が消去されて、「3」乃至「6」の実行履歴の順序が「1」乃至「4」に繰り上がっている。
 そして、「5」の順位では、退避履歴表3832の「1」の順位の退避履歴(loopF(1))の基となった実行履歴01(loopF(1))が復元されて登録されている。「6」および「7」の順位でも「5」と同様に、実行履歴01(loopF(2))および01(loopF(3))が復元されて登録されている。
 退避履歴表3842は、ループ個別履歴が復元された後の主記憶部3130に登録された退避履歴を示すものである。この退避履歴表3842には、退避履歴表3832において示した退避履歴は全て復元されて主記憶部3130から削除され、退避履歴は1つも退避されていないことが示されている。
 このように、本発明の実施の形態では、履歴復元部3520を設けることによって、主記憶部3130に退避履歴として退避されたループ個別履歴を履歴メモリ3430に復元することができる。
 [本発明の実施の形態における新たな実行履歴の登録例]
 図70は、本発明の実施の形態における新たな実行履歴が登録されるときの履歴メモリ3430における履歴情報と主記憶部3130における退避履歴との具体例を示す図である。ここでは、履歴メモリ3430は、データ量と無関係に12個の履歴情報が登録できる容量であることを想定する。
 また、ここでは、空き容量が無い履歴メモリ3430に新たな実行履歴を登録したい場合には、前回の使用からの未使用期間が最も長い実行履歴を削除する(LRU)ことができることとする。さらにここでは、実行履歴は登録されてから一度も使用されていないことを想定し、LRUにより削除される実行履歴は、履歴メモリ3430に最も早くに登録された実行履歴であることとする。
 図70の(a)は、新たに登録される実行履歴を示した模式図である。ここには、新たに登録される実行履歴が登録履歴表3861に示されている。なお、図70では、登録履歴表3861に記されている実行履歴のうち、上方に記されている実行履歴から順に履歴メモリ3430に登録されることを想定する。
 図70の(b)は、従来技術を用いたデータ処理装置3100における新たな実行履歴が登録されるときの履歴メモリ3430における履歴情報と主記憶部3130における退避履歴との具体例を示したものである。ここには、実行履歴表3871と、実行履歴表3872と、消去履歴表3873とが示されている。
 実行履歴表3871は、登録履歴表3861において示した新たな実行履歴が登録される前の履歴メモリ3430における実行履歴を表したものである。また、この実行履歴表3871では、上方に記されている実行履歴から順に履歴メモリ3430に登録されたことを想定する。
 実行履歴表3872は、登録履歴表3861において示した新たな実行履歴が登録された後の履歴メモリ3430における実行履歴を示すものである。この実行履歴表3872には、実行履歴表3871の実行履歴に登録履歴表3861で示した新たな実行履歴が登録された状態が示されている。
 この実行履歴表3872では、実行履歴表3871における上から1番目乃至5番目(00(funcE)、01(loopB(1))乃至01(loopB(4))の実行履歴が消去されている。そして、実行履歴表3871における上から6番目乃至12番目の実行履歴が、実行履歴表3872の1番目乃至7番目に示されている。さらに、この実行履歴表3872では、登録履歴表3861で示した新たな実行履歴が8番目乃至12番目に示されている。
 消去履歴表3873は、登録履歴表3861で示した新たな実行履歴の登録により履歴メモリ3430から消去された実行履歴を表したものである。この消去履歴表3873では、実行履歴表3871における上から1番目乃至5番目の実行履歴が示されている。
 このように、従来技術を用いたデータ処理装置3100では、履歴制御部3510を備えていないため、実行履歴の実行結果を主記憶部3130に退避させることができない。これにより、新たな実行履歴を履歴メモリ3430に登録する場合には、前回の使用から最も未使用期間が長い実行履歴を履歴メモリ3430から削除して、その代わりに新たな実行履歴を登録しなければならない。
 図70の(c)は、本発明の実施の形態におけるデータ処理装置3100において新たな実行履歴が登録されるときの履歴メモリ3430における履歴情報と主記憶部3130における退避履歴との具体例を示したものである。ここには、実行履歴表3881と、退避履歴表3882と、実行履歴表3883と、退避履歴表3884とが示されている。ここでは、主記憶部3130の退避履歴を退避させる領域は、データ量と無関係に8個の退避履歴が退避できる容量であることを想定する。
 実行履歴表3881は、登録履歴表3861において示した新たな実行履歴が登録される前の履歴メモリ3430における実行履歴を表したものである。この実行履歴表3881は、図70の(b)の実行履歴表3871と同様のものを示しているため、詳細な説明を省略する。
 退避履歴表3882は、登録履歴表3861において示した新たな実行履歴が登録される前の主記憶部3130における退避履歴を表したものである。この退避履歴表3882では、主記憶部3130に退避履歴は1つも退避されていないことが示されている。
 実行履歴表3883は、登録履歴表3861において示した新たな実行履歴が登録された後の履歴メモリ3430における履歴情報を示すものである。この実行履歴表3883には、実行履歴表3881の実行履歴に登録履歴表3861で示した新たな実行履歴が登録された状態が示されている。
 この実行履歴表3883では、実行履歴表3881における上から2番目乃至5番目のループBのループ個別履歴(01(loopB(1))乃至01(loopB(4))が履歴メモリ3430から削除されている。そして、その削除されたループBのループ個別履歴の代わりに、ループ代表履歴(10(loopB))が実行履歴表3883における上から2番目に示されている。また、実行履歴表3881における上から6番目乃至9番目の実行履歴が、この実行履歴表3883では3番目乃至6番目に示されている。
 さらに、この実行履歴表3883では、実行履歴表3881における上から10番目乃至12番目のループCのループ個別履歴(01(loopC(1))乃至01(loopC(3))が履歴メモリ3430から削除されている。そして、その削除されたループCのループ個別履歴の代わりに、ループ代表履歴(10(loopC))が上から7番目に示されている。そして、この実行履歴表3883では、登録履歴表3861で示した新たな実行履歴が、8番目乃至12番目に記されている。
 退避履歴表3884は、登録履歴表3861において示した新たな実行履歴が登録された後の主記憶部3130における退避履歴を示すものである。この退避履歴表3884では、上から1番目乃至4番目にループBに関する退避履歴(loopB(1)乃至loopB(4))が示されている。さらに、ここでは、上から5番目乃至7番目にループCに関する退避履歴(loopC(1)乃至loopC(3))が示されている。
 このように、本発明の実施の形態におけるデータ処理装置3100では、履歴制御部3510を備えているため、退避履歴を主記憶部3130に退避させ、退避履歴の基となったループ個別履歴の代わりにループ代表履歴を履歴メモリ3430に登録することができる。これにより、新たな実行履歴を履歴メモリ3430に登録する場合には、ループ個別履歴に基づいて退避履歴を退避させ、そしてループ個別履歴をループ代表履歴に置き換えることで履歴メモリ3430空き容量を生成することができる。すなわち、本発明の実施の形態によれば、従来技術を用いたデータ処理装置3100と比較して履歴メモリ3430に保持される実行履歴の数を増やすことができる。
 <4.データ処理装置の処理手順例>
 [本発明の実施の形態における履歴制御部3510の動作例]
 次に、本発明の実施の形態における履歴制御部3510の処理について図面を参照して説明する。
 図71は、本発明の実施の形態における履歴制御部3510によるループ個別履歴の退避処理の処理手順例を示すフローチャートである。なお、ここでは、関数履歴と、ループ個別履歴と、ループ代表履歴と、退避履歴とは、それぞれ固定長のデータであることを想定する。また、ここでは、履歴メモリ3430では、関数履歴と、ループ個別履歴と、ループ代表履歴とは連続するアドレスに登録された順に格納されるものとする。さらに、主記憶部3130では、退避履歴は連続するアドレスに退避された順に格納されるものとする。
 まず、先頭探索部3610において、探索アドレス(radr)が「0」に設定される(ステップS3911)。これにより、履歴メモリ3430の履歴情報が登録される領域の先頭のデータから退避履歴の探索が開始されるようになる。
 次に、先頭探索部3610において、探索アドレス(radr)から識別子が読み出される(ステップS3912)。そして、読み出された識別子が、ループ個別履歴を指し示す「01」であるか否かが判断される(ステップS3913)。そして、識別子が「01」でないと判断された場合には、識別子が関数履歴を指し示す「00」であるか否かが判断される(ステップS3914)。
 そして、識別子が「00」でないと判断された場合には、解析対象の履歴情報は識別子が「10」のループ代表履歴であると判定される。続いて、ループ代表履歴のデータ長から算出されたループ代表履歴が保持されているアドレスの個数である代表履歴アドレス数(x)が探索アドレス(radr)に足されることによって、探索アドレス(radr)が更新される(ステップS3915)。これにより、探索アドレス(radr)は、次に解析する履歴情報における識別子を指し示すアドレスとなる。
 一方、ステップS3914の処理において、識別子が「00」であると判断された場合には、その識別子を示す履歴情報が関数履歴であると判定される。そして、関数履歴のデータ長から算出された関数履歴が保持されているアドレスの個数である関数履歴アドレス数(y)が探索アドレス(radr)に足されることによって、探索アドレス(radr)が更新される(ステップS3916)。
 一方、ステップS3913の処理において、識別子が「01」であると判断された場合には、その識別子を示す履歴情報がループ個別履歴であると判定される。そして、ループ個別履歴のデータ長から算出されたループ個別履歴が保持されているアドレスの個数である個別履歴アドレス数(z)が探索アドレス(radr)に足されることによって、探索アドレス(radr)が更新される(ステップS3917)。
 次に、連続探索部3620において、連続探索対象ループ開始アドレス(ex_adr)が、ステップS3913で検出されたループ個別履歴における反復再利用区間の開始アドレスに設定される(ステップS3918)。さらに、退避履歴開始アドレス(madr)が、退避領域管理部3530から供給された最初の退避履歴を格納する開始アドレスである退避開始アドレスに設定される(ステップS3919)。
 さらに、ループの回数をカウントするための連続カウンタ(rcnt)が「1」に設定される(ステップS3920)。また、ループ個別履歴開始アドレス(start_adr)が、ステップS3913で検出されたループ個別履歴の開始アドレスに設定される(ステップS3921)。このステップS3918乃至S3921の一連の処理により、ステップS3930における処理の準備が完了する。
 そして、ステップS3913で検出されたループ個別履歴が、反復される反復再利用区間の1番目の実行結果なのか否かが判断され、反復されている場合にはループ個別履歴の実行結果を主記憶部3130に退避される実行結果退避処理が行われる(ステップS3930)。
 ステップS3915、S3916およびS3930の後に、探索アドレス(radr)が履歴メモリ3430の使用領域最終アドレスを超えたか否かが判断される(ステップS3923)。ここでいう使用領域最終アドレスは、履歴メモリ3430の履歴情報が登録される領域において、連続するアドレスに登録された順に格納された履歴情報のうち最後に登録された履歴情報が記録されている最後のアドレスである。
 そして、探索アドレス(radr)が、使用領域の最終アドレスを超えていない場合には、ステップS3912に戻り処理が繰り返される。一方、最終アドレスを超えている場合には、ループ個別履歴の退避処理は終了する。
 図72は、本発明の実施の形態における履歴制御部3510によるループ個別履歴の実行結果退避処理(ステップS3930)の処理手順例を示すフローチャートである。
 まず、連続探索部3620において、探索アドレス(radr)が履歴メモリ3430の使用領域最終アドレスを超えたか否かが判断される(ステップS3931)。そして、探索アドレス(radr)が使用領域の最終アドレスを超えていない場合には、探索アドレス(radr)から識別子が読み出される(ステップS3932)。続いて、読み出された識別子が、ループ個別履歴を指し示す「01」であるか否かが判断される(ステップS3933)。そして、識別子が「01」でないと判断された場合には、ステップS3938に進む。
 一方、識別子が「01」であると判断された場合には、そのループ個別履歴に含まれる開始アドレスと、連続探索対象ループ開始アドレス(ex_adr)とが同一であるか否かが判断される(ステップS3934)。そして、開始アドレスが同一でないと判断された場合には、ステップS3938に進む。
 一方、開始アドレスが同一である場合には、ループ個別履歴のループカウンタ値が、連続カウンタ(rcnt)に「1」を加算した値(rcnt+1)と同じ値であるか否かが判断される(ステップS3935)。そして、ループカウンタ値と「rcnt+1」とが同一でないと判断された場合には、ステップS3938に進む。
 これらステップS3934およびステップS3935により、ステップS3933で検出されたループ個別履歴は、図71のステップS3913において検出されたループ個別履歴を1回目のループとするループ個別履歴であるか否かが判定される。
 例えば、ステップS3934において、ループ個別履歴に含まれる開始アドレスと、連続探索対象ループ開始アドレス(ex_adr)とが異なる場合には、異なる反復再利用区間のループ個別履歴が連続していると判断される。
 また、ステップS3935において、ループ個別履歴に含まれるループカウンタ値が「rcnt+1」とは異なっている場合には、同じ反復再利用区間が反復ではなく新たに1回目から実行されたと判断される。このステップS3935の一例として、ループカウンタ値が「1」であり、「rcnt+1」が「5」である場合を説明する。この場合には、図71のステップS3913で検出されたループ個別履歴の開始アドレスが指し示す反復再利用区間は、反復されて5回実行された後に、ステップS3933で検出されたループ個別履歴の基となった実行から新たな反復になったと判断される。
 一方、ステップS3935において、ループカウンタ値と「rcnt+1」とが同一であると判断された場合には、連続カウンタ(rcnt)に「1」が加算される(ステップS3936)。そして、(個別履歴アドレス数(y)が探索アドレス(radr)に足されることによって、探索アドレス(radr)が更新される(ステップS3937)。その後、ステップS3937の処理が終わると、ステップS3931に戻り処理が繰り返される。
 一方、ステップS3931において、探索アドレス(radr)が使用領域最終アドレスよりも大きな値のアドレスであると判断された場合には、連続カウンタ(rcnt)の値が「1」より大きいか否かが判断される(ステップS3938)。これにより、図71のステップS3913で検出されたループ個別履歴は、反復された実行の一回目のループ個別履歴なのか、単独の実行のループ個別履歴なのかが判断される。そして、連続カウンタ(rcnt)の値が「1」以下であると判断された場合には、図71のステップS3913で検出されたループ個別履歴は単独の実行のループ個別履歴と判定し、実行結果退避処理を終了する。
 一方、連続カウンタ(rcnt)の値が「1」より大きいと判断された場合には、ループ個別履歴が履歴メモリ3430から取得される(ステップS3939)。このステップS3939では、ループ個別履歴取得部3630により、ループ個別履歴開始アドレス(start_adr)を最初のループ個別履歴の登録開始始点として連続カウンタ(rcnt)個のループ個別履歴が履歴メモリ3430から取得される。
 続いて、退避履歴転送部3640により、ループ個別履歴に基づいて退避履歴が生成され、その生成された退避履歴が主記憶部3130に退避履歴開始アドレス(madr)を始点として記憶される(ステップS3940)。なお、ステップS3940は、特許請求の範囲に記載の履歴制御手順の一例である。
 次に、ループ個別履歴消去部3512により、退避履歴の基となったループ個別履歴が履歴メモリから消去される(ステップS3941)。なお、ステップS3941は、特許請求の範囲に記載の履歴制御手順の一例である。
 そして、ループ代表履歴登録部3513により、ループ代表履歴がループ個別履歴開始アドレス(start_adr)に基づいて履歴メモリ3430に登録される(ステップS3942)。そして、実行結果退避処理は終了する。なお、ステップS3942は、特許請求の範囲に記載の履歴制御手順の一例である。
 このように、本発明の実施の形態では、反復再利用区間のループ個別履歴のうち反復された実行に関するループ個別履歴のみを主記憶部3130に退避させることができる。
 [本発明の実施の形態における履歴復元部3520の動作例]
 次に、本発明の実施の形態における履歴復元部3520の処理について図面を参照して説明する。
 図73は、本発明の実施の形態における履歴復元部3520によるループ個別履歴の復元処理の処理手順例を示すフローチャートである。なお、ここでは、図71および図72と同様に、関数履歴と、ループ個別履歴と、ループ代表履歴と、退避履歴とは、それぞれ固定長のデータであることを想定する。また、ここでは、図71および図72と同様に、履歴メモリ3430では、関数履歴と、ループ個別履歴と、ループ代表履歴とは連続するアドレスに登録された順に格納されるものとする。さらに、主記憶部3130では、退避履歴は連続するアドレスに退避された順に格納されるものとする。また、ここでは、プログラムの実行の開始をフローチャートの開始とし、プログラムの実行の終了をフローチャートの終了とする。
 まず、フェッチ部310およびレジスタファイル3340に、関数を参照する命令およびその関数の入力値が読み出される(ステップS3951)。次に、命令デコーダ3320によって、関数を参照する命令がデコードされる(ステップS3952)。続いて、解読(デコード)した命令が再利用命令か否かが判断される(ステップS3953)。そして、デコードした命令が再利用命令でないと判断された場合には、実行部3330によって、レジスタファイル3340から供給される入力値に基づいてその再利用区間が実行されることによって、実行結果が出力される(ステップS3954)。なお、ステップS3954は、特許請求の範囲に記載の実行手順の一例である。
 一方、ステップS3953の処理において、命令が再利用命令であると解読された場合には、検索要求入力部3421によって、再利用区間の開始アドレスおよび入力値を用いて履歴メモリ3430に履歴情報があるか否かが判断される(ステップS3955)。このとき、再利用区間が反復再利用区間である場合には、開始アドレスおよび入力値に加えてループカウンタ値も用いて履歴メモリ3430に履歴情報があるか否か探索される。
 そして、履歴情報が履歴メモリ3430にないと判断された場合には、履歴登録部3440によって、実行結果登録処理が行われる(ステップS3970)。これにより、履歴メモリ3430に実行履歴が登録される。
 一方、履歴情報が履歴メモリ3430にあると判断された場合には、実行結果出力部3422および履歴復元部3520によって、実行結果出力処理が行われる(ステップS3980)。これにより、実行している再利用区間の実行結果が履歴メモリ3430から出力される。
 そして、ステップS3954、S3970およびS3980の処理の後に、実行結果がレジスタファイル3340に書き戻される(ステップS3956)。続いて、プログラムの実行が終了したか否かが判断される(ステップS3957)。そして、プログラムの実行が終了していないと判断された場合には、ステップS3951に戻り処理が繰り返される。
 一方、プログラムの実行が終了したと判断された場合には、履歴復元部3520によるループ個別履歴の復元処理が終了される。
 図74は、本発明の実施の形態における実行結果登録処理(ステップS3970)の処理手順例を示すフローチャートである。
 まず、実行部3330によって、レジスタファイル3340から供給される入力値に基づいてその再利用区間が実行されることによって、実行結果が出力される(ステップS3971)。次に、履歴登録部3440によって、出力された実行結果を含む実行履歴を登録するための空き容量が履歴メモリ3430にあるか否かが判断される(ステップS3972)。なお、ステップS3971は、特許請求の範囲に記載の実行手順の一例である。
 そして、実行履歴を登録するための空き容量が履歴メモリ3430にないと判断された場合には、消去部3460によって、前回の使用からの未使用期間が最も長い実行履歴が履歴メモリ3430から1つ削除される(ステップS3973)。そして、ステップS3972に戻り処理が繰り返される。
 一方、実行履歴を登録するための空き容量が履歴メモリ3430にあると判断された場合には、履歴登録部3440により実行履歴が履歴メモリ3430に登録される(ステップS3974)、実行結果登録処理は終了する。
 図75は、本発明の実施の形態における実行結果出力処理(ステップS3980)の処理手順例を示すフローチャートである。なお、ここでは、関数履歴の実行結果と、ループ個別履歴の実行結果と、ループ代表履歴の退避履歴位置情報とを検索出力情報と表現することとする。
 まず、実行結果出力部3422において、履歴メモリ3430から図73のステップS3955で検索された履歴情報の検索出力情報が取得される(ステップS3981)。次に、取得された検索出力情報がループ代表履歴の退避履歴位置情報であるか否かが判断される(ステップS3982)。そして、取得された検索出力情報がループ代表履歴の退避履歴位置情報でないと判断された場合には、ステップS3990に進む。
 一方、取得された検索出力情報がループ代表履歴の退避履歴位置情報であると判断された場合には、退避履歴取得部3521によって、退避履歴位置情報が指し示す退避履歴が主記憶部3130から取得される(ステップS3983)。続いて、ループ個別履歴生成部3522によって、退避履歴およびループ代表履歴に基づいてループ個別履歴が復元される(ステップS3984)。次に、登録領域確保部3523によって、履歴メモリ3430からループ代表履歴が消去される(ステップS3985)。その後、登録領域確保部3523によって、ループ個別履歴を登録するための空き容量が履歴メモリ3430にあるか否かが判断される(ステップS3986)。そして、ループ個別履歴を登録するための空き容量が履歴メモリ3430にないと判断された場合には、登録領域確保部3523によって、前回の使用からの未使用期間が最も長い実行履歴が履歴メモリ3430から1個削除される(ステップS3987)。そして、ステップS3986に戻り、処理が繰り返される。
 一方、ステップS3986の処理において、ループ個別履歴を登録するための空き容量が履歴メモリ3430にあると判断された場合には、ループ個別履歴登録部3524によって、復元されたループ個別履歴が履歴メモリ3430に登録される(ステップS3988)。続いて、実行結果出力部3422によって、復元されたループ個別履歴が検索される(ステップS3989)。
 その後、検索された実行結果に基づいて実行結果が出力される(ステップS3990)。そして、実行結果出力処理は終了する。
 このように、本発明の実施の形態では、主記憶部3130に退避履歴として退避されたループ個別履歴を履歴メモリ3430に復元して、その復元したループ個別履歴の実行結果を再利用することができる。
 これまでに示してきたように、本発明の実施の形態によれば、反復再利用区間のループ個別履歴の実行結果を主記憶部3130に退避させることができる。これにより、実行結果を退避させない従来技術の場合と比べて履歴メモリ3430に保持される履歴情報の数を増やすことができる。また、退避させた実行結果も実行結果の検索対象とすることができるため、その退避させた実行結果を用いて実行結果の再利用をすることができる。
 また、本発明の実施の形態によれば、従来技術によるデータ処理装置3100と比較して、履歴メモリ3430から有効な実行履歴が削除されることによる値再利用の効率の低下を防止することができる。さらに、本発明の実施の形態によれば、従来技術と比較して少ない容量の履歴メモリ3430でも同等の効果が生じるため、履歴メモリ3430を大きい容量とすることに伴う実行履歴の検索時間の増加による値再利用の効率の低下を防止することができる。
 また、本発明の実施の形態は、従来技術と比べて履歴メモリ3430に保持される履歴情報の数を増やすことができるため、プログラムの投機実行などの場合において、特に顕著な効果が得られると考えられる。
 次に、第5の本発明であるコンパイル処理装置、データ処理装置、コンパイル処理方法およびプログラムについて図76乃至図102を参照して説明する。
 以下、第5の本発明を実施するための形態(以下、実施の形態と称する)について説明する。
説明は以下の順序により行う。
 1.第1の実施の形態(コンパイル処理制御:ハッシュ関数を選択してプログラムに埋め込む例)
 2.第2の実施の形態(データ処理制御:ハッシュ関数が埋め込まれたプログラムを処理する例)
 3.第3の実施の形態(コンパイル処理制御:ハッシュ値を選択してハッシュ値付再利用命令を生成する例)
 4.第4の実施の形態(データ処理制御:ハッシュ値付再利用命令を処理する例)
 5.第5の実施の形態(データ処理制御:既に生成されたオブジェクトプログラムの再利用区間の開始アドレスからハッシュ値を生成する例)
 <1.第1の実施の形態>
 [本発明の第1の実施の形態におけるコンパイル処理装置4100の構成例]
 図76は、本発明の第1の実施の形態におけるコンパイル処理装置4100の構成例を示すブロック図である。このコンパイル処理装置4100は、ソースプログラム記憶部4110と、再利用命令判別部4120と、ハッシュ関数決定部4200と、機械語プログラム生成部4140と、オブジェクトプログラム記憶部4150とを備える。
 ソースプログラム記憶部4110は、コンパイルを行うソースプログラムを記憶するものである。このソースプログラムは、例えば、実行結果が再び利用される再利用区間が含まれるソースプログラムである。このソースプログラム記憶部4110は、記憶したソースプログラムを再利用命令判別部4120に供給する。
 再利用命令判別部4120は、ソースプログラム記憶部4110から読み出したソースプログラムを解析して、再利用命令が含まれるプログラムを生成するものである。ここで、再利用命令とは、再利用区間と再利用しない区間とを、再利用される度合いに基づいて区別することによって、再利用区間が呼出された際に実行結果を再利用するための処理をデータ処理装置に行わせる命令である。
 この再利用命令判別部4120は、再利用候補区間抽出部4121と、再利用候補区間解析部4122と、再利用度生成部4123と、再利用命令変換部4124とを備える。この再利用命令判別部4120は、その生成した再利用命令が含まれるプログラムをハッシュ関数決定部4200に供給する。なお、再利用命令判別部4120は、特許請求の範囲に記載の解析部の一例である。
 再利用候補区間抽出部4121は、複数の命令区間のうち、実行結果を再利用する再利用区間の候補となる再利用候補区間をプログラムから抽出するものである。ここでは、コンパイル処理装置4100が処理する命令区間は関数またはループを想定するものとする。この再利用候補区間抽出部4121は、関数およびループなどの複数回呼び出される可能性がある命令区間を再利用候補区間として抽出する。
 また、この再利用候補区間抽出部4121は、入力値が同じでも異なる実行結果になる関数などの実行結果が再利用できる可能性が無い関数を、再利用候補区間から除外する。なお、ここで、入力値とは、関数またはループの実行に必要な値であって、引数で構成される値であり、例えば、3つの変数を引数とする関数の場合には、この3つの変数の値である。この再利用候補区間抽出部4121は、例えば、システムコールを含む関数または乱数発生関数を再利用候補区間の対象から除外する。この再利用候補区間抽出部4121は、抽出した再利用候補区間の識別情報をプログラムとともに再利用候補区間解析部4122に供給する。
 再利用候補区間解析部4122は、再利用候補区間抽出部4121により抽出された再利用候補区間に関する使用態様を解析するものである。この再利用候補区間解析部4122は、例えば、関数およびループの入力値である引数に関する内容と、関数およびループの呼出し回数に関する内容とを使用態様として解析する。また、再利用候補区間は、特許請求の範囲に記載の命令区間の一例である。
 再利用度生成部4123は、再利用候補区間解析部4122から供給された解析結果に基づいて、再利用候補区間の実行結果が再び利用される度合いを示す再利用度を生成するものである。この再利用度生成部4123は、例えば、再利用候補区間の入力値の組合せに応じて再利用度を生成する。この場合には、再利用候補区間の入力値の組合せが少ないほど再利用される度合いは高くなるため、入力値の組合せの数を分母とする再利用度を生成する。この再利用度生成部4123は、その生成した再利用度を再利用候補区間の識別情報およびプログラムとともに再利用命令変換部4124に供給する。
 再利用命令変換部4124は、再利用度生成部4123から供給された再利用度に基づいて、実行結果を再利用させる再利用候補区間の呼出し命令を再利用命令に変換するものである。例えば、実行結果を再利用させる再利用候補区間が関数である場合には、関数を呼出す命令であるアセンブリ言語の「call」命令を、再利用命令として新たに規定した「memocall」命令に変換する。この再利用命令変換部4124は、その変換した命令を含むプログラムをハッシュ関数決定部4200に供給する。
 ハッシュ関数決定部4200は、再利用区間を識別するための開始アドレスからハッシュ値を生成するハッシュ関数を決定するものである。このハッシュ関数決定部4200は、例えば、再利用区間の開始アドレスを関数入力値として複数のハッシュ関数を用いて、再利用区間の開始アドレスに基づくハッシュ値をハッシュ関数ごとに生成する。ここで、関数入力値とは、ハッシュ関数の入力となる値である。そして、このハッシュ関数決定部4200は、複数のハッシュ関数のうち、値が全て互いに異なるハッシュ値であってビット幅が最も狭いハッシュ値を生成したハッシュ関数を決定して出力する。すなわち、このハッシュ関数決定部4200は、再利用区間の開始アドレスのビット幅より狭いビット幅の値により再利用区間を識別するハッシュ値を生成するハッシュ関数を決定して出力する。このハッシュ関数決定部4200は、その決定したハッシュ関数をプログラムとともに機械語プログラム生成部4140に供給する。
 機械語プログラム生成部4140は、ハッシュ関数決定部4200から供給されたプログラムに基づいて、機械語のプログラムであるオブジェクトプログラムを生成するものである。この機械語プログラム生成部4140は、例えば、ハッシュ関数決定部4200が決定したハッシュ関数が埋め込まれたオブジェクトプログラムを生成する。また、この機械語プログラム生成部4140は、そのオブジェクトプログラムに埋め込まれたハッシュ関数をそのオブジェクトプログラムを実行するデータ処理装置に認識させるためのハッシュ関数指定命令をオブジェクトプログラムに追加する。この機械語プログラム生成部4140は、その生成したオブジェクトプログラムをオブジェクトプログラム記憶部4150に供給する。
 オブジェクトプログラム記憶部4150は、機械語プログラム生成部4140から供給されたオブジェクトプログラムを記憶するものである。
 このように、コンパイル処理装置4100は、まず、関数の実行結果が再利用される度合いに応じて関数の呼出し命令を再利用命令に変換することによって、再利用区間と再利用されない区間とが区別できるようにする。そして、コンパイル処理装置4100は、再利用区間を識別するためのハッシュ値を生成するためのハッシュ関数を決定することによって、その決定したハッシュ関数を埋め込んだプログラムを生成することができる。
 なお、ここでは、コンパイル処理装置4100は、関数を再利用対象とする例について説明したが、ループに関しても同様に再利用対象とすることができる。
 なお、ここでは、便宜上、再利用候補区間解析部4122が再利用候補区間の使用態様を関数毎に解析する例について説明したが、より詳細に使用態様を解析するために関数の呼出し命令毎に解析するものとしてもよい。また、再利用度生成部4123についても再利用度を関数毎に生成する例について説明したが、より詳細に解析するために関数の呼出し命令毎に生成するものとしてもよい。この場合において、再利用命令変換部4124は、関数は同じであっても関数の呼出し命令毎に異なる再利用度に基づいて、関数の呼出し命令毎に呼出し命令を再利用命令に変換する。
 また、ここでは、再利用度を生成することによって再利用命令に変換する例について説明したが、本発明はこれに限定されるものではない。例えば、関数を呼び出す命令を全て再利用対象としてもよい。
 [本発明の第1の実施の形態における再利用命令判別部4120が解析するプログラム例]
 図77は、本発明の第1の実施の形態における再利用命令判別部4120が解析するプログラムの一例を示す概念図である。
 ここでは、再利用候補区間の入力値の組合せと、その入力値の組合せに基づいて再利用度生成部4123が生成する再利用度とについて一例を説明する。ここでは、再利用候補区間解析部4122において以下のC言語のプログラムが解析されたことを想定する。
 まず、再利用候補区間解析部4122は、図77のプログラムにおける4つの関数(funcA乃至D)の入力値の組合せについて解析する。char型の1個の変数を引数とする関数(funcA)については、char型は16ビットのバイナリ文字データであるため、入力値の組合せは最大216個と解析する。char型の1個の変数とbool(Boolean)型の1個の変数を引数とする関数(funcB)については、bool型は1ビットのバイナリ数値データであるため、「216×2=217」により入力値の組合せは最大217個と解析する。
 さらに、bool型の1個の変数を引数とする関数(funcC)については、入力値の組合せは最大2個と解析する。int(integer)型の1個の変数を引数とする関数(funcD)については、int型は32ビットのバイナリ数値データであるため、入力値の組合せは最大232個と解析する。
 そして、再利用度生成部4123は、4つの関数(funcA乃至D)の解析した結果に基づいて、入力値の組合せの数を分母とする再利用度を生成することにより以下の関係の再利用度を生成する。
Figure JPOXMLDOC01-appb-M000001
 このように、bool型の1個の変数を引数とする関数(funcC)の再利用度が1番高く、char型の1個の変数を引数とする関数(funcA)の再利用度が2番目に高くなる。char型の1個の変数とbool型の1個の変数を引数とする関数(funcB)の再利用度が3番目に高く、int型の1個の変数を引数とする関数(funcD)の再利用度が1番低くなる。
 すなわち、再利用候補区間解析部4122は再利用候補区間を解析し、再利用度生成部4123は、その解析結果に基づいて生成した再利用度により、再利用区間とする際の順位付けを再利用候補区間に対して行う。そして、再利用命令変換部4124は、この再利用度の高い再利用候補区間から順に再利用区間として決定する。
 これにより、コンパイル処理装置4100は、再利用される度合いの高い再利用候補区間を再利用区間とするオブジェクトプログラムを生成することができる。
 [本発明の第1の実施の形態におけるハッシュ関数決定部4200の構成例]
 図78は、本発明の第1の実施の形態におけるハッシュ関数決定部4200の構成例を示すブロック図である。このハッシュ関数決定部4200は、開始アドレス取得部4210と、候補ハッシュ関数保持部4220と、候補ハッシュ値生成部4230と、ハッシュ値テーブル4240と、ハッシュ関数出力部4250とを備える。
 開始アドレス取得部4210は、再利用命令変換部4124からの再利用命令を含むプログラムから再利用区間の開始アドレスを取得するものである。この開始アドレス取得部4210は、その取得した開始アドレスを開始アドレスリストとして保持する。この開始アドレス取得部4210は、その取得した開始アドレスを候補ハッシュ値生成部4230に供給する。
 候補ハッシュ関数保持部4220は、開始アドレスをハッシュ値に変換するための複数のハッシュ関数を保持するものである。すなわち、この候補ハッシュ関数保持部4220は、ハッシュ関数決定部4200が決定するハッシュ関数の候補となるハッシュ関数を保持する。この候補ハッシュ関数保持部4220は、ハッシュ関数決定部4200が決定するハッシュ関数の候補として予め定められたハッシュ関数を保持する。
 この候補ハッシュ関数保持部4220は、例えば、10個のハッシュ関数を保持している場合には、その10個のハッシュ関数を候補ハッシュ値生成部4230に供給する。また、この候補ハッシュ関数保持部4220は、例えば、ハッシュ関数出力部4250において1個のハッシュ関数が決定された場合には、そのハッシュ関数をハッシュ関数出力部4250に供給する。なお、候補ハッシュ関数保持部4220から供給されるハッシュ関数は、特許請求の範囲に記載の候補関数の一例である。
 候補ハッシュ値生成部4230は、開始アドレス取得部4210から供給された開始アドレスを関数入力値とし、その関数入力値を候補ハッシュ関数保持部4220から供給されたハッシュ関数の入力としてハッシュ値を生成するものである。すなわち、この候補ハッシュ値生成部4230は、ハッシュ関数決定部4200が決定するハッシュ関数の候補となるハッシュ関数を用いて、再利用区間を識別するためのハッシュ値の候補となるハッシュ値を開始アドレスから生成する。また、この候補ハッシュ値生成部4230は、ハッシュ値を生成する際に、そのハッシュ値を生成したハッシュ関数をそのハッシュ値に関連付けて、どのハッシュ関数から生成されたか識別できるようにする。
 この候補ハッシュ値生成部4230は、例えば、開始アドレス取得部4210に10個の開始アドレスが保持され、かつ、候補ハッシュ関数保持部4220に10個のハッシュ関数が保持されている場合には、全組合せの「10×10=100」個のハッシュ値を生成する。
 この候補ハッシュ値生成部4230は、その生成したハッシュ値をハッシュ値テーブル4240に供給する。なお、候補ハッシュ値生成部4230は、特許請求の範囲に記載の候補値生成部の一例である。また、候補ハッシュ値生成部4230が生成するハッシュ値は、特許請求の範囲に記載の候補値の一例である。
 ハッシュ値テーブル4240は、候補ハッシュ値生成部4230から供給されたハッシュ値を保持するものである。このハッシュ値テーブル4240は、ハッシュ値をそのハッシュ値を生成したハッシュ関数ごとにハッシュ値リストとして保持する。また、このハッシュ値テーブル4240は、保持したハッシュ値リストをハッシュ関数出力部4250に供給する。なお、ハッシュ値テーブル4240は、特許請求の範囲に記載の候補値テーブルの一例である。また、ハッシュ値リストは、特許請求の範囲に記載の候補値リストの一例である。
 ハッシュ関数出力部4250は、ハッシュ値が全て互いに異なるハッシュ値リストを抽出し、この抽出されたハッシュ値リストのうちハッシュ値のビット幅が最も狭くなるハッシュ値リストに関連付けられたハッシュ関数を出力するものである。このハッシュ関数出力部4250は、ユニークハッシュ値リスト判別部4251および確定ハッシュ関数選択部4252を備える。なお、ハッシュ関数出力部4250は、特許請求の範囲に記載の区間識別値生成関数出力部の一例である。なお、ハッシュ関数出力部4250が出力するハッシュ関数は、特許請求の範囲に記載の区間識別値生成関数の一例である。
 ユニークハッシュ値リスト判別部4251は、ハッシュ値テーブル4240に保持されているハッシュ値リストのうちハッシュ値が全て互いに異なるハッシュ値リストを判別するものである。このユニークハッシュ値リスト判別部4251は、例えば、ハッシュ値テーブル4240に保持された10個のハッシュ値リストのうちハッシュ値が全て互いに異なるものが3個の場合にはその3個のハッシュ値リストを判別する。このユニークハッシュ値リスト判別部4251は、その判別したハッシュ値リストを確定ハッシュ関数選択部4252に供給する。
 確定ハッシュ関数選択部4252は、ユニークハッシュ値リスト判別部4251から供給されたハッシュ値リストのうちハッシュ値のビット幅が最も狭くなるハッシュ値リストに関連付けられたハッシュ関数を出力するものである。すなわち、この確定ハッシュ関数選択部4252は、候補ハッシュ関数保持部4220が保持している複数のハッシュ関数のうちから1つのハッシュ関数を確定して、その確定したハッシュ関数を出力する。この確定ハッシュ関数選択部4252は、ユニークハッシュ値リスト判別部4251から供給されたハッシュ値が全て互いに異なるハッシュ値リストのうちハッシュ値のビット幅が最も狭いハッシュ値リストを一つ検出する。そして、この確定ハッシュ関数選択部4252は、その検出したハッシュ値リストに関連付けられたハッシュ関数を候補ハッシュ関数保持部4220から取得し、その取得したハッシュ関数を機械語プログラム生成部4140に供給する。
 このように、本発明の第1の実施の形態では、ハッシュ関数決定部4200を設けることにより、複数のハッシュ関数のうち全て互いに異なるハッシュ値であってビット幅が最も狭いハッシュ値を生成するハッシュ関数をプログラムに埋め込むことができる。
 なお、ここでは、候補ハッシュ関数保持部4220は、保持するハッシュ関数を全て候補ハッシュ値生成部4230に供給する一例について説明したが、本発明はこれに限定されるものではない。例えば、候補ハッシュ関数保持部4220は外部から制御できるようにすることによって、候補ハッシュ値生成部4230に供給するハッシュ関数を、プログラムに応じて外部から指定できるようにしてもよい。
 また、ここでは、確定ハッシュ関数選択部4252は、ハッシュ関数を機械語プログラム生成部4140に供給する一例について説明したが、本発明はこれに限定されるものではない。例えば、確定ハッシュ関数選択部4252は、ハッシュ関数を指し示す識別子をハッシュ関数の代わりに供給するようにしてもよい。この例において、機械語プログラム生成部4140は、確定ハッシュ関数選択部4252から供給された識別子が埋め込まれたオブジェクトプログラムを生成する。これにより、ハッシュ関数をオブジェクトプログラムに埋め込む方法と比較してオブジェクトプログラムを短くすることができるため、ハッシュ関数を頻繁に交換するプログラムを実行する場合にはプログラムの実行処理を早くすることができる。なお、このハッシュ関数の代わりにオブジェクトプログラムに埋め込まれる識別子は、特許請求の範囲に記載の識別子の一例である。
 [本発明の第1の実施の形態における候補ハッシュ値生成部4230が生成するハッシュ値の一例]
 図79は、本発明の第1の実施の形態における候補ハッシュ値生成部4230が生成するハッシュ値の一例を示す概念図である。ここでは、開始アドレスのビット幅は64ビットとする。また、ここでは、左端は最上位ビット(MSB:Most Significant Bit)を示し、右端は最下位ビット(LSB:Least Significant Bit)を示すものとする。
 また、ここでは、一例として、候補ハッシュ関数保持部4220が保持している複数のハッシュ関数は、再利用区間の開始アドレスの最下位ビットから所定の数のビットにおける値を算出する関数を想定する。以下の式1にこのハッシュ関数の一例を示す。
Figure JPOXMLDOC01-appb-M000002
 ここで、hは、候補ハッシュ値生成部4230が生成するハッシュ値である。また、aは、ハッシュ関数の関数入力値であり、ここではハッシュ値テーブル4240から候補ハッシュ値生成部4230に供給される開始アドレスである。また、&は、ビット単位のAND演算である。mは、数値(m)を2進数(b)で表現したマスクビットである。また、式1の下に示されている式2は、式1のmを算出する式の一例である。式2のiは、式1の算出するh(ハッシュ値)のビット幅を指定するための値である。
 図79の(a)には、ハッシュ値テーブル4240から供給される開始アドレスの一例である開始アドレス261が示されている。この開始アドレス4261は、LSB側から第0乃至63ビットの64ビットで構成されるビット列である。この開始アドレス4261は、候補ハッシュ値生成部4230においてハッシュ関数の関数入力値として用いられる。
 図79の(b)には、図79の(a)において示した開始アドレスを関数入力値として生成されるハッシュ値の一例であるハッシュ値4262乃至4266が示されている。
 ハッシュ値4262は、式2のi(ビット幅)が「1」と指定された式1を用いて、開始アドレス4261から算出されたh(ハッシュ値)である。式2のi(ビット幅)を「1」とすると、mは「1」となる。すなわち、式1は、次式3に示すハッシュ関数となる。
Figure JPOXMLDOC01-appb-M000003
 この式3に示すハッシュ関数により、0番の値が「0」である1ビットのハッシュ値4262が開始アドレス4261の0番の値(0)に基づいて算出される。
 ハッシュ値4263は、式2のi(ビット幅)が「2」と指定された式1を用いて、開始アドレス4261から算出されたh(ハッシュ値)である。式2のi(ビット幅)を「2」とすると、mは「3」となる。すなわち、式1は、次式4に示すハッシュ関数となる。
Figure JPOXMLDOC01-appb-M000004
 この式4に示すハッシュ関数により、0番および1番の値が「0および1」である2ビットのビット列のハッシュ値4263が開始アドレス4261の0番および1番の値(0および1)に基づいて算出される。
 ハッシュ値4264は、式2のi(ビット幅)が「3」と指定された式1を用いて、開始アドレス4261から算出されたh(ハッシュ値)である。式2のi(ビット幅)を「3」とすると、mは「7」となる。すなわち、式1は、次式5に示すハッシュ関数となる。
Figure JPOXMLDOC01-appb-M000005
 この式5に示すハッシュ関数により、0番乃至2番の値が「0、1および0」である3ビットのビット列のハッシュ値4264が開始アドレス4261の0番乃至2番の値(0、1および0)に基づいて算出される。
 ハッシュ値4265は、式2のi(ビット幅)が「4」と指定された式1を用いて、開始アドレス4261から算出されたh(ハッシュ値)である。式2のi(ビット幅)を「4」とすると、mは「15」となる。すなわち、式1は、次式6に示すハッシュ関数となる。
Figure JPOXMLDOC01-appb-M000006
 この式6に示すハッシュ関数により、0番乃至3番の値が「0、1、0および1」である4ビットのビット列のハッシュ値4265が開始アドレス4261の0番乃至3番の値(0、1、0および1)に基づいて算出される。
 ハッシュ値4266は、式2のi(ビット幅)が「5」と指定された式1を用いて、開始アドレス4261から算出されたh(ハッシュ値)である。式2のi(ビット幅)を「5」とすると、mは「31」となる。すなわち、式1は、次式7に示すハッシュ関数となる。
Figure JPOXMLDOC01-appb-M000007
 この式7に示すハッシュ関数により、0番乃至4番の値が「0、1、0、1および1」である5ビットのビット列のハッシュ値4266が開始アドレス4261の0番乃至4番の値(0、1、0、1および1)に基づいて算出される。
 このように、本発明の第1の実施の形態では、候補ハッシュ値生成部4230を設けることによって、複数のハッシュ関数を用いて複数のハッシュ値を生成することができる。
 なお、ここでは、式1乃至式7において示したハッシュ関数を一例として説明したが、本発明はこれに限定されるものではない。例えば、開始アドレスの最上位から所定の数のビットと最下位から所定の数のビットとの排他的論理和(EOR:Exclusive OR)を算出するハッシュ関数なども考えられる。
 [本発明の第1の実施の形態におけるハッシュ値テーブル4240に保持されるハッシュ値の一例]
 図80は、本発明の第1の実施の形態におけるハッシュ値テーブル4240に保持されるハッシュ値の一例を示す概念図である。ここでは、図79において説明した式3乃至式7のハッシュ関数を用いてハッシュ値を生成することを想定する。また、ここでは、プログラムにおける再利用区間は8個の関数(funcA乃至funcH)とする。
 開始アドレスリスト4271には、ハッシュ値テーブル4240に登録されたハッシュ値の基となった開始アドレスのリスト名が示されている。この開始アドレスリスト4271において、行4282にはfuncAに関する値が示され、行4283にはfuncBに関する値が示され、行4284にはfuncCに関する値が示されている。さらに、行4285にはfuncDに関する値が示され、行4286にはfuncEに関する値が示され、行4287にはfuncFに関する値が示され、行4288にはfuncGが示され、行4289にはfuncHに関する値が示されていることを表している。
 ハッシュ値リスト4272には、式1のi(ビット幅)を「5」としたハッシュ関数である式7を用いて算出されたハッシュ値のリストが示されている。ハッシュ値リスト4272の行4281には、式1のi(ビット幅)を「5」としたハッシュ関数である式7を用いたことを示す「i=5」が示されている。ハッシュ値リスト4272の行4282乃至4289には、8個の関数(funcA乃至funcH)の開始アドレスを式7の関数入力値として算出されたハッシュ値が示されている。すなわち、ハッシュ値リスト4272の行4282乃至4289には、8つの関数(funcA乃至funcH)の開始アドレスの最下位ビットから5ビットの値がそれぞれ示されている。このハッシュ値リスト4272の行4282乃至4289に示したハッシュ値は、式7と関連付けられてハッシュ値テーブル4240にリストとして保持される。
 ハッシュ値リスト4273には、式1のi(ビット幅)を「4」としたハッシュ関数である式6を用いて算出されたハッシュ値のリストが示されている。ハッシュ値リスト4273の行4281には、式1のi(ビット幅)を「4」としたハッシュ関数である式6を用いたことを示す「i=4」が示されている。ハッシュ値リスト4273の行4282乃至4289には、8個の関数(funcA乃至funcH)の開始アドレスを式6の関数入力値として算出されたハッシュ値が示されている。すなわち、ハッシュ値リスト4273の行4282乃至4289には、8つの関数(funcA乃至funcH)の開始アドレスの最下位ビットから4ビットの値がそれぞれ示されている。このハッシュ値リスト4273の行4282乃至4289に示したハッシュ値は、式6と関連付けられてハッシュ値テーブル4240にリストとして保持される。
 ハッシュ値リスト4274には、式1のi(ビット幅)を「3」としたハッシュ関数である式5を用いて算出されたハッシュ値のリストが示されている。ハッシュ値リスト4274の行4281には、式1のi(ビット幅)を「3」としたハッシュ関数である式5を用いたことを示す「i=3」が示されている。ハッシュ値リスト4274の行4282乃至4289には、8個の関数(funcA乃至funcH)の開始アドレスを式5の関数入力値として算出されたハッシュ値が示されている。すなわち、ハッシュ値リスト4274の行4282乃至4289には、8つの関数(funcA乃至funcH)の開始アドレスの最下位ビットから3ビットの値がそれぞれ示されている。このハッシュ値リスト4274の行4282乃至4289に示したハッシュ値は、式5と関連付けられてハッシュ値テーブル4240にリストとして保持される。
 ハッシュ値リスト4275には、式1のi(ビット幅)を「2」としたハッシュ関数である式4を用いて算出されたハッシュ値のリストが示されている。ハッシュ値リスト4275の行4281には、式1のi(ビット幅)を「2」としたハッシュ関数である式4を用いたことを示す「i=2」が示されている。ハッシュ値リスト4275の行4282乃至4289には、8個の関数(funcA乃至funcH)の開始アドレスを式4の関数入力値として算出されたハッシュ値が示されている。すなわち、ハッシュ値リスト4275の行4282乃至4289には、8つの関数(funcA乃至funcH)の開始アドレスの最下位ビットから2ビットの値がそれぞれ示されている。このハッシュ値リスト4275の行4282乃至4289に示したハッシュ値は、式4と関連付けられてハッシュ値テーブル4240にリストとして保持される。
 ハッシュ値リスト4276には、式1のi(ビット幅)を「1」としたハッシュ関数である式3を用いて算出されたハッシュ値のリストが示されている。ハッシュ値リスト4276の行4281には、式1のi(ビット幅)を「1」としたハッシュ関数である式3を用いたことを示す「i=1」が示されている。ハッシュ値リスト4276の行4282乃至4289には、8個の関数(funcA乃至funcH)の開始アドレスを式3の関数入力値として算出されたハッシュ値が示されている。すなわち、ハッシュ値リスト4276の行4282乃至4289には、8つの関数(funcA乃至funcH)の開始アドレスの最下位ビットの値がそれぞれ示されている。このハッシュ値リスト4276の行4282乃至4289に示したハッシュ値は、式3と関連付けられてハッシュ値テーブル4240にリストとして保持される。
 このように、本発明の第1の実施の形態では、ハッシュ値テーブル4240を用いることによって、ハッシュ値を生成したハッシュ関数に関連付けてリストとして保持することができる。
 続いて、図80を用いて、ユニークハッシュ値リスト判別部4251により判別されるハッシュ値リストと、確定ハッシュ関数選択部4252が選択するハッシュ関数とについて説明する。
 まず、ユニークハッシュ値リスト判別部4251により、ハッシュ値が全て互いに異なるハッシュ値リストが判別され、その判別されたハッシュ値が全て互いに異なるハッシュ値リストが確定ハッシュ関数選択部4252に供給される。この時、ハッシュ値リスト4276は、funcA、funcC、funcEおよびfuncGのハッシュ値が「0」で重複し、さらに、その他の4つの関数のハッシュ値が「1」で重複しているため、確定ハッシュ関数選択部4252に供給されない。
 また、ハッシュ値リスト4275は、funcA、funcCおよびfuncEのハッシュ値が「10」で重複し、さらに、funcB、funcFおよびfuncHのハッシュ値が「11」で重複しているため、確定ハッシュ関数選択部4252に供給されない。さらに、ハッシュ値リスト4274は、funcAおよびfuncEのハッシュ値が「110」で重複し、さらに、funcFおよびfuncHのハッシュ値が「011」で重複しているため、確定ハッシュ関数選択部4252に供給されない。
 その結果、ハッシュ値が全て互い異なるハッシュ値リストであると判別されたハッシュ値リスト4272および273が、ユニークハッシュ値リスト判別部4251により確定ハッシュ関数選択部4252に供給される。
 ユニークハッシュ値リスト判別部4251からハッシュ値リストが供給されると、確定ハッシュ関数選択部4252は、ユニークハッシュ値リスト判別部4251から供給されたハッシュ値リストのうちビット幅が最も狭いハッシュ値のハッシュ値リストを検出する。
 その結果、4ビットのハッシュ値のハッシュ値リスト4273と、5ビットのハッシュ値のハッシュ値リスト4272とのうちハッシュ値リスト4273がビット幅が最も狭いハッシュ値のハッシュ値リストとして検出される。そして、確定ハッシュ関数選択部4252は、ハッシュ値リスト4273に関連付けられたハッシュ関数の式6を候補ハッシュ関数保持部4220から取得し、ハッシュ関数決定部4200が決定したハッシュ関数としてその取得した式6を出力する。
 このように、本発明の第1の実施の形態では、ユニークハッシュ値リスト判別部4251を設けることによって、ハッシュ値が全て互いに異なるハッシュ値リストを、ハッシュ値テーブル4240が保持するハッシュ値リストから判別することができる。また、確定ハッシュ関数選択部4252を設けることによって、ユニークハッシュ値リスト判別部4251が判別したハッシュ値リストのうち、ビット幅が最も狭いハッシュ値のハッシュ値リストに関連付けられたハッシュ関数を決定することができる。
 なお、ここでは、開始アドレスの最下位ビットから所定の数のビットの値をハッシュ値とするハッシュ関数のみを用いてハッシュ値を生成する場合について説明したが、多様なハッシュ関数を用いることによりビット幅がより狭いハッシュ値を生成することができる。
 また、ここでは、ハッシュ値が全て互いに異なるハッシュ値リストが存在する場合について説明した。しかしながら、ハッシュ値が全て互いに異なるハッシュ値リストがハッシュ値テーブル4240に存在しない場合も考えられる。このような場合には、確定ハッシュ関数選択部4252は、開始アドレスの値をそのまま出力する関数を出力する。あるいは、確定ハッシュ関数選択部4252は、ハッシュ関数が無いことを示す情報を出力する。
 [本発明の第1の実施の形態におけるハッシュ関数指定命令の一例]
 次に、本発明の第1の実施の形態におけるコンパイル処理装置4100が生成するハッシュ関数指定命令について図面を参照して説明する。
 図81は、本発明の第1の実施の形態におけるハッシュ関数指定命令の一例を示す概念図である。ここでは、データ処理装置のプロセッサコアは、MIPSにより構成されることを想定する。また、ここでは、左端は最上位ビット(MSB)を示し、右端は最下位ビット(LSB)を示している。
 図81の(a)には、オブジェクトプログラムに埋め込まれたハッシュ関数をそのオブジェクトプログラムを実行するデータ処理装置に認識させるためのハッシュ関数指定命令の一例が示されている。このハッシュ関数指定命令は、32個のビット(0乃至31番)のビット列により表現されるものである。このハッシュ関数指定命令は、オペコードフィールド4291、ハッシュ関数番地フィールド4292、未使用フィールド4293、および、ユーザ定義命令フィールド(UDI:User Definable Instruction)4295とから構成される。
 オペコードフィールド4291は、命令の種別を指定するフィールドである。このオペコードフィールド4291は、第26乃至第31番目のビットから構成されるビット列である。このハッシュ関数指定命令のオペコードフィールド4291には、SPECIAL2命令として「011100」のビット列が格納される。ここで、SPECIAL2命令とは、ユーザが独自に定義した命令であることを指し示す命令である。
 ハッシュ関数番地フィールド4292は、ハッシュ関数の番地を格納するレジスタを指定するフィールドである。このハッシュ関数番地フィールド4292は、第21乃至第25番目のビットから構成されるビット列である。
 未使用フィールド4293は、ハッシュ関数指定命令では使用されないフィールドである。未使用フィールド4293は、第6乃至第20番目のビットから構成される15ビットのビット列である。この未使用フィールド4293は、例えば、ビット列(000000000000000)が格納される。
 ユーザ定義命令フィールド(UDI)4295は、SPECIAL2命令において、ユーザが定義した複数の命令のうちの1つの命令を指定するフィールドである。このユーザ定義命令フィールド(UDI)4295は、第0乃至第5番目のビットから構成されるビット列である。このユーザ定義命令フィールド(UDI)4295は、例えば、ビット列(010001)によってハッシュ関数指定命令を指定する。
 このように、本発明の第1の実施の形態では、ハッシュ関数指定命令を用いることによって、オブジェクトプログラムに埋め込まれたハッシュ関数をデータ処理装置に利用させることができる。
 続いて、図78において確定ハッシュ関数選択部4252に関する別の機能として説明した、確定ハッシュ関数選択部4252が識別子を出力する場合に用いられる識別子供給命令について説明する。ここで、識別子供給命令とは、オブジェクトプログラムを実行するデータ処理装置に識別子を供給し、その識別子をデータ処理装置に利用させるための命令である。
 図81の(b)には、ハッシュ関数を指し示す識別子を供給する識別子供給命令の一例が示されている。この識別子供給命令は、32個のビット(0乃至31番)のビット列により表現されるものである。
 この識別子供給命令は、オペコードフィールド4291、識別子フィールド4294、および、ユーザ定義命令フィールド(UDI)4295とから構成される。なお、ここでは、識別子フィールド4294以外の各フィールドの機能は、図81の(a)で示したハッシュ関数指定命令の各フィールドの機能と同様のものであるため、図81の(a)と同符号を付してここでの詳細な説明を省略する。
 識別子フィールド4294は、ハッシュ関数決定部4200が決定したハッシュ関数を識別するための識別子を格納するフィールドである。この識別子フィールド4294は、例えば、第6乃至第25番目の20ビットから構成されるビット列である。
 このように、本発明の第1の実施の形態によれば、ハッシュ関数決定部4200が決定したハッシュ関数あるいはそのハッシュ関数を指定する識別子をオブジェクトプログラムに埋め込むことができる。
 なお、オペコードフィールド4291がSPECIAL2命令である場合には、第6乃至第25番目の20ビットはユーザが定義可能なエンコード空間である。このため、図81の(a)および(b)において示したハッシュ関数指定命令および識別子供給命令に限定されるものではなく、種々のパターンが考えられる。
 [本発明の第1の実施の形態におけるコンパイル処理装置4100の動作例]
 次に、本発明の第1の実施の形態におけるコンパイル処理装置4100の処理について図面を参照して説明する。図82は、本発明の第1の実施の形態におけるコンパイル処理装置4100によるコンパイル処理の処理手順を示すフローチャートである。
 まず、ソースプログラム記憶部4110からソースプログラムが読み出される(ステップS4911)。次に、再利用候補区間抽出部4121により、再利用候補区間が抽出される(ステップS4912)。
 そして、再利用候補区間解析部4122により、再利用候補区間の使用態様が解析される(ステップS4913)。続いて、再利用度生成部4123により、再利用候補区間の解析結果に基づいて再利用度が生成される(ステップS4914)。
 次に、再利用命令変換部4124により、再利用度に基づいて再利用候補区間の呼出し命令が再利用命令に変換される(ステップS4915)。これは、例えば、関数が再利用候補区間である場合には、関数の呼出し命令(call)が再利用命令(memoCall)に変換されることを意味する。このステップS4911乃至S4915の一連の処理により、再利用区間が判別される。なお、ステップS4911乃至S4915は、特許請求の範囲に記載の解析手順の一例である。
 そして、ハッシュ関数決定部4200により、開始アドレスのビット幅より狭いビット幅で再利用区間を識別するハッシュ値を生成するためのハッシュ関数を決定するハッシュ関数決定処理が行われる(ステップS4920)。
 最後に、機械語プログラム生成部4140により、ハッシュ関数を埋め込んだ機械語プログラムが解析されたプログラムおよびハッシュ関数に基づいて生成される(ステップS4918)。そして、コンパイル処理は終了する。なお、ステップS4918は、特許請求の範囲に記載の機械語プログラム生成手順の一例である。
 図83は、本発明の第1の実施の形態におけるハッシュ関数決定部4200によるハッシュ関数決定処理(ステップS4920)の処理手順例の前半を示すフローチャートである。なお、ここでは、ハッシュ関数の総数とは、開始アドレスをそのまま出力するハッシュ関数と、図79において示した式3乃至式7のハッシュ関数とを合わせた数の「6」であることを想定する。
 まず、開始アドレス取得部4210により、再利用区間の開始アドレスがプログラムから取得され、開始アドレス取得部4210に開始アドレスリストとして保持される(ステップS4921)。
 次に、ハッシュ関数カウンタ(hn)が「1」に初期化される(ステップS4922)。なお、ここで示すハッシュ関数カウンタ(hn)とは、候補ハッシュ値生成部4230によりハッシュ値が生成されたハッシュ関数を識別する値である。例えば、このハッシュ関数カウンタ(hn)は、図80において示したハッシュ値リスト4272乃至4276に関連付けられた式7乃至式3を識別するために付加される「1乃至5」の値である。
 なお、ハッシュ関数カウンタ(hn)の値の「0」には、開始アドレスをそのまま出力するハッシュ関数が割り当てられるものとする。例えば、その開始アドレスをそのまま出力するハッシュ関数として、「h(ハッシュ値)=a(開始アドレス)」などが考えられる。
 続いて、開始アドレスカウンタ(an)が「0」に初期化される(ステップS4923)。なお、ここで示す開始アドレスカウンタ(an)とは、ハッシュ関数カウンタ(hn)とともに用いることによって、ハッシュ値テーブル4240に保持されたハッシュ値を識別する値である。
 例えば、この開始アドレスカウンタ(an)は、ハッシュ関数カウンタ(hn)が「1」の場合には、式7が関連付けられたハッシュ値リスト4272の8つのハッシュ値を識別するための「0乃至7」の値である。また、この開始アドレスカウンタ(an)は、例えば、ハッシュ関数カウンタ(hn)が「5」の場合には、式3が関連付けられたハッシュ値リスト4276の8つのハッシュ値を識別するための「0乃至7」の値である。
 そして、候補ハッシュ値生成部4230により、ハッシュ関数カウンタ(hn)が指し示すハッシュ関数を用いて、開始アドレスカウンタ(an)が指し示す開始アドレスを関数入力値としてハッシュ値が算出される(ステップS4924)。次に、開始アドレスカウンタ(an)に「1」が加算される(ステップS4925)。
 続いて、開始アドレスカウンタ(an)が開始アドレスリストの開始アドレスの総数であるか否かが判断される(ステップS4926)。そして、開始アドレスカウンタ(an)が開始アドレスリストの開始アドレスの総数でないと判断された場合には、ステップS4924に戻る。これにより、ハッシュ関数カウンタ(hn)が指し示すハッシュ関数を用いてまだ算出されていないハッシュ値が算出される。
 一方、開始アドレスカウンタ(an)が開始アドレスリストの開始アドレスの総数であると判断された場合には、ハッシュ関数カウンタ(hn)に「1」が加算される(ステップS4927)。
 続いて、ハッシュ関数カウンタ(hn)がハッシュ関数の総数であるか否かが判断される(ステップS4928)。そして、ハッシュ関数カウンタ(hn)がハッシュ関数の総数でないと判断された場合には、ステップS4923に戻る。これにより、まだハッシュ値が算出されていないハッシュ関数を用いてハッシュ関数が算出される。なお、ステップS4922乃至S4928は、特許請求の範囲に記載の候補値生成手順の一例である。
 一方、ハッシュ関数カウンタ(hn)がハッシュ関数の総数であると判断された場合には、ステップS4929に進む。
 図84は、本発明の第1の実施の形態におけるハッシュ関数決定部4200によるハッシュ関数決定処理(ステップS4920)の処理手順例の後半を示すフローチャートである。
 まず、図83のステップS4928においてハッシュ関数カウンタ(hn)がハッシュ関数の総数であると判断された場合には、選択ハッシュ関数カウンタ(h)が「0」に初期化される(ステップS4929)。
 続いて、ハッシュ値ビット幅サイズ(ws)がハッシュ関数カウンタ(0)のハッシュ関数により生成されるハッシュ値のビット幅に変更される(ステップS4931)。すなわち、ハッシュ値ビット幅サイズ(ws)には開始アドレスのビット幅の64ビットが設定される。
 そして、ハッシュ関数カウンタ(hn)が「1」に変更される(ステップS4932)。続いて、ユニークハッシュ値リスト判別部4251により、ハッシュ関数カウンタ(hn)の指し示すハッシュ関数に対応するハッシュ値リストのハッシュ値が全て互いに異なるか否かが判別される(ステップS4933)。そして、ハッシュ関数(hn)の指し示すハッシュ関数と関連付けられたハッシュ値リストのハッシュ値が全て互いに異なっていないと判別された場合には、ステップS4937に進む。
 一方、ハッシュ関数カウンタ(hn)の指し示すハッシュ関数と関連付けられたハッシュ値リストのハッシュ値が全て互いに異なっていると判別された場合には、ステップS4934に進む。ステップS4934では、確定ハッシュ関数選択部4252により、ハッシュ関数カウンタ(hn)の指し示すハッシュ関数と関連付けられたハッシュ値リストのハッシュ値のビット幅が、ハッシュ値ビット幅サイズ(ws)より小さい値であるか否かが判断される。そして、ハッシュ関数(hn)の指し示すハッシュ関数と関連付けられたハッシュ値リストのハッシュ値のビット幅がwsより小さい値ではないと判断された場合には、ステップS4937に進む。
 一方、ハッシュ関数カウンタ(hn)の指し示すハッシュ関数と関連付けられたハッシュ値リストのハッシュ値のビット幅がハッシュ値ビット幅サイズ(ws)より小さい値であると判断された場合には、ステップS4935に進む。ステップS4935では、選択ハッシュ関数番号(h)がハッシュ関数カウンタ(hn)の値に変更される。
 続いて、ハッシュ値ビット幅サイズ(ws)が、ハッシュ関数カウンタ(hn)が指し示すハッシュ関数と関連付けられたハッシュ値リストのハッシュ値のビット幅に変更される(ステップS4936)。
 そして、ハッシュ関数カウンタ(hn)に「1」が加算される(ステップS4937)。次に、ハッシュ関数カウンタ(hn)がハッシュ関数の総数であるか否かが判断される(ステップS4938)。そして、ハッシュ関数カウンタ(hn)がハッシュ関数の総数でないと判断された場合には、ステップS4933に戻る。
 一方、ハッシュ関数カウンタ(hn)がハッシュ関数の総数であると判断された場合には、選択ハッシュ関数(h)が指し示すハッシュ関数がハッシュ関数決定部4200の決定したハッシュ関数として出力される(ステップS4939)。なお、ステップS4929乃至S4939は、特許請求の範囲に記載の区間識別値生成関数出力手順の一例である。
 このように、本発明の第1の実施の形態では、全て互いに異なるハッシュ値であってビット幅が最も狭くなるハッシュ値を生成するハッシュ関数を複数のハッシュ関数から選択して、プログラムに埋め込むことができる。
 なお、ここでは、ハッシュ関数カウンタ(hn)の指し示すハッシュ関数に関連付けられたハッシュ値リストのハッシュ値のビット幅に基づいてハッシュ関数を選択したが、本発明はこれに限定されるものではない。例えば、ハッシュ値リストのハッシュ値のビット幅を総和した値に基づいてハッシュ関数を選択する場合なども考えられる。
 <2.第2の実施の形態>
 [本発明の第2の実施の形態におけるデータ処理装置4300の構成例]
 図85は、本発明の第2の実施の形態におけるデータ処理装置4300の構成例を示すブロック図である。このデータ処理装置4300は、バス4350を介して主記憶部4360と相互に接続されている。また、ここでは、データ処理装置4300が処理を実行する命令区間は関数またはループであることを想定する。さらに、ここでは、データ処理装置4300は、本発明の第1の実施の形態におけるコンパイル処理装置4100により生成されたオブジェクトプログラムを実行することとする。
 データ処理装置4300は、プログラムにおける各処理を実行するものである。このデータ処理装置4300は、例えば、一般的なコンピュータにおいてはCPU(Central Processing Unit)により実現される。このデータ処理装置4300は、一次キャッシュ4310と、プロセッサコア4400と、ハッシュ変換部4500と、履歴管理部4600とを備える。
 一次キャッシュ4310は、プロセッサコア4400がバス4350を介して扱う情報を一時的に保持するものである。この一次キャッシュ4310は、命令キャッシュ4311およびデータキャッシュ4312を備える。
 命令キャッシュ4311は、プロセッサコア4400において実行される命令を一時的に保持するものである。この命令キャッシュ4311は、プロセッサコア4400が頻繁に実行する命令を一時的に保持することによって、プロセッサコア4400から主記憶部4360へのアクセスを軽減させ、プロセッサコア4400におけるデータの入力待ち時間を短縮させることができる。この命令キャッシュ4311は、例えば、主記憶部4360から供給された再利用命令およびハッシュ関数を指定する命令をプロセッサコア4400に供給する。
 データキャッシュ4312は、プロセッサコア4400の入力データおよび出力データを一時的に保持するものである。このデータキャッシュ4312は、使用頻度の高いプロセッサコア4400の入力データを一時的に保持することによりプロセッサコア4400から主記憶部4360へのアクセスを軽減させて、プロセッサコア4400におけるデータの入力待ち時間を軽減させる。このデータキャッシュ4312は、例えば、主記憶部4360から供給された関数またはループの入力値および開始アドレスをプロセッサコア4400に出力する。また、このデータキャッシュ4312は、例えば、主記憶部4360から供給されたハッシュ関数に関する情報をプロセッサコア4400に出力する。
 プロセッサコア4400は、プログラムの命令に従って演算を実行するものである。このプロセッサコア4400は、例えば、MIPS(Microprocessor without Interlocked Pipeline Stages)プロセッサにより実現される。プロセッサコア4400は、例えば、データキャッシュ4312から供給される関数またはループの入力値および開始アドレスに基づいて、命令キャッシュ4311から入力される関数またはループの区間における命令を実行し、その実行の結果を実行結果として出力する。
 このプロセッサコア4400は、入力される命令が再利用区間を指定する再利用命令である場合において履歴管理部4600から実行結果が供給されないときには、この命令を実行した結果である実行結果をデータキャッシュ4312および履歴管理部4600に出力する。また、このプロセッサコア4400は、再利用命令を実行した際には、再利用命令が指定する再利用区間の開始アドレスをハッシュ変換部4500に供給する。
 さらに、プロセッサコア4400は、入力される命令が再利用区間を指定する再利用命令である場合において履歴管理部4600から実行結果が供給されたときには、再利用区間における処理を中止して、この再利用区間を呼び出したルーチンに戻って実行を継続する。
 ハッシュ変換部4500は、再利用区間の開始アドレスのビット幅より狭いビット幅で再利用区間を識別するハッシュ値に開始アドレスを変換するものである。このハッシュ変換部4500は、プログラムの命令のうちハッシュ関数を指定する命令に基づいてハッシュ関数を保持する。このハッシュ変換部4500は、その保持しているハッシュ関数を用いて、プロセッサコア4400から供給された関数またはループの開始アドレスからハッシュ値を生成する。このハッシュ変換部4500は、その生成したハッシュ値を履歴管理部4600に供給する。
 履歴管理部4600は、再利用区間の実行結果を保持して管理するものである。この履歴管理部4600は、プロセッサコア4400から供給された再利用区間の入力値および実行結果と、ハッシュ変換部4500から供給されたハッシュ値とを実行履歴として保持する。また、この履歴管理部4600は、ハッシュ値と関数またはループの入力値とが供給された場合には、このハッシュ値と入力値とが含まれる実行履歴を検索する。
 バス4350は、データ処理装置4300の各部と主記憶部4360との間を相互に接続するバスである。
 主記憶部4360は、データ処理装置4300が動作するために必要なデータを保持するものである。この主記憶部4360は、データ処理装置4300に処理を実行させるためのプログラムを記憶する。この主記憶部4360は、例えば、RAM(Random Access Memory)などが考えられる。この主記憶部4360は、記憶しているデータを、バス4350を介してデータ処理装置4300に出力する。
 [本発明の第2の実施の形態におけるプロセッサコア4400とハッシュ変換部4500と履歴管理部4600との構成例]
 図86は、本発明の第2の実施の形態におけるプロセッサコア4400とハッシュ変換部4500と履歴管理部4600との構成例を示すブロック図である。ここでは、プロセッサコア4400とハッシュ変換部4500と履歴管理部4600とが示されている。また、ここでは、プロセッサコア4400とハッシュ変換部4500と履歴管理部4600との機能は、図85と同様のものであるため、同一の符号を付してここでの詳細な説明を省略する。
 プロセッサコア4400は、フェッチ部4410と、命令デコーダ4420と、実行部4430と、レジスタファイル4440とを備える。
 フェッチ部4410は、命令キャッシュ4311または主記憶部4360からの命令を読み出すものである。このフェッチ部4410は、その読み出した命令を一時的に保持して、その保持されている命令のうち、実行部4430に実行させるための命令を命令デコーダ4420に供給する。このフェッチ部4410は、例えば、一時的に保持している命令のうち、実行部4430において実行される再利用命令を命令デコーダ4420に供給する。このフェッチ部4410は、例えば、主記憶部4360に記憶された再利用命令を命令デコーダ4420に供給する。
 命令デコーダ4420は、フェッチ部4410から供給された命令を解読(デコード)することによって、プロセッサコア4400における構成部位を制御する制御信号を生成するものである。この命令デコーダ4420は、例えば、命令を解読することによって実行部4430およびレジスタファイル4440を制御する制御信号を生成して、その生成された制御信号を実行部4430およびレジスタファイル4440に供給する。
 この命令デコーダ4420は、フェッチ部4410から再利用命令が供給された場合には、その再利用命令を解読することによって、実行部4430およびレジスタファイル4440の各々を制御する制御信号を実行部4430およびレジスタファイル4440に供給する。
 実行部4430は、命令デコーダ4420から供給された制御信号に基づいて、命令デコーダ4420において解読した命令を実行するものである。この実行部4430は、命令デコーダ4420においてハッシュ関数を指定する命令をデコードした場合には、レジスタファイル4440から取得したハッシュ関数を、信号線4407を介してハッシュ変換部4500に出力する。
 また、この実行部4430は、命令デコーダ4420が再利用命令をデコードした場合には、再利用命令が指定する再利用区間の処理を開始する。そして、この再利用区間の処理の開始とともに、実行部4430は、レジスタファイル4440から取得した再利用区間の開始アドレスを、信号線4408を介してハッシュ変換部4500に出力する。そして、実行部4430は、レジスタファイル4440から供給される再利用区間の入力値に基づいて再利用区間における処理を実行するとともに、再利用区間の入力値を、信号線4409を介して履歴管理部4600に出力する。
 なお、実行部4430は、履歴管理部4600から再利用区間の実行結果が供給された場合には、再利用区間の処理を中止するとともに、その実行結果を履歴管理部4600から供給された旨を通知する信号をフェッチ部4410に供給する。この時、実行部4430は、実行結果をレジスタファイル4440に出力する。
 一方、実行部4430は、履歴管理部4600から再利用区間の実行結果が供給されない場合には、再利用区間の処理を最後まで実行して、その実行結果をレジスタファイル4440に出力するとともに信号線4409を介して履歴管理部4600に出力する。
 レジスタファイル4440は、データキャッシュ4312から供給されたデータおよび実行部4430から供給された実行結果を一時的に保持するものである。このレジスタファイル4440は、例えば、命令デコーダ4420から再利用命令に基づく制御信号が供給された場合には、再利用区間の入力値を実行部4430に供給する。
 ハッシュ変換部4500は、再利用区間の開始アドレスのビット幅より狭いビット幅で再利用区間を識別するハッシュ値に開始アドレスを変換させるものである。このハッシュ変換部4500は、確定ハッシュ関数保持部4510および確定ハッシュ値生成部4520を備える。
 確定ハッシュ関数保持部4510は、実行部4430から供給されたハッシュ関数を保持するものである。すなわち、この確定ハッシュ関数保持部4510は、図78において示した確定ハッシュ関数選択部4252が確定したハッシュ関数を保持する。この確定ハッシュ関数保持部4510は、実行部4430から信号線4407を介して供給されたハッシュ関数を保持し、その保持したハッシュ関数を確定ハッシュ値生成部4520に供給する。
 確定ハッシュ値生成部4520は、確定ハッシュ関数保持部4510から供給されたハッシュ関数を用いて、実行部4430から供給された開始アドレスからハッシュ値を生成するものである。すなわち、この確定ハッシュ値生成部4520は、図78において示した確定ハッシュ関数選択部4252が確定したハッシュ関数を用いて、実行部4430から供給された開始アドレスからハッシュ値を生成する。この確定ハッシュ値生成部4520は、信号線4408を介して関数あるいはループの開始アドレスが供給された場合には、確定ハッシュ関数保持部4510が保持しているハッシュ関数を用いてハッシュ値を生成する。この確定ハッシュ値生成部4520は、その生成されたハッシュ値を信号線4509を介して履歴対象データ保持部4610に供給する。なお、確定ハッシュ値生成部4520は、特許請求の範囲に記載の区間識別値生成部の一例である。なお、確定ハッシュ値生成部4520が生成するハッシュ値は、特許請求の範囲に記載の区間識別値の一例である。また、確定ハッシュ値生成部4520が用いるハッシュ関数は、特許請求の範囲に記載の区間識別値生成関数の一例である。
 履歴管理部4600は、再利用区間の実行結果を保持して管理するものであり、履歴対象データ保持部4610と、履歴検索部4620と、履歴メモリ4630と、履歴登録部4640とを備える。
 履歴対象データ保持部4610は、実行部4430および確定ハッシュ値生成部4520から供給されたデータを一時的に保持するものである。この履歴対象データ保持部4610は、実行部4430から入力値が供給され、かつ、確定ハッシュ値生成部4520からハッシュ値が供給された際には、これらを検索要求として履歴検索部4620に供給する。この履歴対象データ保持部4610は、例えば、実行部4430において関数の再利用区間が実行された場合には、実行部4430から供給された関数の入力値と、確定ハッシュ値生成部4520から供給されたハッシュ値とを検索要求として履歴検索部4620に供給する。また、履歴対象データ保持部4610は、実行部4430においてループの再利用区間が実行された場合には、実行部4430からの入力値およびループカウンタ値と、確定ハッシュ値生成部4520からのハッシュ値とを検索要求として履歴検索部4620に供給する。ここで、ループカウンタ値とは、そのループ区間の何回目の実行による実行結果であるのかを示す値である。
 また、この履歴対象データ保持部4610は、実行部4430からは入力値および実行結果が供給され、確定ハッシュ値生成部4520からはハッシュ値が供給された場合には、実行履歴を登録する条件を満たすため、これらを実行履歴として履歴登録部4640に供給する。例えば、履歴対象データ保持部4610は、実行部4430において関数の再利用区間が実行された場合には、実行部4430からの入力値および実行結果と、確定ハッシュ値生成部4520からのハッシュ値とを実行履歴として履歴登録部4640に供給する。また、履歴対象データ保持部4610は、実行部4430においてループの再利用区間が実行された場合には、実行部4430からの入力値、実行結果、ループカウンタ値と、確定ハッシュ値生成部4520からのハッシュ値とを実行履歴として履歴登録部4640に供給する。
 履歴検索部4620は、履歴対象データ保持部4610から供給された検索要求に基づいて実行履歴を検索するものである。この履歴検索部4620は、検索要求入力部4621および実行結果出力部4622を備える。
 検索要求入力部4621は、履歴対象データ保持部4610から供給された検索要求に基づいて履歴メモリ4630から実行履歴を検索するものである。この検索要求入力部4621は、例えば、関数の再利用区間を指定する命令が命令デコーダ4420において解読された場合には、この命令により指定された関数の開始アドレスから生成されたハッシュ値と、この関数の入力値とを履歴メモリ4630に供給する。また、この検索要求入力部4621は、ループの再利用区間を指定する命令が命令デコーダ4420において解読された場合には、この指定されたループの開始アドレスから生成されたハッシュ値と、入力値と、ループカウンタ値とを履歴メモリ4630に供給する。
 実行結果出力部4622は、履歴メモリ4630において実行履歴が検索された場合に実行結果を履歴メモリ4630から抽出して、その抽出した実行結果を実行部4430に出力するものである。この実行結果出力部4622は、その抽出した実行結果を、信号線4609を介して実行部4430に供給する。
 履歴メモリ4630は、履歴登録部4640から供給された実行履歴を保持するものである。この履歴メモリ4630は、例えば、履歴検索部4620から検索要求が供給された場合において、この検索要求と一致する実行履歴を保持しているときは、この実行履歴の実行結果を実行結果出力部4622に供給する。さらに、この履歴メモリ4630は、履歴登録部4640から実行履歴が供給された場合には、この実行履歴を保持する。この履歴メモリ4630は、例えば、連想メモリ(CAM:Content Addressable Memory)により実現される。
 履歴登録部4640は、履歴対象データ保持部4610から供給された実行履歴を履歴メモリ4630に保持させるためのデータ構造に変換して、その変換された実行履歴を履歴メモリ4630に登録するものである。この履歴登録部4640は、例えば、履歴検索部4620により関数の実行履歴が検索されない場合には、その関数の開始アドレスから生成されたハッシュ値と、入力値と、実行結果とを実行履歴として履歴メモリ4630に登録する。また、この履歴登録部4640は、例えば、履歴検索部4620によりループの実行履歴が検索されない場合には、ループの開始アドレスから生成されたハッシュ値と、入力値と、実行結果と、ループカウンタ値とを実行履歴として履歴メモリ4630に登録する。
 このように、本発明の第2の実施の形態では、データ処理装置4300にハッシュ変換部4500を設けることによって、本発明の第1の実施の形態の装置によりハッシュ関数が埋め込まれたプログラムを実行して開始アドレスをハッシュ値に変換することができる。これにより、開始アドレスのビット幅より狭いビット幅で再利用区間を識別するハッシュ値を開始アドレスの代わりに履歴メモリ4630に保持させることができる。
 すなわち、従来の技術では関数の実行履歴として開始アドレス、入力値および実行結果を履歴メモリに保持させるが、本発明の第2の実施の形態では開始アドレスのビット幅より狭いビット幅のハッシュ値、入力値および実行結果を履歴メモリ4630に保持させる。このように、開始アドレスのビット幅より狭いビット幅のハッシュ値を開始アドレスの代わりに履歴メモリ4630に保持させることによって、履歴メモリ4630に保持される実行履歴の量を増加させることができる。
 なお、ここでは、実行部4430から供給されたハッシュ関数を確定ハッシュ関数保持部4510に保持させる例について説明したが、本発明はこれに限定されるものではない。例えば、図78において示した本発明の第1の実施の形態における候補ハッシュ関数保持部4220と同一の複数のハッシュ関数を事前に確定ハッシュ関数保持部4510に保持させるようにしてもよい。この例において、本発明の第1の実施の形態におけるコンパイル処理装置4100により、図78において説明したハッシュ関数を指し示す識別子をハッシュ関数の代わりにプログラムに埋め込む。そして、本発明の第2の実施の形態におけるデータ処理装置4300によりその識別子に基づいてハッシュ関数を特定する。
 この場合において、実行部4430は、命令デコーダ4420が識別子を指定する命令をデコードした際に、識別子をハッシュ変換部4500に出力する。そして、確定ハッシュ関数保持部4510は、実行部4430から供給された識別子に対応するハッシュ関数を保持している複数のハッシュ関数から選択して、その選択したハッシュ関数を確定ハッシュ値生成部4520に供給する。
 これにより、ハッシュ関数を識別する識別子が埋め込まれたプログラムに基づいて、開始アドレスをハッシュ値に変換することができる。
 [履歴メモリ4630のデータ構造例]
 図87は、本発明の第2の実施の形態における履歴メモリ4630のデータ構造の一例を示す概念図である。ここでは、履歴メモリ4630により、ハッシュ値ごとに保持された実行履歴のうち、1つのハッシュ値における実行履歴を木構造により保持する構成が示されている。この例では、引数がn個であり、かつ、実行結果である出力をm個の格納先に返す関数を想定している。
 この例では、木構造における関数ルート4650と、第1の引数ノード4661および4662と、第nの引数ノード4671乃至4674と、第1の出力ノード4681乃至4684と、第mの出力ノード4691乃至4694とが示されている。
 関数ルート4650には、ハッシュ値と、第1の引数ノード4661を指し示すポインタとが示されている。
 第1および第nの引数ノード4661、4662および4671乃至4674には、履歴メモリ4630に保持されている実行履歴における引数の入力値として、引数の値を示す入力値と、その引数の型と、その引数の格納場所を示す種類とが示されている。ここにいう格納場所とは、レジスタ番号または主記憶部4360のメモリアドレスのことをいう。
 さらに、第1および第nの引数ノード4661、4662および4671乃至4674には、比較対象の入力値が互いに一致した場合に次の引数の引数ノードを指し示す右ポインタと、不一致の場合に同一の引数における他の引数ノードを指し示す下ポインタとが示されている。また、第nの引数ノード4671乃至4674の各々は、第1および第mの出力ノード4681乃至4684および4691乃至4694にそれぞれ連結されている。
 第1および第mの出力ノード4681乃至4684および4691乃至4694には、履歴メモリ4630に保持されている実行履歴における実行結果として、実行結果の値を示す出力値と、その実行結果の格納場所を示す種類と、その実行結果の型とが示されている。さらに、第1の出力ノード4681乃至4684には、次の出力ノードを指し示す右ポインタが示されている。すなわち、第1および第mの出力ノード4681乃至4684および4691乃至4694は、連結リストを構成している。また、第mの出力ノード4691乃至4694には、出力ノードの終端を表わすヌルが示されている。
 このような木構造において、関数ルート4650に示されたハッシュ値と一致するハッシュ値が履歴検索部4620から入力されると、関数ルート4650のポインタによって指し示された第1の引数ノード4661において入力値の比較処理が実行される。ここにいう入力値の比較処理とは、第1の引数ノード4661に示された入力値、種類および型である入力値と、履歴検索部4620からの入力値とを比較することである。
 このとき、例えば、第1の引数ノード4661に示された入力値と履歴検索部4620から+の入力値とが一致した場合には、第1の引数ノード4661の右ポインタにより指し示された次の引数ノードにおいて入力値の比較処理が実行される。一方、第1の引数ノード4661に示された入力値と、履歴検索部4620からの入力値とが一致しない場合には、第1の引数ノード4661の下ポインタにより指し示された第1の引数ノード4662において入力値の比較処理が実行される。
 このようにして、各引数ノードにおける比較処理による結果に基づいて右または下ポインタの指し示す引数ノードが選択され、その選択された引数ノードにおいて入力値の比較処理が順次実行される。そして、例えば、第nの引数ノード4671に示された入力値と履歴検索部4620からの入力値とが互いに一致した場合には、第nの引数ノード4671の右ポインタの指し示す第1の出力ノード4681の実行結果が履歴検索部4620に出力される。そして、最後に、第m番の出力ノード4691の実行結果が履歴検索部4620に出力される。
 このように、履歴メモリ4630をハッシュ値ごとに木構造により構成することによって、同じ引数の入力値を重複して保持させる必要が無いため、記憶領域を節約することができる。また、ハッシュ値ごとにデータ構造を分けることによって、検索速度の低下を抑制することができる。
 [本発明の第2の実施の形態におけるデータ処理装置4300の動作例]
 次に、本発明の第2の実施の形態におけるデータ処理装置4300の処理について図面を参照して説明する。
 図88は、本発明の第2の実施の形態におけるデータ処理装置4300による命令処理方法の処理手順例を示すフローチャートである。このフローチャートは、命令デコーダ4420によりデコードされる命令毎の処理例を説明するものであり、命令デコーダ4420によりデコードされる命令の実行の終了をフローチャートの終了とする。
 まず、フェッチ部4410およびレジスタファイル4440に、命令デコーダ4420によって解読(デコード)される命令およびその命令に従って実行部4430により実行される値が読み出される(ステップS4941)。次に、命令デコーダ4420により、フェッチ部4410から供給された命令がデコードされる(ステップS4942)。
 続いて、実行部4430により、デコードした命令がハッシュ関数指定命令か否かが判断される(ステップS4943)。そして、デコードした命令がハッシュ関数指定命令であると判断された場合には、レジスタファイル4440から供給されるハッシュ関数が信号線44407を介して確定ハッシュ関数保持部4510に登録される(ステップS4944)。これにより、ハッシュ関数指定命令の実行は終了する。
 一方、デコードした命令がハッシュ関数指定命令でないと判断された場合には、デコードした命令が再利用命令か否かが判断される(ステップS4945)。そして、デコードした命令が再利用命令でないと判断された場合には、実行部4430により、レジスタファイル4440から供給される入力値に基づいてその再利用区間が実行されることによって、実行結果が出力されて(ステップS4946)、ステップS4954に進む。
 一方、ステップS4945の処理において、命令が再利用命令であると判断された場合には、確定ハッシュ値生成部4520により、再利用区間の開始アドレスからハッシュ値が算出される(ステップS4947)。続いて、検索要求入力部4621により、ハッシュ値および入力値を用いて履歴メモリ4630に実行履歴があるか否かが判断される(ステップS4948)。このとき、ループが再利用区間である場合には、ハッシュ値および入力値に加えてループカウンタ値も用いて履歴メモリ4630に実行履歴があるか否か探索される。
 そして、実行履歴が履歴メモリ4630にないと判断された場合には、実行部4430により、レジスタファイル4440から供給される入力値に基づいてその再利用区間が実行されることによって、実行結果が出力される(ステップS4949)。そして、履歴登録部4640により、実行履歴が履歴メモリ4630に登録される(ステップS4951)。これにより、履歴メモリ4630に実行履歴が登録される。そして、ステップS4954に進む。
 一方、実行履歴が履歴メモリ4630にあると判断された場合には、実行結果出力部4622により、実行結果が出力される(ステップS4952)。これにより、実行している再利用区間の実行結果が履歴メモリ4630から出力される。続いて、実行部4430は、実行結果が出力された再利用区間の実行を中止させる(ステップS4953)。そして、ステップS4954に進む。
 そして、ステップS4946、S4951およびS4953の処理の後に、実行結果がレジスタファイル4440に書き戻される(ステップS4954)。これにより、デコードされた命令の実行は終了する。
 このように、本発明の第2の実施の形態では、ハッシュ変換部4500を設けることによって、ハッシュ値と入力値と実行結果とを実行履歴として履歴メモリ4630に保持させることができる。
 <3.第3の実施の形態>
 [本発明の第3の実施の形態におけるコンパイル処理装置4100の構成例]
 図89は、本発明の第3の実施の形態におけるコンパイル処理装置4100の構成例を示すブロック図である。このコンパイル処理装置4100は、図76において示したコンパイル処理装置4100のハッシュ関数決定部4200の代わりにハッシュ値付再利用命令生成部4170を備えている。ここでは、ハッシュ値付再利用命令生成部4170以外の構成は、図76と同様のものであるため、図76と同符号を付してここでの各部の構成の詳細な説明を省略する。
 ハッシュ値付再利用命令生成部4170は、再利用区間の開始アドレスのビット幅より狭いビット幅で再利用区間を識別するハッシュ値を含む再利用命令であるハッシュ値付再利用命令を生成するものである。このハッシュ値付再利用命令生成部4170は、ハッシュ値決定部700およびハッシュ値付加部4172を備える。なお、ハッシュ値付再利用命令は、特許請求の範囲に記載の区間識別値付命令の一例である。
 ハッシュ値決定部700は、再利用区間の開始アドレスのビット幅より狭いビット幅で再利用区間を識別するハッシュ値を決定するものである。このハッシュ値決定部4700は、例えば、再利用区間の開始アドレスの所定の順序に従って付与された番号を関数入力値として、複数のハッシュ関数を用いてハッシュ関数ごとにハッシュ値を生成する。そして、このハッシュ値決定部4700は、複数のハッシュ関数のうち、値が全て互いに異なるハッシュ値であってビット幅が最も狭いハッシュ値を決定して出力する。このハッシュ値決定部4700は、その決定したハッシュ値をプログラムとともにハッシュ値付加部4172に供給する。
 ハッシュ値付加部4172は、ハッシュ値決定部4700により決定されたハッシュ値をそのハッシュ値が指し示す再利用区間を呼び出す再利用命令に付加してハッシュ値付再利用命令を生成するものである。このハッシュ値付加部4172は、その生成したハッシュ値付再利用命令が含まれるプログラムを機械語プログラム生成部4140に供給する。なお、ハッシュ値付加部4172は、特許請求の範囲に記載の命令変換部の一例である。
 機械語プログラム生成部4140は、ハッシュ値付加部4172から供給されたハッシュ値付再利用命令が含まれるプログラムに基づいて、機械語のプログラムであるオブジェクトプログラムを生成するものである。また、この機械語プログラム生成部4140は、オブジェクトプログラムを生成する際に、ハッシュ値のビット幅を指定する値を指定する命令をオブジェクトプログラムに埋め込む。
 このように、本発明の第3の実施の形態におけるコンパイル処理装置4100では、まず、関数の実行結果が再利用される度合いに応じて関数の呼出し命令を再利用命令に変換することによって、再利用される関数と再利用されない関数とが区別できるようにする。そして、本発明の第3の実施の形態におけるコンパイル処理装置4100では、再利用区間を識別するためのハッシュ値を決定してハッシュ値付再利用命令を生成することによって、そのハッシュ値付再利用命令が含まれるプログラムを生成することができる。
 [本発明の第3の実施の形態におけるハッシュ値決定部4700の構成例]
 図90は、本発明の第3の実施の形態におけるハッシュ値決定部4700の構成例を示すブロック図である。このハッシュ値決定部4700は、開始アドレス取得部4710と、候補ハッシュ関数保持部4720と、候補ハッシュ値生成部4730と、ハッシュ値テーブル4740と、ハッシュ値出力部4750とを備える。
 開始アドレス取得部4710は、図78において示した開始アドレス取得部4210と同様に、再利用命令変換部4124からの再利用命令を含むプログラムから再利用区間の開始アドレスを取得するものである。この開始アドレス取得部4710は、その取得した開始アドレスを開始アドレスリストとして保持する。また、この開始アドレス取得部4710は、その取得した開始アドレスの取得した順序に従って付与された番号を番号リストとして保持する。この開始アドレス取得部4710は、取得した開始アドレスあるいは付与した番号を候補ハッシュ値生成部4730に供給する。
 候補ハッシュ関数保持部4720は、開始アドレスあるいは番号をハッシュ値に変換するための複数のハッシュ関数を保持するものである。すなわち、この候補ハッシュ関数保持部4720は、ハッシュ値決定部4700が決定するハッシュ値の候補となるハッシュ値を生成するためのハッシュ関数の候補となるハッシュ関数を保持する。この候補ハッシュ関数保持部4720は、予め定められたハッシュ関数を保持する。
 この候補ハッシュ関数保持部4720は、保持している複数のハッシュ関数を候補ハッシュ値生成部4730に供給する。なお、候補ハッシュ関数保持部4720から供給されるハッシュ関数は、特許請求の範囲に記載の候補関数の一例である。
 候補ハッシュ値生成部4730は、開始アドレス取得部4710から供給された開始アドレスあるいは番号を関数入力値とし、その関数入力値を候補ハッシュ関数保持部4720から供給されたハッシュ関数の入力としてハッシュ値を生成するものである。すなわち、この候補ハッシュ値生成部4730は、ハッシュ値決定部4700が決定するハッシュ値の候補となるハッシュ値を生成する。
 この候補ハッシュ値生成部4730は、例えば、開始アドレス取得部4710から番号が供給された場合には、候補ハッシュ関数保持部4720から供給されたハッシュ関数を用いてその番号からハッシュ値を生成する。また、この候補ハッシュ値生成部4730は、例えば、開始アドレス取得部4710から開始アドレスが供給された場合には、候補ハッシュ関数保持部4720から供給されたハッシュ関数を用いてその開始アドレスからハッシュ値を生成する。
 この候補ハッシュ値生成部4730は、その生成したハッシュ値をハッシュ値テーブル4740に供給する。なお、候補ハッシュ値生成部4730は、特許請求の範囲に記載の候補値生成部の一例である。なお、候補ハッシュ値生成部4730から供給されるハッシュ値は、特許請求の範囲に記載の候補値の一例である。
 ハッシュ値テーブル4740は、候補ハッシュ値生成部4730から供給されたハッシュ値を保持するものである。このハッシュ値テーブル4740は、ハッシュ値をそのハッシュ値を生成したハッシュ関数ごとにハッシュ値リストとして保持する。また、このハッシュ値テーブル4740は、保持したハッシュ値リストをハッシュ値出力部4750に供給する。なお、ハッシュ値テーブル4740は、特許請求の範囲に記載の候補値テーブルの一例である。なお、ハッシュ値リストは、特許請求の範囲に記載の候補値リストの一例である。
 ハッシュ値出力部4750は、ハッシュ値が全て互いに異なるハッシュ値リストを抽出し、この抽出されたハッシュ値リストのうちハッシュ値のビット幅が最も狭くなるハッシュ値リストのハッシュ値を出力するものである。このハッシュ値出力部4750は、ユニークハッシュ値リスト判別部4751および確定ハッシュ値選択部4752を備える。なお、ハッシュ値出力部4750は、特許請求の範囲に記載の区間識別値出力部の一例である。なお、ハッシュ値出力部4750が出力するハッシュ値は、特許請求の範囲に記載の区間識別値の一例である。
 ユニークハッシュ値リスト判別部4751は、図78において示したユニークハッシュ値リスト判別部4251と同様に、ハッシュ値テーブル4740に保持されているハッシュ値リストのうちハッシュ値が全て互いに異なるハッシュ値リストを判別するものである。このユニークハッシュ値リスト判別部4751は、その判別したハッシュ値リストを確定ハッシュ値選択部4752に供給する。
 確定ハッシュ値選択部4752は、ユニークハッシュ値リスト判別部4751から供給されたハッシュ値リストのうちハッシュ値のビット幅が最も狭くなるハッシュ値リストを選択して、その選択したハッシュ値リストのハッシュ値を出力するものである。すなわち、この確定ハッシュ値選択部4752は、ハッシュ値決定部4700が決定するハッシュ値の候補のハッシュ値からハッシュ値を確定し、その確定したハッシュ値をハッシュ値決定部4700が決定したハッシュ値として出力する。
 この確定ハッシュ値選択部4752は、ユニークハッシュ値リスト判別部4751から供給されたハッシュ値が全て互いに異なるハッシュ値リストのうちハッシュ値のビット幅が最も狭いハッシュ値リストを一つ検出する。そして、この確定ハッシュ値選択部4752は、その検出したハッシュ値リストのハッシュ値をハッシュ値付加部4172に供給する。
 このように、本発明の第3の実施の形態では、ハッシュ値決定部4700を設けることにより、全て互いに異なるハッシュ値であってビット幅が最も狭いハッシュ値を有するハッシュ値付再利用命令を含むプログラムを生成することができる。
 なお、ここでは、候補ハッシュ関数保持部4720は、保持するハッシュ関数を全て候補ハッシュ値生成部4730に供給する一例について説明したが、本発明はこれに限定されるものではない。例えば、候補ハッシュ関数保持部4720は外部から制御できるようにすることによって、候補ハッシュ値生成部4730に供給するハッシュ関数を制御できるようにしてもよい。また、例えば、ハッシュ値テーブル4740から供給される番号のうち最も大きい番号に基づいて、候補ハッシュ値生成部4730が使用するハッシュ関数を判断できるようにしてもよい。
 [本発明の第3の実施の形態におけるハッシュ値テーブル4740に保持されるハッシュ値の一例]
 図91は、本発明の第3の実施の形態におけるハッシュ値テーブル4740に保持されるハッシュ値の一例を示す概念図である。ここでは、便宜上、開始アドレス取得部4710には、開始アドレスが取得された順序に従って付与された番号が番号リストとして保持されることを想定する。また、この番号は、ハッシュ値テーブル4740に登録された開始アドレスに対して「1」から順に付与される値であることとする。さらに、ここでは、候補ハッシュ関数保持部4720は、図79において説明した式3乃至式6のハッシュ関数を保持しているものとする。
 また、ここでは、プログラムにおける再利用区間は7個の関数(funcA乃至funcG)とする。なお、ここでは、開始アドレス取得部4710は、7個の関数(funcA乃至funcG)をfuncAから順に取得してハッシュ値テーブルに供給したことを想定する。
 また、候補ハッシュ値生成部4730は、ビット幅を短くするハッシュ関数のみでハッシュ値を算出する場合には、ハッシュ値テーブル4740におけるデータ量を軽減させるために、関数入力値をそのままハッシュ値テーブル4740に供給できることとする。すなわち、候補ハッシュ値生成部4730は、開始アドレス取得部4710から番号が関数入力値として供給される際には、開始アドレス取得部4710における番号リストと同様の番号リストをハッシュ値テーブル4740に保持させることができることとする。
 さらに、この候補ハッシュ値生成部4730は、関数入力値をそのままハッシュ値テーブル4740に供給する場合において、ハッシュ関数の生成するハッシュ値のビット幅に関するデータをハッシュ値テーブル4740にハッシュ値リストの代わりとして保持させることを想定する。
 図91の(a)には、ハッシュ値テーブル4740に保持された番号リスト4772の一例が示されている。
 開始アドレスリスト4771は、ハッシュ値テーブル4740に登録されたハッシュ値の基となった開始アドレスのリスト名が示されている。この開始アドレスリスト4771において、行4782にはfuncAに関する値が示され、行4783にはfuncBに関する値が示され、行4784にはfuncCに関する値が示されている。さらに、行4785にはfuncDに関する値が示され、行4786にはfuncEに関する値が示され、行4787にはfuncFに関する値が示され、行4788にはfuncGが示されていることを表している。
 番号リスト4772は、候補ハッシュ値生成部4730が関数入力値をそのままハッシュ値テーブル4740に供給した場合において、ハッシュ値テーブル4740に登録された番号のリストである。この番号リスト4772は、開始アドレス(funcA乃至funcG)に対して付与された番号(1乃至7)が10進数で示された値を括弧の外に表し、かつ、その番号が64ビットの2進数で表された値を括弧の中に表している。
 このような番号リスト4772をハッシュ値テーブル4740に保持させる場合において、候補ハッシュ値生成部4730は、ハッシュ関数の生成するハッシュ値のビット幅に関するデータをハッシュ値リストの代わりとしてハッシュ値テーブル4740に保持させる。
 図91の(b)には、図91の(a)において示した番号リスト4772と、番号リストのビット幅を指定するデータとから想定されるハッシュ値リスト4773乃至4776が示されている。
 ハッシュ値リスト4773には、式1のi(ビット幅)を「4」としたハッシュ関数である式6を用いた場合に算出されるハッシュ値のリストが示されている。このハッシュ値リスト4773の行4782乃至4788には、7個の関数(funcA乃至funcG)の開始アドレスの取得された順序に従って付与された番号(番号リスト4772の行4782乃至4788)を式6の関数入力値として算出されたハッシュ値が示されている。すなわち、ハッシュ値リスト4773の行4782乃至4788には、7つの関数の開始アドレスの取得された順序に従って付与された番号(番号リスト4772の行4782乃至4788)を2進数で表現したビット列の最下位ビットから4ビットの値がそれぞれ示されている。
 ハッシュ値リスト4774には、式1のi(ビット幅)を「3」としたハッシュ関数である式5を用いた場合に算出されるハッシュ値のリストが示されている。このハッシュ値リスト4774の行4782乃至4788には、7個の関数(funcA乃至funcG)の開始アドレスの取得された順序に従って付与された番号(番号リスト4772の行4782乃至4788)を式5の関数入力値として算出されたハッシュ値が示されている。すなわち、ハッシュ値リスト4774の行4782乃至4788には、7つの関数の開始アドレスの取得された順序に従って付与された番号(番号リスト4772の行4782乃至4788)を2進数で表現したビット列の最下位ビットから3ビットの値がそれぞれ示されている。
 ハッシュ値リスト4775には、式1のi(ビット幅)を「2」としたハッシュ関数である式4を用いた場合に算出されるハッシュ値のリストが示されている。このハッシュ値リスト4775の行4782乃至4788には、7個の関数(funcA乃至funcG)の開始アドレスの取得された順序に従って付与された番号(番号リスト4772の行4782乃至4788)を式4の関数入力値として算出されたハッシュ値が示されている。すなわち、ハッシュ値リスト4775の行4782乃至4788には、7つの関数の開始アドレスの取得された順序に従って付与された番号(番号リスト4772の行4782乃至4788)を2進数で表現したビット列の最下位ビットから2ビットの値がそれぞれ示されている。
 ハッシュ値リスト4776には、式1のi(ビット幅)を「1」としたハッシュ関数である式3を用いた場合に算出されるハッシュ値のリストが示されている。このハッシュ値リスト4776の行4782乃至4788には、7個の関数(funcA乃至funcG)の開始アドレスの取得された順序に従って付与された番号(番号リスト4772の行4782乃至4788)を式3の関数入力値として算出されたハッシュ値が示されている。すなわち、ハッシュ値リスト4776の行4782乃至4788には、7つの関数の開始アドレスの取得された順序に従って付与された番号(番号リスト4772の行4782乃至4788)を2進数で表現したビット列の最下位ビットの値がそれぞれ示されている。
 続いて、図91を用いて、ユニークハッシュ値リスト判別部4751により判別されるハッシュ値リストと、確定ハッシュ値選択部4752が選択するハッシュ値とについて説明する。
 まず、ユニークハッシュ値リスト判別部4751は、この図91の(b)において示したハッシュ値リスト4773乃至4776を、図91の(a)の番号リスト4772と、ハッシュ関数の生成するハッシュ値のビット幅に関するデータとから想定する。そして、このハッシュ値リスト4773乃至4776からハッシュ値が全て互いに異なるハッシュ値リストを検出し、その検出したハッシュ値リストを確定ハッシュ値選択部4752に供給する。
 この時、ハッシュ値リスト4776は、funcA、funcC、funcEおよびfuncGのハッシュ値が「1」で重複し、さらに、その他の3つの関数のハッシュ値が「0」で重複しているため、確定ハッシュ値選択部4752に供給されない。また、ハッシュ値リスト4775は、funcAおよびfuncEのハッシュ値が「01」で重複、funcBおよびfuncFのハッシュ値が「10」で重複、funcCおよびfuncGのハッシュ値が「11」で重複しているため供給されない。その結果、ハッシュ値が全て互い異なるハッシュ値リストと判別されたハッシュ値リスト4773および774が確定ハッシュ値選択部4752に供給される。
 続いて、確定ハッシュ値選択部4752は、供給されたハッシュ値リストからハッシュ値のビット幅が最も狭いハッシュ値リストを検出し、その検出されたハッシュ値リストのハッシュ値をハッシュ値付加部4172に供給する。その結果、4ビットのハッシュ値のハッシュ値リスト4773と、3ビットのハッシュ値のハッシュ値リスト4774とのうちハッシュ値リスト4774がビット幅が最も狭いハッシュ値のハッシュ値リストとして検出される。そして、確定ハッシュ値選択部4752は、その検出したハッシュ値リスト4774のハッシュ値を出力する。
 このように、本発明の第3の実施の形態では、候補ハッシュ値生成部4730によりビット幅が異なるハッシュ値のみが生成される場合には、ハッシュ値テーブル4740に関数入力値を保持させておいてもハッシュ値を決定することができる。これにより、ハッシュ値テーブル4740におけるハッシュ値リストのデータ量を軽減させることができるため、全て互いに異なるハッシュ値のハッシュ値リストの検索などの処理を軽減させることができる。また、番号を関数入力値とする場合について説明したが、開始アドレスの場合においても同様に処理することができる。すなわち、この図91において示した方法は、第1の実施の形態におけるハッシュ関数決定部4200でも同様に行うことができる。
 なお、ここでは、開始アドレスの取得された順序に従って付与された番号をハッシュ関数の関数入力値としてハッシュ値を算出したが、本発明はこれに限定されるものではない。例えば、図80において示した第1の実施の形態と同様に、開始アドレスを関数入力値とする場合も考えられる。また、開始アドレスの取得された順序を関数入力値とするではなく、再利用度生成部4123が生成した再利用度の値に対する順序を関数入力値とする場合なども考えられる。
 また、ここでは、ユニークハッシュ値リスト判別部4751は、番号リスト4772と、ハッシュ関数の生成するハッシュ値のビット幅に関するデータとから、ハッシュ値リスト4773乃至4776を想定する場合について説明したが、本発明はこれに限定されるものではない。例えば、ハッシュ値出力部4750は、値が全て互いに異なるとともに最も狭いビット幅の値を、開始アドレス取得部4710が保持する番号リストから直接選択できるようにしてもよい。これにより、候補ハッシュ関数保持部4720、候補ハッシュ値生成部4730およびハッシュ値テーブル4740を備えないハッシュ値決定部4700により、値が全て互いに異なるとともに最も狭いビット幅のハッシュ値を決定することができる。
 [本発明の第3の実施の形態における再利用命令の一例]
 次に、本発明の第3の実施の形態におけるコンパイル処理装置4100が生成する再利用命令について図面を参照して説明する。
 図92は、本発明の第3の実施の形態における関数の呼出し命令および関数の再利用命令の一例を示す概念図である。ここでは、データ処理装置のプロセッサコアはMIPSにより構成されることを想定する。また、ここでは、左端は最上位ビット(MSB)を示し、右端は最下位ビット(LSB)を示している。
 図92の(a)には、MIPS命令セットにおける関数の呼出し命令(call)であるJALR(Jump And Link Register)命令が示されている。MIPS命令セットは32ビットの固定長の命令セットであり、このJALR命令は、32個のビット(0乃至31番)のビット列により表現されるものである。
 このJALR命令は、オペコードフィールド4810と、関数番地フィールド(rs)4820と、第1未使用フィールド4830と、戻り番地フィールド(rd)4840と、第2未使用フィールド4850と、機能指定フィールド4860とから構成される。
 オペコードフィールド4810は、命令の種別を指定するフィールドである。このオペコードフィールド4810は、第26乃至第31番目のビットから構成されるビット列である。このオペコードフィールド4810には、SPECIAL命令としてビット列(000000)が格納される。
 関数番地フィールド(rs)4820は、関数の番地を格納するレジスタを指定するフィールドである。この関数番地フィールド(rs)4820は、第21乃至第25番目のビットから構成されるビット列である。
 第1未使用フィールド4830は、JALR命令では使用されないフィールドである。この第1未使用フィールド4830は、第16乃至第20番目のビット列である。この第1未使用フィールド4830は、JALR命令ではビット列(00000)が格納される。
 戻り番地フィールド(rd)4840は、関数からの戻り番地を指定するフィールドである。この戻り番地フィールド(rd)4840は、第11乃至第15番目のビットから構成されるビット列である。この戻り番地フィールド(rd)4840は、JALR命令では31番レジスタを指すビット列(11111)が格納される。
 第2未使用フィールド4850は、JALR命令では使用されないフィールドである。この第2未使用フィールド4850は、第6乃至第10番目のビットから構成されるビット列である。この第2未使用フィールド4850は、JALR命令ではビット列(00000)が格納される。
 機能指定フィールド4860は、オペコードフィールド4810により指定された命令が複数の機能を含む場合には、その複数の機能のうち1つの機能を指定するフィールドである。この機能指定フィールド4860は、第0乃至第5番目のビットから構成されるビット列である。この機能指定フィールド4860は、JALR命令ではビット列(001001」)が格納される。
 図92の(b)には、本発明の第3の実施の形態における関数のハッシュ値付再利用命令の一例が示されている。このハッシュ値付再利用命令は、32個のビット(0乃至31番)のビット列により表現されるものである。このハッシュ値付再利用命令は、オペコードフィールド4810と、関数番地フィールド(rs)4820と、第1ハッシュ値フィールド4832および4833と、戻り番地フィールド(rd)4840と、第2ハッシュ値フィールド4852および4853と、機能指定フィールド4860とから構成される。なお、ここでは、第1ハッシュ値フィールド4832および4833と、第2ハッシュ値フィールド4852および4853と以外の構成は、図92の(a)と同様のものであるため、図92の(a)と同符号を付してここでの説明を省略する。
 第1ハッシュ値フィールド4832および4833は、第2ハッシュ値フィールド4852および4853とともにハッシュ値が付加された再利用命令であることを示すフィールドである。この第1ハッシュ値フィールド4832および4833は、第2ハッシュ値フィールド4852および4853のビット列と連結させることによって、ハッシュ値を示す10ビットの数値を示すフィールドになる。この第1ハッシュ値フィールド4832および4833と、第2ハッシュ値フィールド4852および4853とは、JALR命令における第1未使用フィールド4830および第2未使用フィールド4850のビット列を「00000」以外のビット列に変更したものである。ただし、この第1ハッシュ値フィールド4832および4833と、第2ハッシュ値フィールド4852および4853とは、一方のビット列が「00000」以外ならばハッシュ値付再利用命令を指し示し、他方のビット列が「00000」であってもよい。
 例えば、第1ハッシュ値フィールド4832には、第2ハッシュ値フィールド4852とともに、ハッシュ値の値が最も低いハッシュ値付再利用命令におけるビット列の値が格納されている。この第1ハッシュ値フィールド4832は、第2ハッシュ値フィールド4852と連結させることによって、10ビットのビット列(0000000001)となる。すなわち、この命令を処理するデータ処理装置において、このビット列(0000000001)は、「1」の値のハッシュ値を指し示すと判断される。
 さらに、第1ハッシュ値フィールド4833には、第2ハッシュ値フィールド4853とともに、ハッシュ値の値が最も高いハッシュ値付再利用命令におけるビット列の値が格納されている。この第1ハッシュ値フィールド4833は、第2ハッシュ値フィールド4853と連結させることによって、10ビットのビット列(1111111111)となる。すなわち、この命令を処理するデータ処理装置において、このビット列(1111111111)は、「1024」の値のハッシュ値を指し示すと判断される。
 なお、図92の(b)では、ハッシュ値付加部4172が生成するハッシュ値付再利用命令について説明した。再利用命令変換部4124が生成するハッシュ値が付加される前の再利用命令については、第1未使用フィールド4830および第2未使用フィールド4850のいずれか一方のビット列が「00000」以外のビット列に変更されたものであれば何でもよい。
 このように、第3の実施の形態では、ハッシュ値付加部4172を設けることによって、ハッシュ値が付加された再利用命令を生成することができる。
 なお、ここでは、JALRの第1未使用フィールド4830および第2未使用フィールド4850にハッシュ値を埋め込んだハッシュ値付再利用命令について説明したが、本発明はこれに限定されるものではない。例えば、図81において示したハッシュ関数指定命令および識別子供給命令と同様に、ユーザが独自に新たにハッシュ値付再利用命令を定義してもよい。
 例えば、オペコードフィールド4810にはSPECIAL2命令を格納し、機能指定フィールド4860には図81のユーザ定義命令フィールド(UDI)4295と同様に、ユーザが定義した複数の命令のうちの1つの命令を指定する値を格納する。そして、第6乃至第25番目のユーザが定義可能なエンコード空間に、関数の番地を格納するレジスタを指定する値、関数からの戻り番地を指定する値、ハッシュ値が格納されている番地を格納する値を格納する。このハッシュ値が格納されている番地には10ビット以上のビット幅のハッシュ値が格納できるため、これにより、10ビットより大きいビット幅のハッシュ値が付加されたハッシュ値付再利用命令を生成することができる。
 このハッシュ値が格納されている番地を格納するレジスタを指定するフィールドを格納させることにより、10ビットより大きいビット幅のハッシュ値が付加されたハッシュ値付再利用命令を生成することができる。
 [本発明の第3の実施の形態におけるコンパイル処理装置4100の動作例]
 次に、本発明の第3の実施の形態におけるコンパイル処理装置4100の処理について図面を参照して説明する。
 図93は、本発明の第3の実施の形態におけるコンパイル処理装置4100によるコンパイル処理の処理手順を示すフローチャートである。
 まず、ソースプログラム記憶部4110からソースプログラムが読み出される(ステップS4911)。次に、再利用候補区間抽出部4121により、再利用候補区間が抽出される(ステップS4912)。
 そして、再利用候補区間解析部4122により、再利用候補区間の使用態様が解析される(ステップS4913)。続いて、再利用度生成部4123により、再利用候補区間の解析結果に基づいて再利用度が生成される(ステップS4914)。
 次に、再利用命令変換部4124により、再利用度に基づいて再利用候補区間の呼出し命令が再利用命令に変換される(ステップS4915)。これは、例えば、関数が再利用候補区間である場合には、関数の呼出し命令(call)が再利用命令(memoCall)に変換されることを意味する。このステップS4911乃至S4915の一連の処理により、再利用区間が判別される。
 そして、ハッシュ値決定部4700により、開始アドレスのビット幅より狭いビット幅で再利用区間を識別するハッシュ値を決定するハッシュ値決定処理が行われる(ステップS4960)。
 続いて、ハッシュ値付加部4172により、ハッシュ値付再利用命令が生成される(ステップS4917)。
 最後に、機械語プログラム生成部4140により、ハッシュ値のビット幅を指定する命令およびハッシュ値付再利用命令が含まれる機械語プログラムが生成される(ステップS4918)。そして、コンパイル処理は終了する。
 図94は、本発明の第3の実施の形態におけるハッシュ値決定部4700によるハッシュ値決定処理(ステップS4960)の処理手順例の前半を示すフローチャートである。なお、ここでは、便宜上、ハッシュ値テーブル4740には、図91の(b)において示したハッシュ値リストが保持されることを想定する。なお、ここでは、ハッシュ関数の総数とは、開始アドレスをそのまま出力するハッシュ関数と、図79において示した式3乃至式7のハッシュ関数とを合わせた数の「6」であることを想定する。
 まず、開始アドレス取得部4710により、再利用区間の開始アドレスがプログラムから取得され、開始アドレス取得部4710に開始アドレスリストとして保持される(ステップS4961)。続いて、開始アドレス取得部4710に保持された開始アドレスの保持された順序に従って番号が付与され、その番号が番号リストとして保持される(ステップS4962)。
 次に、ハッシュ関数カウンタ(hn)が「1」に初期化される(ステップS4963)。なお、ここで示すハッシュ関数カウンタ(hn)とは、図83において示したハッシュ関数カウンタ(hn)と同様のものであるので、ここでの詳細な説明を省略する。なお、ハッシュ関数カウンタ(hn)の値の「0」には、図83において示したハッシュ関数カウンタ(hn)と同様に、開始アドレスをそのまま出力するハッシュ関数が割り当てられるものとする。
 続いて、開始アドレスカウンタ(an)が「0」に初期化される(ステップS4964)。なお、ここで示す開始アドレスカウンタ(an)とは、図83において示した開始アドレスカウンタ(an)と同様のものであるので、ここでの詳細な説明を省略する。
 そして、候補ハッシュ値生成部4730により、ハッシュ関数カウンタ(hn)が指し示すハッシュ関数を用いて、開始アドレスカウンタ(an)が指し示す開始アドレスに対して付与された番号を関数入力値としてハッシュ値が算出される(ステップS4965)。次に、開始アドレスカウンタ(an)に「1」が加算される(ステップS4966)。
 続いて、開始アドレスカウンタ(an)が開始アドレスリストの開始アドレスの総数であるか否かが判断される(ステップS4967)。そして、開始アドレスカウンタ(an)が開始アドレスリストの開始アドレスの総数でないと判断された場合には、ステップS4965に戻る。これにより、ハッシュ関数カウンタ(hn)が指し示すハッシュ関数の付与された番号を関数入力値としてまだ算出されていないハッシュ値が算出される。
 一方、開始アドレスカウンタ(an)が開始アドレスリストの開始アドレスの総数であると判断された場合には、ハッシュ関数カウンタ(hn)に「1」が加算される(ステップS4968)。
 続いて、ハッシュ関数カウンタ(hn)がハッシュ関数の総数であるか否かが判断される(ステップS4969)。そして、ハッシュ関数カウンタ(hn)がハッシュ関数の総数でないと判断された場合には、ステップS4964に戻る。これにより、まだハッシュ値が算出されていないハッシュ関数を用いてハッシュ関数が算出される。
 一方、ハッシュ関数カウンタ(hn)がハッシュ関数の総数であると判断された場合には、ステップS4970に進む。
 図95は、本発明の第3の実施の形態におけるハッシュ値決定部4700によるハッシュ値決定処理(ステップS4960)の処理手順例の後半を示すフローチャートである。
 まず、図94のステップS4969においてハッシュ関数カウンタ(hn)がハッシュ関数の総数であると判断された場合には、選択ハッシュ関数カウンタ(h)が「0」に初期化される(ステップS4970)。
 続いて、ハッシュ値ビット幅サイズ(ws)がハッシュ関数カウンタ(0)のハッシュ関数により生成されたハッシュ値のビット幅に変更される(ステップS4971)。これにより、ハッシュ値ビット幅サイズ(ws)には開始アドレスのビット幅の64ビットが設定される。
 そして、ハッシュ関数カウンタ(hn)が「1」に変更される(ステップS4972)。続いて、ユニークハッシュ値リスト判別部4751により、ハッシュ関数カウンタ(hn)の指し示すハッシュ関数に対応するハッシュ値リストのハッシュ値が全て互いに異なるか否かが判別される(ステップS4973)。そして、ハッシュ関数(hn)の指し示すハッシュ関数と関連付けられたハッシュ値リストのハッシュ値が全て互いに異なっていないと判別された場合には、ステップS4977に進む。
 一方、ハッシュ関数カウンタ(hn)の指し示すハッシュ関数と関連付けられたハッシュ値リストのハッシュ値が全て互いに異なっていると判別された場合には、ステップS4974に進む。ステップS4974では、確定ハッシュ値選択部4752により、ハッシュ関数カウンタ(hn)の指し示すハッシュ関数と関連付けられたハッシュ値リストのハッシュ値のビット幅が、ハッシュ値ビット幅サイズ(ws)より小さい値であるか否かが判断される。そして、ハッシュ関数(hn)の指し示すハッシュ関数と関連付けられたハッシュ値リストのハッシュ値のビット幅がwsより小さい値ではないと判断された場合には、ステップS4977に進む。
 一方、ハッシュ関数カウンタ(hn)の指し示すハッシュ関数と関連付けられたハッシュ値リストのハッシュ値のビット幅がハッシュ値ビット幅サイズ(ws)より小さい値であると判断された場合には、ステップS4975に進む。ステップS4975では、選択ハッシュ関数番号(h)がハッシュ関数カウンタ(hn)の値に変更される。
 続いて、ハッシュ値ビット幅サイズ(ws)が、ハッシュ関数カウンタ(hn)が指し示すハッシュ関数と関連付けられたハッシュ値リストのハッシュ値のビット幅に変更される(ステップS4976)。
 そして、ハッシュ関数カウンタ(hn)に「1」が加算される(ステップS4977)。次に、ハッシュ関数カウンタ(hn)がハッシュ関数の総数であるか否かが判断される(ステップS4978)。そして、ハッシュ関数カウンタ(hn)がハッシュ関数の総数でないと判断された場合には、ステップS4973に戻る。
 一方、ハッシュ関数カウンタ(hn)がハッシュ関数の総数であると判断された場合には、ステップS4979に進む。ステップS4979では、選択ハッシュ関数(h)が指し示すハッシュ関数と関連付けられたハッシュ値リストのハッシュ値がハッシュ値決定部4700の決定したハッシュ値として出力される(ステップS4979)。
 このように、本発明の第3の実施の形態では、ハッシュ値決定部4700を設けることによって、複数のハッシュ関数のうち全て互いに異なるハッシュ値であってビット幅が最も狭くなるハッシュ値を生成するハッシュ関数のハッシュ値を出力することができる。
 このように、本発明の第3の実施の形態によれば、ハッシュ値付再利用命令が含まれるプログラムを生成することができる。
 <4.第4の実施の形態>
 [本発明の第4の実施の形態におけるデータ処理装置4300の構成例]
 図96は、本発明の第4の実施の形態におけるデータ処理装置4300の構成例を示すブロック図である。このデータ処理装置4300は、図85において示したデータ処理装置4300のハッシュ変換部4500を除いたものである。このデータ処理装置4300における命令キャッシュ4311およびデータキャッシュ4312は、図85において示した各構成と同様の機能であるため、図85と同一の符号を付してここでの説明を省略する。また、このデータ処理装置4300が接続されている主記憶部4360およびその接続を介しているバス4350は、図85において示したものと同様の機能であるため、図85と同一の符号を付してここでの説明を省略する。
 プロセッサコア4400は、図85におけるプロセッサコア4400と同様に、プログラムの命令に従って演算を実行するものである。このプロセッサコア4400は、図92において示したハッシュ値付再利用命令が入力された場合には、ハッシュ値付再利用命令に含まれるハッシュ値と、再利用区間の入力値とを履歴管理部4600に供給する。また、このプロセッサコア4400は、ハッシュ値付再利用命令を実行した際において履歴管理部4600から実行結果が供給されないときには、この命令を実行した結果である実行結果をデータキャッシュ4312および履歴管理部4600に出力する。
 さらに、プロセッサコア4400は、入力される命令がハッシュ値付再利用命令である場合において履歴管理部4600から実行結果が供給されたときには、再利用区間における処理を中止して、この再利用区間を呼び出したルーチンに戻って実行を継続する。
 履歴管理部4600は、再利用区間の実行結果を保持して管理するものである。この履歴管理部4600は、プロセッサコア4400から供給されたハッシュ値と入力値と実行結果とを実行履歴として保持する。また、この履歴管理部4600は、ハッシュ値と入力値とがプロセッサコア4400から供給された場合には、このハッシュ値と入力値とが含まれる実行履歴を検索する。
 [本発明の第4の実施の形態におけるプロセッサコア4400および履歴管理部4600の構成例]
 図97は、本発明の第4の実施の形態におけるプロセッサコア4400および履歴管理部4600の構成例を示すブロック図である。ここでは、プロセッサコア4400と履歴管理部4600とが示されている。また、ここでは、プロセッサコア4400および履歴管理部4600の機能は、図85および図96と同様のものであるため、同一の符号を付してここでの詳細な説明を省略する。
 プロセッサコア4400は、フェッチ部4410と、命令デコーダ4420と、実行部4430と、レジスタファイル4440とを備える。なお、本発明の第4の実施の形態におけるフェッチ部4410と、命令デコーダ4420と、レジスタファイル4440との機能は、図86において示した各構成と同様の機能であるため、図86と同一の符号を付してここでの詳細な説明を省略する。
 実行部4430は、命令デコーダ4420から供給された制御信号に基づいて、命令デコーダ4420において解析した命令を実行するものである。この実行部4430は、命令デコーダ4420においてハッシュ値のビット幅を指定する命令をデコードした場合には、その命令が指定するビット幅をハッシュ値のビット幅として設定する。
 また、この実行部4430は、命令デコーダ4420がハッシュ値付再利用命令をデコードした場合、ハッシュ値付再利用命令が指定する再利用区間の処理を開始する。そして、この再利用区間の処理の開始とともに、実行部4430は、ハッシュ値付再利用命令から取得したハッシュ値を、信号線4409を介して履歴管理部4600に出力する。例えば、この実行部4430は、ハッシュ値のビット幅が「5」と設定された場合には、図92において示した第2ハッシュ値フィールド4852および4853の最下位ビットから5ビットの値をハッシュ値として信号線4409を介して履歴管理部4600に出力する。
 そして、実行部4430は、レジスタファイル4440から供給される再利用区間の入力値に基づいて再利用区間における処理を実行するとともに、再利用区間の入力値を、信号線4409を介して履歴管理部4600に出力する。
 なお、実行部4430は、履歴管理部4600から再利用区間の実行結果が供給された場合には、再利用区間の処理を中止するとともに、その実行結果を履歴管理部4600から供給された旨を通知する信号をフェッチ部4410に供給する。この時、実行部4430は、実行結果をレジスタファイル4440に出力する。
 一方、実行部4430は、履歴管理部4600から再利用区間の実行結果が供給されない場合には、再利用区間の処理を最後まで実行して、その実行結果をレジスタファイル4440に出力するとともに信号線4409を介して履歴管理部4600に出力する。
 履歴管理部4600は、再利用区間の実行結果を保持して管理するものであり、履歴対象データ保持部4610と、履歴検索部4620と、履歴メモリ4630と、履歴登録部4640とを備える。なお、本発明の第4の実施の形態における履歴管理部4600の各構成は、ハッシュ値が実行部4430から供給されること以外は図86において示した各構成と同様の機能であるため、図86と同一の符号を付してここでの詳細な説明を省略する。すなわち、図86において示した履歴管理部4600はハッシュ変換部4500から供給されたハッシュ値を用いていたが、この本発明の第4の実施の形態における履歴管理部4600は実行部4430から供給されるハッシュ値を用いる点が異なる。
 このように、本発明の第4の実施の形態では、本発明の第3の実施の形態の装置により生成されたハッシュ値付再利用命令が含まれるプログラムに基づいて、ハッシュ値と入力値と実行結果とを実行履歴として履歴メモリ4630に保持させることができる。
 [本発明の第4の実施の形態におけるデータ処理装置4300の動作例]
 次に、本発明の第4の実施の形態におけるデータ処理装置4300の処理について図面を参照して説明する。
 図98は、本発明の第4の実施の形態におけるデータ処理装置4300による命令処理方法の処理手順例を示すフローチャートである。このフローチャートは、ハッシュ値のビット幅を指し示す命令が実行された以降の命令デコーダ4420によりデコードされる命令毎の処理例を説明するものであり、命令デコーダ4420によりデコードされる命令の実行の終了をフローチャートの終了とする。
 まず、フェッチ部4410およびレジスタファイル4440に、命令デコーダ4420によって解読(デコード)される命令およびその命令に従って実行部4430により実行される値が読み出される(ステップS4941)。次に、命令デコーダ4420により、フェッチ部4410から供給された命令がデコードされる(ステップS4942)。
 続いて、実行部4430により、デコードした命令が再利用区間を指定するハッシュ値付再利用命令か否かが判断される(ステップS4945)。そして、デコードした命令がハッシュ値付再利用命令でないと判断された場合には、レジスタファイル4440から供給される入力値に基づいてその再利用区間が実行されることによって、実行結果が出力される(ステップS4946)。そして、ステップS4954に進む。
 一方、ステップS4945の処理において、命令がハッシュ値付再利用命令であると判断された場合には、検索要求入力部4621により、ハッシュ値および入力値を用いて履歴メモリ4630に実行履歴があるか否かが判断される(ステップS4948)。そして、実行履歴が履歴メモリ4630にないと判断された場合には、実行部4430により、レジスタファイル4440から供給される入力値に基づいてその再利用区間が実行され、実行結果が出力される(ステップS4949)。続いて、履歴登録部4640により、実行履歴が履歴メモリ4630に登録される(ステップS4951)。これにより、履歴メモリ4630に実行履歴が登録される。そして、ステップS4954に進む。
 一方、実行履歴が履歴メモリ4630にあると判断された場合には、実行結果出力部4622により、実行結果が出力される(ステップS4952)。これにより、実行している再利用区間の実行結果が履歴メモリ4630から出力される。続いて、実行部4430は、実行結果が出力された再利用区間の実行を中止させる(ステップS4953)。そして、ステップS4954に進む。
 そして、ステップS4946、S4951およびS4953の処理の後に、実行結果がレジスタファイル4440に書き戻される(ステップS4954)。これにより、デコードされた命令の実行は終了する。
 このように、本発明の第4の実施の形態では、ハッシュ値と入力値と実行結果とを実行履歴として履歴メモリ4630に保持させることができる。
 <5.第5の実施の形態>
 [本発明の第5の実施の形態におけるデータ処理装置4300の構成例]
 図99は、本発明の第5の実施の形態におけるデータ処理装置4300の構成例を示すブロック図である。このデータ処理装置4300は、図85において示したデータ処理装置4300の各構成に加えて、ハッシュ関数決定部4370を備えている。ここでは、このハッシュ関数決定部4370およびハッシュ変換部4500以外の各構成の機能は、図85と同様の機能であるため、ここでの説明を省略する。
 ハッシュ関数決定部4370は、プロセッサコア4400がプログラムを実行する前にハッシュ関数を決定するものである。このハッシュ関数決定部4370は、主記憶部4360から供給されたオブジェクトプログラムから再利用区間の開始アドレスを取得し、その開始アドレスのビット幅より狭いビット幅で再利用区間を識別するハッシュ値を生成するためのハッシュ関数を決定する。
 なお、このハッシュ関数決定部4370は、図78において示した本発明の第1の実施の形態のハッシュ関数決定部4200をデータ処理装置4300に備えたものである。すなわち、この本発明の第5の実施の形態のハッシュ関数決定部4370では、開始アドレス取得部4210はオブジェクトプログラムを解析して再利用区間の開始アドレスを取得する。また、この本発明の第5の実施の形態では、確定ハッシュ関数選択部4252は選択したハッシュ関数をハッシュ変換部4500に供給する。このハッシュ関数決定部4370における開始アドレス取得部4210および確定ハッシュ関数選択部4252以外の各構成の機能は、図78と同様のものであるため、この本発明の第5の実施の形態での詳細な説明を省略する。
 このハッシュ関数決定部4370は、その決定したハッシュ関数をハッシュ変換部4500に供給する。
 ハッシュ変換部4500は、再利用区間の開始アドレスのビット幅より狭いビット幅で再利用区間を識別するためのハッシュ値に開始アドレスを変換するものである。このハッシュ変換部4500は、ハッシュ関数決定部4370から供給されたハッシュ関数を保持する。このハッシュ変換部4500は、その保持しているハッシュ関数を用いて、プロセッサコア4400から供給された関数またはループの開始アドレスからハッシュ値を生成する。このハッシュ変換部4500は、その生成したハッシュ値を履歴管理部4600に供給する。
 このように、本発明の第5の実施の形態では、データ処理装置4300にハッシュ関数決定部4370を設けることによって、既に生成されたオブジェクトプログラムを用いてハッシュ関数を決定することができる。
 [本発明の第5の実施の形態におけるプロセッサコア4400とハッシュ変換部4500と履歴管理部4600との構成例]
 図100は、本発明の第5の実施の形態におけるプロセッサコア4400とハッシュ変換部4500と履歴管理部4600との構成例を示すブロック図である。ここでは、プロセッサコア4400とハッシュ変換部4500と履歴管理部4600とが示されている。また、ここでは、プロセッサコア4400、ハッシュ変換部4500、履歴管理部4600の他に、ハッシュ変換部4500にハッシュ関数を供給するハッシュ関数決定部4370が示されている。
 プロセッサコア4400は、フェッチ部4410と、命令デコーダ4420と、実行部4430と、レジスタファイル4440とを備える。なお、本発明の第5の実施の形態におけるフェッチ部4410と命令デコーダ4420とレジスタファイル4440との機能は、図86において示した各構成と同様の機能であるため、ここでの詳細な説明を省略する。
 実行部4430は、命令デコーダ4420から供給された制御信号に基づいて、命令デコーダ4420において解析した命令を実行するものである。この本発明の第5の実施の形態における実行部4430は、図86において示した実行部4430におけるハッシュ関数指定す命令を実行する機能を省いたものである。このハッシュ関数指定命令を実行する機能以外の実行部4430の機能は、図86において示した本発明の第1の実施の形態における実行部4430の機能と同一であるためここでの説明を省略する。
 ハッシュ変換部4500は、再利用区間の開始アドレスのビット幅より狭いビット幅で再利用区間を識別するためのハッシュ値に開始アドレスを変換させるものであり、確定ハッシュ関数保持部4510および確定ハッシュ値生成部4520を備える。なお、本発明の第5の実施の形態における確定ハッシュ値生成部4520の機能は、図86において示したものと同様の機能であるため、ここでの詳細な説明を省略する。
 確定ハッシュ関数保持部4510は、ハッシュ関数決定部4370から供給されたハッシュ関数を保持するものである。この確定ハッシュ関数保持部4510は、ハッシュ関数決定部4370から信号線4501を介してハッシュ関数が供給された場合にはこのハッシュ関数を保持し、その保持したハッシュ関数を確定ハッシュ値生成部4520に供給する。
 履歴管理部4600は、再利用区間の実行結果を保持して管理するものであり、履歴対象データ保持部4610と、履歴検索部4620と、履歴メモリ4630と、履歴登録部4640とを備える。なお、この本発明の第5の実施の形態における履歴管理部4600の各構成の機能は、図86において示した各構成の機能と同様のものであるため、ここでの詳細な説明を省略する。
 [本発明の第5の実施の形態におけるデータ処理装置4300の動作例]
 次に、本発明の第5の実施の形態におけるデータ処理装置4300の処理について図面を参照して説明する。
 図101は、本発明の第5の実施の形態におけるデータ処理装置4300による命令処理方法の処理手順例を示すフローチャートである。
 まず、ハッシュ関数決定部4370によって、ハッシュ関数が決定される(ステップS4981)。なお、このハッシュ関数決定部4370のハッシュ関数を決定する処理手順例は、図83および9において示したハッシュ関数決定部4200の処理手順例と同様であるので、ここでの説明を省略する。
 続いて、ハッシュ変換部4500における確定ハッシュ関数保持部4510において、ハッシュ関数決定部4200により決定されたハッシュ関数が保持される(ステップS4982)。そして、プログラムの命令を実行するプログラム実行処理が行われる(ステップS4990)。
 図102は、本発明の第5の実施の形態におけるプログラム実行処理(ステップS4990)の処理手順例を示すフローチャートである。このフローチャートは、プログラムの実行の開始をフローチャートの開始とし、プログラムの実行の終了をフローチャートの終了とする。
 まず、フェッチ部4410およびレジスタファイル4440に、命令デコーダ4420によって解読(デコード)される命令およびその命令に従って実行部4430により実行される値が読み出される(ステップS4941)。次に、命令デコーダ4420により、そのフェッチ部4410から供給された命令がデコードされる(ステップS4942)。
 続いて、実行部4430により、解読(デコード)した命令が再利用命令か否かが判断される(ステップS4945)。そして、デコードした命令が再利用命令でないと判断された場合には、レジスタファイル4440から供給される入力値に基づいてその再利用区間が実行されることによって、実行結果が出力される(ステップS4946)。そして、ステップS4954に進む。
 一方、ステップS4945の処理において、命令が再利用命令であると判断された場合には、確定ハッシュ値生成部4520により、再利用区間の開始アドレスからハッシュ値が算出される(ステップS4947)。続いて、検索要求入力部4621により、ハッシュ値および入力値を用いて履歴メモリ4630に実行情報があるか否かが判断される(ステップS4948)。
 そして、実行履歴が履歴メモリ4630にないと判断された場合には、実行部4430により、レジスタファイル4440から供給される入力値に基づいてその再利用区間が実行され、実行結果が出力される(ステップS4949)。そして、履歴登録部4640により、実行履歴が履歴メモリ4630に登録される(ステップS4951)。これにより、履歴メモリ4630に実行履歴が登録される。そして、ステップS4954に進む。
 一方、実行履歴が履歴メモリ4630にあると判断された場合には、実行結果出力部4622により、実行結果が出力される(ステップS4952)。これにより、実行している再利用区間の実行結果が履歴メモリ4630から出力される。続いて、実行部4430は、実行結果が出力された再利用区間の実行を中止させる(ステップS4953)。そして、ステップS4954に進む。
 そして、ステップS4946、S4951およびS4953の処理の後に、実行結果がレジスタファイル4440に書き戻される(ステップS4954)。これにより、デコードされた命令の実行は終了する。
 続いて、プログラムの実行が終了したか否かが判断される(ステップS4995)。そして、プログラムの実行が終了していないと判断された場合には、ステップS4941に戻り処理が繰り返される。
 このように、本発明の第5の実施の形態では、ハッシュ関数決定部4370から確定ハッシュ関数保持部4510にハッシュ関数を供給することによって、既に生成されたオブジェクトプログラムの再利用区間の開始アドレスからハッシュ値を生成することができる。
 このように、本発明の実施の形態によれば、値再利用の効率を改善することができる。すなわち、複数のハッシュ関数から選択したハッシュ関数を用いて開始アドレスからハッシュ値を生成することによって、ハッシュ値と入力値と実行結果とを実行履歴として履歴メモリ4630に保持させることができる。このハッシュ値は、開始アドレスより短いビット幅で再利用区間を識別する値である。
 すなわち、本発明の実施の形態によれば、関数アドレスと入力値と実行結果とを実行履歴として履歴メモリ4630に保存させる従来技術の装置と比較して、履歴メモリ4630に保持されるデータ量を軽減することができる。これにより、履歴メモリ4630に保持される実行履歴の数を増加させることができることによって、検索におけるヒット率を上昇させることができる。
 また、開始アドレスがハッシュ値となることにより、実行履歴の検索時に比較されるビット数が減少する。このことにより、検索回路を減少させることができることによって、検索に掛かる時間を減少させることができる。
 なお、本発明の実施の形態は本発明を具現化するための一例を示したものであり、本発明の実施の形態において明示したように、本発明の実施の形態における事項と、特許請求の範囲における発明特定事項とはそれぞれ対応関係を有する。同様に、特許請求の範囲における発明特定事項と、これと同一名称を付した本発明の実施の形態における事項とはそれぞれ対応関係を有する。ただし、本発明は実施の形態に限定されるものではなく、本発明の要旨を逸脱しない範囲において実施の形態に種々の変形を施すことにより具現化することができる。
 例えば、本発明の実施の形態においては、主記憶部3130に退避された実行結果を再利用する際に、退避履歴からループ個別履歴を復元して履歴メモリ3430に登録し、その登録されたループ個別履歴から実行結果を出力する例を説明した。しかしながら、これに限定されるものではなく、主記憶部3130に退避された実行結果を再利用する際に、ループ履歴を復元しないで実行結果を再利用する場合も考えられる。
 また、本発明の実施の形態において説明した処理手順は、これら一連の手順を有する方法として捉えてもよく、また、これら一連の手順をコンピュータに実行させるためのプログラム乃至そのプログラムを記憶する記録媒体として捉えてもよい。この記録媒体として、例えば、CD(Compact Disc)、MD(MiniDisc)、DVD(Digital Versatile Disk)、メモリカード、ブルーレイディスク(Blu-ray Disc(登録商標))等を用いることができる。
 100 データ処理装置
 120 バス
 130 主記憶部
 200 一次キャッシュ
 210 命令キャッシュ
 220 データキャッシュ
 300 データ処理部
 310 フェッチ部
 320 命令デコーダ
 331 ロードユニット
 332 入力選択部
 333 演算回路
 334 ストアユニット
 340 レジスタファイル
 400 実行結果再利用処理部
 410 実行履歴検索部
 420 実行結果出力部
 430 履歴メモリ
 500 プログラム変換処理装置
 510 ソースプログラム記憶部
 520 オブジェクトプログラム記憶部
 600 予告命令挿入コード生成部
 610 プログラム解析部
 611 再利用候補区間抽出部
 612 再利用候補区間解析部
 620 プログラム最適化処理部
 621 再利用度生成部
 622 再利用区間選択部
 623 予告命令生成処理部
 630 コード生成部
 1100 データ処理装置
 1120 バス
 1130 主記憶部
 1200 一次キャッシュ
 1210 命令キャッシュ
 1220 データキャッシュ
 1300 プロセッサコア
 1309、1409 信号線
 1310 フェッチ部
 1320 命令デコーダ
 1330 実行部
 1340 レジスタファイル
 1400 履歴管理部
 1410 履歴対象データ保持部
 1420 履歴検索部
 1421 検索要求入力部
 1422 実行結果出力部
 1430 履歴メモリ
 1440 履歴登録部
 1450 優先度テーブル
 1460 履歴メモリ容量管理部
 1470 低優先度履歴消去部
 1471 最小値優先度履歴検索部
 1472 優先度比較部
 1473 消去部
 1500 コンパイル処理装置
 1510 ソースプログラム記憶部
 1520 再利用アシストコンパイル処理部
 1522 コード生成部
 1530 オブジェクトプログラム記憶部
 1600 プログラム変換処理部
 1610 ソースプログラム解析部
 1611 再利用候補区間抽出部
 1612 再利用候補区間解析部
 1620 最適化部
 1621 再利用度生成部
 1622 優先度生成部
 1623 再利用命令変換部
 2100 データ処理装置
 2120 バス
 2130 主記憶部
 2200 一次キャッシュ
 2210 命令キャッシュ
 2220 データキャッシュ
 2300 データ処理部
 2310 フェッチ部
 2320 命令デコーダ
 2330 実行部
 2331 ロードユニット
 2332 入力選択部
 2333 演算回路
 2334 ストアユニット
 2340 レジスタファイル
 2350 プログラムカウンタ
 2400、2700 実行結果再利用処理部
 2410、2710 実行履歴検索部
 2420、2720 実行結果出力部
 2430、2730 履歴メモリ
 2440、2740 実行データ保持部
 2500、2800 検索開始命令アドレス管理部
 2510、2810 アドレス判定部
 2520、2820 入力値設定命令アドレステーブル
 2600 プログラム解析処理装置
 2610 ソースプログラム記憶部
 2620 コンパイル処理部
 2630 プログラム解析部
 2631 再利用候補区間抽出部
 2632 再利用候補区間解析部
 2640 プログラム最適化処理部
 2641 再利用度生成部
 2642 再利用区間抽出部
 2643 再利用区間情報生成部
 2650 コード生成部
 2660 オブジェクトプログラム記憶部
 2670 再利用区間情報記憶部
 2840 設定入力値保持部
 2850 検索開始命令決定部
 3100 データ処理装置
 3120 バス
 3130 主記憶部
 3200 一次キャッシュ
 3210 命令キャッシュ
 3220 データキャッシュ
 3300 プロセッサコア
 3310 フェッチ部
 3320 命令デコーダ
 3330 実行部
 3340 レジスタファイル
 3400 履歴管理部
 3410 履歴対象データ保持部
 3420 履歴検索部
 3421 検索要求入力部
 3422 実行結果出力部
 3430 履歴メモリ
 3440 履歴登録部
 3450 履歴メモリ容量管理部
 3460 消去部
 3500 履歴変換部
 3510 履歴制御部
 3512 ループ個別履歴消去部
 3513 ループ代表履歴登録部
 3520 履歴復元部
 3521 退避履歴取得部
 3522 ループ個別履歴生成部
 3523 登録領域確保部
 3524 ループ個別履歴登録部
 3530 退避領域管理部
 3600 退避履歴生成部
 3610 先頭探索部
 3620 連続探索部
 3630 ループ個別履歴取得部
 3640 退避履歴転送部
 3650 ループ代表履歴生成部
 4100 コンパイル処理装置
 4110 ソースプログラム記憶部
 4120 再利用命令判別部
 4121 再利用候補区間抽出部
 4122 再利用候補区間解析部
 4123 再利用度生成部
 4124 再利用命令変換部
 4140 機械語プログラム生成部
 4150 オブジェクトプログラム記憶部
 4170 ハッシュ値付再利用命令生成部
 4172 ハッシュ値付加部
 4200 ハッシュ関数決定部
 4210、4710 開始アドレス取得部
 4220、4720 候補ハッシュ関数保持部
 4230、4730 候補ハッシュ値生成部
 4240、4740 ハッシュ値テーブル
 4250 ハッシュ関数出力部
 4251、4751 ユニークハッシュ値リスト判別部
 4252 確定ハッシュ関数選択部
 4300 データ処理装置
 4310 一次キャッシュ
 4311 命令キャッシュ
 4312 データキャッシュ
 4350 バス
 4360 主記憶部
 4370 ハッシュ関数決定部
 4400 プロセッサコア
 4410 フェッチ部
 4420 命令デコーダ
 4430 実行部
 4440 レジスタファイル
 4500 ハッシュ変換部
 4510 確定ハッシュ関数保持部
 4520 確定ハッシュ値生成部
 4600 履歴管理部
 4610 履歴対象データ保持部
 4620 履歴検索部
 4621 検索要求入力部
 4622 実行結果出力部
 4630 履歴メモリ
 4640 履歴登録部
 4700 ハッシュ値決定部
 4750 ハッシュ値出力部
 4752 確定ハッシュ値選択部

Claims (71)

  1.  複数回実行される命令区間である再利用区間が含まれる命令列に基づく処理を実行する実行部と、
     前記再利用区間を識別するための識別情報ごとに前記再利用区間における入力値および実行結果を関連付けて実行履歴として保持する履歴メモリと、
     前記再利用区間における処理の実行を予告する予告命令に基づいて前記再利用区間の入力値を取得して前記取得された入力値と前記予告命令により特定された前記識別情報とに基づいて前記実行履歴における前記実行結果を検索する実行履歴検索部と、
     前記予告命令によって識別された前記再利用区間における処理が実行されるときに前記実行履歴検索部により前記実行結果が抽出された場合には前記抽出された実行結果を前記実行部に出力する実行結果出力部と
    を具備するデータ処理装置。
  2.  前記実行履歴検索部は、前記予告命令から前記再利用区間の先頭アドレスが呼び出される呼出し命令の直前の命令までの命令群のうち前記再利用区間の入力値を設定するための入力値設定命令に基づいて入力値を取得する請求項1記載のデータ処理装置。
  3.  前記実行履歴検索部は、前記取得された入力値と前記予告命令に含まれる前記識別情報とに基づいて前記実行履歴における前記実行結果を検索する請求項1記載のデータ処理装置。
  4.  前記履歴メモリは、前記識別情報である前記再利用区間の先頭アドレスごとに前記再利用区間における入力値および実行結果を関連付けて前記実行履歴として保持し、
     前記実行部は、前記先頭アドレスを参照するための参照情報を含む前記予告命令に基づいて前記先頭アドレスを前記実行履歴検索部に出力し、
     前記実行履歴検索部は、前記識別情報として前記実行部から出力された前記先頭アドレスと前記再利用区間の入力値とに基づいて前記実行履歴における前記実行結果を検索する請求項1記載のデータ処理装置。
  5.  前記予告命令は、前記識別情報である前記再利用区間の先頭アドレスを設定するための予告設定命令であり、
     前記履歴メモリは、前記再利用区間の先頭アドレスごとに前記再利用区間における入力値および実行結果を関連付けて前記実行履歴として保持し、
     前記実行部は、前記先頭アドレスの設定先が示された設定情報を含む前記予告設定命令に基づいて前記先頭アドレスを前記設定先に設定し、
     前記実行履歴検索部は、前記予告設定命令に基づいて前記再利用区間の入力値を取得して前記取得された入力値と前記実行部により設定された前記先頭アドレスとに基づいて前記実行履歴における前記実行結果を検索する
    請求項1記載のデータ処理装置。
  6.  前記履歴メモリは、前記実行履歴を削除する際の優先度と前記優先度に対応する前記再利用区間における入力値および実行結果とを関連付けて前記実行履歴として前記識別情報ごとに保持し、
     前記実行履歴検索部は、前記予告命令に含まれる前記優先度に基づいて前記履歴メモリにおける前記実行履歴を削除する
    請求項1記載のデータ処理装置。
  7.  前記実行部は、前記実行履歴検索部により前記実行履歴における前記実行結果が前記履歴メモリから抽出されない場合には前記予告命令によって識別された前記再利用区間における処理を実行し、
     前記実行履歴検索部は、前記予告命令に基づいて取得された前記入力値と前記実行部により実行された実行結果と前記識別情報とを前記履歴メモリに保持させる
    請求項1記載のデータ処理装置。
  8.  前記履歴メモリは、前記再利用区間である関数を識別するための前記識別情報ごとに前記関数における入力値および実行結果を関連付けて前記実行履歴として保持し、
     前記実行履歴検索部は、前記関数の実行を予告する予告命令に基づいて前記関数の入力値を取得して前記取得された入力値と前記予告命令により特定された前記識別情報とに基づいて前記実行履歴における前記実行結果を検索し、
     実行結果出力部は、前記予告命令によって識別された前記関数が実行されるときに前記実行履歴検索部により前記実行結果が抽出された場合には前記抽出された実行結果を前記実行部に出力する
    請求項1記載のデータ処理装置。
  9.  プログラムのうち複数回実行される命令区間の各々の実行結果が互いに一致する度合いを示す再利用度を前記命令区間の使用態様に基づいて前記命令区間ごとに生成する再利用度生成部と、
     前記複数の命令区間のうち前記再利用度に基づいて選択された再利用区間における入力値を設定するための入力値設定命令の直前に前記再利用区間における入力値の設定を予告する予告命令を生成する予告命令生成部と
    を具備するプログラム変換処理装置。
  10.  前記予告命令生成部は、前記再利用度に基づいて選択された複数の前記再利用区間を識別するための識別情報を含む前記予告命令を生成する請求項9記載のプログラム変換処理装置。
  11.  前記予告命令生成部は、前記再利用区間の先頭アドレスを設定するためのアドレス設定命令の後に前記先頭アドレスを参照するための参照情報を含む前記予告命令を生成する請求項9記載のプログラム変換処理装置。
  12.  前記予告命令生成部は、前記再利用区間の先頭アドレスを設定するために前記先頭アドレスの設定先が示された設定情報を含むアドレス設定命令として前記予告命令を生成する請求項9記載のプログラム変換処理装置。
  13.  前記予告命令生成部は、前記再利用度生成部により生成された前記再利用度に応じて付与された優先度を含む前記予告命令を生成する請求項9記載のプログラム変換処理装置。
  14.  複数回実行される命令区間である再利用区間が含まれる命令列に基づく処理を実行する実行部と、前記再利用区間を識別するための識別情報ごとに前記再利用区間における入力値および実行結果を関連付けて実行履歴として保持する履歴メモリとを備えるデータ処理装置におけるデータ処理方法であって、
     前記再利用区間における処理の実行を予告する予告命令により特定された前記識別情報と前記予告命令により特定された前記再利用区間の入力値とを取得する取得手順と、
     前記取得手順により取得された前記識別情報と前記入力値とに基づいて前記実行履歴における前記実行結果を検索する実行履歴検索手順と、
     前記予告命令によって識別された前記再利用区間における処理が実行されるときに前記実行履歴検索部により前記実行結果が抽出された場合には前記抽出された実行結果を前記実行部に出力する実行結果出力手順と
    を具備するデータ処理方法。
  15.  プログラムのうち複数回実行される複数の命令区間各々の実行結果が互いに一致する度合いを示す再利用度を前記命令区間の使用態様に基づいて前記命令区間ごとに生成する再利用度生成手順と、
     前記複数の命令区間のうち前記再利用度に基づいて選択された再利用区間における入力値を設定するための入力値設定命令の直前に前記再利用区間における入力値の設定を予告する予告命令を生成する予告命令生成手順と、
    を具備する予告命令生成処理方法。
  16.  プログラムにおける命令区間の使用態様を解析する解析部と、
     前記命令区間の実行結果が再び利用される度合いを示す再利用度を前記解析の結果に基づいて生成する再利用度生成部と、
     前記命令区間の呼出し命令を前記再利用度に基づいて再利用命令に変換する命令変換部と
    を具備するプログラム変換処理装置。
  17.  前記解析部は、前記使用態様として前記命令区間の入力値の個数を解析し、
     前記再利用度生成部は、前記解析の結果に基づいて前記再利用度を生成する
    請求項16記載のプログラム変換処理装置。
  18.  前記解析部は、前記使用態様として前記命令区間の入力値が採り得る値の組合せを解析し、
     前記再利用度生成部は、前記解析の結果に基づいて前記再利用度を生成する
    請求項16記載のプログラム変換処理装置。
  19.  前記解析部は、前記使用態様として前記命令区間の呼び出される回数を解析し、
     前記再利用度生成部は、前記解析の結果に基づいて前記再利用度を生成する
    請求項16記載のプログラム変換処理装置。
  20.  前記命令区間は関数であり、前記解析部は前記使用態様として前記関数の入力値および呼び出される回数を解析し、
     前記再利用度生成部は、前記解析の結果に基づいて前記再利用度を生成する
    請求項16記載のプログラム変換処理装置。
  21.  前記命令区間はループであり、前記解析部は前記使用態様として前記ループの入力値および呼び出される回数を解析し、
     前記再利用度生成部は、前記解析の結果に基づいて前記再利用度を生成する
    請求項16記載のプログラム変換処理装置。
  22.  前記解析部は、前記使用態様として前記命令区間の前記入力値がメモリアクセスを伴うか否かを解析し、
     前記再利用度生成部は、前記命令区間の前記入力値がメモリアクセスを伴う場合には当該メモリアクセスを伴わない前記入力値を用いる場合と比較して低い前記度合いを示す前記再利用度を生成する
    請求項16記載のプログラム変換処理装置。
  23.  前記命令変換部は、前記再利用度と前記命令区間の前記実行結果を保持するためのデータである実行履歴のデータ量と前記実行履歴が保持される履歴メモリの容量とに基づいて、前記命令区間の前記データ量の総和が前記履歴メモリの容量以内となるように前記再利用度が最も高い前記命令区間から順に前記呼出し命令を前記再利用命令に変換する請求項16記載のプログラム変換処理装置。
  24.  前記実行履歴が前記履歴メモリに保持される際の優先度を前記再利用度に基づいて生成する優先度生成部をさらに具備し、
     前記命令変換部は、前記命令区間の呼出し命令を前記優先度が含まれる前記再利用命令に変換する請求項16記載のプログラム変換処理装置。
  25.  複数の命令区間のうち実行結果が再び利用される再利用区間を指定する再利用命令により呼び出された前記再利用区間における処理を実行し、前記再利用区間の区間識別情報と前記再利用区間の入力値と前記再利用区間の実行結果とを実行履歴として出力する実行部と、
     前記実行履歴を保持する履歴メモリと
    を具備するデータ処理装置。
  26.  前記実行部は、前記複数の命令区間のうち再び利用される度合いに基づいて抽出された命令区間を指定する前記再利用命令により呼び出された前記再利用区間における処理を実行し、前記実行履歴を出力する請求項25記載のデータ処理装置。
  27.  前記再利用区間は関数であり、前記実行部は、前記区間情報と前記再利用区間の入力値と前記再利用区間の実行結果として前記関数の開始アドレスと前記関数の入力値と前記関数の実行結果とを出力する請求項26記載のデータ処理装置。
  28.  前記再利用区間はループであり、前記実行部は、前記区間情報と前記再利用区間の入力値と前記再利用区間の実行結果として前記ループの開始アドレスと前記ループの入力値と前記ループの実行結果とを出力する請求項26記載のデータ処理装置。
  29.  前記区間識別情報と前記再利用区間の入力値とを用いて前記履歴メモリから前記実行結果が検索された場合には前記実行結果を出力する履歴検索部をさらに具備する請求項25記載のデータ処理装置。
  30.  前記実行結果が再利用される度合いの順位を示す優先度および前記実行履歴の前記履歴メモリにおけるアドレスを優先度情報として保持する優先度テーブルと、
     前記優先度テーブルから前記優先度が最も低い前記優先度情報を消去候補情報として検索する最低優先度履歴検索部と、
     前記実行部が前記履歴メモリに新たな実行履歴を保持しようとしている場合には前記消去候補情報の前記優先度と前記新たな実行履歴の前記優先度とを比較する優先度比較部と、
     前記消去候補情報の前記優先度が前記新たな実行履歴の前記優先度より低い場合には前記消去候補情報の前記アドレスに基づいて前記実行履歴を前記履歴メモリから消去する消去部と
    をさらに具備する請求項25記載のデータ処理装置。
  31.  前記履歴メモリの空き容量を管理する履歴メモリ管理部をさらに具備し、
     前記優先度比較部は、前記新たな実行履歴のデータ量が前記履歴メモリの空き容量よりも大きい場合には前記消去候補情報の前記優先度と前記新たな実行履歴の前記優先度とを比較する請求項30記載のデータ処理装置。
  32.  プログラムにおける命令区間の使用態様を解析する解析手順と、
     前記命令区間の実行結果が再び利用される度合いを示す再利用度を前記解析の結果に基づいて生成する再利用度生成手順と、
     前記命令区間の呼出し命令を前記再利用度に基づいて再利用命令に変換する命令変換手順と
    を具備するプログラム変換処理方法。
  33.  複数の命令区間のうち実行結果が再び利用される再利用区間を指定する再利用命令により呼び出された前記再利用区間における処理を実行し、前記再利用区間の区間識別情報と前記再利用区間の入力値と前記再利用区間の実行結果とを実行履歴として出力する実行手順を具備するデータ処理方法であって、
     前記実行履歴を保持する履歴メモリを備えるコンピュータにおけるデータ処理方法。
  34.  複数の命令区間が含まれる命令列に基づく処理を実行部と、
     前記命令区間を呼び出すための呼出し命令が実行される前に前記命令区間の入力値を設定するための入力値設定命令のアドレスである入力値設定命令アドレスを前記命令区間の区間識別情報ごとに保持する入力値設定命令アドレステーブルと、
     前記区間識別情報ごとに前記命令区間における入力値および実行結果を関連付けて実行履歴として保持する履歴メモリと、
     前記入力値設定命令アドレスにより特定された前記入力値設定命令から前記呼出し命令までの命令群のうちの前記入力値設定命令に基づいて前記実行部から出力された入力値と前記入力値設定命令アドレスに対応する前記区間識別情報とを用いて前記実行履歴における前記実行結果を検索する実行履歴検索部と、
     前記入力値設定命令アドレスによって特定される前記呼出し命令が実行されるときに前記実行履歴検索部により前記実行結果が抽出された場合には前記抽出された実行結果を前記実行部に出力する実行結果出力部と
    を具備するデータ処理装置。
  35.  前記入力値設定命令アドレステーブルは、前記複数の命令区間のうち複数回実行される命令区間である再利用区間の入力値を設定するための前記入力値設定命令の前記入力値設定命令アドレスを前記再利用区間の前記区間識別情報ごとに保持し、
     実行履歴検索部は、前記再利用区間における前記命令群のうちの前記入力値設定命令に基づいて前記実行部から出力された前記入力値と前記入力値設定命令アドレスに対応する前記区間識別情報とを用いて前記再利用区間における前記実行結果を検索し、
     実行結果出力部は、前記入力値設定命令アドレスによって特定される前記再利用区間の前記呼出し命令が実行されるときに前記実行履歴検索部により前記実行履歴における前記再利用区間の前記実行結果が抽出された場合には前記抽出された実行結果を前記実行部に出力する
    請求項34記載のデータ処理装置。
  36.  前記入力値設定命令に基づいて設定された入力値のうち前記呼出し命令により呼び出された前記命令区間において参照された入力値に対応する前記入力値設定命令アドレスと前記区間識別情報とを前記入力値設定命令アドレステーブルに出力する入力値設定命令アドレス出力部をさらに具備する請求項34記載のデータ処理装置。
  37.  前記入力値設定命令アドレス出力部は、前記命令区間において参照された複数の入力値に対応する前記入力値設定命令のうち最先の前記入力値設定命令の前記入力値設定命令アドレスと前記区間識別情報である前記命令区間の先頭アドレスとを出力する請求項36記載のデータ処理装置。
  38.  前記入力値設定命令アドレステーブルは、前記命令区間における複数の入力値を設定するための入力値設定命令のうち最先の前記入力値設定命令の前記入力値設定命令アドレスを前記区間識別情報ごとに保持する請求項34記載のデータ処理装置。
  39.  前記実行部は、前記実行履歴検索部により前記実行履歴における前記実行結果が前記履歴メモリから抽出されない場合には前記入力値設定命令アドレスによって特定された前記命令区間における処理を実行し、
     前記実行履歴検索部は、前記入力値設定命令に基づいて前記実行部から出力された入力値と前記実行部により実行された実行結果と前記入力値設定命令アドレスに対応する前記区間識別情報とを前記履歴メモリに保持させる
    請求項34記載のデータ処理装置。
  40.  前記入力値設定命令アドレステーブルは、前記命令区間である関数の前記入力値設定命令の前記入力値設定命令アドレスを前記区間識別情報である前記関数の先頭アドレスごとに保持し、
     前記履歴メモリは、前記関数の先頭アドレスごとに前記関数における入力値および実行結果を関連付けて前記実行履歴として保持し、
     前記実行履歴検索部は、前記命令群のうちの前記入力値設定命令に基づいて前記実行部から出力された前記関数の前記入力値と前記入力値設定命令アドレスに対応する前記関数の先頭アドレスとを用いて前記実行結果を検索し、
     前記実行結果出力部は、前記入力値設定命令アドレスによって特定される前記関数の前記呼出し命令が実行されるときに前記実行履歴検索部により前記関数の前記実行結果が抽出された場合には前記抽出された実行結果を前記実行部に出力する
    請求項34記載のデータ処理装置。
  41.  プログラムのうち複数回実行される命令区間における処理の実行ごとの入力値が互いに一致する度合いを示す再利用度を前記命令区間の使用態様に基づいて前記命令区間ごとに生成する再利用度生成部と、
     前記複数の命令区間のうち前記再利用度に基づいて抽出された再利用区間における入力値を設定するための入力値設定命令の入力値設定命令アドレスと前記再利用区間を識別するための区間識別情報とが関連付けられた再利用区間情報を生成する再利用区間情報生成部と
    を具備するプログラム解析処理装置。
  42.  複数の命令区間が含まれる命令列に基づく処理を実行する実行部と、前記命令区間を呼び出すための呼出し命令の実行前に前記命令区間の入力値を設定するための入力値設定命令の入力値設定命令アドレスを前記命令区間の区間識別情報ごとに保持する入力値設定命令アドレステーブルと、前記区間識別情報ごとに前記命令区間における入力値および実行結果を関連付けて実行履歴として保持する履歴メモリとを備えるデータ処理装置におけるデータ処理方法であって、
     前記入力値設定命令アドレスにより特定された前記入力値設定命令から前記呼出し命令までの命令群のうちの前記入力値設定命令に基づいて前記実行部から出力された入力値と前記入力値設定命令アドレスに対応する前記区間識別情報とを用いて前記実行履歴における前記実行結果を検索する実行履歴検索手順と、
     前記入力値設定命令アドレスによって特定される前記呼出し命令が実行されるときに前記実行履歴検索手順により前記実行結果が抽出された場合には前記抽出された実行結果を前記実行部に出力する実行結果出力手順と
    を具備するデータ処理方法。
  43.  プログラムのうち複数回実行される命令区間の各々の実行結果が互いに一致する度合いを示す再利用度を前記命令区間の使用態様に基づいて前記命令区間ごとに生成する再利用度生成手順と、
     前記複数の命令区間のうち前記再利用度に基づいて抽出された再利用区間における入力値を設定するための入力値設定命令の入力値設定命令アドレスと前記再利用区間を識別するための区間識別情報とが関連付けられた再利用区間情報を生成する再利用区間情報生成手順と
    を具備するプログラム解析処理方法。
  44.  命令区間を実行して実行結果を出力する実行部と、
     前記命令区間のうち実行結果が再び利用される再利用区間の区間識別情報と入力値と実行結果とを実行履歴として保持し、前記保持した実行結果が再び利用される場合には前記区間識別情報および前記入力値に基づいて前記実行履歴が検索される履歴メモリと、
     前記再利用区間のうち実行が反復される反復再利用区間の各回の前記実行結果を前記履歴メモリから退避させるための退避履歴を保持する退避履歴保持部と、
     前記反復再利用区間の前記実行履歴に基づいて前記退避履歴を前記退避履歴保持部に供給し、前記退避履歴の供給の際に前記退避履歴の基となった前記実行履歴を前記履歴メモリから消去して前記退避履歴を指し示す情報を含む代表履歴を前記履歴メモリに保持させる履歴制御部と
    を備えるデータ処理装置。
  45.  前記履歴制御部は、前記履歴メモリに保持させる新たな前記実行履歴のデータ量が前記履歴メモリの空き容量よりも大きい場合には前記退避履歴を前記退避履歴保持部に供給する請求項44記載のデータ処理装置。
  46.  前記退避履歴および前記代表履歴に基づいて前記実行履歴を前記履歴メモリに復元する履歴復元部と、
     前記区間識別情報および前記入力値に基づいて前記復元された前記実行履歴を前記履歴メモリから検索した場合には前記復元された前記実行履歴に基づいて前記実行結果を出力する履歴検索部と
    をさらに備える請求項44記載のデータ処理装置。
  47.  前記履歴検索部は、前記区間識別情報および前記入力値に基づいて検索された前記実行履歴が前記代表履歴であった場合には前記復元部に前記実行履歴の復元を開始させる請求項46記載のデータ処理装置。
  48.  前記履歴制御部は、前記退避履歴の個数を示す退避カウントをさらに含む前記代表履歴を生成し、
     前記履歴復元部は、前記代表履歴における前記退避履歴を指し示す情報および前記退避カウントに基づいて前記退避履歴を前記退避履歴保持部から抽出して前記実行履歴を復元する
    請求項46記載のデータ処理装置。
  49.  前記実行部は、前記再利用区間の前記実行結果を供給する場合には前記反復再利用区間の前記実行履歴と前記反復再利用区間以外の前記実行履歴と前記代表履歴とを識別するための識別子をさらに出力し、
     前記履歴メモリは、前記識別子を前記実行履歴としてさらに保持し、
     前記履歴制御部は、前記識別子を用いて識別した前記実行履歴に基づいて前記退避履歴を供給し、前記識別子をさらに含む前記代表履歴を生成する
    請求項44記載のデータ処理装置。
  50.  前記反復再利用区間はサブルーチンであり、前記実行部は、前記サブルーチンの開始アドレスを前記区間識別情報として出力する請求項44記載のデータ処理装置。
  51.  前記反復再利用区間はループであり、前記実行部は、前記ループの開始アドレスを前記区間識別情報として出力する請求項44記載のデータ処理装置。
  52.  前記実行部は、前記反復再利用区間の前記実行結果を出力する場合には何回目の実行による前記実行結果であるかを示すカウンタ値をさらに出力し、
     前記履歴メモリは、前記カウンタ値を前記実行履歴としてさらに保持し、
     前記履歴制御部は、前記カウンタ値を含む前記退避履歴を出力する
    請求項8記載のデータ処理装置。
  53.  実行結果が再び利用される再利用区間の区間識別情報と入力値と実行結果とを実行履歴として保持し、前記保持した実行結果が再び利用される場合には前記区間識別情報および前記入力値に基づいて前記実行履歴が検索される履歴メモリと、
     前記再利用区間のうち実行が反復される反復再利用区間の各回の前記実行結果を退避履歴として前記履歴メモリから外部の記憶部に退避させ、前記退避の際に前記退避履歴の基となった前記実行履歴を前記履歴メモリから消去して前記退避履歴を指し示す情報を含む代表履歴を前記履歴メモリに保持させる履歴制御部と
    を備える履歴保存装置。
  54.  命令区間のうち実行結果が再び利用される再利用区間の区間識別情報と入力値と実行結果とを実行履歴として保持し、前記保持した実行結果が再び利用される場合には前記区間識別情報および前記入力値に基づいて前記実行履歴が検索される履歴メモリと、
     前記再利用区間のうち実行が反復される反復再利用区間の各回の前記実行結果を前記履歴メモリから退避させるための退避履歴を保持する退避履歴保持部と
    を備えるコンピュータにおけるデータ処理方法であって、
     前記命令区間を実行して実行結果を出力する実行手順と、
     前記反復再利用区間の前記実行履歴に基づいて前記退避履歴を前記退避履歴保持部に供給し、前記退避履歴の供給の際に前記退避履歴の基となった前記実行履歴を前記履歴メモリから消去して前記退避履歴を指し示す情報を含む代表履歴を前記履歴メモリに保持させる履歴制御手順と
    を備えるデータ処理方法。
  55.  命令区間のうち実行結果が再び利用される再利用区間の区間識別情報と入力値と実行結果とを実行履歴として保持し、前記保持した実行結果が再び利用される場合には前記区間識別情報および前記入力値に基づいて前記実行履歴が検索される履歴メモリと、
     前記再利用区間のうち実行が反復される反復再利用区間の各回の前記実行結果を前記履歴メモリから退避させるための退避履歴を保持する退避履歴保持部と
    を備えるコンピュータにおけるプログラムであって、
     前記命令区間を実行して実行結果を出力する実行手順と、
     前記反復再利用区間の前記実行履歴に基づいて前記退避履歴を前記退避履歴保持部に供給し、前記退避履歴の供給の際に前記退避履歴の基となった前記実行履歴を前記履歴メモリから消去して前記退避履歴を指し示す情報を含む代表履歴を前記履歴メモリに保持させる履歴制御手順と
    をコンピュータに実行させるプログラム。
  56.  プログラムにおける複数の命令区間の使用態様を解析して前記命令区間のうち実行結果が再び利用される再利用区間を判別する解析部と、
     前記再利用区間の開始アドレスのビット幅より狭いビット幅の値により前記再利用区間を識別する区間識別値を生成するための区間識別値生成関数の候補である候補関数を用いることによって、前記区間識別値の候補である候補値を前記候補関数に関連付けて前記開始アドレスから生成する候補値生成部と、
     前記候補値生成部により生成された前記候補値を前記関連付けられた候補関数ごとに候補値リストとして保持する候補値テーブルと、
     前記候補値が全て互いに異なる前記候補値リストを抽出し、この抽出された候補値リストのうち前記候補値のビット幅に基づいて選択された候補値リストの前記関連付けられた候補関数を前記区間識別値生成関数として出力する区間識別値生成関数出力部と、
     前記区間識別値生成関数が埋め込まれた機械語プログラムを前記解析されたプログラムおよび前記区間識別値生成関数に基づいて生成する機械語プログラム生成部と
    を具備するコンパイル処理装置。
  57.  前記候補関数は、ハッシュ関数であり、
     前記区間識別値生成関数出力部は、前記抽出された候補値リストのうち前記候補値のビット幅に基づいて選択された候補値リストの前記関連付けられたハッシュ関数を前記区間識別値生成関数として出力する
    請求項56記載のコンパイル処理装置。
  58.  前記ハッシュ関数は、前記開始アドレスの最下位ビットから所定の数のビットにおける値を前記候補値とするハッシュ関数であり、
     前記区間識別値生成関数出力部は、前記抽出された候補値リストのうち前記候補値のビット幅に基づいて選択された候補値リストの前記関連付けられたハッシュ関数を前記区間識別値生成関数として出力する
    請求項57記載のコンパイル処理装置。
  59.  前記区間識別値生成関数出力部は、前記抽出された候補値リストのうちビット幅が最も狭い前記候補値の候補値リストの前記関連付けられた候補関数を前記区間識別値生成関数として出力する請求項56記載のコンパイル処理装置。
  60.  前記区間識別値生成関数出力部は、前記区間識別値生成関数として前記区間識別値生成関数を識別するための識別子を出力し、
     前記機械語プログラム生成部は、前記識別子が埋め込まれた機械語プログラムを生成する
    請求項56記載のコンパイル処理装置。
  61.  複数の命令区間を実行して実行結果を出力する実行部と、
     前記命令区間のうち実行結果が再び利用される再利用区間の開始アドレスのビット幅より狭いビット幅の値により前記再利用区間を識別する区間識別値とその前記再利用区間の入力値とその前記再利用区間の実行結果とを実行履歴として保持する履歴メモリと、
     前記区間識別値および前記入力値に基づいて前記履歴メモリから前記実行履歴を検索し、前記実行履歴が検索された場合には前記実行結果を出力する履歴検索部と
    を具備するデータ処理装置。
  62.  前記実行部が前記再利用区間を実行したときに前記開始アドレスを出力した場合には、前記区間識別値を生成するための区間識別値生成関数を用いて前記開始アドレスから前記区間識別値を生成する区間識別値生成部をさらに具備し、
     前記実行部は、前記区間識別値生成部に前記区間識別値生成関数を供給し、
     前記履歴メモリは、前記区間識別値生成部により生成された前記区間識別値と前記入力値と前記実行結果とを前記実行履歴として保持し、
     前記履歴探索部は、前記区間識別値と前記入力値とに基づいて前記履歴メモリから前記実行履歴を検索し、前記実行履歴が検索された場合には前記実行結果を出力する
    請求項61記載のデータ処理装置。
  63.  前記実行部は、前記区間識別値生成関数を前記区間識別値生成部に供給し、
     前記区間識別値生成部は、前記実行部が前記再利用区間を実行したときに前記開始アドレスを出力した場合には、前記実行部から供給された前記区間識別値生成関数を用いて前記開始アドレスから前記区間識別値を生成する
    請求項62記載のデータ処理装置。
  64.  前記実行部は、前記区間識別値生成関数を識別する識別子を前記区間識別値生成部に供給し、
     前記区間識別値生成部は、前記区間識別値生成関数の候補である候補関数から前記区間識別値生成関数を前記識別子に基づいて選択し、前記実行部が前記再利用区間を実行したときに前記開始アドレスを出力した場合には前記選択した区間識別値生成関数を用いて前記開始アドレスから前記区間識別値を生成する
    請求項62記載のデータ処理装置。
  65.  前記実行部は、前記区間識別値が含まれる命令により前記再利用区間を実行した場合には前記区間識別値を前記履歴メモリに供給し、
     前記履歴メモリは、前記区間識別値と前記入力値と前記実行結果とを前記実行履歴として保持し、
     前記履歴探索部は、前記区間識別値と前記入力値とに基づいて前記履歴メモリから前記実行履歴を検索し、前記実行履歴が検索された場合には前記実行結果を出力する
    請求項61記載のデータ処理装置。
  66.  プログラムにおける複数の命令区間の使用態様を解析して前記命令区間のうち実行結果が再び利用される再利用区間を判別する解析部と、
     前記再利用区間の開始アドレスのビット幅より狭いビット幅の値により前記再利用区間を識別する区間識別値を生成するための区間識別値生成関数の候補である候補関数を用いることによって、前記区間識別値の候補である候補値を前記候補関数に関連付けて生成する候補値生成部と、
     前記候補値生成部により生成された前記候補値を前記関連付けられた候補関数ごとに候補値リストとして保持する候補値テーブルと、
     前記候補値が全て互いに異なる前記候補値リストを抽出し、この抽出された候補値リストのうち前記候補値のビット幅に基づいて選択された候補値リストの前記候補値を前記区間識別値として出力する区間識別値出力部と、
     前記再利用区間を呼び出す命令を前記区間識別値が含まれる区間識別値付命令に変換する命令変換部と、
     前記再利用区間が前記区間識別値付命令により呼び出される機械語プログラムを前記区間識別値付命令が含まれるソースプログラムに基づいて生成する機械語プログラム生成部と
    を具備するコンパイル処理装置。
  67.  前記候補値生成部は、前記開始アドレスの所定の順序に従って付与された番号を入力の値とする前記候補関数を用いることによって前記候補値を生成する請求項66記載のコンパイル処理装置。
  68.  前記候補値生成部は、前記開始アドレスを入力の値とする前記候補関数を用いることによって前記候補値を生成する請求項66記載のコンパイル処理装置。
  69.  複数の命令区間を実行して実行結果を出力する実行部と、
     前記再利用区間の開始アドレスのビット幅より狭いビット幅の値により前記再利用区間を識別する区間識別値を生成するための区間識別値生成関数の候補である候補関数を用いることによって、前記区間識別値の候補である候補値を前記候補関数に関連付けて前記開始アドレスから生成する候補値生成部と、
     前記候補値生成部により生成された前記候補値を前記関連付けられた候補関数ごとに候補値リストとして保持する候補値テーブルと、
     前記候補値が全て互いに異なる前記候補値リストを抽出し、この抽出された候補値リストのうち前記候補値のビット幅に基づいて選択された候補値リストの前記関連付けられた候補関数を区間識別値生成関数として出力する区間識別値生成関数出力部と、
     前記実行部が前記再利用区間を実行したときに前記開始アドレスが出力された場合には前記区間識別値生成関数を用いて前記開始アドレスから前記区間識別値を生成する区間識別値生成部と、
     前記再利用区間の前記区間識別値と入力値と実行結果とを実行履歴として保持する履歴メモリと、
     前記区間識別値および前記入力値に基づいて前記履歴メモリから前記実行履歴を検索し、前記実行履歴が検索された場合には前記実行結果を出力する履歴検索部と
    を具備するデータ処理装置。
  70.  区間識別値の候補である候補値を前記候補値を生成した候補関数ごとに候補値リストとして保持する候補値テーブルを備えるコンピュータにおけるデータ処理方法であって、
     プログラムにおける複数の命令区間の使用態様を解析して前記命令区間のうち実行結果が再び利用される再利用区間を判別する解析手順と、
     前記再利用区間の開始アドレスのビット幅より狭いビット幅の値により前記再利用区間を識別する前記区間識別値を生成するための区間識別値生成関数の候補である前記候補関数を用いることによって、前記区間識別値の候補である前記候補値を前記候補関数に関連付けて前記開始アドレスから生成する候補値生成手順と、
     前記候補値が全て互いに異なる前記候補値リストを抽出し、この抽出された候補値リストのうち前記候補値のビット幅に基づいて選択された候補値リストの前記関連付けられた候補関数を前記区間識別値生成関数として出力する区間識別値生成関数出力手順と、
     前記区間識別値生成関数が埋め込まれた機械語プログラムを前記解析されたプログラムおよび前記区間識別値生成関数に基づいて生成する機械語プログラム生成手順と
    を具備するコンパイル処理方法。
  71.  区間識別値の候補である候補値を前記候補値を生成した候補関数ごとに候補値リストとして保持する候補値テーブルを備えるコンピュータにおけるプログラムであって、
     プログラムにおける複数の命令区間の使用態様を解析して前記命令区間のうち実行結果が再び利用される再利用区間を判別する解析手順と、
     前記再利用区間の開始アドレスのビット幅より狭いビット幅の値により前記再利用区間を識別する前記区間識別値を生成するための区間識別値生成関数の候補である前記候補関数を用いることによって、前記区間識別値の候補である前記候補値を前記候補関数に関連付けて前記開始アドレスから生成する候補値生成手順と、
     前記候補値が全て互いに異なる前記候補値リストを抽出し、この抽出された候補値リストのうち前記候補値のビット幅に基づいて選択された候補値リストの前記関連付けられた候補関数を前記区間識別値生成関数として出力する区間識別値生成関数出力手順と、
     前記区間識別値生成関数が埋め込まれた機械語プログラムを前記解析されたプログラムおよび前記区間識別値生成関数に基づいて生成する機械語プログラム生成手順と
    をコンピュータに実行させるプログラム。
PCT/JP2010/063246 2009-08-13 2010-08-05 データ処理装置、データ処理方法、プログラム変換処理装置およびプログラム変換処理方法、プログラム変換処理装置、データ処理装置、プログラム変換処理方法およびデータ処理方法、データ処理装置、データ処理方法、プログラム解析処理装置およびプログラム解析処理方法、データ処理装置、履歴保存装置、データ処理方法およびプログラム、並びに、コンパイル処理装置、データ処理装置、コンパイル処理方法およびプログラム WO2011018974A1 (ja)

Priority Applications (3)

Application Number Priority Date Filing Date Title
EP10808157A EP2466453A1 (en) 2009-08-13 2010-08-05 Data processing device, data processing method, program conversion processing device, and program conversion processing method, program conversion processing device, data processing device, program conversion processing method, and data processing method, data processing device, data processing method, program analysis processing device, and program analysis processing method, data processing device, history storing device, data processing method, and program, and compile processing device, data processing device, compile processing method, and program
CN2010800349313A CN102667715A (zh) 2009-08-13 2010-08-05 数据处理设备、数据处理方法、程序转换处理设备和程序转换处理方法、程序转换处理设备、数据处理设备、程序转换处理方法和数据处理方法、数据处理设备、数据处理方法、程序分析处理设备和程序分析处理方法、数据处理设备、历史保存设备、数据处理方法和程序、以及编译处理设备
US13/389,134 US20120185859A1 (en) 2009-08-13 2010-08-05 Methods and systems for program analysis and program conversion

Applications Claiming Priority (10)

Application Number Priority Date Filing Date Title
JP2009187623A JP2011039857A (ja) 2009-08-13 2009-08-13 プログラム変換処理装置、データ処理装置、プログラム変換処理方法およびデータ処理方法
JP2009187622A JP2011039856A (ja) 2009-08-13 2009-08-13 データ処理装置、データ処理方法、プログラム変換処理装置およびプログラム変換処理方法
JP2009-187625 2009-08-13
JP2009187625A JP2011039859A (ja) 2009-08-13 2009-08-13 データ処理装置、履歴保存装置、データ処理方法およびプログラム
JP2009-187622 2009-08-13
JP2009-187624 2009-08-13
JP2009187624A JP2011039858A (ja) 2009-08-13 2009-08-13 データ処理装置、データ処理方法、プログラム解析処理装置およびプログラム解析処理方法
JP2009-187623 2009-08-13
JP2009251586A JP2011096153A (ja) 2009-11-02 2009-11-02 コンパイル処理装置、データ処理装置、コンパイル処理方法およびプログラム
JP2009-251586 2009-11-02

Publications (1)

Publication Number Publication Date
WO2011018974A1 true WO2011018974A1 (ja) 2011-02-17

Family

ID=43586152

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2010/063246 WO2011018974A1 (ja) 2009-08-13 2010-08-05 データ処理装置、データ処理方法、プログラム変換処理装置およびプログラム変換処理方法、プログラム変換処理装置、データ処理装置、プログラム変換処理方法およびデータ処理方法、データ処理装置、データ処理方法、プログラム解析処理装置およびプログラム解析処理方法、データ処理装置、履歴保存装置、データ処理方法およびプログラム、並びに、コンパイル処理装置、データ処理装置、コンパイル処理方法およびプログラム

Country Status (6)

Country Link
US (1) US20120185859A1 (ja)
EP (1) EP2466453A1 (ja)
KR (1) KR20120068824A (ja)
CN (1) CN102667715A (ja)
TW (1) TW201124910A (ja)
WO (1) WO2011018974A1 (ja)

Families Citing this family (24)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8789030B2 (en) 2012-09-18 2014-07-22 Concurix Corporation Memoization from offline analysis
US9563409B2 (en) * 2012-11-05 2017-02-07 Xerox Corporation Systems and methods for managing duplication of operations
US9262416B2 (en) 2012-11-08 2016-02-16 Microsoft Technology Licensing, Llc Purity analysis using white list/black list analysis
US8839204B2 (en) 2012-11-08 2014-09-16 Concurix Corporation Determination of function purity for memoization
US8752034B2 (en) 2012-11-08 2014-06-10 Concurix Corporation Memoization configuration file consumed at runtime
US8752021B2 (en) 2012-11-08 2014-06-10 Concurix Corporation Input vector analysis for memoization estimation
US8656378B2 (en) 2012-11-08 2014-02-18 Concurix Corporation Memoization configuration file consumed at compile time
US9612795B2 (en) * 2013-03-14 2017-04-04 Semiconductor Energy Laboratory Co., Ltd. Data processing device, data processing method, and computer program
WO2014188502A1 (ja) * 2013-05-21 2014-11-27 株式会社日立製作所 管理システム、管理プログラム及び管理方法
US20150078375A1 (en) * 2013-09-13 2015-03-19 Broadcom Corporation Mutable Hash for Network Hash Polarization
EP2869145B1 (de) * 2013-10-29 2016-04-27 dSPACE digital signal processing and control engineering GmbH Verfahren zur Beeinflussung eines Steuerprogramms eines Steuergerätes
US9933841B2 (en) * 2014-04-17 2018-04-03 Arm Limited Reuse of results of back-to-back micro-operations
US9652397B2 (en) * 2014-04-23 2017-05-16 Texas Instruments Incorporated Dynamic power reduction and performance improvement in caches using fast access
US10528565B2 (en) * 2015-01-30 2020-01-07 Quest Software Inc. Logical level predictive caching in relational databases
US11176096B2 (en) * 2015-08-24 2021-11-16 International Business Machines Corporation File system for genomic data
US10417331B2 (en) * 2016-03-18 2019-09-17 Vmware, Inc. System and method for processing command line interface commands
WO2017204139A1 (ja) * 2016-05-23 2017-11-30 日本電気株式会社 データ処理装置、データ処理方法、およびプログラム記録媒体
US10860715B2 (en) * 2016-05-26 2020-12-08 Barracuda Networks, Inc. Method and apparatus for proactively identifying and mitigating malware attacks via hosted web assets
US10635492B2 (en) * 2016-10-17 2020-04-28 International Business Machines Corporation Leveraging shared work to enhance job performance across analytics platforms
US10467028B2 (en) * 2017-03-21 2019-11-05 Intel Corporation Technologies for memory margin aware reliable software execution
JP6900265B2 (ja) * 2017-07-20 2021-07-07 株式会社日立製作所 データ分析システム、及びデータ分析方法
US10489056B2 (en) 2017-11-09 2019-11-26 Nvidia Corporation Queue manager for streaming multiprocessor systems
CN113448891B (zh) * 2020-03-25 2023-07-21 澜起科技股份有限公司 存储器控制器以及用于监测对存储模块的访问的方法
CN112988391B (zh) * 2021-03-30 2023-08-01 北京字跳网络技术有限公司 数据处理方法、装置、设备和存储介质

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030204666A1 (en) * 2000-06-29 2003-10-30 Youfeng Wu Management of reuse invalidation buffer for computation reuse
JP2004258905A (ja) 2003-02-25 2004-09-16 Japan Science & Technology Agency データ処理装置、データ処理プログラム、およびデータ処理プログラムを記録した記録媒体
JP2005092354A (ja) * 2003-09-12 2005-04-07 Japan Science & Technology Agency データ処理装置、データ処理プログラム、およびデータ処理プログラムを記録した記録媒体

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TW470915B (en) * 1996-03-12 2002-01-01 Matsushita Electric Ind Co Ltd Optimization apparatus which removes transfer instructions by a global analysis of equivalence relations
US6810474B1 (en) * 1998-03-04 2004-10-26 Hitachi, Ltd. Information processor
JP4254954B2 (ja) * 2004-03-29 2009-04-15 独立行政法人科学技術振興機構 データ処理装置
EP1731998A1 (en) * 2004-03-29 2006-12-13 Kyoto University Data processing device, data processing program, and recording medium containing the data processing program

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030204666A1 (en) * 2000-06-29 2003-10-30 Youfeng Wu Management of reuse invalidation buffer for computation reuse
JP2004258905A (ja) 2003-02-25 2004-09-16 Japan Science & Technology Agency データ処理装置、データ処理プログラム、およびデータ処理プログラムを記録した記録媒体
JP3855076B2 (ja) 2003-02-25 2006-12-06 独立行政法人科学技術振興機構 データ処理装置、データ処理プログラム、およびデータ処理プログラムを記録した記録媒体
JP2005092354A (ja) * 2003-09-12 2005-04-07 Japan Science & Technology Agency データ処理装置、データ処理プログラム、およびデータ処理プログラムを記録した記録媒体

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
STEPHEN E. RICHARDSON: "Caching Function Results Faster or Arithmetic by Avoiding Unnecessary Computation", 1992, SUN MICROSYSTEMS LABORATORIES, INC.
TAKERU YOSHIKAWA ET AL.: "Improvement of the buffer replacement algorithm in value reuse mechanism", IPSJ SIG NOTES, vol. 2003, no. 102, 16 October 2003 (2003-10-16), pages 37 - 42, XP008151578 *
YASUHIKO NAKAJIMA ET AL.: "A Speedup Technique with Function Level Value Reuse and Parallel Precomputation", JOINT SYMPOSIUM ON PARALLEL PROCESSING, vol. 2002, no. 8, 29 May 2002 (2002-05-29), pages 269 - 276, XP008151678 *

Also Published As

Publication number Publication date
CN102667715A (zh) 2012-09-12
KR20120068824A (ko) 2012-06-27
TW201124910A (en) 2011-07-16
EP2466453A1 (en) 2012-06-20
US20120185859A1 (en) 2012-07-19

Similar Documents

Publication Publication Date Title
WO2011018974A1 (ja) データ処理装置、データ処理方法、プログラム変換処理装置およびプログラム変換処理方法、プログラム変換処理装置、データ処理装置、プログラム変換処理方法およびデータ処理方法、データ処理装置、データ処理方法、プログラム解析処理装置およびプログラム解析処理方法、データ処理装置、履歴保存装置、データ処理方法およびプログラム、並びに、コンパイル処理装置、データ処理装置、コンパイル処理方法およびプログラム
CN101965554B (zh) 选择性地提交已执行指令的结果的系统和方法
CN103250131B (zh) 包括用于早期远分支预测的影子缓存的单周期多分支预测
JP3901181B2 (ja) プログラム並列化装置及びその方法並びにプログラム
JP6160259B2 (ja) 文字列探索方法、文字列探索装置および文字列探索プログラム
JP2000148472A (ja) マイクロプロセッサ装置及びそのソフトウェア命令高速化方法並びにその制御プログラムを記録した記録媒体
JP4129981B2 (ja) コンパイラ、コンパイラプログラム、記録媒体、制御方法、及び中央処理装置
US8635434B2 (en) Mathematical operation processing apparatus for performing high speed mathematical operations
US9182960B2 (en) Loop distribution detection program and loop distribution detection method
US11442727B2 (en) Controlling prediction functional blocks used by a branch predictor in a processor
KR101645001B1 (ko) Vliw 명령어 생성 장치 및 그 방법과 vliw 명령어를 처리하는 vliw 프로세서 및 그 방법
JP4254954B2 (ja) データ処理装置
US10108405B2 (en) Compiling apparatus and compiling method
JP2011039857A (ja) プログラム変換処理装置、データ処理装置、プログラム変換処理方法およびデータ処理方法
JPWO2017204139A1 (ja) データ処理装置、データ処理方法、およびプログラム記録媒体
JP2011096153A (ja) コンパイル処理装置、データ処理装置、コンパイル処理方法およびプログラム
CN216527140U (zh) 一种分支预测的装置及处理器
CN113031952A (zh) 深度学习模型的执行代码的确定方法、装置及存储介质
JP2011039856A (ja) データ処理装置、データ処理方法、プログラム変換処理装置およびプログラム変換処理方法
CN116069602B (zh) 一种最坏情况执行时间分析方法和装置
JP2011039858A (ja) データ処理装置、データ処理方法、プログラム解析処理装置およびプログラム解析処理方法
CN116168765B (zh) 基于改进strobemer的基因序列生成方法及系统
CN114035848A (zh) 一种分支预测的方法、装置及处理器
JP3895314B2 (ja) データ処理装置、データ処理プログラム、およびデータ処理プログラムを記録した記録媒体
JP2011039859A (ja) データ処理装置、履歴保存装置、データ処理方法およびプログラム

Legal Events

Date Code Title Description
WWE Wipo information: entry into national phase

Ref document number: 201080034931.3

Country of ref document: CN

121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 10808157

Country of ref document: EP

Kind code of ref document: A1

WWE Wipo information: entry into national phase

Ref document number: 2010808157

Country of ref document: EP

ENP Entry into the national phase

Ref document number: 20127003143

Country of ref document: KR

Kind code of ref document: A

WWE Wipo information: entry into national phase

Ref document number: 13389134

Country of ref document: US

Ref document number: 1166/CHENP/2012

Country of ref document: IN

NENP Non-entry into the national phase

Ref country code: DE