JP2011039858A - Data processing device, data processing method, program analysis processing device, and program analysis processing method - Google Patents
Data processing device, data processing method, program analysis processing device, and program analysis processing method Download PDFInfo
- Publication number
- JP2011039858A JP2011039858A JP2009187624A JP2009187624A JP2011039858A JP 2011039858 A JP2011039858 A JP 2011039858A JP 2009187624 A JP2009187624 A JP 2009187624A JP 2009187624 A JP2009187624 A JP 2009187624A JP 2011039858 A JP2011039858 A JP 2011039858A
- Authority
- JP
- Japan
- Prior art keywords
- input value
- instruction
- execution
- unit
- value setting
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Abandoned
Links
Images
Abstract
Description
本発明は、データ処理装置に関し、特に複数回実行される命令区間の実行結果を再利用するデータ処理装置およびその処理方法、ならびに、このデータ処理装置に対応するプログラムに変換するデータ変換処理装置およびその処理方法に関する。 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.
従来からCPU(Central Processing Unit)などのマイクロプロセッサにおいて、演算処理の高速化技術に関する研究開発が盛んに行われている。この演算処理の高速化技術として、値再利用技術という手法が考案されている。例えば、この値再利用技術をループの命令区間に適用したデータ処理装置が提案されている(例えば、特許文献1参照。)。 2. Description of the Related Art Conventionally, research and development relating to high-speed computing processing technology has been actively performed in microprocessors such as a CPU (Central Processing Unit). As a technique for speeding up this arithmetic processing, a technique called value reuse technique has been devised. For example, a data processing apparatus in which this value reuse technique is applied to an instruction section of a loop has been proposed (for example, see Patent Document 1).
この値再利用技術では、プログラムの一部分である命令区間のうち、その命令区間における入力値が同じであれば実行結果も同一となる命令区間における入力値と、その実行結果である出力値とを関連付けて再利用表に登録する。そして、同じ命令区間を再度実行する場合に、同一の入力値が再利用表に登録されていれば、その入力値に対応する出力値を再利用表から出力することによって、過去に実行された命令区間の実行結果を再利用する。このように、複数回実行される命令区間のうち、過去に実行された命令区間の実行結果を再利用することができる命令区間をここでは再利用区間という。 In this value reuse technique, among the instruction sections that are part of the program, if the input value in the instruction section is the same, the input value in the instruction section that has the same execution result and the output value that is the execution result are Register in the reuse table in association. And when the same instruction interval is executed again, if the same input value is registered in the reuse table, it was executed in the past by outputting the output value corresponding to the input value from the reuse table. Reuse the execution result of the instruction section. As described above, 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.
上述の従来技術では、再利用区間における処理が再度実行されたときに、その再利用区間の入力値が再利用表に登録されていれば、その再利用区間の処理を省略することができるため、再利用区間の実行に要する実行時間を短縮することができる。しかしながら、この場合、再利用区間の呼出し命令の実行後において入力値を参照する命令が実行されるまでは、その再利用区間の入力値が再利用表に登録されているか否かの判断を行うことができない。このように、入力値が使用されるまで再利用表の検索を行うことができないことから、実行結果の再利用によって短縮することができる期間が制限されてしまう。 In the above-described conventional technology, when the process in the reuse section is executed again, if the input value of the reuse section is registered in the reuse table, the process in the reuse section can be omitted. Therefore, it is possible to reduce the execution time required for executing the reuse section. However, in this case, it is determined whether or not the input value of the reuse section is registered in the reuse table until the instruction that refers to the input value is executed after the execution of the call instruction of the reuse section. I can't. Thus, since the reuse table cannot be searched until the input value is used, the period that can be shortened by reusing the execution result is limited.
本発明はこのような状況に鑑みてなされたものであり、実行結果の再利用による再利用区間の処理時間を短縮させることを目的とする。 The present invention has been made in view of such a situation, and an object thereof is to shorten the processing time of a reuse section by reusing an execution result.
本発明は、上記課題を解決するためになされたものであり、その第1の側面は、複数の命令区間が含まれる命令列に基づく処理を実行部と、上記命令区間を呼び出すための呼出し命令が実行される前に上記命令区間の入力値を設定するための入力値設定命令のアドレスである入力値設定命令アドレスを上記命令区間の区間識別情報ごとに保持する入力値設定命令アドレステーブルと、上記区間識別情報ごとに上記命令区間における入力値および実行結果を関連付けて実行履歴として保持する履歴メモリと、上記入力値設定命令アドレスにより特定された上記入力値設定命令から上記呼出し命令までの命令群のうちの上記入力値設定命令に基づいて上記実行部から出力された入力値と上記入力値設定命令アドレスに対応する上記区間識別情報とを用いて上記実行履歴における上記実行結果を検索する実行履歴検索部と、上記入力値設定命令アドレスによって特定される上記呼出し命令が実行されるときに上記実行履歴検索部により上記実行結果が抽出された場合には上記抽出された実行結果を上記実行部に出力する実行結果出力部とを具備するデータ処理装置およびその処理方法である。これにより、命令区間の実行前までに、入力値設定命令アドレステーブルにおける入力値設定命令アドレスにより特定された入力値設定命令に基づく入力値と、その入力値設定命令アドレスに関連付けられた区間識別情報とを用いて履歴メモリにおける実行結果を検索し、入力値設定命令アドレスによって特定される呼出し命令が実行されるときに、実行履歴検索部により実行結果が抽出された場合には、その実行結果を実行部に出力させるという作用をもたらす。 The present invention has been made to solve the above-mentioned problems, and a first aspect of the present invention is to execute a process based on an instruction sequence including a plurality of instruction sections and a call instruction for calling the instruction sections. An input value setting instruction address table that holds an input value setting instruction address that is an address of an input value setting instruction for setting an input value of the instruction section before the execution is executed for each section identification information of the instruction section; A history memory that associates an input value and an execution result in the instruction section for each section identification information and holds them as an execution history, and an instruction group from the input value setting instruction to the call instruction specified by the input value setting instruction address And the section identification information corresponding to the input value setting command address, and the input value output from the execution unit based on the input value setting command The execution history search unit that searches for the execution result in the execution history and 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. In some cases, the data processing apparatus includes an execution result output unit that outputs the extracted execution result to the execution unit, and a processing method thereof. Thus, before the execution of the instruction section, the input value based on the input value setting instruction specified by the input value setting instruction address in the input value setting instruction address table and the section identification information associated with the input value setting instruction address When 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 is extracted. This brings about the effect that the execution unit outputs.
また、この第1の側面において、上記入力値設定命令アドレステーブルは、上記複数の命令区間のうち複数回実行される命令区間である再利用区間の入力値を設定するための上記入力値設定命令の上記入力値設定命令アドレスを上記再利用区間の上記区間識別情報ごとに保持し、実行履歴検索部は、上記再利用区間における上記命令群のうちの上記入力値設定命令に基づいて上記実行部から出力された上記入力値と上記入力値設定命令アドレスに対応する上記区間識別情報とを用いて上記再利用区間における上記実行結果を検索し、実行結果出力部は、上記入力値設定命令アドレスによって特定される上記再利用区間の上記呼出し命令が実行されるときに上記実行履歴検索部により上記実行履歴における上記再利用区間の上記実行結果が抽出された場合には上記抽出された実行結果を上記実行部に出力するようにしてもよい。これにより、複数回実行される命令区間である再利用区間の呼出し命令の実行前までに、入力値設定命令アドレスにより特定される入力値設定命令により取得される入力値と、その入力値設定命令アドレスに対応する区間識別情報とを用いて履歴メモリにおける実行結果を検索し、入力値設定命令アドレスによって特定される再利用区間の呼出し命令が実行されるときに、実行履歴検索部により実行結果が抽出された場合には、その実行結果を実行部に出力させるという作用をもたらす。 In the first aspect, 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. When the calling instruction of the specified reuse section is executed, 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. As a result, 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.
また、この第1の側面において、上記入力値設定命令に基づいて設定された入力値のうち上記呼出し命令により呼び出された上記命令区間において参照された入力値に対応する上記入力値設定命令アドレスと上記区間識別情報とを上記入力値設定命令アドレステーブルに出力する入力値設定命令アドレス出力部をさらに具備するようにしてもよい。これにより、入力値設定命令アドレス出力部により、呼出し命令前までの入力値設定命令により設定された入力値のうち、その呼出し命令の命令区間において参照された入力値が設定された入力値設定命令の入力値設定命令アドレスと区間識別情報とを出力させるという作用をもたらす。この場合において、上記入力値設定命令アドレス出力部は、上記命令区間において参照された複数の入力値に対応する上記入力値設定命令のうち最先の上記入力値設定命令の上記入力値設定命令アドレスと上記区間識別情報である上記命令区間の先頭アドレスとを出力するようにしてもよい。これにより、入力値設定命令アドレス出力部により、関数の命令区間において参照された複数の入力値を設定する入力値設定命令のうち、最先の入力値設定命令の入力値設定命令アドレスとその命令区間の先頭アドレスとを出力させるという作用をもたらす。 In the first aspect, 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. As a result, 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. In this case, 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. And the start address of the command section, which is the section identification information, may be output. As a result, 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.
また、この第1の側面において、上記入力値設定命令アドレステーブルは、上記命令区間における複数の入力値を設定するための入力値設定命令のうち最先の上記入力値設定命令の上記入力値設定命令アドレスを上記区間識別情報ごとに保持するようにしてもよい。これにより、入力値設定命令アドレステーブルにより、命令区間における複数の入力値設定命令のうち、最先に実行された入力値設定命令の入力値設定命令アドレスを、区間識別情報ごとに保持させるという作用をもたらす。 In the first aspect, 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.
また、この第1の側面において、上記実行部は、上記実行履歴検索部により上記実行履歴における上記実行結果が上記履歴メモリから抽出されない場合には上記入力値設定命令アドレスによって特定された上記命令区間における処理を実行し、上記実行履歴検索部は、上記入力値設定命令に基づいて上記実行部から出力された入力値と上記実行部により実行された実行結果と上記入力値設定命令アドレスに対応する上記区間識別情報とを上記履歴メモリに保持させるようにしてもよい。これにより、実行履歴検索部において実行結果が履歴メモリから抽出されない場合には、入力値設定命令アドレスによって特定された命令区間における処理を実行部により実行して、実行履歴検索部により、入力値設定命令に基づいて取得された入力値と、実行部により実行された命令区間における処理の実行結果と、入力値設定命令アドレステーブルにおける入力値設定命令アドレスに対応する区間識別情報とを履歴メモリに保持させるという作用をもたらす。 In the first aspect, 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. Thereby, when the execution result is not extracted from the history memory in the execution history search unit, the execution unit executes the process in the instruction section specified by the input value setting instruction address, and the execution history search unit sets the input value. The history value memory stores the input value acquired based on the instruction, the execution result of the process in the instruction section executed by the execution unit, and the section identification information corresponding to the input value setting instruction address in the input value setting instruction address table It brings the effect of letting.
また、この第1の側面において、上記入力値設定命令アドレステーブルは、上記命令区間である関数の上記入力値設定命令の上記入力値設定命令アドレスを上記区間識別情報である上記関数の先頭アドレスごとに保持し、上記履歴メモリは、上記関数の先頭アドレスごとに上記関数における入力値および実行結果を関連付けて上記実行履歴として保持し、上記実行履歴検索部は、上記命令群のうちの上記入力値設定命令に基づいて上記実行部から出力された上記関数の上記入力値と上記入力値設定命令アドレスに対応する上記関数の先頭アドレスとを用いて上記実行結果を検索し、上記実行結果出力部は、上記入力値設定命令アドレスによって特定される上記関数の上記呼出し命令が実行されるときに上記実行履歴検索部により上記関数の上記実行結果が抽出された場合には上記抽出された実行結果を上記実行部に出力するようにしてもよい。これにより、関数の呼出し命令の実行前までに、入力値設定命令アドレスにより特定された入力値設定命令に基づいて設定された入力値と、その入力値設定命令アドレスに関連付けられた区間識別情報とを用いて履歴メモリにおける関数の実行結果を検索し、入力値設定命令アドレスによって特定される呼出し命令が実行されるときに、実行履歴検索部により実行結果が抽出された場合には、その関数の実行結果を実行部に出力させるという作用をもたらす。 In the first aspect, 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. When the call instruction of the function specified by the input value setting instruction address is executed, the execution history search unit The execution result of the extracted may be output to the execution unit when the execution result is extracted. Thus, before the execution of the function call instruction, the input value set based on the input value setting instruction specified by the input value setting instruction address, the section identification information associated with the input value setting instruction address, and When 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.
また、本発明の第2の側面は、プログラムのうち複数回実行される命令区間における処理の実行ごとの入力値が互いに一致する度合いを示す再利用度を上記命令区間の使用態様に基づいて上記命令区間ごとに生成する再利用度生成部と、上記複数の命令区間のうち上記再利用度に基づいて抽出された再利用区間における入力値を設定するための入力値設定命令の入力値設定命令アドレスと上記再利用区間を識別するための区間識別情報とが関連付けられた再利用区間情報を生成する再利用区間情報生成部とを具備するプログラム解析処理装置およびその処理方法である。これにより、複数回実行される命令区間の各々の実行結果が互いに一致する度合いを示す再利用度に基づいて複数の命令区間のうち再利用区間が抽出されて、再利用区間情報生成部により、その再利用区間における入力値設定命令の入力値設定命令アドレスと、再利用区間の区間識別情報とが関連付けられた再利用区間情報を生成させるという作用をもたらす。 Further, 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. Thereby, based on the degree of reuse indicating the degree to which the execution results of the instruction sections executed a plurality of times match 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.
本発明によれば、実行結果の再利用による再利用区間の処理時間を短縮させることができるという優れた効果を奏し得る。 According to 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.
以下、本発明を実施するための形態(以下、実施の形態と称する)について説明する。説明は以下の順序により行う。
1.第1の実施の形態(データ処理制御:入力値設定命令アドレスの事前登録の例)
2.第2の実施の形態(プログラム解析処理:入力値設定命令アドレスの抽出例)
3.第3の実施の形態(データ処理制御:プログラムの実行中における入力値設定命令アドレスの登録例)
4.第4の実施の形態(履歴データ転送制御:プログラム実行ごとにデータ処理装置の外部から履歴データを履歴メモリに読み出す例)
Hereinafter, modes for carrying out the present invention (hereinafter referred to as embodiments) will be described. The description will be made in the following order.
1. First Embodiment (Data Processing Control: Example of Preregistration of Input Value Setting Instruction Address)
2. Second Embodiment (Program Analysis Processing: Extraction Example of Input Value Setting Instruction Address)
3. Third Embodiment (Data Processing Control: Input Value Setting Instruction Address Registration Example During Program Execution)
4). 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)
<1.第1の実施の形態>
[データ処理装置の構成例]
図1は、本発明の第1の実施の形態におけるデータ処理装置の一構成例を示すブロック図である。ここでは、集積回路を構成するデータ処理装置100と、バス120と、主記憶部130とが示されている。この集積回路は、データ処理装置100において、バス120を介して読み出される主記憶部130からの命令列に従って、処理を実行するものである。
<1. First Embodiment>
[Configuration example of data processing device]
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. Here, a
データ処理装置100は、一次キャッシュ200と、データ処理部300と、実行結果再利用処理部400と、検索開始命令アドレス管理部500とを備える。なお、データ処理装置100は、特許請求の範囲に記載のデータ処理装置の一例である。
The
一次キャッシュ200は、バス120を介して主記憶部130から命令およびデータを読み出す際、または、書き込む際の処理により生じる遅延時間を軽減するためのメモリである。この一次キャッシュ200は、例えば、DRAM(Dynamic Random Access Memory)により実現される。
The
この一次キャッシュ200は、命令キャッシュ210およびデータキャッシュ220を備える。命令キャッシュ210は、主記憶部130から読み出された過去の命令を一時的に保持するものである。この命令キャッシュ210は、データ処理部300からの要求に従って、その保持された命令を、命令線219を介してデータ処理部300に出力する。
The
この命令キャッシュ210は、データ処理部300から要求された命令を保持している場合には、その保持されている複数の命令のうち、その要求された命令をデータ処理部300に出力する。一方、データ処理部300から要求された命令を保持していない場合には、命令キャッシュ210は、データ処理部300によって主記憶部130から読み出された命令を保持する。
When the
データキャッシュ220は、主記憶部130から読み出された過去のデータを一時的に保持するものである。このデータキャッシュ220は、データ処理部300からの要求に従って、その保持されたデータを、データ線229を介してデータ処理部300に出力する。
The
このデータキャッシュ220は、データ処理部300から要求されたデータが保持されている場合には、その保持されている複数のデータのうち、その要求されたデータをデータ処理部300に出力する。一方、データ処理部300から要求されたデータが保持されていない場合には、データキャッシュ220は、データ処理部300により主記憶部130から読み出されたデータを保持する。また、データキャッシュ220は、主記憶部130に書き戻すためのデータがデータ処理部300から供給された場合には、そのデータを保持する。
When the data requested by the
データ処理部300は、主記憶部130から読み出された命令に基づく処理を実行するものである。このデータ処理部300は、例えば、命令キャッシュ210を介して主記憶部130から命令を読み出して、その読み出された命令に従って、データキャッシュ220を介して主記憶部130に記憶されたデータを読み出す。また、データ処理部300は、例えば、その読み出されたデータを用いて、演算命令に基づく演算処理を実行する。
The
また、データ処理部300は、例えば、関数の命令区間における処理を実行する場合には、データキャッシュ220からの関数における引数の入力値を用いて、その関数の演算処理を実行して、その演算処理の結果である実行結果をデータキャッシュ220に出力する。このとき、データ処理部300は、その関数における入力値および実行結果を実行結果再利用処理部400に出力する。このデータ処理部300は、例えば、プロセッサコアにより実現される。
In addition, for example, when executing processing in an instruction section of a function, the
実行結果再利用処理部400は、過去に実行された命令区間の入力値と、再び実行される命令区間の入力値とが一致した場合には、その過去に実行された命令区間の実行結果を再利用する実行結果再利用処理を実行するものである。ここでは、複数回実行される命令区間のうち、過去に実行された命令区間の実行結果を再利用することができる命令区間を再利用区間という。すなわち、この再利用区間とは、複数回実行される命令区間のうち、命令区間における入力値が同じであれば実行結果も同じとなる命令区間のことをいう。
When the input value of the instruction section executed in the past matches the input value of the instruction section executed again, the execution result
この実行結果再利用処理部400は、複数回実行される再利用区間における入力値および実行結果を実行履歴として保持する。また、実行結果再利用処理部400は、再び実行される再利用区間の入力値と、その保持された実行履歴における入力値とが同一である場合には、その保持された実行履歴における実行結果をデータ処理部300に出力する。これとともに、実行結果再利用処理部400は、その再利用区間における処理を省略(スキップ)するための指示をデータ処理部300に通知する。
The execution result
この実行結果再利用処理部400は、例えば、再利用区間である関数の引数の入力値と、その保持された実行履歴における入力値とが同一である場合には、その保持された実行履歴における実行結果をデータ処理部300に出力する。これとともに、実行結果再利用処理部400は、その関数における処理をスキップするための指示をデータ処理部300に通知する。
For example, when the input value of the argument of the function that is the reuse section is the same as the input value in the held execution history, the execution result
検索開始命令アドレス管理部500は、実行結果再利用処理部400における実行履歴の検索を開始する基準となる命令アドレスを管理するものである。この検索開始命令アドレス管理部500は、実行結果再利用処理部400において保持された実行履歴における入力値と、再利用区間の実行のために設定された入力値との比較を開始するタイミングを示す基準として命令アドレスを再利用区間ごとに管理する。また、検索開始命令アドレス管理部500は、その管理された命令アドレスに基づいて、実行結果再利用処理部400に実行履歴の検索の開始を指示する。
The search start instruction
バス120は、データ処理装置100と主記憶部130との間の通信を行うものである。このバス120は、主記憶部130に記憶されているプログラムをデータ処理装置100に転送する。また、このバス120は、データ処理装置100から出力されたデータを主記憶部130に転送する。
The
主記憶部130は、データ処理装置100に処理を実行させるためのプログラムを記憶するものである。ここでは、このプログラムは、ABI(Application Binary Interface)の規定に基づいて生成されたプログラムであることを想定する。このプログラムは、例えば、SPARC(Scalable Processor Architecture)_ABIに基づいて生成されるものである。このようなプログラムにおいては、データ処理装置100によって、関数における入力値および実行結果が格納される場所を特定することができるため、実行結果の再利用を実現することができる。
The
[データ処理部300および実行結果再利用処理部400の構成例]
図2は、本発明の第1の実施の形態におけるデータ処理部300および実行結果再利用処理部400の一構成例を示すブロック図である。
[Configuration Example of
FIG. 2 is a block diagram illustrating a configuration example of the
データ処理部300は、フェッチ部310と、命令デコーダ320と、実行部330と、レジスタファイル340とを備える。この実行部330は、ロードユニット331と、入力選択部332と、演算回路333と、ストアユニット334と、プログラムカウンタ350とを備える。
The
また、実行結果再利用処理部400は、実行履歴検索部410と、実行結果出力部420と、履歴メモリ430とを備える。さらに、検索開始命令アドレス管理部500は、アドレス判定部510および入力値設定命令アドレステーブル520を備える。
The execution result
フェッチ部310は、命令キャッシュ210に保持されている命令、または、主記憶部130に記憶されている命令を、命令線219を介して読み出すものである。このフェッチ部310は、プログラムカウンタ350から出力される命令アドレスに従って、命令キャッシュ210から命令を読み出す。
The fetch
このフェッチ部310は、例えば、再利用区間である関数を呼び出すための呼出し命令の前に、その関数における引数の入力値を設定するための入力値設定命令を読み出す。そして、その入力値設定命令が読み出された後に、フェッチ部310は、その関数の呼出し命令を読み出す。
For example, the fetch
また、フェッチ部310は、読み出された命令を命令デコーダ320に供給する。また、履歴メモリ430における実行結果を再利用するための関数省略信号が実行履歴検索部410から供給された場合には、フェッチ部310は、例えば、その実行結果を設定するための命令を命令デコーダ320に供給する。
The fetch
命令デコーダ320は、フェッチ部310から供給された命令を解読(デコード)して、その解読内容に基づいて、実行部330、レジスタファイル340およびアドレス判定部510を制御するものである。
The
この命令デコーダ320は、フェッチ部310から入力値設定命令が供給された場合には、実行データ保持部440に関数の引数の入力値を保持させるために、入力値設定信号をアドレス判定部510に供給する。この場合において、命令デコーダ320は、フェッチ部310から供給された命令が、関数における引数の入力値を設定するための入力値設定命令であるか否かを判断する。この命令デコーダ320は、例えば、ABIの規定に基づいて、フェッチ部310からの命令が入力値設定命令であるか否かを判断する。ここで、MIPS(Microprocessor without Interlocked Pipeline Stages)のABIの規定に基づく判断例について簡単に説明する。
When the instruction value is supplied from the fetch
MIPSの規定では、例えば、引数の入力値が全て整数である場合において、引数が4個以下のときには、レジスタファイル340におけるレジスタ4番乃至7番に入力値が格納される。また、引数が5個以上のときには、5番目以上の引数の入力値が主記憶部130におけるスタック領域にスタックされる。具体的には、5番目以上の引数の入力値は、レジスタファイル340のレジスタ29番に格納されたスタックポイント値に16以上の値が加算された値に対応する主記憶部130のスタック領域にスタックされる。
According to the MIPS rules, for example, when all input values of arguments are integers and the number of arguments is 4 or less, the input values are stored in registers 4 to 7 in the
したがって、命令デコーダ320は、例えば、ロードワード命令(lw)に示された転送先レジスタがレジスタ4番乃至7番である場合には、入力値設定命令と判断する。また、命令デコーダ320は、引数が5個以上であり、かつ、その全ての引数が整数である場合には、ストアワード命令(sw)に示された転送先レジスタがレジスタ29番であり、かつ、そのオフセット値が「16」以上となるため、入力値設定命令と判断する。
Therefore, for example, when the transfer destination register indicated by the load word instruction (lw) is the registers 4 to 7, the
このようにして、命令デコーダ320は、フェッチ部310から供給された命令に示されるデータの格納先に基づいて、その命令が入力値設定命令であるか否かを判断する。そして、入力値設定命令と判断された場合には、命令デコーダ320は、入力選択部332から出力されるデータを引数の入力値として実行データ保持部440に保持させるために、入力値設定信号をアドレス判定部510に供給する。
In this way, the
この命令デコーダ320は、例えば、主記憶部130から読み出された関数の入力値を設定するための入力値設定命令を受け付けた場合には、ロードユニット331から読み出された入力値をレジスタファイル340に格納するように制御する。これとともに、命令デコーダ320は、アドレス判定部510に対し入力値設定信号を供給する。
For example, when receiving an input value setting command for setting an input value of a function read from the
また、命令デコーダ320は、例えば、レジスタファイル340に格納されているデータを関数の入力値として設定するための入力値設定命令を受け付けた場合には、レジスタファイル340における1つのレジスタに格納された入力値を他のレジスタに転送させる。これとともに、命令デコーダ320は、アドレス判定部510に対し入力値設定信号を供給する。
For example, when the
また、命令デコーダ320は、入力値設定命令の後に、関数を呼び出すための呼出し命令を受け付けた場合には、関数の先頭アドレスにジャンプする旨を示す関数呼出し信号をアドレス判定部510に供給する。すなわち、この命令デコーダ320は、関数の呼出し命令を受け付けた場合には、履歴メモリ430における実行結果の再利用処理を実行するタイミングを通知するために、関数呼出し信号をアドレス判定部510に供給する。
When the
また、命令デコーダ320は、例えば、MIPSの規定に基づいて、フェッチ部310からの命令に示されるデータの格納場所により、その命令が、関数の引数である入力値を参照するための入力値参照命令か否かを判断する。この命令デコーダ320は、入力値参照命令を受け付けた場合には、入力値参照信号をアドレス判定部510に供給する。また、命令デコーダ320は、関数の戻り命令を受け付けた場合には、アドレス判定部510に関数戻り信号を供給する。
In addition, the
また、命令デコーダ320は、MIPSの規定に基づいて、フェッチ部310からの命令に示される格納場所によってその命令が、関数の実行による実行結果を設定するための実行結果設定命令か否かを判断する。この命令デコーダ320は、実行結果設定命令を受け付けた場合には、実行データ保持部440に保持させるために、実行結果設定信号をアドレス判定部510に供給する。
Further, the
また、命令デコーダ320は、関数の戻り命令を受け付けた場合には、アドレス判定部510に関数戻り信号を供給する。また、命令デコーダ320は、フェッチ部310から供給された命令に基づいて、プログラムカウンタ350の値を設定する。
When the
実行部330は、命令デコーダ320からの制御に従って処理を実行するものである。この実行部330は、複数の命令区間を含む命令列に基づく処理を実行する。すなわち、この実行部330は、複数回実行される命令区間である再利用区間が含まれる命令列に基づく処理を実行する。この実行部330は、再利用区間である関数の入力値および実行結果を、レジスタファイル340または主記憶部130に出力するとともに、実行データ保持部440に供給する。
The
この実行部330は、例えば、入力値設定命令の実行により、関数の呼出し命令の前にその関数の入力値を、レジスタファイル340または主記憶部130に設定するとともに、実行データ保持部440に出力する。この実行部330は、例えば、入力値設定命令により設定された入力値を、入力値参照命令の実行によって参照するとともに、実行データ保持部440にその参照した入力値を出力する。この実行部330は、例えば、関数における引数の数値、引数の型および引数の格納場所を入力値として実行データ保持部440に出力する。なお、実行部330は、特許請求の範囲に記載の実行部の一例である。
The
ロードユニット331は、命令デコーダ320からの制御に従って、主記憶部130またはデータキャッシュ220からデータを読み出して、その読み出されたデータを入力選択部332に供給するものである。このロードユニット331は、例えば、命令デコーダ320からの制御に従って、主記憶部130またはデータキャッシュ220から関数における引数の入力値を読み出して、その読み出された入力値を入力選択部332に供給する。
The
入力選択部332は、命令デコーダ320からの制御に従って、実行結果出力部420、演算回路333、レジスタファイル340および実行結果出力部420から出力されたデータのうちいずれか1つのデータを選択するものである。
The
この入力選択部332は、その選択されたデータを、レジスタファイル340および実行データ保持部440に出力する。すなわち、この入力選択部332は、命令デコーダ320の制御に従って、実行結果出力部420、演算回路333、レジスタファイル340および実行結果出力部420の出力のうち、いずれかをレジスタファイル340および実行データ保持部440に出力する。
The
この入力選択部332は、例えば、入力値設定命令としてロードワード命令が命令デコーダ320に供給された場合には、命令デコーダ320の制御に従って、ロードユニット331からのデータを、レジスタファイル340および実行データ保持部440に出力する。
For example, when a load word instruction is supplied to the
また、この入力選択部332は、例えば、入力値設定命令としてムーブ命令が供給された場合には、命令デコーダ320の制御に従って、レジスタファイル340におけるデータを、レジスタファイル340および実行データ保持部440に出力する。
Further, for example, when a move command is supplied as an input value setting command, the
また、入力選択部332は、演算処理を実行するための演算命令が命令デコーダ320に供給された場合には、命令デコーダ320の制御に従って、演算回路333から出力された演算結果を実行結果として、レジスタファイル340に出力する。また、この入力選択部332は、実行履歴検索部410により実行結果が抽出された場合には、命令デコーダ320からの制御に従って、実行結果出力部420から出力された実行結果をレジスタファイル340に出力する。
In addition, when an arithmetic instruction for executing arithmetic processing is supplied to the
演算回路333は、命令デコーダ320からの制御に従って、演算処理を実行するものである。この演算回路333は、例えば、乗算、除算または積和などの演算処理を実行するための演算命令が命令デコーダ320に供給された場合には、命令デコーダ320の制御に従って、レジスタファイル340に格納されたデータを用いて演算処理を実行する。また、演算回路333は、その演算処理による演算結果を実行結果として、入力選択部332を介してレジスタファイル340に格納する。
The
ストアユニット334は、命令デコーダ320からの制御に従って、レジスタファイル340に格納されたデータ、または、実行結果出力部420から出力された実行結果を主記憶部130に書き戻すためのものである。このストアユニット334は、主記憶部130にデータを書き戻すためのストアワード命令が命令デコーダ320に供給された場合には、命令デコーダ320からの制御に従って、書き戻すべきデータを、データ線229を介してデータキャッシュ220に出力する。
The
また、このストアユニット334は、実行履歴検索部410により履歴メモリ430から実行結果が抽出された場合には、実行結果出力部420から出力された実行結果を、データ線229を介して主記憶部130およびデータキャッシュ220に書き戻す。
In addition, when the execution result is extracted from the
レジスタファイル340は、実行部330から出力されたデータを格納するものである。このレジスタファイル340は、複数のレジスタ、例えば、レジスタ0番乃至31番の32個のレジスタにより構成される。このレジスタファイル340は、命令デコーダ320からの制御に従って、実行部330から出力されたデータを、複数のレジスタのうち1つのレジスタに格納する。
The
また、このレジスタファイル340は、例えば、命令デコーダ320からの制御に従って、複数のレジスタのうち1つのレジスタに格納された実行結果を実行部330に、または実行部330を介して実行履歴検索部410に出力する。
The
プログラムカウンタ350は、命令デコーダ320からの制御によってカウント値が設定されるものである。このプログラムカウンタ350は、例えば、命令デコーダ320からの制御によって、1つの命令が実行されるたびにカウント値を1つ増加させる。また、このプログラムカウンタ350は、命令デコーダ320からの制御によって、関数の呼出し命令が実行された場合には、レジスタファイル340に格納された関数の先頭アドレスが設定される。このプログラムカウンタ350は、そのカウント値を、主記憶部130のメモリアドレスを示す命令アドレスとしてアドレス判定部510に出力する。
The
アドレス判定部510は、入力値設定命令アドレステーブル520に登録された入力値設定命令アドレスに基づいて、履歴メモリ430における実行履歴を検索させるために、実行履歴検索部410および実行データ保持部440を制御するものである。すなわち、アドレス判定部510は、プログラムカウンタ350から出力された命令アドレスが、入力値設定命令アドレステーブル520に保持された入力値設定命令アドレスと一致した場合には、実行履歴の検索を開始させるものである。
The
このアドレス判定部510は、プログラムカウンタ350から出力された命令アドレスと、入力値設定命令アドレステーブル520に登録された入力値設定命令アドレスとが一致したか否かを判定する。そして、双方の命令アドレスが一致した場合には、アドレス判定部510は、入力値設定命令アドレスにより特定された入力値設定命令に基づいて、実行部330から出力された入力値を実行データ保持部440に保持させる。
The
これとともに、アドレス判定部510は、入力値設定命令アドレステーブル520におけるその一致した入力値設定命令アドレスと関連付けられた区間識別情報を実行データ保持部440に保持させる。ここにいう区間識別情報とは、複数の再利用区間を互いに識別するための識別情報である。この区間識別情報として、例えば、再利用区間である関数の先頭アドレスを用いるようにしてもよい。
At the same time, the
また、双方の命令アドレスが一致した場合において、命令デコーダ320から、関数呼出し信号が供給されるまでの間に入力値設定信号が供給されたときは、アドレス判定部510は、実行部330から出力された入力値を実行データ保持部440に保持させる。すなわち、アドレス判定部510は、関数呼出し信号が供給されるまでの間、命令デコーダ320から供給された入力値設定信号に基づいて、関数における引数の入力値として実行部330からの出力を実行データ保持部440に保持させる。
Further, when both instruction addresses coincide with each other, when the input value setting signal is supplied from the
また、アドレス判定部510は、命令デコーダ320から関数呼出し信号が供給された場合には、履歴メモリ430における実行結果の再利用処理を実行履歴検索部410に指示する。また、アドレス判定部510は、命令デコーダ320から供給される実行結果設定信号に基づいて、関数の実行結果として実行部330からの出力を実行データ保持部440に保持させる。
Further, when a function call signal is supplied from the
また、アドレス判定部510は、命令デコーダ320から供給される関数戻り信号に基づいて、実行データ保持部440における区間識別情報、入力値および実行結果を履歴メモリ430に新たに登録させるために、実行履歴検索部410に登録の指示を行う。
In addition, the
入力値設定命令アドレステーブル520は、複数回実行される再利用区間である関数を識別するための区間識別情報ごとに、その関数における入力値を設定するための入力値設定命令のアドレスである入力値設定命令アドレスを保持するものである。ここにいうアドレスとは、入力値設定命令が、主記憶部130に記憶されているメモリアドレスを示す。
The input value setting instruction address table 520 is an input that is an address of an input value setting instruction for setting an input value in a 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
ここでは、入力値設定命令アドレステーブル520には、例えば、コンパイラ装置またはプログラムの事前実行により、主記憶部130に記憶されるプログラムを解析することによって抽出された再利用区間に関するデータが保持されていることを想定する。すなわち、入力値設定命令アドレステーブル520には、実行結果が再利用される度合いが高い関数の入力設定命令アドレスと、その関数を識別するための区間識別情報とが関連付けて保持されている。
Here, in the input value setting instruction address table 520, for example, data relating to a reuse section extracted by analyzing a program stored in the
この入力値設定命令アドレステーブル520は、例えば、関数における入力値を設定するための入力値設定命令のうち、最初に入力値を設定する入力値設定命令の入力値設定命令アドレスを区間識別情報ごとに保持する。すなわち、この入力値設定命令アドレステーブル520は、再利用区間の区間識別情報ごとに、その再利用区間における最先の入力値設定命令アドレスを保持する。このように、最先の入力値設定命令のみを保持させることによって、入力値設定命令アドレステーブル520の容量を低減することができる。 The input value setting command address table 520 is, for example, the input value setting command address of the input value setting command that first sets the input value 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 520 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 command address table 520 can be reduced by holding only the earliest input value setting command.
また、入力値設定命令アドレステーブル520は、その保持されたデータをアドレス判定部510に出力する。なお、入力値設定命令アドレステーブル520に、再利用区間である関数が複数の引数を持つ場合には、区間識別情報ごとに、複数の入力値設定命令アドレスを保持させるようにしてもよい。また、入力値設定命令アドレステーブル520は、特許請求の範囲に記載の入力値設定命令アドレステーブルの一例である。
Further, the input value setting instruction address table 520 outputs the held data to the
なお、入力値設定命令アドレステーブル520に、区間識別情報ごとに実行履歴を削除する際の優先度をさらに保持させるようにしてもよい。この場合には、実行履歴検索部410は、アドレス判定部510からの優先度を履歴メモリ430に登録する。そして、履歴メモリ430の容量が一定の条件を超えた場合には、実行履歴検索部410は、履歴メモリ430に保持された優先度に基づいて、履歴メモリ430における実行履歴を削除する。
Note that the input value setting command address table 520 may further hold the priority when deleting the execution history for each section identification information. In this case, the execution
実行データ保持部440は、アドレス判定部510からの指示に従って、アドレス判定部510からの区間識別情報と、実行部330からの関数における入力値および実行結果とを保持するものである。この実行データ保持部440は、その保持された区間識別情報と、関数における入力値および実行結果とを実行履歴検索部410に出力する。
The execution
実行履歴検索部410は、実行データ保持部440から出力された識別情報および関数の入力値に基づいて、履歴メモリ430における実行履歴を検索するものである。この実行履歴検索部410は、履歴メモリ430において区間識別情報ごとに保持された再利用区間における入力値および実行結果である実行履歴のうち、実行データ保持部440に保持された区間識別情報および入力値と同一の実行履歴における実行結果を抽出する。
The execution
実行履歴検索部410は、履歴メモリ430から実行結果が抽出された場合において、アドレス判定部510からの再利用処理の指示を受け付けたときは、その実行結果を実行結果出力部420に出力する。これとともに、実行履歴検索部410は、関数の処理を省略するための関数省略信号として、その抽出された実行結果における格納場所に関する情報をフェッチ部310に供給する。
When the execution result is extracted from the
一方、履歴メモリ430から実行結果が抽出されない場合において、アドレス判定部510からの再利用処理の指示を受け付けたときは、実行履歴検索部410は、関数省略信号をフェッチ部310に出力しない。そして、実行部330における関数の実行によって、新たに生成された実行結果が実行データ保持部440に保持された後に、実行履歴検索部410は、実行データ保持部440からの出力を履歴メモリ430に登録する。
On the other hand, when the execution result is not extracted from the
すなわち、この実行履歴検索部410は、アドレス判定部510からの登録指示に基づいて、実行データ保持部440に保持された区間識別情報、入力値および実行結果を履歴メモリ430に保持させる。
That is, the execution
実行結果出力部420は、実行履歴検索部410によって履歴メモリ430から実行結果が抽出された場合には、その実行結果を、入力選択部332を介してレジスタファイル340に、または、ストアユニット334に出力するものである。この実行結果出力部420は、履歴メモリ430からの実行結果におけるデータの格納場所に従って、ストアユニット334または入力選択部332にその実行結果におけるデータを出力する。なお、実行結果出力部420は、特許請求の範囲に記載の実行結果出力部の一例である。
If the execution result is extracted from the
履歴メモリ430は、区間識別情報ごとに、区間識別情報により識別される関数における入力値および実行結果を関連付けて実行履歴として保持するものである。この履歴メモリ430は、例えば、連想メモリ(CAM:Content Addressable Memory)により実現される。この例において、履歴メモリ430は、実行結果を検索するための検索キーである区間識別情報が実行履歴検索部410から入力されることによって、その区間識別情報に関連付けられた実行履歴の検索を開始する。
The
また、履歴メモリ430は、実行履歴検索部410から順次供給された入力値と、履歴メモリ430に保持されている入力値とが全て一致する場合には、その履歴メモリ430における入力値に関連付けられた実行結果を実行履歴検索部410に出力する。すなわち、実行履歴検索部410から入力された区間識別情報および入力値と同一の実行履歴が履歴メモリ430から検出されることによって、実行履歴検索部410により履歴メモリ430から実行結果が抽出される。
The
また、この連想メモリにより実現される履歴メモリ430は、例えば、実行履歴における入力値のパターンを木構造により保持する。なお、履歴メモリ430は、特許請求の範囲に記載の履歴メモリの一例である。
The
このように、アドレス判定部510および入力値設定命令アドレステーブル520を設けることによって、再利用区間の最先の入力値設定命令を特定することができるため、再利用区間の実行前に、履歴メモリ430における実行履歴の検索を行うことができる。次に、履歴メモリ430におけるデータ構造の例について図面を参照して以下に説明する。
Thus, by providing the
[履歴メモリ430のデータ構造例]
図3は、本発明の第1の実施の形態における履歴メモリ430のデータ構造の一例を示す概念図である。ここでは、履歴メモリ430により、区間識別情報ごとに保持された実行履歴のうち、1つの区間識別情報における複数の実行履歴を木構造により保持する構成が示されている。この例では、引数がn個の関数であって、実行結果である出力をm個の格納先に返す関数を想定する。また、ここでは、関数の先頭アドレスである関数アドレスを区間識別情報とする。
[Data structure example of history memory 430]
FIG. 3 is a conceptual diagram showing an example of the data structure of the
この例では、木構造における関数ルート460と、第1の引数ノード461および462と、第nの引数ノード471乃至474と、第1の出力ノード481乃至484と、第mの出力ノード491乃至494とが示されている。
In this example, the
関数ルート460には、区間識別情報である関数アドレスと、第1の引数ノード461を指し示すポインタとが示されている。
In the
第1および第nの引数ノード461、462および471乃至474には、履歴メモリ430に保持されている実行履歴における引数の入力値として、引数の値を示す入力データと、その引数の型と、その引数の格納場所を示す種類とが示されている。ここにいう格納場所とは、レジスタファイル340のレジスタ番号または主記憶部130のメモリアドレスのことをいう。
The first and
さらに、第1および第nの引数ノード461、462および471乃至474には、比較対象の入力値が互いに一致するときに、次の引数における引数ノードを指し示す右ポインタが示されている。一方、第1および第nの引数ノード461、462および471乃至474には、比較対象の入力値が不一致のときに、同一の引数における他の引数ノードを指し示す下ポインタが示されている。また、第nの引数ノード471乃至474の各々に、第1および第mの出力ノード481乃至484および491乃至494がそれぞれ連結されている。
Furthermore, the first and
第1および第mの出力ノード481乃至484および491乃至494には、履歴メモリ430に保持されている実行履歴における実行結果として、実行結果の値を示す出力データと、その実行結果の格納場所を示す種類と、その実行結果の型とが示されている。さらに、第1の出力ノード481乃至484には、次の出力における出力ノードを指し示す右ポインタが示されている。この第1および第mの出力ノード481乃至484および491乃至494は、連結リストを構成している。また、第mの出力ノード491乃至494の右ポインタには、出力ノードの終端を表わすヌルが示されている。
In the first and m-
このような木構造において、関数ルート460に示された関数アドレスと一致する関数アドレスが実行履歴検索部410から入力されると、関数ルート460のポインタによって指し示された第1の引数ノード461において入力値の比較処理が実行される。ここにいう入力値の比較処理とは、第1の引数ノード461に示された入力データ、種類および型である入力値と、実行履歴検索部410からの入力値とを比較することである。
In such a tree structure, when a function address that matches the function address indicated in the
このとき、例えば、第1の引数ノード461に示された入力値と、実行履歴検索部410からの入力値とが一致した場合には、第1の引数ノード461の右ポインタにより指し示された次の引数ノードにおいて入力値の比較処理が実行される。一方、第1の引数ノード461に示された入力値と、実行履歴検索部410からの入力値とが一致しない場合には、第1の引数ノード461の下ポインタにより指し示された第1の引数ノード462において入力値の比較処理が実行される。
At this time, for example, when the input value indicated by the first argument node 461 matches the input value from the execution
このようにして、各引数ノードにおける比較処理による比較結果に基づいて右または下ポインタの指し示す引数ノードが選択され、その選択された引数ノードにおいて入力値の比較処理が順次実行される。そして、第nの引数ノード471に示された入力値と、実行履歴検索部410からの入力値とが互いに一致した場合には、第nの引数ノード471の右ポインタにより第1の出力ノード481が指し示される。これにより、第1の出力ノード481に保持された出力データ、種類および型を示す実行結果から順番に、第m番の出力ノード491に保持された実行結果までが実行履歴検索部410に順次出力される。
In this way, the argument node pointed to by the right or lower pointer is selected based on the comparison result of the comparison process at each argument node, and the input value comparison process is sequentially executed at the selected argument node. If the input value indicated by the
このように、履歴メモリ430を区間識別情報ごとに木構造により構成することによって、同じ引数の入力値を重複して保持する必要が無いため、履歴メモリ430の記憶領域を節約することができる。また、区間識別情報ごとにデータ構造を分けることによって、検索速度の低下を抑制することができる。次に、この履歴メモリ430に対する登録手法として、再利用区間である関数の1回目の実行における履歴メモリ430に対する登録処理例について図面を参照して以下に説明する。
In this way, by configuring the
[再利用区間の1回目の実行による履歴メモリ430に対する登録例]
図4は、本発明の第1の実施の形態におけるデータ処理装置100による1回目の関数の実行における区間識別情報および実行履歴の登録手法を示す概念図である。図4(a)は、入力値設定命令アドレステーブル520のデータフォーマットの一例を示す図である。入力値設定命令アドレステーブル520には、関数における最先の入力値設定命令アドレス521と、その関数を識別するための区間識別情報である関数アドレス522との対応関係が示されている。
[Registration example for the
FIG. 4 is a conceptual diagram showing a method of registering section identification information and execution history in the first function execution by the
図4(b)は、上位ルーチンにおいて2つの引数を持つ関数が呼出し命令(call)によって呼び出された後に、その関数の命令区間である下位ルーチンにおいて戻り命令(return)によって上位ルーチンに復帰する処理例を示す概念図である。ここでは、上位ルーチンにおける入力値A設定321および入力値B設定322と、下位ルーチンにおける入力値A参照323、入力値B参照324および実行結果C設定325とが示されている。また、ここでは、左から右に時間が経過することとする。
FIG. 4B shows a process in which a function having two arguments is called by a call instruction (call) in the upper routine and then returned to the upper routine by a return instruction (return) in a lower routine that is an instruction section of the function. It is a conceptual diagram which shows an example. Here, an input value A setting 321 and an input value B setting 322 in the upper routine, an input
入力値A設定321および入力値B設定322は、2つの入力値設定命令に基づいて、再利用区間である関数における入力値Aおよび入力値Bが設定されるタイミングを示す。ここでは、入力値A設定命令アドレスに対応する入力値A設定命令に基づいて入力値Aが設定される。また、入力値B設定命令アドレスに対応する入力値B設定命令に基づいて入力値Bが設定される。このように、関数の呼出し命令(call)の前に、入力値設定命令によってその関数の引数の入力値が設定されるのは、図1で述べたとおり、主記憶部130に記憶されたプログラムがABIの規定に基づいて生成されるからである。
The input value A setting 321 and the input value B setting 322 indicate the timing at which the input value A and the input value B in the function that is a reuse section are set based on two input value setting commands. Here, 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. In this way, 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. 1, the program stored in the
入力値A参照323および入力値B参照324は、下位ルーチンによる関数の処理において、入力値参照命令の実行によって関数の入力値が参照されるタイミングを示す。ここでは、入力値A設定命令および入力値B設定命令により設定された入力値Aおよび入力値Bが、2つの入力値参照命令に基づいてそれぞれ参照される。すなわち、関数の処理において、入力値参照命令の実行により、入力値Aおよび入力値Bが設定されたレジスタファイル340におけるレジスタに格納された引数の数値が使用される。
The input
実行結果C設定325は、関数の処理により生成された実行結果Cが主記憶部130またはレジスタファイル340に設定されるタイミングを示す。ここでは、実行結果設定命令に基づいて実行結果Cが設定される。
The execution result C setting 325 indicates the timing at which the execution result C generated by the function processing is set in the
図4(c)は、履歴メモリ430におけるデータフォーマットの一例を示す概念図である。ここでは、関数の区間識別情報である関数アドレス431と、実行履歴検索データ432との対応関係が示されている。実行履歴検索データ432は、図3に示した木構造により構成される検索データであって、実行履歴における入力値および実行結果が関連付けられた情報を含む検索データである。
FIG. 4C is a conceptual diagram illustrating an example of a data format in the
このような場合において、入力値A設定321では、アドレス判定部510により、プログラムカウンタ350から出力された命令アドレスが、入力値設定命令アドレステーブル520における「入力値A設定命令アドレス」と一致したと判定される。
In such a case, in the input value A setting 321, it is assumed that the instruction address output from the
これにより、その一致した入力値設定命令アドレス(入力値A設定命令アドレス)に対応する区間識別情報(関数アドレス1)が、履歴メモリ430に入力される。すなわち、アドレス判定部510により、区間識別情報(関数アドレス1)を実行データ保持部440に保持させて、その保持された「関数アドレス1」が実行履歴検索部410によって履歴メモリ430に入力される。
As a result, 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
このとき、履歴メモリ430において、アドレス判定部510からの区間識別情報(関数アドレス1)と一致する区間識別情報が保持されていないため、その区間識別情報(関数アドレス1)が履歴メモリ430に登録される。
At this time, since the section identification information that matches the section identification information (function address 1) from the
この後、入力値設定命令により設定された入力値Aおよび入力値Bと、実行結果設定命令により設定された実行結果Cが、区間識別情報(関数アドレス1)に関連付けられて履歴メモリ430に登録される。すなわち、入力設定命令の実行による命令デコーダ320からの入力値設定信号に基づいて、アドレス判定部510によって、入力値Aおよび入力値Bが、実行データ保持部440に保持される。その後、実行結果設定命令の実行による命令デコーダ320からの実行結果設定信号に基づいて、実行結果Cが実行データ保持部440に保持される。
Thereafter, 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
そして、戻り命令(return)による命令デコーダ320からの関数戻り信号に基づいて、アドレス判定部510から実行履歴検索部410に実行履歴の登録が指示される。これにより、実行履歴検索部410によって、実行データ保持部440におけるデータ(入力値A、入力値Bおよび実行結果C)が履歴メモリ430に登録される。
Then, based on the function return signal from the
このように、入力値設定命令アドレステーブル520を設けることによって、入力値設定命令アドレステーブル520に保持された入力値設定命令アドレスに対応する関数の実行履歴だけを履歴メモリ430に登録することができる。これにより、再利用区間の入力値設定命令アドレスを事前に登録しておくことによって、実行結果が再利用される可能性の高い実行履歴だけを履歴メモリ430に保持させることができる。このため、履歴メモリ430の容量を有効に利用することができる。次に、履歴メモリ430に保持された実行履歴における実行結果を再利用する例について次図を参照して簡単に説明する。
Thus, by providing the input value setting instruction address table 520, only the execution history of the function corresponding to the input value setting instruction address held in the input value setting instruction address table 520 can be registered in the
[実行結果再利用処理の例]
図5は、本発明の第1の実施の形態におけるデータ処理装置100による実行結果再利用処理に関する手法の一例を示す概念図である。ここでは、図5(a)および(c)は、図4(a)および(c)に対応するため、ここでの説明を省略する。
[Execution result reuse processing example]
FIG. 5 is a conceptual diagram showing an example of a method related to the execution result reuse process by the
図5(b)は、上位ルーチンにおいて2つの引数を持つ関数が呼出し命令(call)によって呼び出された後に、その関数の命令区間である下位ルーチンにおいて戻り命令(return)によって上位ルーチンに復帰する処理例を示す概念図である。 FIG. 5B shows a process in which a function having two arguments is called by a call instruction (call) in the upper routine and then returned to the upper routine by a return instruction (return) in the lower routine that is the instruction section of the function. It is a conceptual diagram which shows an example.
ここでは、上位ルーチンにおける入力値A設定321および入力値B設定322と、関数の命令区間である下位ルーチンにおける入力値A参照323、入力値B参照324および実行結果C設定325とが示されている。これらは図4に示したものと同様であるため、同一符号を付してここでの説明を省略する。また、ここでは、左から右に時間が経過することとする。
Here, an input value A setting 321 and an input value B setting 322 in the upper routine, and an input
このような場合において、入力値A設定321では、アドレス判定部510により、プログラムカウンタ350から出力された命令アドレスが、入力値設定命令アドレステーブル520における「入力値A設定命令アドレス」と一致したと判定される。これにより、その一致した入力値設定命令アドレス(入力値A設定命令アドレス)に対応する区間識別情報(関数アドレス1)が、履歴メモリ430に入力される。すなわち、アドレス判定部510により、区間識別情報(関数アドレス1)を実行データ保持部440に保持させて、その保持された関数アドレス1が実行履歴検索部410によって履歴メモリ430に入力される。
In such a case, in the input value A setting 321, it is assumed that the instruction address output from the
このとき、履歴メモリ430には、アドレス判定部510からの区間識別情報(関数アドレス1)と同一の「関数アドレス1」が既に保持されているため、これに関連付けられた「実行履歴検索データ1」による実行結果の検索が行われる。
At this time, since the same “
また、入力値A設定321では、入力値A設定命令により設定された入力値Aが、履歴メモリ430に入力される。そして、入力値B設定322では、入力値B設定命令により設定された入力値Bが、履歴メモリ430に入力される。すなわち、アドレス判定部510からの指示により、命令デコーダ320からの入力値設定信号に基づいて、入力値Aおよび入力値Bが、実行データ保持部440に順次保持される。そして、実行履歴検索部410により、実行データ保持部440における入力値Aおよび入力値Bが実行履歴検索部410に順次入力される。
In the input value A setting 321, the input value A set by the input value A setting command is input to the
これにより、実行履歴検索部410からの入力値Aおよび入力値Bと、履歴メモリ430における「関数アドレス1」に対応する「実行履歴検索データ1」に保持された入力値との比較が順次行われる。ここでは、双方の入力値(入力値AおよびB)が一致するため、区間識別情報(関数アドレス1)および入力値(入力値Aおよび入力値B)に関連付けられた実行結果(実行結果C)が実行履歴検索部410に供給される。すなわち、履歴メモリ430に入力された区間識別情報(関数アドレス1)および入力値(入力値Aおよび入力値B)に関連付けられた実行結果(実行結果C)が履歴メモリ430から出力される。
As a result, the comparison between the input value A and the input value B from the execution
この後、呼出し命令(call)による命令デコーダ320からの関数呼出し信号に基づいて、アドレス判定部510から実行履歴検索部410に実行結果の再利用指示が通知されることによって、実行結果Cの再利用処理が実行される。すなわち、実行結果出力部420により、入力値設定命令アドレスにより特定される呼出し命令が実行されるときに、実行履歴検索部410により実行結果が抽出された場合には、その抽出された実行結果が実行部330に出力される。
Thereafter, based on the function call signal from the
このように、入力値設定命令アドレステーブル520を設けることによって、関数アドレス1の関数に対する最初に実行される最先の入力値A設定命令を特定することができる。このため、入力値A設定命令から呼出し命令(call)までの命令群のうちの入力値A設定命令および入力値B設定命令に基づいて設定される入力値(入力値Aおよび入力値B)を特定することができる。これにより、入力値A設定命令アドレスにより特定される呼出し命令(call)の実行までの実行履歴検索期間Tsにおいて、履歴メモリ430における区間識別情報(関数アドレス1)に対応する実行履歴の検索を行うことができる。
Thus, by providing the input value setting instruction address table 520, the earliest input value A setting instruction to be executed first for the function at the
また、実行履歴検索期間Tsにおいて関数アドレス1の実行履歴検索データ1により、実行履歴検索部410からの入力値Aおよび入力値Bに関連付けられた実行結果Cが抽出されることによって、関数の実行に要する時間(短縮期間T1)を削減することができる。ここで、本発明の第1の実施の形態における短縮期間T1と、従来の実行結果再利用処理による短縮期間との差異について以下に図面を参照して簡単に説明する。
Further, the execution result C associated with the input value A and the input value B from the execution
[実行結果再利用処理によって短縮される短縮期間の例]
図6は、実行結果再利用処理により関数の実行時間が短縮される例を示す概念図である。図6(a)は、入力値設定命令アドレステーブル520を設けない従来のデータ処理装置における実行結果の再利用による短縮期間を示す概念図である。図6(b)は、本発明の第1の実施の形態におけるデータ処理装置100における実行結果の再利用による短縮期間を示す概念図である。図6(a)および(b)は、図5(b)に示したものと同様であるため、同一符号を付してここでの説明を省略する。
[Example of shortening period shortened by execution result reuse processing]
FIG. 6 is a conceptual diagram illustrating an example in which the execution time of a function is shortened by the execution result reuse process. FIG. 6A is a conceptual diagram showing a shortened period due to reuse of execution results in a conventional data processing apparatus that does not have an input value setting instruction address table 520. FIG. 6B is a conceptual diagram showing a shortened period due to reuse of the execution result in the
図6(a)に示す従来技術の場合には、関数の命令区間である下位ルーチンにおいて2つの引数が入力値参照命令の実行によって全て参照(入力値A参照323および入力値B参照324)されるまで、関数の引数である入力値AおよびBを特定することができない。このため、関数の入力値AおよびBが、履歴メモリ430における入力値と全て一致したときであっても、入力値B参照324から戻り命令(return)までの短縮期間T2だけしか関数の実行期間を削減することができない。
In the case of the prior art shown in FIG. 6A, all of the two arguments are referred to by the execution of the input value reference instruction (input
一方、図6(b)に示す本発明の第1の実施の形態では、図5で述べたとおり、入力値設定命令アドレステーブル520に基づいて特定された入力値A設定321によって、入力値Aおよび入力値Bを特定することができる。すなわち、入力値A設定命令から呼出し命令(call)までの実行履歴検索期間Tsにおける入力値設定命令に基づいて、関数における引数の入力値を特定することができる。 On the other hand, in the first embodiment of the present invention shown in FIG. 6B, the input value A is set by the input value A setting 321 specified based on the input value setting command address table 520 as described in FIG. And the 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).
これにより、実行履歴検索期間Tsにおいて履歴メモリ430における実行結果の検索を終了させることができるため、実行結果を再利用することができる場合には、関数の実行に要する全ての期間(短縮期間T1)を削減することができる。したがって、本発明の第1の実施の形態では、データ処理装置100における実行結果再利用処理により、従来の短縮期間T2よりも長い短縮期間T1を削減することができる。次に、実行履歴検索部410および履歴メモリ430における両者の区間識別情報が一致した場合において、実行履歴検索部410からの入力値と、履歴メモリ430における入力値とが一致しないときの実行履歴の登録例について次図を参照して説明する。
As a result, the search of the execution result in the
[再利用区間の2回目以降の実行による履歴メモリ430に対する実行履歴の登録例]
図7は、本発明の第1の実施の形態におけるデータ処理装置100による2回目以降の関数の実行における実行履歴の登録手法を示す概念図である。ここでは、図7(a)乃至(c)は、図4(a)乃至(c)に対応するため、ここでの詳細な説明を省略する。
[Execution history registration example for the
FIG. 7 is a conceptual diagram showing an execution history registration method in the second and subsequent function executions by the
図7(b)は、図4(b)に示した関数の処理例を示す概念図である。ここでは、関数の引数である入力値が変数であり、履歴メモリ430に保持されていない入力値が設定された場合を想定する。例えば、履歴メモリ430における入力値Aの示す値が「3」であり、ここでの関数の実行により設定された入力値Aの示す値が「5」である場合が該当する。
FIG. 7B is a conceptual diagram illustrating a processing example of the function illustrated in FIG. Here, it is assumed that an input value that is an argument of a function is a variable and an input value that is not held in the
このような場合において、入力値A設定321では、アドレス判定部510により、プログラムカウンタ350から出力された命令アドレスが、入力値設定命令アドレステーブル520における「入力値A設定命令アドレス」と一致したと判定される。
In such a case, in the input value A setting 321, it is assumed that the instruction address output from the
これにより、その一致した入力値設定命令アドレス(入力値A設定命令アドレス)に対応する区間識別情報(関数アドレス1)が、履歴メモリ430に入力される。すなわち、アドレス判定部510により、区間識別情報(関数アドレス1)を実行データ保持部440に保持させて、その保持された「関数アドレス1」が実行履歴検索部410によって履歴メモリ430に入力される。
As a result, 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
このとき、履歴メモリ430において、アドレス判定部510からの区間識別情報(関数アドレス1)と一致する区間識別情報が既に保持されているため、これに関連付けられた「実行履歴検索データ1」による実行結果の検索が行われる。
At this time, since the section identification information that matches the section identification information (function address 1) from the
また、入力値A設定321では、入力値A設定命令により設定された入力値Aが、履歴メモリ430に入力される。このとき、実行履歴検索部410からの入力値Aと、履歴メモリ430における「実行履歴検索データ1」に保持された入力値とが一致しないため、実行履歴検索部410からの入力値Aが「実行履歴検索データ1」に新たに登録される。
In the input value A setting 321, the input value A set by the input value A setting command is input to the
また、入力値B設定322では、入力値B設定命令により設定された入力値Bが、実行履歴検索部410によって履歴メモリ430に登録される。すなわち、入力値Aおよび入力値Bが関連付けられた「実行履歴検索データ1」が生成される。
Further, in the input value B setting 322, the input value B set by the input value B setting command is registered in the
この後、下位ルーチンにおいて関数の処理が実行され、実行結果C設定325において、実行結果設定命令により設定された実行結果Cが、実行履歴検索部410によって履歴メモリ430に登録される。すなわち、入力値A、入力値Bおよび実行結果Cが関連付けられた「実行履歴検索データ1」が生成される。
Thereafter, the processing of the function is executed in the lower-level routine, and the execution result C set by the execution result setting instruction is registered in the
このように、同一の関数に対する2回目以降の処理において、入力値設定命令によって設定された入力値が、履歴メモリ430における入力値と一致しない場合には、関数が実行されて、その実行結果および入力値が履歴メモリ430に新たに登録される。なお、ここでは、入力値設定命令によって特定された入力値を登録する例について説明したが、入力値参照命令の実行によって特定された入力値を履歴メモリ430に登録するようにしてもよい。
As described above, when the input value set by the input value setting command does not match the input value in the
[データ処理装置100の動作例]
次に本発明の第1の実施の形態におけるデータ処理装置100の動作について図面を参照して説明する。
[Operation Example of Data Processing Device 100]
Next, the operation of the
図8は、本発明の第1の実施の形態におけるデータ処理装置100による実行結果再利用方法の処理手順の一例を示すフローチャートである。
FIG. 8 is a flowchart showing an example of the processing procedure of the execution result reuse method by the
まず、フェッチ部310により、主記憶部130または命令キャッシュ210から命令が読み出される(ステップS911)。このとき、アドレス判定部510により、プログラムカウンタ350から出力される命令アドレスが、入力値設定命令アドレステーブル520に登録された入力値設定命令アドレスと一致するか否かが判断される(ステップS912)。そして、入力値設定命令アドレスと一致しない場合には、ステップS911に戻り、入力値設定命令アドレスと一致するまで繰り返される。
First, the fetch
一方、入力値設定命令アドレスと一致した場合には、アドレス判定部510により、その一致した入力値設定命令アドレスに関連付けられた区間識別情報を入力値設定命令アドレステーブル520から取得される。そして、アドレス判定部510により、その取得された区間識別情報が、実行データ保持部440に保持される(ステップS913)。
On the other hand, if the input value setting instruction address matches, the
続いて、実行履歴検索部410により、履歴メモリ430の検索キーとして、実行データ保持部440に保持された区間識別情報が履歴メモリ430に入力される(ステップS914)。これにより、履歴メモリ430における区間識別情報に対応する複数の実行履歴の検索が開始される。
Subsequently, the execution
次に、命令デコーダ320により、フェッチ部310から読み出された命令が入力値設定命令であるか否かが判断される(ステップS915)。そして、入力値設定命令であると判断された場合には、命令デコーダ320からの入力値設定信号に基づいて、入力値設定命令により設定された入力値が、アドレス判定部510の指示によって実行データ保持部440に保持される。
Next, the
この後、実行履歴検索部410により、実行データ保持部440に保持された入力値が、履歴メモリ430に入力される(ステップS921)。なお、1回目のステップS915の判断については、ここでは、必ず入力値設定命令と判断されるため、その判断を省略して、ステップS921に進むようにしてもよい。
Thereafter, the execution
続いて、実行履歴検索部410からの区間識別情報に対応する履歴メモリ430における実行履歴について、履歴メモリ430により、実行履歴検索部410からの入力値と、その実行履歴における入力値とが一致するか否かが判断される(ステップS922)。そして、両者の入力値が一致しない場合には、ステップS924の処理に進む。
Subsequently, for the execution history in the
一方、両者の入力値が一致した場合には、履歴メモリ430において、実行履歴における次の引数の入力値を比較するために、次の引数における引数ノードにポインタが進められる(ステップS923)。すなわち、実行履歴検索部410からの入力値と一致する引数ノードがあれば、その引数ノードの右ポインタによって、次の引数ノードが指し示される。次に、フェッチ部310により、主記憶部130または命令キャッシュ210から命令が読み出され(ステップS924)、ステップS915の処理に戻る。
On the other hand, if the two input values match, the pointer is advanced to the argument node in the next argument in the
一方、ステップS915の処理において、入力値設定命令でないと判断された場合において、フェッチ部310により読み出された命令が関数の呼出し命令であるか否かが判断される(ステップS916)。そして、呼出し命令でない場合には、ステップS924に進む。
On the other hand, if it is determined in step S915 that the instruction is not an input value setting instruction, it is determined whether the instruction read by the fetch
このようにして、関数における全ての引数の入力値が設定されるまで、ステップS915、S916およびS921乃至S924における一連の処理が繰り返し実行される。すなわち、入力値設定命令アドレステーブル520により特定された入力値設定命令から呼出し命令までの関数の入力値設定命令に基づいて設定された入力値が実行データ保持部440に保持されて、その保持された入力値が履歴メモリ430に入力される。
In this way, a series of processes in steps S915, S916 and S921 to S924 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 520 is held in the execution
このように、プログラムカウンタ350から出力される命令アドレスと一致する入力値設定命令アドレスに対応する区間識別情報が実行データ保持部440に保持される。そして、その入力値設定命令アドレスにより特定された入力値設定命令から呼出し命令までの命令群のうちの入力値設定命令に基づいて、実行部から出力された入力値が実行データ保持部440に保持される。これにより、実行履歴検索部410によって、実行データ保持部440における区間識別情報および入力値を用いて、履歴メモリ430における実行履歴に関連付けられた実行結果が検索される。なお、ステップS911乃至S916およびS921乃至S924は、特許請求の範囲に記載の実行履歴検索手順の一例である。
As described above, the section identification information corresponding to the input value setting instruction address that matches the instruction address output from the
一方、ステップS916において関数の呼出し命令と判断された場合には、実行データ保持部440からの区間識別情報および入力値が、履歴メモリ430における区間識別情報に関連付けられた入力値と全て一致したか否かが判断される(ステップS917)。
On the other hand, if it is determined in step S916 that the instruction is a function call instruction, whether the section identification information and the input value from the execution
そして、実行履歴検索部410からの区間識別情報および入力値が全て一致した場合には、実行結果再利用処理が実行される(ステップS925)。すなわち、実行履歴検索部410からの区間識別情報および入力値に対応する履歴メモリ430における実行結果が、実行結果出力部420から出力される。そして、主記憶部130またはレジスタファイル340に書き戻されて、関数の処理をスキップする。なお、S925は、特許請求の範囲に記載の実行結果出力手順の一例である。
If all the section identification information and input values from the execution
一方、実行履歴検索部410からの区間識別情報および入力値が全て一致しない場合には、呼出し命令により呼び出された関数が実行されて、その実行結果が実行データ保持部440に保持される(ステップS918)。そして、実行履歴検索部410により、実行データ保持部440に保持された実行結果と、ステップS913およびS921の処理によって保持された区間識別情報および入力値とが履歴メモリ430に登録される(ステップS919)。
On the other hand, if the section identification information from the execution
このように、本発明の第1の実施の形態では、入力値設定命令アドレステーブル520によって、再利用区間である関数の呼出し命令前に、実行データ保持部440に再利用区間の区間識別情報およびその入力値を保持させることができる。これにより、関数が呼び出される前に、実行履歴検索部410によって、その実行データ保持部440に保持された区間識別情報および入力値に基づいて、履歴メモリ430における実行履歴を検索することができる。
As described above, in the first embodiment of the present invention, the input value setting command address table 520 causes the execution
このため、実行履歴検索部410からの区間識別情報および入力値と一致する履歴メモリ430における実行履歴に関連付けられた実行結果が抽出された場合には、呼出し命令により呼び出される関数の実行を省略することができる。これにより、実行結果の再利用による関数の処理時間を大幅に削減することができる。
For this reason, when an execution result associated with the execution history in the
<2.第2の実施の形態>
[プログラム解析処理装置の構成例]
図9は、本発明の第2の実施の形態におけるプログラム解析処理装置の機能構成例を示すブロック図である。プログラム解析処理装置600は、ソースプログラム記憶部610と、コンパイル処理部620と、オブジェクトプログラム記憶部660と、再利用区間情報記憶部670とを備える。なお、プログラム解析処理装置600は、特許請求の範囲に記載のプログラム解析処理装置の一例である。
<2. Second Embodiment>
[Configuration example of program analysis processing device]
FIG. 9 is a block diagram illustrating a functional configuration example of the program analysis processing apparatus according to the second embodiment of the present invention. The program
ソースプログラム記憶部610は、コンパイル処理の対象となるソースプログラムを記憶するものである。このソースプログラムは、実行結果が再び利用される再利用区間が含まれるソースプログラムである。このソースプログラム記憶部610は、その記憶されたソースプログラムをコンパイル処理部620に供給する。
The source
コンパイル処理部620は、ソースプログラム記憶部610からのソースプログラムをコンパイルすることによって、機械語プログラムであるオブジェクトプログラムと、再利用区間情報とを生成するものである。ここにいう再利用区間情報とは、再利用区間ごとに、再利用区間における1番目の入力値設定命令の入力値設定命令アドレスと、その再利用区間を識別するための区間識別情報とが関連付けられた情報である。この再利用区間情報は、図2に示した検索開始命令アドレス管理部500における入力値設定命令アドレステーブル520に格納される。
The compile
このコンパイル処理部620は、生成されたオブジェクトプログラムをオブジェクトプログラム記憶部660に、生成された再利用区間情報を再利用区間情報記憶部670に記憶させる。このコンパイル処理部620は、プログラム解析部630と、プログラム最適化処理部640と、コード生成部650とを備える。
The compile
プログラム解析部630は、ソースプログラム記憶部610から読み出されたソースプログラムに基づいて、形態素解析や構文解析などの解析処理を実行するものである。このプログラム解析部630は、解析または最適化に適した形式の中間コードとして表現された中間表現によるプログラムを生成して、その生成された中間表現によるプログラムに対して解析処理を実行する。
The
このプログラム解析部630は、再利用候補区間抽出部631および再利用候補区間解析部632を備える。再利用候補区間抽出部631は、プログラムに含まれる複数の命令区間のうち、実行結果が再利用される再利用区間の候補となる再利用候補区間を、そのプログラムから抽出するものである。この再利用候補区間抽出部631は、再利用候補区間として関数の命令区間を抽出する。
The
この再利用候補区間抽出部631は、実行結果が再利用できない関数を再利用候補区間の対象から除外する。この再利用候補区間抽出部631は、命令区間の入力値が全て同じであっても異なる実行結果になる関数、例えば、命令区間に分岐命令を含むような関数を再利用候補区間の対象から除外する。この再利用候補区間抽出部631は、例えば、第1の関数の実行直後に第2の関数が実行されるため、第1の関数の呼出し命令の前に、第2の入力値設定命令が実行されるような第1および第2の関数を再利用候補区間の対象から除外する。また、再利用候補区間抽出部631は、抽出された再利用候補区間を識別するための区間識別情報を、プログラムとともに再利用候補区間解析部632に供給する。
The reuse candidate
再利用候補区間解析部632は、再利用候補区間抽出部631により抽出された再利用候補区間の使用態様を解析するものである。この再利用候補区間解析部632は、例えば、関数における引数の個数および型と、1つの関数が実行される回数とを使用態様として関数ごとに解析する。
The reuse candidate
この再利用候補区間解析部632は、例えば、関数における引数が採り得る範囲を使用態様の解析結果として出力する。この再利用候補区間解析部632は、その解析結果を、再利用候補区間の区間識別情報およびプログラムとともにプログラム最適化処理部640に供給する。
For example, the reuse candidate
プログラム最適化処理部640は、再利用候補区間解析部632から供給されたプログラムに基づいて、プログラムの実行速度を向上させるための最適化や、コードサイズを削減するための最適化などのプログラム最適化処理を実行するものである。このプログラム最適化処理部640は、再利用度生成部641と、再利用区間抽出部642と、再利用区間情報生成部643とを備える。
Based on the program supplied from the reuse candidate
再利用度生成部641は、再利用候補区間解析部632から供給された解析結果に基づいて、再利用候補区間の実行結果が再び利用される度合いを示す再利用度を生成するものである。すなわち、再利用度生成部641は、複数回実行される命令区間における処理の実行ごとの入力値が互いに一致する度合いを示す再利用度を、命令区間の使用態様に基づいて命令区間ごとに生成する。
Based on the analysis result supplied from the reuse candidate
この再利用度生成部641は、例えば、1つの再利用候補区間が実行される実行回数に応じて再利用度を生成する。この場合において、再利用度生成部641は、例えば、実行回数が大きいほど、再利用度を大きく設定する。また、再利用度生成部641は、例えば、再利用候補区間の入力値が採り得る範囲に応じて、その再利用候補区間に対する再利用度を生成する。この場合には、再利用度は、例えば、その採り得る範囲の数の逆数に定数を乗算することによって算出される。これにより、再利用候補区間の再利用度が大きいほど、その再利用候補区間の実行結果は再利用される確率が高いことを示す。
For example, the reuse
また、再利用度生成部641は、生成された再利用候補区間に関する再利用度を、プログラムおよび再利用候補区間の区間識別情報とともに再利用区間抽出部642に供給する。なお、再利用度生成部641は、特許請求の範囲に記載の再利用度生成部の一例である。
In addition, the reuse
再利用区間抽出部642は、再利用候補区間解析部632により抽出された複数の再利用候補区間のうち、再利用度生成部641からの各再利用候補区間に関する再利用度に基づいて、再利用区間を抽出するものである。この再利用区間抽出部642は、例えば、再利用度に関する一定の閾値(再利用閾値)以上である再利用候補区間を再利用区間として抽出する。
The reuse
また、再利用区間抽出部642は、その抽出された再利用区間に関する区間識別情報を、プログラムとともに再利用区間情報生成部643に供給する。なお、再利用区間抽出部642は、例えば、図2に示した履歴メモリ430における区間識別情報ごとの実行履歴を削除する際の優先度を再利用度に基づいて生成するようにしてもよい。この場合、再利用区間抽出部642は、再利用度が高いほど優先度が低くなるように優先度を生成する。
In addition, the reuse
再利用区間情報生成部643は、再利用区間抽出部642により抽出された再利用区間の区間識別情報と、その再利用区間における最先の入力値設定命令アドレスとを関連付けて再利用区間情報として生成するものである。この再利用区間情報生成部643は、再利用区間抽出部642により抽出された再利用区間における入力値設定命令のうち、時間軸上において最初に実行される最先の入力値設定命令のメモリアドレスである入力値設定命令アドレスを再利用区間ごとに抽出する。
The reuse section
また、再利用区間情報生成部643は、その抽出された最先の入力値設定命令アドレスおよび区間識別情報を再利用区間ごとに関連付けた再利用区間識別情報を生成する。また、再利用区間情報生成部643は、その生成された再利用区間識別情報を再利用区間情報記憶部670に記憶させる。なお、ここでは、再利用区間情報として、区間識別情報ごとに最先の入力値設定命令アドレスを関連付けて生成する例について説明したが、区間識別情報ごとに、全ての入力値設定命令アドレスを関連付けて生成するようにしてもよい。
Further, the reuse section
また、再利用区間情報生成部643は、例えば、再利用区間抽出部642から供給されたプログラムに対して、再利用区間における最先の入力値設定命令からその再利用区間の呼出し命令までの命令群の数が極力少なくなるように、命令コードを並び替える。これにより、図2に示した履歴メモリ430における実行履歴の検索期間を短縮することができるため、データ処理装置100における履歴メモリ430による消費電力を低減することができる。
In addition, the reuse interval
また、再利用区間情報生成部643は、その命令コードが並び替えられたプログラムをコード生成部650に供給する。なお、再利用区間情報生成部643は、特許請求の範囲に記載の再利用区間情報生成部の一例である。
In addition, the reuse section
なお、再利用区間情報生成部643は、再利用度生成部641からの再利用度に基づいて、履歴メモリ430の実行履歴を削除する際の優先度と、区間識別情報と、最先の入力値設定命令アドレスとを関連付けて再利用区間情報を生成するようにしてもよい。
Note that the reuse section
これにより、履歴メモリ430の容量が一定の条件を超えた場合には、実行履歴検索部410により、その優先度に従って履歴メモリ430の実行履歴を削除させることができる。このため、再利用度の高い実行履歴を優先的に履歴メモリ430に保持させることができる。
As a result, when the capacity of the
コード生成部650は、再利用区間情報生成部643から供給されたプログラムに基づいて、機械語プログラムのコードであるオブジェクトプログラムを生成するものである。このコード生成部650は、その生成されたオブジェクトプログラムをオブジェクトプログラム記憶部660に記憶させる。
The
オブジェクトプログラム記憶部660は、コード生成部650から出力されたオブジェクトプログラムを記憶するものである。このオブジェクトプログラム記憶部660に記憶されたオブジェクトプログラムが、図1に示した主記憶部130に記憶される。
The object
再利用区間情報記憶部670は、再利用区間情報生成部643から出力された再利用区間情報を記憶するものである。この再利用区間情報記憶部670に記憶された再利用区間情報が図2に示した入力値設定命令アドレステーブル520に転送される。
The reuse section
このように、再利用度生成部641を設けることによって、複数回実行される命令区間の使用態様に基づいて再利用度が生成されるため、複数の命令区間のうち、実行結果が再利用される確率の高い命令区間を再利用区間として抽出することができる。また、再利用区間情報生成部643を設けることによって、その抽出された再利用区間ごとに再利用区間における入力値設定命令アドレスおよび区間識別情報が関連付けられた再利用区間情報を生成することができる。
As described above, by providing the reuse
[プログラム解析処理装置600の動作例]
次に本発明の第2の実施の形態におけるプログラム解析処理装置600の動作について図面を参照して説明する。
[Operation Example of Program Analysis Processing Device 600]
Next, the operation of the program
図10は、本発明の第2の実施の形態におけるプログラム解析処理装置600のプログラム解析処理方法の処理手順の一例を示すフローチャートである。
FIG. 10 is a flowchart showing an example of the processing procedure of the program analysis processing method of the program
まず、再利用候補区間抽出部631により、ソースプログラム記憶部610からソースプログラムが読み出される(ステップS931)。そして、再利用候補区間抽出部631により、プログラムに含まれる複数の関数である命令区間のうち、再利用候補区間となる関数が抽出される(ステップS932)。
First, the reuse candidate
続いて、再利用候補区間解析部632により、再利用候補区間抽出部631において抽出された再利用候補区間に関する使用態様が解析される(ステップS933)。この後、再利用度生成部641により、再利用候補区間解析部632により解析された再利用候補区間の使用態様に基づいて、再利用候補区間ごとに再利用度が生成される(ステップS934)。なお、ステップS934は、特許請求の範囲に記載の再利用度生成手順の一例である。
Subsequently, the reuse candidate
そして、再利用区間抽出部642により、再利用候補区間ごとの再利用度に基づいて、再利用区間が抽出される(ステップS935)。次に、再利用区間情報生成部643により、再利用区間における最先の入力値設定命令アドレスと、その再利用区間の区間識別情報とが再利用区間ごとに関連付けられた再利用区間情報が生成される(ステップS936)。そして、再利用区間情報生成部643により、その生成された再利用区間情報が再利用区間情報記憶部670に記憶される。なお、ステップS936は、特許請求の範囲に記載の再利用区間情報生成手順の一例である。
Then, the reuse
その後、コード生成部650により、再利用区間情報生成部643から供給されたプログラムに基づいてオブジェクトプログラムが生成されて、その生成されたオブジェクトプログラムがオブジェクトプログラム記憶部660に記憶される(ステップS937)。
Thereafter, the
このように、本発明の第2の実施の形態では、再利用度の高い再利用区間である関数における入力値設定命令アドレスおよびその区間識別情報が関連付けられた再利用区間情報を生成することができる。これにより、図2に示した履歴メモリ430において実行結果が再利用される可能性の高い関数に対する実行履歴が保持されるため、実行結果の再利用処理による実行時間の削減を向上させることができる。
As described above, in 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. Thereby, since the execution history for the function whose execution result is highly likely to be reused is held in the
なお、本発明の第1および第2の実施の形態では、プログラム解析処理装置600によって生成された再利用区間情報を、データ処理装置100における入力値設定命令アドレステーブル520に登録する例について説明したが、これに限られるものではない。例えば、データ処理装置100において、主記憶部130に記憶されたプログラムを実行しているときに、入力値設定命令アドレステーブル520に再利用区間情報を登録するようにしてもよい。そこで、プログラムの実行中に入力値設定命令アドレステーブル520に入力値設定命令アドレスおよび区間識別情報を登録するように改良したデータ処理装置100を、第3の実施の形態として以下に説明する。
In the first and second embodiments of the present invention, the example in which the reuse section information generated by the program
<3.第3の実施の形態>
[データ処理装置100の構成例]
図11は、本発明の第3の実施の形態におけるデータ処理装置100の一構成例を示すブロック図である。ここでは、図1に示したデータ処理装置100のうち、データ処理部300、実行結果再利用処理部700および検索開始命令アドレス管理部800が示されている。ここでは、データ処理部300は、図2と同じものであるため、図2と同一符号を付してここでの説明を省略する。
<3. Third Embodiment>
[Configuration Example of Data Processing Device 100]
FIG. 11 is a block diagram showing a configuration example of the
実行結果再利用処理部700は、実行履歴検索部710と、実行結果出力部720と、履歴メモリ730と、実行データ保持部740とを備える。実行履歴検索部710、実行結果出力部720、履歴メモリ730および実行データ保持部740は、図2に示した実行履歴検索部410、実行結果出力部420、履歴メモリ430および実行データ保持部440に対応する。また、実行結果出力部720および履歴メモリ730の構成は、図2に示した実行結果出力部420および履歴メモリ430と同様のものであるため、ここでの説明を省略する。
The execution result
検索開始命令アドレス管理部800は、アドレス判定部810と、入力値設定命令アドレステーブル820と、入力値設定命令アドレス出力部830と、設定入力値保持部840と、検索開始命令決定部850とを備える。アドレス判定部810および入力値設定命令アドレステーブル820は、図2に示したアドレス判定部510および入力値設定命令アドレステーブル520に対応する。
The search start command
ここでは、入力値設定命令アドレスおよび区間識別情報を入力値設定命令アドレステーブル820に登録する機能を中心に説明する。また、入力値設定命令アドレステーブル820に登録された入力値設定命令アドレスに基づいて、履歴メモリ730における実行結果を検索する手法については、図2と同様の構成により実現されるため、ここでの説明を省略する。
Here, 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 820. Further, the method for searching the execution result in the
実行データ保持部740は、アドレス判定部810からの指示に従って、実行結果再利用処理に用いるデータを保持して、その保持されたデータを実行履歴検索部710、設定入力値保持部840および検索開始命令決定部850に出力するものである。この実行データ保持部740は、アドレス判定部810からの入力値設定信号に基づく指示に従って、実行部330からの出力を、設定入力値として保持する。
The execution
この実行データ保持部740は、時間軸上においてその設定入力値を保持した順番を、入力値設定命令により入力値が設定された設定順番として、その設定入力値とともに保持する。この実行データ保持部740は、例えば、アドレス判定部810からの入力値設定信号に基づく指示に従って、最初に保持した設定入力値を、1番目の設定入力値として保持する。
The execution
また、実行データ保持部740は、アドレス判定部810からの関数呼出し信号に基づく指示に従って、その保持された設定入力値およびその設定順番を、設定入力値保持部840に出力する。この実行データ保持部740は、例えば、設定入力値に含まれる格納場所およびその設定順番を、設定入力値保持部840に出力する。ここにいう格納場所とは、レジスタファイル340のレジスタ番号または主記憶部130のメモリアドレスのことをいう。
Further, the execution
このとき、実行データ保持部740は、同一の格納場所を示す複数の設定入力値がある場合には、その複数の設定入力値のうち、最も大きい数(最大)の設定順番の設定入力値およびその設定順番だけを設定入力値保持部840に出力する。すなわち、実行データ保持部740は、同一の格納場所を示す複数の設定入力値がある場合には、その複数の設定入力値のうち、最後に設定された設定入力値およびその設定順番を出力する。あるいは、実行データ保持部740は、同一の格納場所を示す設定入力値を設定入力値保持部840に新たに保持させる場合には、その新たな設定入力値の設定順番を、既に保持されている設定入力値の設定順番の保持領域に重ねて保持させる(上書きする)。
At this time, when there are a plurality of setting input values indicating the same storage location, the execution
このように、同一の格納場所を示す複数の設定入力値のうち、最大の設定順番の設定入力値のみを設定入力値保持部840に保持させることによって、関数の入力値として参照されなかった入力値設定命令を登録の対象から除外することができる。これは、命令デコーダ320では、命令に示されたデータの格納先によってその命令が入力値設定命令か否かを判断するが、関数の命令区間以外では、関数の入力値が格納されるレジスタは、他の処理によっても参照される。このため、同一の格納場所を示す設定入力値のうち、関数の呼出し命令の直前に設定された設定入力値以外は、関数の入力値の設定ではないと判断できるからである。
In this way, the input that is not referred to as the input value of the function by causing the setting input
また、実行データ保持部740は、アドレス判定部810からの関数呼出し信号に基づく指示に従って、例えば、実行部330からの出力を、関数の区間識別情報として保持する。この実行データ保持部740は、アドレス判定部810からの関数呼出し信号に基づく指示に従って、例えば、プログラムカウンタ350からの命令アドレスを、関数の区間識別情報として保持する。
Further, the execution
また、実行データ保持部740は、アドレス判定部810からの入力値参照信号に基づく指示に従って、実行部330からの出力を、参照入力値として保持する。また、実行データ保持部740は、アドレス判定部810からの実行結果設定信号に基づく指示に従って、実行部330からの出力を、関数の実行結果として保持する。
The execution
また、実行データ保持部740は、アドレス判定部810からの関数戻り信号に基づく指示に従って、その保持された区間識別情報および参照入力値を、検索開始命令決定部850に出力する。この実行データ保持部740は、例えば、アドレス判定部810からの関数戻り信号に基づく指示に従って、参照入力値に示される格納場所を検索開始命令決定部850に出力する。
The execution
また、実行データ保持部740は、アドレス判定部810からの関数戻り信号に基づく指示に従って、その保持された区間識別情報、参照入力値および実行結果を、実行履歴検索部710に出力する。
The execution
また、実行データ保持部740は、アドレス判定部810からの関数戻り信号に基づく指示に従って、その保持されたデータを実行履歴検索部710に出力した後に、実行データ保持部740に保持されたデータを消去する。
Further, the execution
アドレス判定部810は、プログラムに含まれる複数の命令区間である関数の入力値設定命令アドレスを入力値設定命令アドレス出力部830に保持させるものである。このアドレス判定部810は、命令デコーダ320から供給される入力値設定信号に基づいて、プログラムカウンタ350から出力された命令アドレスを、入力値命令アドレスとして入力値設定命令アドレス出力部830に保持させる。これとともに、このアドレス判定部810は、命令デコーダ320からの入力値設定信号に基づいて、実行部330から出力される入力値を、設定入力値として実行データ保持部740に保持させる。
The
また、アドレス判定部810は、例えば、命令デコーダ320から供給される関数呼出し信号に基づいて、関数の命令区間である先頭アドレスを区間識別情報として実行データ保持部740に保持させる。このアドレス判定部810は、例えば、命令デコーダ320からの関数呼出し信号に基づいて、プログラムカウンタ350からの命令アドレスを区間識別情報として実行データ保持部740に保持させる。あるいは、このアドレス判定部810は、例えば、命令デコーダ320からの関数呼出し信号に基づいて、実行部330から出力される関数の先頭アドレスを区間識別情報として実行データ保持部440に保持させる。
For example, the
また、アドレス判定部810は、命令デコーダ320から供給される入力値参照信号に基づいて、実行部330から出力される入力値を、参照入力値として実行データ保持部740に保持させる。また、アドレス判定部810は、命令デコーダ320から供給される実行結果設定信号に基づいて、実行部330から出力された実行結果を実行データ保持部740に保持させる。
Further, the
入力値設定命令アドレステーブル820は、命令区間である関数を識別するための区間識別情報ごとに、その関数における入力値を設定するための入力値設定命令のアドレスである入力値設定命令アドレスを保持するものである。この入力値設定命令アドレステーブル820は、例えば、関数における入力値を設定するための入力値設定命令のうち、最初に入力値を設定する最先の入力値設定命令のアドレスを入力値設定命令アドレスとして区間識別情報ごとに保持する。 The input value setting instruction address table 820 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 820 is, for example, the address of the earliest input value setting command for setting 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.
また、入力値設定命令アドレステーブル820は、その保持されたデータをアドレス判定部810に出力する。なお、入力値設定命令アドレステーブル820には、関数が複数の引数を持つ場合には、その関数の区間識別情報ごとに、複数の引数に対応する入力値設定命令アドレスを複数保持させるようにしてもよい。また、入力値設定命令アドレステーブル820は、特許請求の範囲に記載の入力値設定命令アドレステーブルの一例である。
Further, the input value setting instruction address table 820 outputs the held data to the
入力値設定命令アドレス出力部830は、アドレス判定部810から供給された入力値設定命令アドレスと、検索開始命令決定部850から供給された区間識別情報とを関連付けて入力値設定命令アドレステーブル820に出力するものである。この入力値設定命令アドレス出力部830は、アドレス判定部810から供給された入力値設定命令アドレスを保持する。
The input value setting command
この入力値設定命令アドレス出力部830は、時間軸上においてその入力値設定命令アドレスを保持した順番である設定順番を、その入力値設定命令アドレスとともに保持する。この実行データ保持部740は、例えば、アドレス判定部810から供給された最初の入力値設定命令アドレスを1番目の入力値設定命令アドレスとして保持する。
The input value setting command
また、入力値設定命令アドレス出力部830は、その保持された入力値設定命令アドレスのうち、検索開始命令決定部850により決定された設定順番の入力値設定命令アドレスと、検索開始命令決定部850からの区間識別情報とを関連付けて出力する。すなわち、入力値設定命令アドレス出力部830は、関数における入力値設定命令アドレスと、その関数の区間識別情報である関数の先頭アドレスとを関連付けて、関数ごとに入力値設定命令アドレステーブル820に登録する。
The input value setting instruction
また、入力値設定命令アドレス出力部830は、アドレス判定部810からの関数戻り信号に基づく指示に従って、その保持されたデータを登録した後に、入力値設定命令アドレス出力部830に保持されたデータを消去する。
The input value setting command
設定入力値保持部840は、実行データ保持部740から出力された設定入力値およびその設定順番を関連付けて保持するものである。この設定入力値保持部840は、その保持された設定入力値およびその設定順番を検索開始命令決定部850に出力する。
The setting input
検索開始命令決定部850は、関数の実行における入力値参照命令の実行により参照された参照入力値に含まれる格納場所に基づいて、検索開始命令としてその関数における最先の入力値設定命令を決定するためのものである。この検索開始命令決定部850は、関数の呼出し命令前の入力値設定命令に基づく設定入力値に含まれる格納場所と、呼出し命令後の入力値参照命令に基づく参照入力値に含まれる格納場所とに基づいて、最先の入力値設定命令の設定順番を特定する。
The search start
この検索開始命令決定部850は、例えば、設定入力値保持部840における設定入力値のうち、実行データ保持部740からの参照入力値の格納場所に基づいて、関数の命令区間において参照された設定入力値の設定順番が抽出される。そして、この検索開始命令決定部850は、その抽出された設定入力値の設定順番のうち、最も小さい設定順番を特定する。
The search start
すなわち、検索開始命令決定部850は、命令デコーダ320において入力値設定命令と判断された命令のうち、関数の命令区間において参照された入力値の格納場所に、最初に入力値を設定した入力値設定命令を、最先の入力値設定命令として特定する。
That is, the search start
また、検索開始命令決定部850は、その特定された最も小さい設定順番を入力値設定命令アドレス出力部830に通知する。これとともに、検索開始命令決定部850は、実行データ保持部740から出力された区間識別情報を入力値設定命令アドレス出力部830に出力する。
In addition, the search start
また、検索開始命令決定部850は、実行データ保持部740から参照入力値の格納場所が出力され場合には、入力値設定命令アドレス出力部830に入力値設定命令アドレステーブル820に対する入力値設定命令アドレスの登録を抑制する。これにより、入力値設定命令アドレステーブル820に対する無駄な入力値設定命令アドレスの登録を低減することができる。
Further, when the storage location of the reference input value is output from the execution
実行履歴検索部710は、アドレス判定部810からの関数戻り信号に基づく登録指示に従って、実行データ保持部740からの区間識別情報、参照入力値および実行結果を履歴メモリ730に登録するものである。この実行履歴検索部710の他の機能は、図2に示した実行履歴検索部410と同様のものであるため、ここでの説明を省略する。
The execution
このように、入力値設定命令アドレス出力部830を設けることによって、主記憶部130からのプログラムを実行している間において、入力値設定命令アドレステーブル820に、入力値設定命令アドレスおよび区間識情報を登録することができる。すなわち、入力値設定命令アドレス出力部830を設けることによって、入力値設定命令により保持された入力値設定命令アドレスと、その入力値設定命令により特定された命令区間の区間識別情報とを入力値設定命令アドレステーブル820に出力することができる。
As described above, by providing the input value setting command
また、入力値設定命令アドレス出力部830は、検索開始命令決定部850によって、入力値設定命令により設定された入力値のうち、呼出し命令により呼び出された命令区間において参照された入力値に対応する入力値設定命令アドレスを出力することができる。すなわち、入力値設定命令アドレス出力部830は、命令区間において参照された複数の入力値に対応する入力値設定命令のうち、最先の入力値設定命令の入力値設定命令アドレスと区間識別情報である命令区間の先頭アドレスとを出力することができる。次に、入力値設定命令アドレステーブル820に入力値設定命令アドレスおよび区間識別情報を登録する例について以下に図面を参照して説明する。
Further, the input value setting instruction
[入力値設定命令アドレステーブル820への登録例]
図12は、本発明の第3の実施の形態におけるデータ処理装置100による入力値設定命令アドレステーブル820に対する入力値設定命令アドレスおよび区間識別情報の登録例を示す概念図である。図12(a)は、入力値設定命令アドレステーブル820のデータフォーマットの一例を示す図である。入力値設定命令アドレステーブル820には、関数である命令区間における最先の入力値設定命令アドレス821と、その関数を識別するための区間識別情報である関数アドレス822との対応関係が示されている。
[Example of registration in input value setting instruction address table 820]
FIG. 12 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 820 by the
図12(b)は、入力値設定命令の実行のたびに保持された入力値設定命令アドレスおよび設定入力値との対応関係を示す図である。図12(b)には、設定順番811と、入力値設定命令アドレス831と、設定入力値841とが示されている。
FIG. 12B is a diagram showing a correspondence relationship between the input value setting instruction address and the set input value held every time the input value setting instruction is executed. FIG. 12B shows a
設定順番811は、入力値設定命令が実行された順番を示す。入力値設定命令アドレス831は、入力値設定命令に基づいて、入力値設定命令アドレス出力部830に保持された、プログラムカウンタ350からの命令アドレスを示す。設定入力値841は、入力値設定命令に基づいて、設定入力値保持部840に保持された入力値を示す。なお、この入力値は、入力値の格納場所を示す情報だけでもよい。入力値の格納場所が分かれば、関数における入力値が参照されたか否かを判断することができるからである。
The
図12(c)は、上位ルーチンにおいて2つの引数を持つ関数が呼出し命令(call)によって呼び出された後に、その関数の命令区間である下位ルーチンにおいて戻り命令(return)によって上位ルーチンに復帰する一連の処理例を示す概念図である。 FIG. 12C shows a sequence in which a function having two arguments is called by a call instruction (call) in the upper routine and then returned to the upper routine by a return instruction (return) in the lower routine that is the instruction section of the function. It is a conceptual diagram which shows the example of a process.
ここでは、関数の呼出し命令(call)311および戻り命令(retuen)312が示されている。また、上位ルーチンにおける入力値A設定321および入力値B設定322と、下位ルーチンにおける入力値A参照323、入力値B参照324および実行結果C設定325とが示されている。これらは、図4(b)に示したものと同様であるため、ここでの説明を省略する。
Here, a function call instruction (call) 311 and a return instruction (return) 312 are shown. Further, an input value A setting 321 and an input value B setting 322 in the upper routine, an input
図12(d)は、履歴メモリ730におけるデータフォーマットの一例を示す概念図である。ここでは、関数の区間識別情報である関数アドレス731と、実行履歴検索データ732との対応関係が示されている。実行履歴検索データ732は、図3に示した木構造により構成される検索データであって、実行履歴における入力値および実行結果が関連付けられた情報を含む検索データである。
FIG. 12D is a conceptual diagram illustrating an example of a data format in the
このような場合において、入力値A設定321では、アドレス判定部810からの指示により、プログラムカウンタ350から出力された命令アドレス(入力値A設定命令アドレス)が、入力値設定命令アドレス出力部830に保持される。このとき、アドレス判定部810からの指示により、実行データ保持部740に保持された1番目の設定入力値(入力値A)が、設定入力値保持部840に出力される。
In such a case, in the input value A setting 321, the instruction address (input value A setting instruction address) output from the
入力値B設定322では、アドレス判定部810の指示により、プログラムカウンタ350から出力された命令アドレス(入力値B設定命令アドレス)が、入力値設定命令アドレス出力部830に保持される。このとき、アドレス判定部810からの指示により、実行データ保持部740に保持された2番目の設定入力値(入力値B)が、設定入力値保持部840に出力される。
In the input value B setting 322, the instruction address (input value B setting instruction address) output from the
呼出し命令(call)311では、アドレス判定部810からの指示により、実行データ保持部740に区間識別情報(関数アドレス1)が保持される。入力値A参照323、入力値B参照324および実行結果C設定325では、アドレス判定部810の指示により、1番目の参照入力値(入力値A)、2番目の参照入力値(入力値B)および実行結果(実行結果C)が実行データ保持部740に保持される。
In the call instruction (call) 311, the section identification information (function address 1) is held in the execution
戻り命令(return)312では、アドレス判定部810からの指示により、実行データ保持部740における区間識別情報(関数アドレス1)、1番目および2番目の参照入力値(入力値Aおよび入力値B)が、検索開始命令決定部850に出力される。これにより、検索開始命令決定部850によって、1番目および2番目の参照入力値(入力値Aおよび入力値B)に対応する設定入力値保持部840における1番目および2番目の設定入力値(入力値Aおよび入力値B)が抽出される。
In the return instruction (return) 312, section identification information (function address 1) in the execution
すなわち、実行データ保持部740における参照入力値の格納場所に基づいて、設定入力値保持部840における設定入力値のうち、関数の実行により参照された入力値が特定される。これは、命令デコーダ320により入力値設定命令と判断された命令であっても、関数に対する入力値を設定する命令でない場合があるからである。例えば、レジスタ4番にデータを格納する命令は、命令デコーダ320によって入力値設定命令と判断されるが、関数の命令区間外では、他の処理によっても使用される場合がある。
That is, based on the storage location of the reference input value in the execution
そして、検索開始命令決定部850によって、その抽出された設定入力値の設定順番(1および2)のうち、最も小さい設定順番(1)が選択される。すなわち、検索開始命令決定部850により、関数における最先の入力値設定命令に基づいて設定された設定入力値に対応する設定順番(1)が選択される。
Then, search start
これにより、検索開始命令決定部850から設定順番(1)および区間識別情報(関数アドレス1)が、入力値設定命令アドレス出力部830に供給される。そして、入力値設定命令アドレス出力部830により、検索開始命令決定部850からの設定順番(1)に対応する「入力値A設定命令アドレス」と、「関数アドレス1」とが関連付けられて入力値設定命令アドレステーブル820に出力される。
Accordingly, the setting order (1) and the section identification information (function address 1) are supplied from the search start
また、アドレス判定部810からの指示により、実行データ保持部740における区間識別情報(関数アドレス1)、参照入力値(入力値Aおよび入力値B)および実行結果(実行結果C)が、実行履歴検索部710に出力される。そして、実行履歴検索部710により、その出力されたデータが履歴メモリ730に登録される。
Further, according to an instruction from the
[データ処理装置100の動作例]
次に本発明の第3の実施の形態におけるデータ処理装置100の動作について図面を参照して説明する。
[Operation Example of Data Processing Device 100]
Next, the operation of the
図13は、本発明の第3の実施の形態におけるデータ処理装置100による実行結果再利用方法の処理手順の一例を示すフローチャートである。
FIG. 13 is a flowchart illustrating an example of a processing procedure of an execution result reuse method by the
まず、フェッチ部310により、主記憶部130または命令キャッシュ210から命令が読み出される(ステップS941)。続いて、アドレス判定部810により、プログラムカウンタ350から出力される命令アドレスが、入力値設定命令アドレステーブル820における入力値設定命令アドレスと一致するか否かが判断される(ステップS942)。
First, the fetch
そして、プログラムカウンタ350からの命令アドレスが入力値設定命令アドレスと一致する場合には、実行履歴検索処理(ステップS960)が実行される。一方、入力値設定命令アドレスと一致しない場合には、命令デコーダ320により、入力値設定命令か否かが判断される(ステップS943)。
If the instruction address from the
そして、入力値設定命令と判断された場合には、アドレス判定部810からの指示により、プログラムカウンタ350からの命令アドレスが、入力値設定命令アドレスとして入力値設定命令アドレス出力部830に保持される(ステップS954)。続いて、アドレス判定部810からの指示によって実行部330からの出力が設定入力値として実行データ保持部740に保持されて、その保持された設定入力値が、設定入力値保持部840に保持される(ステップS955)。
If it is determined that the instruction is an input value setting instruction, an instruction address from the
一方、入力値設定命令でないと判断された場合には、命令デコーダ320により、関数の呼出し命令か否かが判断される(ステップS944)。そして、関数の呼出し命令でないと判断された場合には、ステップS941に戻る。
On the other hand, if it is determined that the instruction is not an input value setting instruction, the
このようにして、関数の呼出し命令が読み出されるまでの間、入力値設定命令が読み出されるたびに、プログラムカウンタ350からの命令が、入力値設定命令アドレス出力部830に、設定入力値およびその設定順番が、設定入力値保持部840に保持される。この場合において、設定入力値の格納場所が同一の設定入力値が、設定入力値保持部840に既に保持されているときは、既に保持されている設定入力値およびその設定順番の保持領域に重ねて、新たな設定入力値およびその設定順番が保持される。
In this way, every time the input value setting instruction is read until the function call instruction is read, the instruction from the
一方、関数の呼出し命令でないと判断された場合には、アドレス判定部810により、関数の先頭アドレスが、区間識別情報として実行データ保持部740に保持される(ステップS945)。次に、関数の命令区間において、フェッチ部310により、主記憶部130または命令キャッシュ210から命令が読み出される(ステップS946)。続いて、命令デコーダ320により、その読み出された命令が入力値参照命令であるか否かが判断される(ステップS947)。
On the other hand, if it is determined that the instruction is not a function call instruction, the
そして、入力値参照命令と判断された場合には、アドレス判定部810からの指示により、実行部330からの出力を、参照入力値としてその順番とともに実行データ保持部740に保持されて(ステップS956)、ステップS946の処理に戻る。一方、入力値参照命令でないと判断された場合には、命令デコーダ320により、読み出された命令が、実行結果設定命令か否かが判断される(ステップS948)。
If it is determined that the instruction is an input value reference command, the output from the
そして、実行結果設定命令であると判断された場合には、アドレス判定部810からの指示により、実行部330からの出力を、実行結果として実行データ保持部740に保持させて(ステップS957)、ステップS946の処理に戻る。一方、実行結果設定命令でないと判断された場合には、命令デコーダ320により、読み出された命令が、関数の戻り命令であるか否かが判断される(ステップS949)。
If it is determined that the instruction is an execution result setting instruction, an output from the
そして、関数の戻り命令でないと判断された場合には、ステップS946に戻り、関数の呼出し命令が読み出されるまで、参照入力値および実行結果が、実行データ保持部740に保持される。
If it is determined that the instruction is not a function return instruction, the process returns to step S946, and the reference input value and the execution result are held in the execution
一方、関数の呼出し命令と判断された場合には、検索開始命令決定部850により、設定入力値保持部840に保持された設定入力値のうち、実行データ保持部740に保持された参照入力値に基づいて、関数における最先の設定入力値の設定順番が特定される。そして、入力値設定命令アドレス出力部830における入力値設定命令アドレスのうち、検索開始命令決定部850により特定された設定順番に対応する入力値設定命令アドレスが、最先の入力値設定命令アドレスとして抽出される。
On the other hand, if it is determined that the instruction is a function call instruction, the reference input value held in the execution
これにより、入力値設定命令アドレス出力部830により、最先の入力値設定命令アドレスと、実行データ保持部740からの区間識別情報とが関連付けられて入力値設定命令アドレステーブル820に登録される(ステップS951)。また、アドレス判定部810からの登録指示により、実行履歴検索部710によって実行データ保持部740における区間識別情報、参照入力値および実行結果が、履歴メモリ730に登録される(ステップS952)。
As a result, the input value setting command
そして、履歴メモリ730および入力値設定命令アドレステーブル820への登録が終了した後に、実行データ保持部740、設定入力値保持部840および入力値設定命令アドレス出力部830におけるデータが消去される(ステップS953)。そして、実行結果再利用方法の処理を終了する。
Then, after the registration in the
[データ処理装置100における実行履歴検索処理の例]
図14は、本発明の第3の実施形態におけるデータ処理装置100による実行履歴検索処理(ステップS960)の処理手順例を示すフローチャートである。
[Example of execution history search processing in data processing apparatus 100]
FIG. 14 is a flowchart illustrating an example of a processing procedure of an execution history search process (step S960) by the
まず、アドレス判定部810により、プログラムカウンタ350からの命令アドレスと一致する入力値設定命令アドレスに対応する区間識別情報が、入力値設定命令アドレステーブル820から実行データ保持部740に出力される(ステップS963)。続いて、実行履歴検索部710により、履歴メモリ730の検索キーとして、実行データ保持部740に保持された区間識別情報が履歴メモリ730に入力される(ステップS964)。これにより、履歴メモリ730における区間識別情報に対応する複数の実行履歴の検索が開始される。
First, the
次に、命令デコーダ320により、フェッチ部310から読み出された命令が、入力値設定命令であるか否かが判断される(ステップS965)。そして、入力値設定命令であると判断された場合には、命令デコーダ320からの入力値設定信号に基づいて、入力値設定命令により設定された入力値が、アドレス判定部810によって実行データ保持部740に保持される。
Next, the
この後、実行履歴検索部710により、実行データ保持部740に保持された入力値が、履歴メモリ730に入力される(ステップS971)。なお、1回目のステップS965の判断については、ここでは、必ず入力値設定命令と判断されるため、その判断を省略して、ステップS971に進むようにしてもよい。
Thereafter, the execution
続いて、実行履歴検索部710からの区間識別情報に対応する履歴メモリ730における実行履歴について、履歴メモリ730により、実行履歴検索部710からの入力値と、その実行履歴における入力値とが一致するか否かが判断される(ステップS972)。そして、両者の入力値が一致しない場合には、ステップS974の処理に進む。
Subsequently, for the execution history in the
一方、両者の入力値が一致した場合には、履歴メモリ730において、実行履歴における次の引数の入力値を比較するために、次の引数における引数ノードにポインタが進められる(ステップS973)。すなわち、実行履歴検索部710からの入力値と一致する引数ノードがあれば、その引数ノードの右ポインタによって、次の引数ノードが指し示される。次に、フェッチ部310により、主記憶部130または命令キャッシュ210から命令が読み出され(ステップS974)、ステップS915の処理に戻る。
On the other hand, if the two input values match, the
一方、ステップS965の処理において、入力値設定命令でないと判断された場合において、フェッチ部310により読み出された命令が関数の呼出し命令であるか否かが判断される(ステップS966)。そして、関数の呼出し命令でない場合には、ステップS974に進む。
On the other hand, if it is determined in step S965 that the instruction is not an input value setting instruction, it is determined whether the instruction read by the fetch
このようにして、関数における全ての入力値が設定されるまで、ステップS965、S966およびS971乃至S974における一連の処理が繰り返し実行される。すなわち、入力値設定命令アドレステーブル820により特定された入力値設定命令から呼出し命令までの関数の入力値設定命令に基づいて設定された入力値が、実行データ保持部740に保持されて、その保持された入力値が履歴メモリ730に入力される。
In this way, a series of processes in steps S965, S966, and S971 to S974 are repeatedly executed until all input values in the function are set. In other words, 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 820 is held in the execution
このように、プログラムカウンタ350から出力される命令アドレスと一致する入力値設定命令アドレスに対応する区間識別情報が実行データ保持部740に保持される。そして、その入力値設定命令アドレスにより特定された入力値設定命令から呼出し命令までの命令群のうちの入力値設定命令に基づいて実行部から出力された入力値が、実行データ保持部740に保持される。
As described above, the section identification information corresponding to the input value setting instruction address that matches the instruction address output from the
これにより、実行履歴検索部710によって、実行データ保持部740における区間識別情報および入力値を用いて、履歴メモリ730における実行履歴に関連付けられた実行結果が検索される。なお、ステップS963乃至S966およびS971乃至S974は、特許請求の範囲に記載の実行履歴検索手順の一例である。
As a result, the execution
一方、ステップS966において、関数の呼出し命令と判断された場合には、実行データ保持部740における区間識別情報および入力値が、履歴メモリ730における区間識別情報に関連付けられた入力値と全て一致したか否かが判断される(ステップS967)。
On the other hand, if it is determined in step S966 that the instruction is a function call instruction, whether the section identification information and the input value in the execution
そして、実行履歴検索部710からの区間識別情報および入力値が全て一致した場合には、実行結果再利用処理が実行される(ステップS975)。すなわち、実行履歴検索部710からの区間識別情報および入力値に対応する履歴メモリ730における実行結果が、実行結果出力部720から出力される。そして、主記憶部130またはレジスタファイル340に書き戻されて、関数の処理をスキップする。なお、S975は、特許請求の範囲に記載の実行結果出力手順の一例である。
If all the section identification information and input values from the execution
一方、実行履歴検索部710からの区間識別情報および入力値が全て一致しない場合には、呼出し命令により呼び出された関数が実行されて、その実行結果が実行データ保持部740に保持される(ステップS968)。そして、実行履歴検索部710により、実行データ保持部740に保持された実行結果と、ステップS963およびS971の処理によって保持された区間識別情報および入力値とが、履歴メモリ730に登録される(ステップS919)。
On the other hand, when the section identification information from the execution
このように、本発明の第3の実施の形態では、検索開始命令アドレス管理部800は、プログラムの実行中において、関数における最先の入力値設定命令アドレスを入力値設定命令アドレステーブル820に登録することができる。
As described above, in the third embodiment of the present invention, the search start instruction
このように、本発明の実施の形態によれば、命令区間の呼出し命令の実行の前に、履歴メモリ430または730における実行履歴を検索することができるため、実行結果の再利用によるプログラムの処理時間を短縮することができる。また、入力値設定命令アドレステーブル520および720を設けることによって、プログラム自体に専用命令を埋め込むことなく、関数の呼出し命令の実行前に、履歴メモリ430または730における実行履歴を検索することができる。
As described above, according to the embodiment of the present invention, the execution history in the
なお、本発明の実施の形態では、履歴メモリ430または730を、SRAM(Static Random Access Memory)やROM(Read Only Memory)などの不揮発メモリにより実現するようにしてもよい。これにより、データ処理装置100の電源がオフされた場合であっても、履歴メモリ430または730に保持された実行履歴は消失しないため、データ処理装置100の起動直後においても、過去の実行結果を有効に利用することができる。このため、データ処理装置100の起動直後における実行結果再利用処理による実行時間の削減効果の低下を抑制することができる。
In the embodiment of the present invention, the
また、プログラムの実行後に、データ処理装置100の外部に設けた記憶部に履歴メモリ430または730に保持された履歴データを転送するようにしてもよい。ここで、履歴データを記憶する記憶部をデータ処理装置100の外部に設けた場合を、第4の実施の形態として、次図を参照して簡単に説明する。
In addition, after the program is executed, the history data held in the
<4.第4の実施の形態>
[データ処理装置100の外部に履歴データ記憶部を設けた例]
図15は、本発明の第4の実施の形態におけるデータ処理装置100の外部に履歴データ記憶部を設けた場合における集積回路の一構成例を示すブロック図である。ここでは、図1に示した集積回路の構成に加えて履歴データ記憶部140が示されている。この履歴データ記憶部140以外の構成は、図1に示したものと同様であるため、ここでの説明を省略する。
<4. Fourth Embodiment>
[Example in which a history data storage unit is provided outside the data processing apparatus 100]
FIG. 15 is a block diagram showing a configuration example of an integrated circuit when a history data storage unit is provided outside the
履歴データ記憶部140は、主記憶部130に記憶されたプログラムが実行された後に、データ処理装置100から転送された履歴メモリ430または730における履歴データを記憶するものである。この履歴データ記憶部140は、例えば、不揮発性メモリにより実現される。
The history
このように、不揮発性メモリにより実現される履歴データ記憶部140をデータ処理装置100の外部に設けて、履歴メモリ430または730の履歴データを転送することによって、電源オフによる履歴データの消失を回避することができる。次に、履歴データの転送方法について、次図を参照して簡単に説明する。
As described above, by providing the history
図16は、本発明の第4の実施の形態におけるデータ処理装置100による履歴データ転送方法の処理手順を示すフローチャートである。
FIG. 16 is a flowchart illustrating a processing procedure of the history data transfer method by the
まず、アプリケーションが起動されて(ステップS991)、データ処理部300により、履歴データ記憶部140に履歴データがあるか否かが判断される(ステップS992)。
First, an application is activated (step S991), and the
そして、履歴データ記憶部140に履歴データが記憶されている場合には、データ処理部300により、その記憶された履歴データが履歴メモリ430または730に転送される(ステップS993)。一方、履歴データが記憶されていない場合には、ステップS994に進む。
If the history data is stored in the history
そして、データ処理部300により、主記憶部130に記憶されたプログラムであるアプリケーションが実行される(ステップS994)。このアプリケーションの実行後に、データ処理部300により、履歴データ記憶部140および履歴メモリ430または730における両者の履歴データに基づいて、履歴データ記憶部140に記憶させる新たに履歴データが再構築される(ステップS995)。そして、その再構築された履歴データを履歴データ記憶部140に記憶する。
Then, the
このように、プログラムの実行前に、履歴データ記憶部140に記憶された過去の履歴データを履歴メモリ430または730に転送することによって、プログラムの起動直後における再利用処理による実行時間の短縮効果を向上させることができる。
As described above, by transferring the past history data stored in the history
なお、本発明の実施の形態では、1つの関数の命令区間に対する実行結果に再利用の例について説明したが、関数の命令区間において、さらに複数回関数を呼び出すような多重構造の関数に対しても適用することができる。 In the embodiment of the present invention, an example of reusing the execution result for the instruction section of one function has been described. However, for a function having a multiple structure that calls a function more than once in the instruction section of a function. Can also be applied.
なお、本発明の実施の形態は本発明を具現化するための一例を示したものであり、本発明の実施の形態において明示したように、本発明の実施の形態における事項と、特許請求の範囲における発明特定事項とはそれぞれ対応関係を有する。同様に、特許請求の範囲における発明特定事項と、これと同一名称を付した本発明の実施の形態における事項とはそれぞれ対応関係を有する。ただし、本発明は実施の形態に限定されるものではなく、本発明の要旨を逸脱しない範囲において実施の形態に種々の変形を施すことにより具現化することができる。 The embodiment of the present invention shows an example for embodying the present invention. As clearly shown in the embodiment of the present invention, the matters in the embodiment of the present invention and the claims Each invention-specific matter in the scope has a corresponding relationship. Similarly, the matters specifying the invention in the claims and the matters in the embodiment of the present invention having the same names as the claims have a corresponding relationship. However, the present invention is not limited to the embodiments, and can be embodied by making various modifications to the embodiments without departing from the gist of the present invention.
また、本発明の実施の形態において説明した処理手順は、これら一連の手順を有する方法として捉えてもよく、また、これら一連の手順をコンピュータに実行させるためのプログラム乃至そのプログラムを記憶する記録媒体として捉えてもよい。この記録媒体として、例えば、CD(Compact Disc)、MD(MiniDisc)、DVD(Digital Versatile Disk)、メモリカード、ブルーレイディスク(Blu-ray Disc(登録商標))等を用いることができる。 The processing procedure described in the embodiment of the present invention may be regarded as a method having a series of these procedures, and a program for causing a computer to execute the series of procedures or a recording medium storing the program May be taken as As this recording medium, for example, a CD (Compact Disc), an MD (MiniDisc), a DVD (Digital Versatile Disk), a memory card, a Blu-ray Disc (registered trademark), or the like can be used.
100 データ処理装置
120 バス
130 主記憶部
200 一次キャッシュ
210 命令キャッシュ
220 データキャッシュ
300 データ処理部
310 フェッチ部
320 命令デコーダ
330 実行部
331 ロードユニット
332 入力選択部
333 演算回路
334 ストアユニット
340 レジスタファイル
350 プログラムカウンタ
400、700 実行結果再利用処理部
410、710 実行履歴検索部
420、720 実行結果出力部
430、730 履歴メモリ
440、740 実行データ保持部
500、800 検索開始命令アドレス管理部
510、810 アドレス判定部
520、820 入力値設定命令アドレステーブル
600 プログラム解析処理装置
610 ソースプログラム記憶部
620 コンパイル処理部
630 プログラム解析部
631 再利用候補区間抽出部
632 再利用候補区間解析部
640 プログラム最適化処理部
641 再利用度生成部
642 再利用区間抽出部
643 再利用区間情報生成部
650 コード生成部
660 オブジェクトプログラム記憶部
670 再利用区間情報記憶部
840 設定入力値保持部
850 検索開始命令決定部
DESCRIPTION OF
Claims (10)
前記命令区間を呼び出すための呼出し命令が実行される前に前記命令区間の入力値を設定するための入力値設定命令のアドレスである入力値設定命令アドレスを前記命令区間の区間識別情報ごとに保持する入力値設定命令アドレステーブルと、
前記区間識別情報ごとに前記命令区間における入力値および実行結果を関連付けて実行履歴として保持する履歴メモリと、
前記入力値設定命令アドレスにより特定された前記入力値設定命令から前記呼出し命令までの命令群のうちの前記入力値設定命令に基づいて前記実行部から出力された入力値と前記入力値設定命令アドレスに対応する前記区間識別情報とを用いて前記実行履歴における前記実行結果を検索する実行履歴検索部と、
前記入力値設定命令アドレスによって特定される前記呼出し命令が実行されるときに前記実行履歴検索部により前記実行結果が抽出された場合には前記抽出された実行結果を前記実行部に出力する実行結果出力部と
を具備するデータ処理装置。 A process based on an instruction sequence including a plurality of instruction sections;
An input value setting instruction address that is an address of an input value setting instruction for setting an input value of the instruction section is held for each section identification information of the instruction section before a call instruction for calling the instruction section is executed. Input value setting instruction address table to be
A history memory that associates an input value and an execution result in the command section for each section identification information and holds it as an execution history;
The input value and the input value setting instruction address output from the execution unit 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 An execution history search unit that searches for the execution result in the execution history using the section identification information corresponding to
When 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 that outputs the extracted execution result to the execution unit A data processing apparatus comprising an output unit.
実行履歴検索部は、前記再利用区間における前記命令群のうちの前記入力値設定命令に基づいて前記実行部から出力された前記入力値と前記入力値設定命令アドレスに対応する前記区間識別情報とを用いて前記再利用区間における前記実行結果を検索し、
実行結果出力部は、前記入力値設定命令アドレスによって特定される前記再利用区間の前記呼出し命令が実行されるときに前記実行履歴検索部により前記実行履歴における前記再利用区間の前記実行結果が抽出された場合には前記抽出された実行結果を前記実行部に出力する
請求項1記載のデータ処理装置。 The input value setting instruction address table includes the input value setting instruction address of the input value setting instruction for setting an input value of a reuse section that is an instruction section executed a plurality of times among the plurality of instruction sections. Hold for each section identification information of the reuse section,
The execution history search unit includes: the input value output from the execution unit based on the input value setting command in the instruction group in the reuse interval; and the interval identification information corresponding to the input value setting command address. The execution result in the reuse section is searched using
The execution result output unit extracts the execution result of the reuse section in the execution history by the execution history search unit when the call instruction of the reuse section specified by the input value setting instruction address is executed. The data processing apparatus according to claim 1, wherein, when it is performed, the extracted execution result is output to the execution unit.
前記実行履歴検索部は、前記入力値設定命令に基づいて前記実行部から出力された入力値と前記実行部により実行された実行結果と前記入力値設定命令アドレスに対応する前記区間識別情報とを前記履歴メモリに保持させる
請求項1記載のデータ処理装置。 The execution unit executes processing in the command section specified by the input value setting command address 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 includes an input value output from the execution unit based on the input value setting command, an execution result executed by the execution unit, and the section identification information corresponding to the input value setting command address. The data processing apparatus according to claim 1, wherein the data processing apparatus is held in the history memory.
前記履歴メモリは、前記関数の先頭アドレスごとに前記関数における入力値および実行結果を関連付けて前記実行履歴として保持し、
前記実行履歴検索部は、前記命令群のうちの前記入力値設定命令に基づいて前記実行部から出力された前記関数の前記入力値と前記入力値設定命令アドレスに対応する前記関数の先頭アドレスとを用いて前記実行結果を検索し、
前記実行結果出力部は、前記入力値設定命令アドレスによって特定される前記関数の前記呼出し命令が実行されるときに前記実行履歴検索部により前記関数の前記実行結果が抽出された場合には前記抽出された実行結果を前記実行部に出力する
請求項1記載のデータ処理装置。 The input value setting instruction address table holds 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,
The execution history search unit includes the input value of the function output from the execution unit based on the input value setting command of the instruction group and a start address of the function corresponding to the input value setting command address. The execution result is searched using
The execution result output unit extracts the execution result when the execution history search unit extracts the execution result of the function when the call instruction of the function specified by the input value setting instruction address is executed. The data processing apparatus according to claim 1, wherein the executed result is output to the execution unit.
前記複数の命令区間のうち前記再利用度に基づいて抽出された再利用区間における入力値を設定するための入力値設定命令の入力値設定命令アドレスと前記再利用区間を識別するための区間識別情報とが関連付けられた再利用区間情報を生成する再利用区間情報生成部と
を具備するプログラム解析処理装置。 A reuse level generation unit that generates a reuse level for each instruction interval based on a usage mode of the instruction interval, indicating a degree of matching between input values for each execution of processing in an instruction interval that is executed a plurality of times in the program When,
An input value setting instruction address of an input value setting instruction for setting an input value in a reuse section extracted based on the degree of reuse among the plurality of instruction sections, and a section identification for identifying the reuse section A program analysis processing apparatus comprising: a reuse section information generation unit that generates reuse section information associated with information.
前記入力値設定命令アドレスにより特定された前記入力値設定命令から前記呼出し命令までの命令群のうちの前記入力値設定命令に基づいて前記実行部から出力された入力値と前記入力値設定命令アドレスに対応する前記区間識別情報とを用いて前記実行履歴における前記実行結果を検索する実行履歴検索手順と、
前記入力値設定命令アドレスによって特定される前記呼出し命令が実行されるときに前記実行履歴検索手順により前記実行結果が抽出された場合には前記抽出された実行結果を前記実行部に出力する実行結果出力手順と
を具備するデータ処理方法。 An execution unit for executing processing based on an instruction sequence including a plurality of instruction sections, and an input value setting instruction input value for setting an input value of the instruction section before execution of a call instruction for calling the instruction section An input value setting instruction address table that holds a set instruction address for each section identification information of the instruction section, and a history memory that holds an input value and an execution result in the instruction section for each section identification information and stores them as an execution history. A data processing method in a data processing apparatus comprising:
The input value and the input value setting instruction address output from the execution unit 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 An execution history search procedure for searching for the execution result in the execution history using the section identification information corresponding to
When the execution result is extracted by the execution history search procedure when the call instruction specified by the input value setting instruction address is executed, the execution result is output to the execution unit. A data processing method comprising: an output procedure.
前記複数の命令区間のうち前記再利用度に基づいて抽出された再利用区間における入力値を設定するための入力値設定命令の入力値設定命令アドレスと前記再利用区間を識別するための区間識別情報とが関連付けられた再利用区間情報を生成する再利用区間情報生成手順と
を具備するプログラム解析処理方法。 A reuse degree generation procedure for generating a reuse degree for each instruction section based on a usage mode of the instruction section;
An input value setting instruction address of an input value setting instruction for setting an input value in a reuse section extracted based on the degree of reuse among the plurality of instruction sections, and a section identification for identifying the reuse section A program analysis processing method comprising: a reuse section information generation procedure for generating reuse section information associated with information.
Priority Applications (7)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2009187624A JP2011039858A (en) | 2009-08-13 | 2009-08-13 | Data processing device, data processing method, program analysis processing device, and program analysis processing method |
KR1020127003143A KR20120068824A (en) | 2009-08-13 | 2010-08-05 | Data processing device, data processing method, program conversion processing device, program conversion processing method, program analysis processing device, program analysis processing method, history storing device, program, compile processing device, and compile processing method |
TW099126111A TW201124910A (en) | 2009-08-13 | 2010-08-05 | Data processing device, data processing method, program conversion processing device, and program conversion processing method |
US13/389,134 US20120185859A1 (en) | 2009-08-13 | 2010-08-05 | Methods and systems for program analysis and program conversion |
CN2010800349313A CN102667715A (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 me |
PCT/JP2010/063246 WO2011018974A1 (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 |
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 |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2009187624A JP2011039858A (en) | 2009-08-13 | 2009-08-13 | Data processing device, data processing method, program analysis processing device, and program analysis processing method |
Publications (1)
Publication Number | Publication Date |
---|---|
JP2011039858A true JP2011039858A (en) | 2011-02-24 |
Family
ID=43767550
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2009187624A Abandoned JP2011039858A (en) | 2009-08-13 | 2009-08-13 | Data processing device, data processing method, program analysis processing device, and program analysis processing method |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP2011039858A (en) |
-
2009
- 2009-08-13 JP JP2009187624A patent/JP2011039858A/en not_active Abandoned
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2011018974A1 (en) | 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 | |
US20050132342A1 (en) | Pattern-matching system | |
US7249350B2 (en) | Optimized translation of scalar type SIMD instructions into non-scalar SIMD instructions | |
CN103309644A (en) | Translation address cache for a microprocessor | |
CN108846069B (en) | Document execution method and device based on markup language | |
KR970066865A (en) | Optimizer for eliminating transmission commands by analyzing bandlike equivalence relationship | |
CN114610957A (en) | Data processing method, device, equipment and computer storage medium | |
JP2002287959A (en) | Load store queue | |
JP6648431B2 (en) | Matching program, matching method and matching device | |
US9588747B2 (en) | Method and apparatus for converting programs | |
US9182960B2 (en) | Loop distribution detection program and loop distribution detection method | |
US20070255771A1 (en) | Method and system for renewing an index | |
CN111611788B (en) | Data processing method and device, electronic equipment and storage medium | |
JP2011039858A (en) | Data processing device, data processing method, program analysis processing device, and program analysis processing method | |
JPH0786875B2 (en) | Vector processor | |
CN107329807B (en) | Data delay processing method and device, and computer readable storage medium | |
JP2011039857A (en) | Program conversion processing device, data processing device, program conversion processing method, and data processing method | |
US10108405B2 (en) | Compiling apparatus and compiling method | |
CN115563116A (en) | Database table scanning method, device and equipment | |
JP2011039856A (en) | Data processing device, data processing method, program conversion processing device, and program conversion processing method | |
JP2011096153A (en) | Compile processing device, data processing device, compile processing method, and program | |
JP2011039859A (en) | Data processor, history storing device, and data processing method and program | |
US8554780B2 (en) | Search apparatus and search method | |
WO2022062005A1 (en) | Gemm-based image data processing method, apparatus, and device, and medium | |
CN108958802B (en) | Thread pre-operation method, device and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20120723 |
|
A762 | Written abandonment of application |
Free format text: JAPANESE INTERMEDIATE CODE: A762 Effective date: 20130416 |