WO2011018974A1 - データ処理装置、データ処理方法、プログラム変換処理装置およびプログラム変換処理方法、プログラム変換処理装置、データ処理装置、プログラム変換処理方法およびデータ処理方法、データ処理装置、データ処理方法、プログラム解析処理装置およびプログラム解析処理方法、データ処理装置、履歴保存装置、データ処理方法およびプログラム、並びに、コンパイル処理装置、データ処理装置、コンパイル処理方法およびプログラム - Google Patents
データ処理装置、データ処理方法、プログラム変換処理装置およびプログラム変換処理方法、プログラム変換処理装置、データ処理装置、プログラム変換処理方法およびデータ処理方法、データ処理装置、データ処理方法、プログラム解析処理装置およびプログラム解析処理方法、データ処理装置、履歴保存装置、データ処理方法およびプログラム、並びに、コンパイル処理装置、データ処理装置、コンパイル処理方法およびプログラム Download PDFInfo
- 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
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/30—Arrangements for executing machine instructions, e.g. instruction decode
- G06F9/38—Concurrent instruction execution, e.g. pipeline, look ahead
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/30—Arrangements for executing machine instructions, e.g. instruction decode
- G06F9/38—Concurrent instruction execution, e.g. pipeline, look ahead
- G06F9/3824—Operand accessing
- G06F9/383—Operand prefetching
- G06F9/3832—Value prediction for operands; operand history buffers
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/30—Arrangements for executing machine instructions, e.g. instruction decode
- G06F9/30003—Arrangements for executing specific machine instructions
- G06F9/30076—Arrangements for executing specific machine instructions to perform miscellaneous control operations, e.g. NOP
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/30—Arrangements for executing machine instructions, e.g. instruction decode
- G06F9/32—Address formation of the next instruction, e.g. by incrementing the instruction counter
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/30—Arrangements for executing machine instructions, e.g. instruction decode
- G06F9/38—Concurrent instruction execution, e.g. pipeline, look ahead
- G06F9/3802—Instruction prefetching
- G06F9/3808—Instruction prefetching for instruction reuse, e.g. trace cache, branch target cache
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/30—Arrangements for executing machine instructions, e.g. instruction decode
- G06F9/38—Concurrent instruction execution, e.g. pipeline, look ahead
- G06F9/3802—Instruction prefetching
- G06F9/3808—Instruction prefetching for instruction reuse, e.g. trace cache, branch target cache
- G06F9/381—Loop 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
Description
この値再利用技術では、プログラムの一部分である命令区間のうち、その命令区間における入力値が同じであれば実行結果も同じとなる命令区間における入力値と、その実行結果である出力値とを関連付けて再利用表に登録する。その後、同じ命令区間を再度実行する場合に、同一の入力値が再利用表に登録されていれば、その入力値に対応する出力値を再利用表から出力することによって、過去に実行された命令区間の実行結果を再利用する。このように、複数回実行される命令区間のうち、過去に実行された命令区間の実行結果を再利用することができる命令区間をここでは再利用区間という。
説明は以下の順序により行う。
1.第1の実施の形態(データ処理制御:識別情報を含む予告命令による実行結果の再利用処理の例)
2.第2の実施の形態(データ処理制御:参照情報を含む予告命令による実行結果の再利用処理の例)
3.第3の実施の形態(データ処理制御:予告設定命令による実行結果の再利用処理の例)
4.第4の実施の形態(プログラム変換制御:予告命令を含むプログラムの生成例)
[データ処理装置の構成例]
図1は、本発明の第1の実施の形態におけるデータ処理装置の一構成例を示すブロック図である。ここでは、集積回路を構成するデータ処理装置100と、バス120と、主記憶部130とが示されている。この集積回路は、主記憶部130からバス120を介して読み出される命令列に従って、データ処理装置100により処理を実行するものである。
また、この主記憶部130に記憶されているプログラムには、再利用区間である関数が実行される前に、関数における処理の実行を予告する予告命令が挿入されている。
図2は、本発明の第1の実施の形態におけるデータ処理部300および実行結果再利用処理部400の一構成例を示すブロック図である。ここでは、主記憶部130に予告命令が挿入されたプログラムが記憶されていることを想定している。
図3は、本発明の第1の実施の形態における履歴メモリ430のデータ構造の一例を示す概念図である。ここでは、履歴メモリ430により、複数の関数を互いに識別する識別情報ごとに保持された実行履歴のうち、1つの識別情報における実行履歴を木構造により保持する構成が示されている。この例では、引数がn個であり、かつ、実行結果である出力をm個の格納先に返す関数を想定している。また、ここでは、関数の先頭アドレスである関数アドレスを識別情報として用いることとする。
図4は、本発明の第1の実施の形態におけるデータ処理装置100において識別情報を含む予告命令を受け付けた場合におけるデータ処理装置100の動作概要を示す概念図である。図4の(a)は、アセンブリ言語により記述された命令列の一部を例示する図である。図4の(a)には、インデックス(index)を指定する予告命令(noticeCall)と、関数(func)を呼び出すコール命令(Call)とが示されている。
図5は、本発明の第1の実施の形態におけるデータ処理装置100により実行されるプログラムの一部を例示する図である。図5の(a)は、再利用区間として選択された関数のソースプログラムの一部の例を示す図である。図5の(b)は、図5の(a)に示したソースプログラムがMIPSのアセンブリ言語により変換された命令列の一部を例示する図である。
図6は、予告命令の実行により関数における処理時間が短縮される例を示す概念図である。図6の(a)は、予告命令のないプログラムの処理を実行する従来のデータ処理装置における実行結果の再利用による短縮時間を示す概念図である。図6の(b)は、本発明の第1の実施の形態におけるデータ処理装置100における実行結果の再利用による短縮時間を示す概念図である。
次に本発明の実施の形態におけるデータ処理装置100の動作について図面を参照して説明する。
[参照情報を含む予告命令によるデータ処理装置100の動作例]
図8は、本発明の第2の実施の形態におけるデータ処理装置100において参照情報を含む予告命令を受け付けた場合におけるデータ処理装置100の動作概要を示す概念図である。ここでは、履歴メモリ430の検索キーである識別情報として関数の先頭アドレスである関数アドレスを用いることを想定している。
図9は、本発明の第2の実施の形態におけるデータ処理装置100により実行されるプログラムの一部を例示する図である。図9の(a)は、再利用区間として選択された関数のソースプログラムの一部の例を示す図である。図5の(b)は、図5の(a)に示したソースプログラムがMIPSのアセンブリ言語により変換された命令列の一部を例示する図である。
[参照情報を含む予告命令によるデータ処理装置100の動作例]
図10は、本発明の第3の実施の形態におけるデータ処理装置100において予告設定命令を受け付けた場合におけるデータ処理装置100の動作概要を示す概念図である。ここでは、履歴メモリ430の検索キーである識別情報として関数の先頭アドレスである関数アドレスを用いることを想定している。
図11は、本発明の第3の実施の形態におけるデータ処理装置100により実行されるプログラムの一部を例示する図である。図11の(a)の上段には、5つの引数(a乃至e)を持つ関数(func)の呼出しが記述されている。下段には、イント(int)型の関数(func)の定義が記述されている。この関数(func)は、イント(int)型の引数として、第1の引数(a)、第2の引数(b)、第3の引数(c)、第4の引数(d)および第5の引数(e)を持つ。
[プログラム変換装置の構成例]
図12は、本発明の第4の実施の形態におけるプログラム変換処理装置の一機能構成例を示すブロック図である。プログラム変換処理装置500は、ソースプログラム記憶部510と、予告命令挿入コード生成部600と、オブジェクトプログラム記憶部520とを備える。なお、プログラム変換処理装置500は、特許請求の範囲に記載のプログラム変換処理装置の一例である。
図13は、本発明の第4の実施の形態におけるプログラム変換処理装置500により生成される予告命令のデータフォーマットを例示する図である。ここでは、MIPSの規定による32ビット命令のデータフォーマットに基づく予告命令の例について示す。
次に本発明の第4の実施の形態におけるプログラム変換処理装置500の動作について図面を参照して説明する。
図15は、本発明の第4の実施の形態における識別情報を含む予告命令についての予告命令処理(ステップS940)の処理手順の一例を示すフローチャートである。
図16は、本発明の第4の実施の形態における参照情報を含む予告命令についての予告命令処理(ステップS950)の処理手順の一例を示すフローチャートである。
図17は、本発明の第4の実施の形態における予告設定命令についての予告命令処理(ステップS960)の処理手順の一例を示すフローチャートである。
1.第1の実施の形態(コンパイル処理制御:実行履歴のデータ量の総和が履歴メモリの容量以内となるように呼出し命令を再利用命令に変換する例)
2.第2の実施の形態(データ処理制御:実行履歴のデータ量の総和が履歴メモリの容量以内となるように変換された再利用命令に基づいて実行履歴を保持する例)
3.第3の実施の形態(コンパイル処理制御:優先度を含む再利用命令に変換する例)
4.第4の実施の形態(データ処理制御:優先度を含む再利用命令に基づいて実行履歴を保持する例)
[コンパイル処理装置1500の構成例]
図18は、本発明の第1の実施の形態におけるコンパイル処理装置1500の構成例を示すブロック図である。このコンパイル処理装置1500は、ソースプログラム記憶部1510と、再利用アシストコンパイル処理部1520と、オブジェクトプログラム記憶部1530とを備える。また、ここでは、コンパイル処理装置1500が処理する命令区間は関数を想定するものとする。
図19は、本発明の第1の実施の形態において再利用候補区間抽出部1611が再利用候補区間を抽出する際に、再利用候補区間から除外される関数の一例を示す模式図である。ここでは、再利用候補区間抽出部1611により再利用候補区間から除外される関数が各枠の中にC言語のコードにより示されている。
次に、本発明の第1の実施の形態における再利用候補区間解析部1612により解析される命令区間の使用態様の一例および再利用度生成部1621により生成される再利用度の関係例について次図を参照して説明する。ここでは、再利用候補区間は関数であると想定する。また、再利用度が大きいものほど再利用される度合いが大きく、再利用命令変換部1623において優先的に呼出し命令が再利用命令に変換されるものとする。
図20は、本発明の第1の実施の形態における再利用候補区間解析部1612により引数の個数を使用態様として解析する場合における再利用度生成部1621による再利用度の生成例を示す模式図である。
図21は、本発明の第1の実施の形態における再利用候補区間解析部1612により引数の型を使用態様として解析する場合における再利用度生成部1621による再利用度の生成例を示す模式図である。
図22は、本発明の第1の実施の形態における再利用候補区間解析部1612により定数と変数とで異なる引数を使用態様として解析する場合における再利用度生成部1621による再利用度の生成例を示す模式図である。
図23は、本発明の第1の実施の形態における再利用候補区間解析部1612により引数の採る値の組合せを使用態様として解析する場合における再利用度生成部1621による再利用度の生成例を示す模式図である。
図24は、本発明の第1の実施の形態における再利用候補区間解析部1612により関数の呼び出される回数を使用態様として解析する場合における再利用度生成部1621による再利用度の生成例を示す模式図である。
図25は、本発明の第1の実施の形態における再利用候補区間解析部1612によりメモリアクセスを伴う引数の有無を使用態様として解析する場合における再利用度生成部1621による再利用度の生成例を示す模式図である。
次に、本発明の第1の実施の形態におけるプログラム変換処理部1600の動作について図面を参照して説明する。
次に、本発明の第1の実施の形態におけるコンパイル処理装置1500が生成する再利用命令について図面を参照して説明する。
次に、本発明の第1の実施の形態におけるコンパイル処理装置1500の処理について図面を参照して説明する。
[データ処理装置1100の構成例]
図29は、本発明の第2の実施の形態におけるデータ処理装置1100の構成例を示すブロック図である。このデータ処理装置1100は、バス1120を介して主記憶部1130と相互に接続されている。また、ここでは、データ処理装置1100が処理する命令区間は関数を想定するものとする。
図30は、本発明の第2の実施の形態におけるプロセッサコア1300および履歴管理部1400の構成例を示すブロック図である。ここでは、プロセッサコア1300および履歴管理部1400の機能は、図29と同様のものであるため、同一の符号を付してここでの説明を省略する。
図31は、本発明の第2の実施の形態における履歴メモリ1430のデータ構造の一例を示す概念図である。ここでは、履歴メモリ1430により、区間識別情報ごとに保持された実行履歴のうち、1つの区間識別情報における実行履歴を木構造により保持する構成が示されている。この例では、引数がn個であり、かつ、実行結果である出力をm個の格納先に返す関数を想定している。また、ここでは、関数の先頭アドレスである関数の開始アドレスを区間識別情報として用いることとする。
図32は、本発明の第2の実施の形態におけるプロセッサコア1300により処理されるプログラムおよび履歴管理部1400により保存される実行履歴の一例を示す概念図である。ここでは、従来技術を用いて実行履歴を保存する場合と、本発明の第2の実施の形態により実行履歴を保存する場合とが表されている。なお、ここでは、変換されたプログラムの実行は、ここで示したプログラムの上から順に実行されるものと想定する。
次に、本発明の第2の実施の形態におけるプロセッサコア1300および履歴管理部1400の処理について図面を参照して説明する。
[本発明の第3の実施の形態におけるコンパイル処理装置1500の構成例]
図34は、本発明の第3の実施の形態におけるコンパイル処理装置1500の構成例を示すブロック図である。このコンパイル処理装置1500は、図18において示したコンパイル処理装置1500の構成に加えて優先度生成部1622を備えている。ここでは、優先度生成部1622以外の構成は、図18と同様のものであるため、図18と同符号を付してここでの各部の構成の詳細な説明を省略する。
次に、本発明の第3の実施の形態におけるプログラム変換処理部1600の動作について次図を参照して説明する。
次に、本発明の第3の実施の形態におけるコンパイル処理装置1500が生成する再利用命令について図面を参照して説明する。
次に、本発明の第3の実施の形態におけるコンパイル処理装置1500の処理について図面を参照して説明する。
[プロセッサコア1300および履歴管理部1400の構成例]
図39は、本発明の第4の実施の形態におけるプロセッサコア1300および履歴管理部1400の構成例を示すブロック図である。ここでは、図30において示した構成に加えて、優先度テーブル1450、履歴メモリ容量管理部1460、および、低優先度履歴消去部1470を備えている。ここでは、優先度テーブル1450、履歴メモリ容量管理部1460、および、低優先度履歴消去部1470以外の構成の機能は、図30とほぼ同様のものであるため、図30と同符号を付してここでの詳細な説明を省略する。
図40は、本発明の第4の実施の形態における履歴メモリ1430のデータ構造の一例を示す概念図である。ここでは、履歴メモリ1430により、区間識別情報ごとに保持された実行履歴のうち、1つの区間識別情報における実行履歴を木構造により保持する構成が示されている。この例では、引数がn個であり、かつ、実行結果である出力をm個の格納先に返す関数を想定している。また、ここでは、関数の開始アドレスを区間識別情報として用いることとする。さらに、ここでは、m個目の出力のアドレスを優先度情報の登録された実行履歴のアドレスとすることとする。
図41は、本発明の第4の実施の形態における優先度テーブル1450のデータ構造の一例を示す概念図である。ここでは、一例として、1乃至6の優先度と、この優先度を含む再利用命令により生成された実行履歴に関するアドレスとが示されている。
図42は、本発明の第4の実施の形態におけるプロセッサコア1300により処理されるプログラムおよび履歴管理部1400により保存される実行履歴の一例を示す概念図である。ここでは、従来技術を用いて実行履歴を保存する場合と、本発明の第4の実施の形態により実行履歴を保存する場合とが表されている。なお、ここでは、変換されたプログラムの実行は、ここで示したプログラムの上から順に実行されるものと想定する。
次に、本発明の第4の実施の形態におけるプロセッサコア1300および履歴管理部1400の処理について図面を参照して説明する。
説明は以下の順序により行う。
1.第1の実施の形態(データ処理制御:入力値設定命令アドレスの事前登録の例)
2.第2の実施の形態(プログラム解析処理:入力値設定命令アドレスの抽出例)
3.第3の実施の形態(データ処理制御:プログラムの実行中における入力値設定命令アドレスの登録例)
4.第4の実施の形態(履歴データ転送制御:プログラム実行ごとにデータ処理装置の外部から履歴データを履歴メモリに読み出す例)
[データ処理装置の構成例]
図45は、本発明の第1の実施の形態におけるデータ処理装置の一構成例を示すブロック図である。ここでは、集積回路を構成するデータ処理装置2100と、バス2120と、主記憶部2130とが示されている。この集積回路は、データ処理装置2100において、バス2120を介して読み出される主記憶部2130からの命令列に従って、処理を実行するものである。
図46は、本発明の第1の実施の形態におけるデータ処理部2300および実行結果再利用処理部2400の一構成例を示すブロック図である。
図47は、本発明の第1の実施の形態における履歴メモリ2430のデータ構造の一例を示す概念図である。ここでは、履歴メモリ2430により、区間識別情報ごとに保持された実行履歴のうち、1つの区間識別情報における複数の実行履歴を木構造により保持する構成が示されている。この例では、引数がn個の関数であって、実行結果である出力をm個の格納先に返す関数を想定する。また、ここでは、関数の先頭アドレスである関数アドレスを区間識別情報とする。
図48は、本発明の第1の実施の形態におけるデータ処理装置2100による1回目の関数の実行における区間識別情報および実行履歴の登録手法を示す概念図である。図48の(a)は、入力値設定命令アドレステーブル2520のデータフォーマットの一例を示す図である。入力値設定命令アドレステーブル2520には、関数における最先の入力値設定命令アドレス2521と、その関数を識別するための区間識別情報である関数アドレス2522との対応関係が示されている。
図49は、本発明の第1の実施の形態におけるデータ処理装置2100による実行結果再利用処理に関する手法の一例を示す概念図である。ここでは、図49の(a)および(c)は、図48の(a)および(c)に対応するため、ここでの説明を省略する。
図50は、実行結果再利用処理により関数の実行時間が短縮される例を示す概念図である。図50の(a)は、入力値設定命令アドレステーブル2520を設けない従来のデータ処理装置における実行結果の再利用による短縮期間を示す概念図である。図50の(b)は、本発明の第1の実施の形態におけるデータ処理装置2100における実行結果の再利用による短縮期間を示す概念図である。図50の(a)および(b)は、図49の(b)に示したものと同様であるため、同一符号を付してここでの説明を省略する。
次に本発明の第1の実施の形態におけるデータ処理装置2100の動作について図面を参照して説明する。
[プログラム解析処理装置の構成例]
図53は、本発明の第2の実施の形態におけるプログラム解析処理装置の機能構成例を示すブロック図である。プログラム解析処理装置2600は、ソースプログラム記憶部2610と、コンパイル処理部2620と、オブジェクトプログラム記憶部2660と、再利用区間情報記憶部2670とを備える。なお、プログラム解析処理装置2600は、特許請求の範囲に記載のプログラム解析処理装置の一例である。
次に本発明の第2の実施の形態におけるプログラム解析処理装置2600の動作について図面を参照して説明する。
[データ処理装置2100の構成例]
図55は、本発明の第3の実施の形態におけるデータ処理装置2100の一構成例を示すブロック図である。ここでは、図45に示したデータ処理装置2100のうち、データ処理部2300、実行結果再利用処理部2700および検索開始命令アドレス管理部2800が示されている。ここでは、データ処理部2300は、図46と同じものであるため、図46と同一符号を付してここでの説明を省略する。
図56は、本発明の第3の実施の形態におけるデータ処理装置2100による入力値設定命令アドレステーブル2820に対する入力値設定命令アドレスおよび区間識別情報の登録例を示す概念図である。図56の(a)は、入力値設定命令アドレステーブル2820のデータフォーマットの一例を示す図である。入力値設定命令アドレステーブル2820には、関数である命令区間における最先の入力値設定命令アドレス2821と、その関数を識別するための区間識別情報である関数アドレス2822との対応関係が示されている。
次に本発明の第3の実施の形態におけるデータ処理装置2100の動作について図面を参照して説明する。
図58は、本発明の第3の実施形態におけるデータ処理装置2100による実行履歴検索処理(ステップS2960)の処理手順例を示すフローチャートである。
[データ処理装置2100の外部に履歴データ記憶部を設けた例]
図59は、本発明の第4の実施の形態におけるデータ処理装置2100の外部に履歴データ記憶部を設けた場合における集積回路の一構成例を示すブロック図である。ここでは、図45に示した集積回路の構成に加えて履歴データ記憶部2140が示されている。この履歴データ記憶部2140以外の構成は、図45に示したものと同様であるため、ここでの説明を省略する。
説明は以下の順序により行う。
1.データ処理装置の構成例(値再利用制御:反復再利用区間の実行履歴を退避する例)
2.履歴情報のフィールド構成例(値再利用制御:関数履歴、ループ個別履歴、ループ代表履歴および退避履歴の例)
3.履歴メモリに保持される履歴情報および主記憶部に保持される退避履歴の一例(値再利用制御:ループ個別履歴例を退避および復元させる例)
4.データ処理装置の処理手順例(値再利用制御:ループ個別履歴例を退避および復元させる例)
[データ処理装置3100の構成例]
図61は、本発明の実施の形態におけるデータ処理装置3100の構成例を示すブロック図である。このデータ処理装置3100は、バス3120を介して主記憶部3130と相互に接続されている。また、ここでは、データ処理装置3100が処理を実行する命令区間は関数またはループであることを想定する。
図62は、本発明の実施の形態におけるプロセッサコア3300と履歴管理部3400と履歴変換部3500との構成例を示すブロック図である。ここでは、プロセッサコア3300と履歴管理部3400と履歴変換部3500とに加えて、バス3120を介して履歴変換部3500と接続される主記憶部3130も示されている。ここでは、プロセッサコア3300と履歴管理部3400と履歴変換部3500と主記憶部3130との機能は、図61と同様のものであるため、同一の符号を付してここでの詳細な説明を省略する。
図63は、本発明の実施の形態における履歴制御部3510の構成例を示すブロック図である。履歴制御部3510は、退避履歴生成部3600と、ループ個別履歴消去部3512と、ループ代表履歴登録部3513とを備える。
図64は、本発明の実施の形態における退避履歴生成部3600の構成例を示すブロック図である。退避履歴生成部3600は、先頭探索部3610と、連続探索部3620と、ループ個別履歴取得部3630と、退避履歴転送部3640と、ループ代表履歴生成部3650とを備える。
図65は、本発明の実施の形態における履歴復元部3520の構成例を示すブロック図である。履歴復元部3520は、退避履歴取得部3521と、ループ個別履歴生成部3522と、登録領域確保部3523と、ループ個別履歴登録部3524とを備える。
[実行履歴、ループ個別履歴および退避履歴のフィールド構成例]
図66は、本発明の実施の形態における履歴メモリ3430に保持される関数履歴、ループ個別履歴およびループ代表履歴と、主記憶部3130に保持される退避履歴とのフィールド構成例を示す模式図である。
図67は、本発明の実施の形態における入力値リンクおよび実行結果リンクのデータ構造例を示す概念図である。
図68は、本発明の実施の形態における履歴制御部3510によるループ個別履歴の退避の際の、履歴メモリ3430および主記憶部3130における実行履歴、ループ代表履歴および退避履歴の具体例を示す図である。ここでは、履歴メモリ3430における関数履歴、ループ個別履歴およびループ代表履歴を登録する領域は、データ量と無関係に10個の履歴が格納できる容量であることを想定する。さらにここでは、主記憶部3130における退避履歴を保持させる領域は、データ量と無関係に6個の退避履歴を退避できる容量であることとする。また、これ以降の説明では、便宜上、関数再利用区間の実行履歴である関数履歴、反復再利用区間の実行履歴であるループ個別履歴、および、反復再利用区間の代表履歴であるループ代表履歴の3つの履歴を履歴情報と表現することとする。
図69は、本発明の実施の形態における履歴復元部3520によるループ個別履歴の復元の際の、履歴メモリ3430および主記憶部3130における実行履歴、ループ代表履歴および退避履歴の具体例を示す図である。ここでは、履歴メモリ3430および主記憶部3130は、図68において示した履歴メモリ3430および主記憶部3130と同様の機能であることを想定する。また、ここでは、空き容量が無い履歴メモリ3430に新たな実行履歴を登録する場合には、前回の使用からの未使用期間が最も長い実行履歴を削除する(LRU:Least Recently Used)ことにより空き容量を確保することとする。さらに、ここでは、実行履歴は登録されてから一度も使用されていないことを想定し、LRUにより削除される実行履歴は、順序が最も若い実行履歴であることとする。
図70は、本発明の実施の形態における新たな実行履歴が登録されるときの履歴メモリ3430における履歴情報と主記憶部3130における退避履歴との具体例を示す図である。ここでは、履歴メモリ3430は、データ量と無関係に12個の履歴情報が登録できる容量であることを想定する。
[本発明の実施の形態における履歴制御部3510の動作例]
次に、本発明の実施の形態における履歴制御部3510の処理について図面を参照して説明する。
次に、本発明の実施の形態における履歴復元部3520の処理について図面を参照して説明する。
説明は以下の順序により行う。
1.第1の実施の形態(コンパイル処理制御:ハッシュ関数を選択してプログラムに埋め込む例)
2.第2の実施の形態(データ処理制御:ハッシュ関数が埋め込まれたプログラムを処理する例)
3.第3の実施の形態(コンパイル処理制御:ハッシュ値を選択してハッシュ値付再利用命令を生成する例)
4.第4の実施の形態(データ処理制御:ハッシュ値付再利用命令を処理する例)
5.第5の実施の形態(データ処理制御:既に生成されたオブジェクトプログラムの再利用区間の開始アドレスからハッシュ値を生成する例)
[本発明の第1の実施の形態におけるコンパイル処理装置4100の構成例]
図76は、本発明の第1の実施の形態におけるコンパイル処理装置4100の構成例を示すブロック図である。このコンパイル処理装置4100は、ソースプログラム記憶部4110と、再利用命令判別部4120と、ハッシュ関数決定部4200と、機械語プログラム生成部4140と、オブジェクトプログラム記憶部4150とを備える。
図77は、本発明の第1の実施の形態における再利用命令判別部4120が解析するプログラムの一例を示す概念図である。
これにより、コンパイル処理装置4100は、再利用される度合いの高い再利用候補区間を再利用区間とするオブジェクトプログラムを生成することができる。
図78は、本発明の第1の実施の形態におけるハッシュ関数決定部4200の構成例を示すブロック図である。このハッシュ関数決定部4200は、開始アドレス取得部4210と、候補ハッシュ関数保持部4220と、候補ハッシュ値生成部4230と、ハッシュ値テーブル4240と、ハッシュ関数出力部4250とを備える。
図79は、本発明の第1の実施の形態における候補ハッシュ値生成部4230が生成するハッシュ値の一例を示す概念図である。ここでは、開始アドレスのビット幅は64ビットとする。また、ここでは、左端は最上位ビット(MSB:Most Significant Bit)を示し、右端は最下位ビット(LSB:Least Significant Bit)を示すものとする。
図80は、本発明の第1の実施の形態におけるハッシュ値テーブル4240に保持されるハッシュ値の一例を示す概念図である。ここでは、図79において説明した式3乃至式7のハッシュ関数を用いてハッシュ値を生成することを想定する。また、ここでは、プログラムにおける再利用区間は8個の関数(funcA乃至funcH)とする。
なお、ここでは、開始アドレスの最下位ビットから所定の数のビットの値をハッシュ値とするハッシュ関数のみを用いてハッシュ値を生成する場合について説明したが、多様なハッシュ関数を用いることによりビット幅がより狭いハッシュ値を生成することができる。
次に、本発明の第1の実施の形態におけるコンパイル処理装置4100が生成するハッシュ関数指定命令について図面を参照して説明する。
なお、オペコードフィールド4291がSPECIAL2命令である場合には、第6乃至第25番目の20ビットはユーザが定義可能なエンコード空間である。このため、図81の(a)および(b)において示したハッシュ関数指定命令および識別子供給命令に限定されるものではなく、種々のパターンが考えられる。
次に、本発明の第1の実施の形態におけるコンパイル処理装置4100の処理について図面を参照して説明する。図82は、本発明の第1の実施の形態におけるコンパイル処理装置4100によるコンパイル処理の処理手順を示すフローチャートである。
まず、開始アドレス取得部4210により、再利用区間の開始アドレスがプログラムから取得され、開始アドレス取得部4210に開始アドレスリストとして保持される(ステップS4921)。
[本発明の第2の実施の形態におけるデータ処理装置4300の構成例]
図85は、本発明の第2の実施の形態におけるデータ処理装置4300の構成例を示すブロック図である。このデータ処理装置4300は、バス4350を介して主記憶部4360と相互に接続されている。また、ここでは、データ処理装置4300が処理を実行する命令区間は関数またはループであることを想定する。さらに、ここでは、データ処理装置4300は、本発明の第1の実施の形態におけるコンパイル処理装置4100により生成されたオブジェクトプログラムを実行することとする。
図86は、本発明の第2の実施の形態におけるプロセッサコア4400とハッシュ変換部4500と履歴管理部4600との構成例を示すブロック図である。ここでは、プロセッサコア4400とハッシュ変換部4500と履歴管理部4600とが示されている。また、ここでは、プロセッサコア4400とハッシュ変換部4500と履歴管理部4600との機能は、図85と同様のものであるため、同一の符号を付してここでの詳細な説明を省略する。
図87は、本発明の第2の実施の形態における履歴メモリ4630のデータ構造の一例を示す概念図である。ここでは、履歴メモリ4630により、ハッシュ値ごとに保持された実行履歴のうち、1つのハッシュ値における実行履歴を木構造により保持する構成が示されている。この例では、引数がn個であり、かつ、実行結果である出力をm個の格納先に返す関数を想定している。
次に、本発明の第2の実施の形態におけるデータ処理装置4300の処理について図面を参照して説明する。
[本発明の第3の実施の形態におけるコンパイル処理装置4100の構成例]
図89は、本発明の第3の実施の形態におけるコンパイル処理装置4100の構成例を示すブロック図である。このコンパイル処理装置4100は、図76において示したコンパイル処理装置4100のハッシュ関数決定部4200の代わりにハッシュ値付再利用命令生成部4170を備えている。ここでは、ハッシュ値付再利用命令生成部4170以外の構成は、図76と同様のものであるため、図76と同符号を付してここでの各部の構成の詳細な説明を省略する。
図90は、本発明の第3の実施の形態におけるハッシュ値決定部4700の構成例を示すブロック図である。このハッシュ値決定部4700は、開始アドレス取得部4710と、候補ハッシュ関数保持部4720と、候補ハッシュ値生成部4730と、ハッシュ値テーブル4740と、ハッシュ値出力部4750とを備える。
図91は、本発明の第3の実施の形態におけるハッシュ値テーブル4740に保持されるハッシュ値の一例を示す概念図である。ここでは、便宜上、開始アドレス取得部4710には、開始アドレスが取得された順序に従って付与された番号が番号リストとして保持されることを想定する。また、この番号は、ハッシュ値テーブル4740に登録された開始アドレスに対して「1」から順に付与される値であることとする。さらに、ここでは、候補ハッシュ関数保持部4720は、図79において説明した式3乃至式6のハッシュ関数を保持しているものとする。
さらに、この候補ハッシュ値生成部4730は、関数入力値をそのままハッシュ値テーブル4740に供給する場合において、ハッシュ関数の生成するハッシュ値のビット幅に関するデータをハッシュ値テーブル4740にハッシュ値リストの代わりとして保持させることを想定する。
この時、ハッシュ値リスト4776は、funcA、funcC、funcEおよびfuncGのハッシュ値が「1」で重複し、さらに、その他の3つの関数のハッシュ値が「0」で重複しているため、確定ハッシュ値選択部4752に供給されない。また、ハッシュ値リスト4775は、funcAおよびfuncEのハッシュ値が「01」で重複、funcBおよびfuncFのハッシュ値が「10」で重複、funcCおよびfuncGのハッシュ値が「11」で重複しているため供給されない。その結果、ハッシュ値が全て互い異なるハッシュ値リストと判別されたハッシュ値リスト4773および774が確定ハッシュ値選択部4752に供給される。
次に、本発明の第3の実施の形態におけるコンパイル処理装置4100が生成する再利用命令について図面を参照して説明する。
次に、本発明の第3の実施の形態におけるコンパイル処理装置4100の処理について図面を参照して説明する。
[本発明の第4の実施の形態におけるデータ処理装置4300の構成例]
図96は、本発明の第4の実施の形態におけるデータ処理装置4300の構成例を示すブロック図である。このデータ処理装置4300は、図85において示したデータ処理装置4300のハッシュ変換部4500を除いたものである。このデータ処理装置4300における命令キャッシュ4311およびデータキャッシュ4312は、図85において示した各構成と同様の機能であるため、図85と同一の符号を付してここでの説明を省略する。また、このデータ処理装置4300が接続されている主記憶部4360およびその接続を介しているバス4350は、図85において示したものと同様の機能であるため、図85と同一の符号を付してここでの説明を省略する。
図97は、本発明の第4の実施の形態におけるプロセッサコア4400および履歴管理部4600の構成例を示すブロック図である。ここでは、プロセッサコア4400と履歴管理部4600とが示されている。また、ここでは、プロセッサコア4400および履歴管理部4600の機能は、図85および図96と同様のものであるため、同一の符号を付してここでの詳細な説明を省略する。
次に、本発明の第4の実施の形態におけるデータ処理装置4300の処理について図面を参照して説明する。
[本発明の第5の実施の形態におけるデータ処理装置4300の構成例]
図99は、本発明の第5の実施の形態におけるデータ処理装置4300の構成例を示すブロック図である。このデータ処理装置4300は、図85において示したデータ処理装置4300の各構成に加えて、ハッシュ関数決定部4370を備えている。ここでは、このハッシュ関数決定部4370およびハッシュ変換部4500以外の各構成の機能は、図85と同様の機能であるため、ここでの説明を省略する。
図100は、本発明の第5の実施の形態におけるプロセッサコア4400とハッシュ変換部4500と履歴管理部4600との構成例を示すブロック図である。ここでは、プロセッサコア4400とハッシュ変換部4500と履歴管理部4600とが示されている。また、ここでは、プロセッサコア4400、ハッシュ変換部4500、履歴管理部4600の他に、ハッシュ変換部4500にハッシュ関数を供給するハッシュ関数決定部4370が示されている。
次に、本発明の第5の実施の形態におけるデータ処理装置4300の処理について図面を参照して説明する。
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記載のデータ処理装置。
- 前記実行履歴検索部は、前記取得された入力値と前記予告命令に含まれる前記識別情報とに基づいて前記実行履歴における前記実行結果を検索する請求項1記載のデータ処理装置。
- 前記履歴メモリは、前記識別情報である前記再利用区間の先頭アドレスごとに前記再利用区間における入力値および実行結果を関連付けて前記実行履歴として保持し、
前記実行部は、前記先頭アドレスを参照するための参照情報を含む前記予告命令に基づいて前記先頭アドレスを前記実行履歴検索部に出力し、
前記実行履歴検索部は、前記識別情報として前記実行部から出力された前記先頭アドレスと前記再利用区間の入力値とに基づいて前記実行履歴における前記実行結果を検索する請求項1記載のデータ処理装置。 - 前記予告命令は、前記識別情報である前記再利用区間の先頭アドレスを設定するための予告設定命令であり、
前記履歴メモリは、前記再利用区間の先頭アドレスごとに前記再利用区間における入力値および実行結果を関連付けて前記実行履歴として保持し、
前記実行部は、前記先頭アドレスの設定先が示された設定情報を含む前記予告設定命令に基づいて前記先頭アドレスを前記設定先に設定し、
前記実行履歴検索部は、前記予告設定命令に基づいて前記再利用区間の入力値を取得して前記取得された入力値と前記実行部により設定された前記先頭アドレスとに基づいて前記実行履歴における前記実行結果を検索する
請求項1記載のデータ処理装置。 - 前記履歴メモリは、前記実行履歴を削除する際の優先度と前記優先度に対応する前記再利用区間における入力値および実行結果とを関連付けて前記実行履歴として前記識別情報ごとに保持し、
前記実行履歴検索部は、前記予告命令に含まれる前記優先度に基づいて前記履歴メモリにおける前記実行履歴を削除する
請求項1記載のデータ処理装置。 - 前記実行部は、前記実行履歴検索部により前記実行履歴における前記実行結果が前記履歴メモリから抽出されない場合には前記予告命令によって識別された前記再利用区間における処理を実行し、
前記実行履歴検索部は、前記予告命令に基づいて取得された前記入力値と前記実行部により実行された実行結果と前記識別情報とを前記履歴メモリに保持させる
請求項1記載のデータ処理装置。 - 前記履歴メモリは、前記再利用区間である関数を識別するための前記識別情報ごとに前記関数における入力値および実行結果を関連付けて前記実行履歴として保持し、
前記実行履歴検索部は、前記関数の実行を予告する予告命令に基づいて前記関数の入力値を取得して前記取得された入力値と前記予告命令により特定された前記識別情報とに基づいて前記実行履歴における前記実行結果を検索し、
実行結果出力部は、前記予告命令によって識別された前記関数が実行されるときに前記実行履歴検索部により前記実行結果が抽出された場合には前記抽出された実行結果を前記実行部に出力する
請求項1記載のデータ処理装置。 - プログラムのうち複数回実行される命令区間の各々の実行結果が互いに一致する度合いを示す再利用度を前記命令区間の使用態様に基づいて前記命令区間ごとに生成する再利用度生成部と、
前記複数の命令区間のうち前記再利用度に基づいて選択された再利用区間における入力値を設定するための入力値設定命令の直前に前記再利用区間における入力値の設定を予告する予告命令を生成する予告命令生成部と
を具備するプログラム変換処理装置。 - 前記予告命令生成部は、前記再利用度に基づいて選択された複数の前記再利用区間を識別するための識別情報を含む前記予告命令を生成する請求項9記載のプログラム変換処理装置。
- 前記予告命令生成部は、前記再利用区間の先頭アドレスを設定するためのアドレス設定命令の後に前記先頭アドレスを参照するための参照情報を含む前記予告命令を生成する請求項9記載のプログラム変換処理装置。
- 前記予告命令生成部は、前記再利用区間の先頭アドレスを設定するために前記先頭アドレスの設定先が示された設定情報を含むアドレス設定命令として前記予告命令を生成する請求項9記載のプログラム変換処理装置。
- 前記予告命令生成部は、前記再利用度生成部により生成された前記再利用度に応じて付与された優先度を含む前記予告命令を生成する請求項9記載のプログラム変換処理装置。
- 複数回実行される命令区間である再利用区間が含まれる命令列に基づく処理を実行する実行部と、前記再利用区間を識別するための識別情報ごとに前記再利用区間における入力値および実行結果を関連付けて実行履歴として保持する履歴メモリとを備えるデータ処理装置におけるデータ処理方法であって、
前記再利用区間における処理の実行を予告する予告命令により特定された前記識別情報と前記予告命令により特定された前記再利用区間の入力値とを取得する取得手順と、
前記取得手順により取得された前記識別情報と前記入力値とに基づいて前記実行履歴における前記実行結果を検索する実行履歴検索手順と、
前記予告命令によって識別された前記再利用区間における処理が実行されるときに前記実行履歴検索部により前記実行結果が抽出された場合には前記抽出された実行結果を前記実行部に出力する実行結果出力手順と
を具備するデータ処理方法。 - プログラムのうち複数回実行される複数の命令区間各々の実行結果が互いに一致する度合いを示す再利用度を前記命令区間の使用態様に基づいて前記命令区間ごとに生成する再利用度生成手順と、
前記複数の命令区間のうち前記再利用度に基づいて選択された再利用区間における入力値を設定するための入力値設定命令の直前に前記再利用区間における入力値の設定を予告する予告命令を生成する予告命令生成手順と、
を具備する予告命令生成処理方法。 - プログラムにおける命令区間の使用態様を解析する解析部と、
前記命令区間の実行結果が再び利用される度合いを示す再利用度を前記解析の結果に基づいて生成する再利用度生成部と、
前記命令区間の呼出し命令を前記再利用度に基づいて再利用命令に変換する命令変換部と
を具備するプログラム変換処理装置。 - 前記解析部は、前記使用態様として前記命令区間の入力値の個数を解析し、
前記再利用度生成部は、前記解析の結果に基づいて前記再利用度を生成する
請求項16記載のプログラム変換処理装置。 - 前記解析部は、前記使用態様として前記命令区間の入力値が採り得る値の組合せを解析し、
前記再利用度生成部は、前記解析の結果に基づいて前記再利用度を生成する
請求項16記載のプログラム変換処理装置。 - 前記解析部は、前記使用態様として前記命令区間の呼び出される回数を解析し、
前記再利用度生成部は、前記解析の結果に基づいて前記再利用度を生成する
請求項16記載のプログラム変換処理装置。 - 前記命令区間は関数であり、前記解析部は前記使用態様として前記関数の入力値および呼び出される回数を解析し、
前記再利用度生成部は、前記解析の結果に基づいて前記再利用度を生成する
請求項16記載のプログラム変換処理装置。 - 前記命令区間はループであり、前記解析部は前記使用態様として前記ループの入力値および呼び出される回数を解析し、
前記再利用度生成部は、前記解析の結果に基づいて前記再利用度を生成する
請求項16記載のプログラム変換処理装置。 - 前記解析部は、前記使用態様として前記命令区間の前記入力値がメモリアクセスを伴うか否かを解析し、
前記再利用度生成部は、前記命令区間の前記入力値がメモリアクセスを伴う場合には当該メモリアクセスを伴わない前記入力値を用いる場合と比較して低い前記度合いを示す前記再利用度を生成する
請求項16記載のプログラム変換処理装置。 - 前記命令変換部は、前記再利用度と前記命令区間の前記実行結果を保持するためのデータである実行履歴のデータ量と前記実行履歴が保持される履歴メモリの容量とに基づいて、前記命令区間の前記データ量の総和が前記履歴メモリの容量以内となるように前記再利用度が最も高い前記命令区間から順に前記呼出し命令を前記再利用命令に変換する請求項16記載のプログラム変換処理装置。
- 前記実行履歴が前記履歴メモリに保持される際の優先度を前記再利用度に基づいて生成する優先度生成部をさらに具備し、
前記命令変換部は、前記命令区間の呼出し命令を前記優先度が含まれる前記再利用命令に変換する請求項16記載のプログラム変換処理装置。 - 複数の命令区間のうち実行結果が再び利用される再利用区間を指定する再利用命令により呼び出された前記再利用区間における処理を実行し、前記再利用区間の区間識別情報と前記再利用区間の入力値と前記再利用区間の実行結果とを実行履歴として出力する実行部と、
前記実行履歴を保持する履歴メモリと
を具備するデータ処理装置。 - 前記実行部は、前記複数の命令区間のうち再び利用される度合いに基づいて抽出された命令区間を指定する前記再利用命令により呼び出された前記再利用区間における処理を実行し、前記実行履歴を出力する請求項25記載のデータ処理装置。
- 前記再利用区間は関数であり、前記実行部は、前記区間情報と前記再利用区間の入力値と前記再利用区間の実行結果として前記関数の開始アドレスと前記関数の入力値と前記関数の実行結果とを出力する請求項26記載のデータ処理装置。
- 前記再利用区間はループであり、前記実行部は、前記区間情報と前記再利用区間の入力値と前記再利用区間の実行結果として前記ループの開始アドレスと前記ループの入力値と前記ループの実行結果とを出力する請求項26記載のデータ処理装置。
- 前記区間識別情報と前記再利用区間の入力値とを用いて前記履歴メモリから前記実行結果が検索された場合には前記実行結果を出力する履歴検索部をさらに具備する請求項25記載のデータ処理装置。
- 前記実行結果が再利用される度合いの順位を示す優先度および前記実行履歴の前記履歴メモリにおけるアドレスを優先度情報として保持する優先度テーブルと、
前記優先度テーブルから前記優先度が最も低い前記優先度情報を消去候補情報として検索する最低優先度履歴検索部と、
前記実行部が前記履歴メモリに新たな実行履歴を保持しようとしている場合には前記消去候補情報の前記優先度と前記新たな実行履歴の前記優先度とを比較する優先度比較部と、
前記消去候補情報の前記優先度が前記新たな実行履歴の前記優先度より低い場合には前記消去候補情報の前記アドレスに基づいて前記実行履歴を前記履歴メモリから消去する消去部と
をさらに具備する請求項25記載のデータ処理装置。 - 前記履歴メモリの空き容量を管理する履歴メモリ管理部をさらに具備し、
前記優先度比較部は、前記新たな実行履歴のデータ量が前記履歴メモリの空き容量よりも大きい場合には前記消去候補情報の前記優先度と前記新たな実行履歴の前記優先度とを比較する請求項30記載のデータ処理装置。 - プログラムにおける命令区間の使用態様を解析する解析手順と、
前記命令区間の実行結果が再び利用される度合いを示す再利用度を前記解析の結果に基づいて生成する再利用度生成手順と、
前記命令区間の呼出し命令を前記再利用度に基づいて再利用命令に変換する命令変換手順と
を具備するプログラム変換処理方法。 - 複数の命令区間のうち実行結果が再び利用される再利用区間を指定する再利用命令により呼び出された前記再利用区間における処理を実行し、前記再利用区間の区間識別情報と前記再利用区間の入力値と前記再利用区間の実行結果とを実行履歴として出力する実行手順を具備するデータ処理方法であって、
前記実行履歴を保持する履歴メモリを備えるコンピュータにおけるデータ処理方法。 - 複数の命令区間が含まれる命令列に基づく処理を実行部と、
前記命令区間を呼び出すための呼出し命令が実行される前に前記命令区間の入力値を設定するための入力値設定命令のアドレスである入力値設定命令アドレスを前記命令区間の区間識別情報ごとに保持する入力値設定命令アドレステーブルと、
前記区間識別情報ごとに前記命令区間における入力値および実行結果を関連付けて実行履歴として保持する履歴メモリと、
前記入力値設定命令アドレスにより特定された前記入力値設定命令から前記呼出し命令までの命令群のうちの前記入力値設定命令に基づいて前記実行部から出力された入力値と前記入力値設定命令アドレスに対応する前記区間識別情報とを用いて前記実行履歴における前記実行結果を検索する実行履歴検索部と、
前記入力値設定命令アドレスによって特定される前記呼出し命令が実行されるときに前記実行履歴検索部により前記実行結果が抽出された場合には前記抽出された実行結果を前記実行部に出力する実行結果出力部と
を具備するデータ処理装置。 - 前記入力値設定命令アドレステーブルは、前記複数の命令区間のうち複数回実行される命令区間である再利用区間の入力値を設定するための前記入力値設定命令の前記入力値設定命令アドレスを前記再利用区間の前記区間識別情報ごとに保持し、
実行履歴検索部は、前記再利用区間における前記命令群のうちの前記入力値設定命令に基づいて前記実行部から出力された前記入力値と前記入力値設定命令アドレスに対応する前記区間識別情報とを用いて前記再利用区間における前記実行結果を検索し、
実行結果出力部は、前記入力値設定命令アドレスによって特定される前記再利用区間の前記呼出し命令が実行されるときに前記実行履歴検索部により前記実行履歴における前記再利用区間の前記実行結果が抽出された場合には前記抽出された実行結果を前記実行部に出力する
請求項34記載のデータ処理装置。 - 前記入力値設定命令に基づいて設定された入力値のうち前記呼出し命令により呼び出された前記命令区間において参照された入力値に対応する前記入力値設定命令アドレスと前記区間識別情報とを前記入力値設定命令アドレステーブルに出力する入力値設定命令アドレス出力部をさらに具備する請求項34記載のデータ処理装置。
- 前記入力値設定命令アドレス出力部は、前記命令区間において参照された複数の入力値に対応する前記入力値設定命令のうち最先の前記入力値設定命令の前記入力値設定命令アドレスと前記区間識別情報である前記命令区間の先頭アドレスとを出力する請求項36記載のデータ処理装置。
- 前記入力値設定命令アドレステーブルは、前記命令区間における複数の入力値を設定するための入力値設定命令のうち最先の前記入力値設定命令の前記入力値設定命令アドレスを前記区間識別情報ごとに保持する請求項34記載のデータ処理装置。
- 前記実行部は、前記実行履歴検索部により前記実行履歴における前記実行結果が前記履歴メモリから抽出されない場合には前記入力値設定命令アドレスによって特定された前記命令区間における処理を実行し、
前記実行履歴検索部は、前記入力値設定命令に基づいて前記実行部から出力された入力値と前記実行部により実行された実行結果と前記入力値設定命令アドレスに対応する前記区間識別情報とを前記履歴メモリに保持させる
請求項34記載のデータ処理装置。 - 前記入力値設定命令アドレステーブルは、前記命令区間である関数の前記入力値設定命令の前記入力値設定命令アドレスを前記区間識別情報である前記関数の先頭アドレスごとに保持し、
前記履歴メモリは、前記関数の先頭アドレスごとに前記関数における入力値および実行結果を関連付けて前記実行履歴として保持し、
前記実行履歴検索部は、前記命令群のうちの前記入力値設定命令に基づいて前記実行部から出力された前記関数の前記入力値と前記入力値設定命令アドレスに対応する前記関数の先頭アドレスとを用いて前記実行結果を検索し、
前記実行結果出力部は、前記入力値設定命令アドレスによって特定される前記関数の前記呼出し命令が実行されるときに前記実行履歴検索部により前記関数の前記実行結果が抽出された場合には前記抽出された実行結果を前記実行部に出力する
請求項34記載のデータ処理装置。 - プログラムのうち複数回実行される命令区間における処理の実行ごとの入力値が互いに一致する度合いを示す再利用度を前記命令区間の使用態様に基づいて前記命令区間ごとに生成する再利用度生成部と、
前記複数の命令区間のうち前記再利用度に基づいて抽出された再利用区間における入力値を設定するための入力値設定命令の入力値設定命令アドレスと前記再利用区間を識別するための区間識別情報とが関連付けられた再利用区間情報を生成する再利用区間情報生成部と
を具備するプログラム解析処理装置。 - 複数の命令区間が含まれる命令列に基づく処理を実行する実行部と、前記命令区間を呼び出すための呼出し命令の実行前に前記命令区間の入力値を設定するための入力値設定命令の入力値設定命令アドレスを前記命令区間の区間識別情報ごとに保持する入力値設定命令アドレステーブルと、前記区間識別情報ごとに前記命令区間における入力値および実行結果を関連付けて実行履歴として保持する履歴メモリとを備えるデータ処理装置におけるデータ処理方法であって、
前記入力値設定命令アドレスにより特定された前記入力値設定命令から前記呼出し命令までの命令群のうちの前記入力値設定命令に基づいて前記実行部から出力された入力値と前記入力値設定命令アドレスに対応する前記区間識別情報とを用いて前記実行履歴における前記実行結果を検索する実行履歴検索手順と、
前記入力値設定命令アドレスによって特定される前記呼出し命令が実行されるときに前記実行履歴検索手順により前記実行結果が抽出された場合には前記抽出された実行結果を前記実行部に出力する実行結果出力手順と
を具備するデータ処理方法。 - プログラムのうち複数回実行される命令区間の各々の実行結果が互いに一致する度合いを示す再利用度を前記命令区間の使用態様に基づいて前記命令区間ごとに生成する再利用度生成手順と、
前記複数の命令区間のうち前記再利用度に基づいて抽出された再利用区間における入力値を設定するための入力値設定命令の入力値設定命令アドレスと前記再利用区間を識別するための区間識別情報とが関連付けられた再利用区間情報を生成する再利用区間情報生成手順と
を具備するプログラム解析処理方法。 - 命令区間を実行して実行結果を出力する実行部と、
前記命令区間のうち実行結果が再び利用される再利用区間の区間識別情報と入力値と実行結果とを実行履歴として保持し、前記保持した実行結果が再び利用される場合には前記区間識別情報および前記入力値に基づいて前記実行履歴が検索される履歴メモリと、
前記再利用区間のうち実行が反復される反復再利用区間の各回の前記実行結果を前記履歴メモリから退避させるための退避履歴を保持する退避履歴保持部と、
前記反復再利用区間の前記実行履歴に基づいて前記退避履歴を前記退避履歴保持部に供給し、前記退避履歴の供給の際に前記退避履歴の基となった前記実行履歴を前記履歴メモリから消去して前記退避履歴を指し示す情報を含む代表履歴を前記履歴メモリに保持させる履歴制御部と
を備えるデータ処理装置。 - 前記履歴制御部は、前記履歴メモリに保持させる新たな前記実行履歴のデータ量が前記履歴メモリの空き容量よりも大きい場合には前記退避履歴を前記退避履歴保持部に供給する請求項44記載のデータ処理装置。
- 前記退避履歴および前記代表履歴に基づいて前記実行履歴を前記履歴メモリに復元する履歴復元部と、
前記区間識別情報および前記入力値に基づいて前記復元された前記実行履歴を前記履歴メモリから検索した場合には前記復元された前記実行履歴に基づいて前記実行結果を出力する履歴検索部と
をさらに備える請求項44記載のデータ処理装置。 - 前記履歴検索部は、前記区間識別情報および前記入力値に基づいて検索された前記実行履歴が前記代表履歴であった場合には前記復元部に前記実行履歴の復元を開始させる請求項46記載のデータ処理装置。
- 前記履歴制御部は、前記退避履歴の個数を示す退避カウントをさらに含む前記代表履歴を生成し、
前記履歴復元部は、前記代表履歴における前記退避履歴を指し示す情報および前記退避カウントに基づいて前記退避履歴を前記退避履歴保持部から抽出して前記実行履歴を復元する
請求項46記載のデータ処理装置。 - 前記実行部は、前記再利用区間の前記実行結果を供給する場合には前記反復再利用区間の前記実行履歴と前記反復再利用区間以外の前記実行履歴と前記代表履歴とを識別するための識別子をさらに出力し、
前記履歴メモリは、前記識別子を前記実行履歴としてさらに保持し、
前記履歴制御部は、前記識別子を用いて識別した前記実行履歴に基づいて前記退避履歴を供給し、前記識別子をさらに含む前記代表履歴を生成する
請求項44記載のデータ処理装置。 - 前記反復再利用区間はサブルーチンであり、前記実行部は、前記サブルーチンの開始アドレスを前記区間識別情報として出力する請求項44記載のデータ処理装置。
- 前記反復再利用区間はループであり、前記実行部は、前記ループの開始アドレスを前記区間識別情報として出力する請求項44記載のデータ処理装置。
- 前記実行部は、前記反復再利用区間の前記実行結果を出力する場合には何回目の実行による前記実行結果であるかを示すカウンタ値をさらに出力し、
前記履歴メモリは、前記カウンタ値を前記実行履歴としてさらに保持し、
前記履歴制御部は、前記カウンタ値を含む前記退避履歴を出力する
請求項8記載のデータ処理装置。 - 実行結果が再び利用される再利用区間の区間識別情報と入力値と実行結果とを実行履歴として保持し、前記保持した実行結果が再び利用される場合には前記区間識別情報および前記入力値に基づいて前記実行履歴が検索される履歴メモリと、
前記再利用区間のうち実行が反復される反復再利用区間の各回の前記実行結果を退避履歴として前記履歴メモリから外部の記憶部に退避させ、前記退避の際に前記退避履歴の基となった前記実行履歴を前記履歴メモリから消去して前記退避履歴を指し示す情報を含む代表履歴を前記履歴メモリに保持させる履歴制御部と
を備える履歴保存装置。 - 命令区間のうち実行結果が再び利用される再利用区間の区間識別情報と入力値と実行結果とを実行履歴として保持し、前記保持した実行結果が再び利用される場合には前記区間識別情報および前記入力値に基づいて前記実行履歴が検索される履歴メモリと、
前記再利用区間のうち実行が反復される反復再利用区間の各回の前記実行結果を前記履歴メモリから退避させるための退避履歴を保持する退避履歴保持部と
を備えるコンピュータにおけるデータ処理方法であって、
前記命令区間を実行して実行結果を出力する実行手順と、
前記反復再利用区間の前記実行履歴に基づいて前記退避履歴を前記退避履歴保持部に供給し、前記退避履歴の供給の際に前記退避履歴の基となった前記実行履歴を前記履歴メモリから消去して前記退避履歴を指し示す情報を含む代表履歴を前記履歴メモリに保持させる履歴制御手順と
を備えるデータ処理方法。 - 命令区間のうち実行結果が再び利用される再利用区間の区間識別情報と入力値と実行結果とを実行履歴として保持し、前記保持した実行結果が再び利用される場合には前記区間識別情報および前記入力値に基づいて前記実行履歴が検索される履歴メモリと、
前記再利用区間のうち実行が反復される反復再利用区間の各回の前記実行結果を前記履歴メモリから退避させるための退避履歴を保持する退避履歴保持部と
を備えるコンピュータにおけるプログラムであって、
前記命令区間を実行して実行結果を出力する実行手順と、
前記反復再利用区間の前記実行履歴に基づいて前記退避履歴を前記退避履歴保持部に供給し、前記退避履歴の供給の際に前記退避履歴の基となった前記実行履歴を前記履歴メモリから消去して前記退避履歴を指し示す情報を含む代表履歴を前記履歴メモリに保持させる履歴制御手順と
をコンピュータに実行させるプログラム。 - プログラムにおける複数の命令区間の使用態様を解析して前記命令区間のうち実行結果が再び利用される再利用区間を判別する解析部と、
前記再利用区間の開始アドレスのビット幅より狭いビット幅の値により前記再利用区間を識別する区間識別値を生成するための区間識別値生成関数の候補である候補関数を用いることによって、前記区間識別値の候補である候補値を前記候補関数に関連付けて前記開始アドレスから生成する候補値生成部と、
前記候補値生成部により生成された前記候補値を前記関連付けられた候補関数ごとに候補値リストとして保持する候補値テーブルと、
前記候補値が全て互いに異なる前記候補値リストを抽出し、この抽出された候補値リストのうち前記候補値のビット幅に基づいて選択された候補値リストの前記関連付けられた候補関数を前記区間識別値生成関数として出力する区間識別値生成関数出力部と、
前記区間識別値生成関数が埋め込まれた機械語プログラムを前記解析されたプログラムおよび前記区間識別値生成関数に基づいて生成する機械語プログラム生成部と
を具備するコンパイル処理装置。 - 前記候補関数は、ハッシュ関数であり、
前記区間識別値生成関数出力部は、前記抽出された候補値リストのうち前記候補値のビット幅に基づいて選択された候補値リストの前記関連付けられたハッシュ関数を前記区間識別値生成関数として出力する
請求項56記載のコンパイル処理装置。 - 前記ハッシュ関数は、前記開始アドレスの最下位ビットから所定の数のビットにおける値を前記候補値とするハッシュ関数であり、
前記区間識別値生成関数出力部は、前記抽出された候補値リストのうち前記候補値のビット幅に基づいて選択された候補値リストの前記関連付けられたハッシュ関数を前記区間識別値生成関数として出力する
請求項57記載のコンパイル処理装置。 - 前記区間識別値生成関数出力部は、前記抽出された候補値リストのうちビット幅が最も狭い前記候補値の候補値リストの前記関連付けられた候補関数を前記区間識別値生成関数として出力する請求項56記載のコンパイル処理装置。
- 前記区間識別値生成関数出力部は、前記区間識別値生成関数として前記区間識別値生成関数を識別するための識別子を出力し、
前記機械語プログラム生成部は、前記識別子が埋め込まれた機械語プログラムを生成する
請求項56記載のコンパイル処理装置。 - 複数の命令区間を実行して実行結果を出力する実行部と、
前記命令区間のうち実行結果が再び利用される再利用区間の開始アドレスのビット幅より狭いビット幅の値により前記再利用区間を識別する区間識別値とその前記再利用区間の入力値とその前記再利用区間の実行結果とを実行履歴として保持する履歴メモリと、
前記区間識別値および前記入力値に基づいて前記履歴メモリから前記実行履歴を検索し、前記実行履歴が検索された場合には前記実行結果を出力する履歴検索部と
を具備するデータ処理装置。 - 前記実行部が前記再利用区間を実行したときに前記開始アドレスを出力した場合には、前記区間識別値を生成するための区間識別値生成関数を用いて前記開始アドレスから前記区間識別値を生成する区間識別値生成部をさらに具備し、
前記実行部は、前記区間識別値生成部に前記区間識別値生成関数を供給し、
前記履歴メモリは、前記区間識別値生成部により生成された前記区間識別値と前記入力値と前記実行結果とを前記実行履歴として保持し、
前記履歴探索部は、前記区間識別値と前記入力値とに基づいて前記履歴メモリから前記実行履歴を検索し、前記実行履歴が検索された場合には前記実行結果を出力する
請求項61記載のデータ処理装置。 - 前記実行部は、前記区間識別値生成関数を前記区間識別値生成部に供給し、
前記区間識別値生成部は、前記実行部が前記再利用区間を実行したときに前記開始アドレスを出力した場合には、前記実行部から供給された前記区間識別値生成関数を用いて前記開始アドレスから前記区間識別値を生成する
請求項62記載のデータ処理装置。 - 前記実行部は、前記区間識別値生成関数を識別する識別子を前記区間識別値生成部に供給し、
前記区間識別値生成部は、前記区間識別値生成関数の候補である候補関数から前記区間識別値生成関数を前記識別子に基づいて選択し、前記実行部が前記再利用区間を実行したときに前記開始アドレスを出力した場合には前記選択した区間識別値生成関数を用いて前記開始アドレスから前記区間識別値を生成する
請求項62記載のデータ処理装置。 - 前記実行部は、前記区間識別値が含まれる命令により前記再利用区間を実行した場合には前記区間識別値を前記履歴メモリに供給し、
前記履歴メモリは、前記区間識別値と前記入力値と前記実行結果とを前記実行履歴として保持し、
前記履歴探索部は、前記区間識別値と前記入力値とに基づいて前記履歴メモリから前記実行履歴を検索し、前記実行履歴が検索された場合には前記実行結果を出力する
請求項61記載のデータ処理装置。 - プログラムにおける複数の命令区間の使用態様を解析して前記命令区間のうち実行結果が再び利用される再利用区間を判別する解析部と、
前記再利用区間の開始アドレスのビット幅より狭いビット幅の値により前記再利用区間を識別する区間識別値を生成するための区間識別値生成関数の候補である候補関数を用いることによって、前記区間識別値の候補である候補値を前記候補関数に関連付けて生成する候補値生成部と、
前記候補値生成部により生成された前記候補値を前記関連付けられた候補関数ごとに候補値リストとして保持する候補値テーブルと、
前記候補値が全て互いに異なる前記候補値リストを抽出し、この抽出された候補値リストのうち前記候補値のビット幅に基づいて選択された候補値リストの前記候補値を前記区間識別値として出力する区間識別値出力部と、
前記再利用区間を呼び出す命令を前記区間識別値が含まれる区間識別値付命令に変換する命令変換部と、
前記再利用区間が前記区間識別値付命令により呼び出される機械語プログラムを前記区間識別値付命令が含まれるソースプログラムに基づいて生成する機械語プログラム生成部と
を具備するコンパイル処理装置。 - 前記候補値生成部は、前記開始アドレスの所定の順序に従って付与された番号を入力の値とする前記候補関数を用いることによって前記候補値を生成する請求項66記載のコンパイル処理装置。
- 前記候補値生成部は、前記開始アドレスを入力の値とする前記候補関数を用いることによって前記候補値を生成する請求項66記載のコンパイル処理装置。
- 複数の命令区間を実行して実行結果を出力する実行部と、
前記再利用区間の開始アドレスのビット幅より狭いビット幅の値により前記再利用区間を識別する区間識別値を生成するための区間識別値生成関数の候補である候補関数を用いることによって、前記区間識別値の候補である候補値を前記候補関数に関連付けて前記開始アドレスから生成する候補値生成部と、
前記候補値生成部により生成された前記候補値を前記関連付けられた候補関数ごとに候補値リストとして保持する候補値テーブルと、
前記候補値が全て互いに異なる前記候補値リストを抽出し、この抽出された候補値リストのうち前記候補値のビット幅に基づいて選択された候補値リストの前記関連付けられた候補関数を区間識別値生成関数として出力する区間識別値生成関数出力部と、
前記実行部が前記再利用区間を実行したときに前記開始アドレスが出力された場合には前記区間識別値生成関数を用いて前記開始アドレスから前記区間識別値を生成する区間識別値生成部と、
前記再利用区間の前記区間識別値と入力値と実行結果とを実行履歴として保持する履歴メモリと、
前記区間識別値および前記入力値に基づいて前記履歴メモリから前記実行履歴を検索し、前記実行履歴が検索された場合には前記実行結果を出力する履歴検索部と
を具備するデータ処理装置。 - 区間識別値の候補である候補値を前記候補値を生成した候補関数ごとに候補値リストとして保持する候補値テーブルを備えるコンピュータにおけるデータ処理方法であって、
プログラムにおける複数の命令区間の使用態様を解析して前記命令区間のうち実行結果が再び利用される再利用区間を判別する解析手順と、
前記再利用区間の開始アドレスのビット幅より狭いビット幅の値により前記再利用区間を識別する前記区間識別値を生成するための区間識別値生成関数の候補である前記候補関数を用いることによって、前記区間識別値の候補である前記候補値を前記候補関数に関連付けて前記開始アドレスから生成する候補値生成手順と、
前記候補値が全て互いに異なる前記候補値リストを抽出し、この抽出された候補値リストのうち前記候補値のビット幅に基づいて選択された候補値リストの前記関連付けられた候補関数を前記区間識別値生成関数として出力する区間識別値生成関数出力手順と、
前記区間識別値生成関数が埋め込まれた機械語プログラムを前記解析されたプログラムおよび前記区間識別値生成関数に基づいて生成する機械語プログラム生成手順と
を具備するコンパイル処理方法。 - 区間識別値の候補である候補値を前記候補値を生成した候補関数ごとに候補値リストとして保持する候補値テーブルを備えるコンピュータにおけるプログラムであって、
プログラムにおける複数の命令区間の使用態様を解析して前記命令区間のうち実行結果が再び利用される再利用区間を判別する解析手順と、
前記再利用区間の開始アドレスのビット幅より狭いビット幅の値により前記再利用区間を識別する前記区間識別値を生成するための区間識別値生成関数の候補である前記候補関数を用いることによって、前記区間識別値の候補である前記候補値を前記候補関数に関連付けて前記開始アドレスから生成する候補値生成手順と、
前記候補値が全て互いに異なる前記候補値リストを抽出し、この抽出された候補値リストのうち前記候補値のビット幅に基づいて選択された候補値リストの前記関連付けられた候補関数を前記区間識別値生成関数として出力する区間識別値生成関数出力手順と、
前記区間識別値生成関数が埋め込まれた機械語プログラムを前記解析されたプログラムおよび前記区間識別値生成関数に基づいて生成する機械語プログラム生成手順と
をコンピュータに実行させるプログラム。
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)
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)
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)
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 |
-
2010
- 2010-08-05 TW TW099126111A patent/TW201124910A/zh unknown
- 2010-08-05 KR KR1020127003143A patent/KR20120068824A/ko not_active Application Discontinuation
- 2010-08-05 US US13/389,134 patent/US20120185859A1/en not_active Abandoned
- 2010-08-05 CN CN2010800349313A patent/CN102667715A/zh active Pending
- 2010-08-05 WO PCT/JP2010/063246 patent/WO2011018974A1/ja active Application Filing
- 2010-08-05 EP EP10808157A patent/EP2466453A1/en not_active Withdrawn
Patent Citations (4)
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)
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 |