JP4892387B2 - Execution path detection apparatus, information processing apparatus, execution path detection method, program, and recording medium - Google Patents
Execution path detection apparatus, information processing apparatus, execution path detection method, program, and recording medium Download PDFInfo
- Publication number
- JP4892387B2 JP4892387B2 JP2007094075A JP2007094075A JP4892387B2 JP 4892387 B2 JP4892387 B2 JP 4892387B2 JP 2007094075 A JP2007094075 A JP 2007094075A JP 2007094075 A JP2007094075 A JP 2007094075A JP 4892387 B2 JP4892387 B2 JP 4892387B2
- Authority
- JP
- Japan
- Prior art keywords
- branch
- execution
- instruction
- history table
- address
- 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.)
- Expired - Fee Related
Links
Images
Description
本発明は、実行パス検出装置、情報処理装置、実行パス検出方法、プログラム及び記録媒体に関する。 The present invention relates to an execution path detection device, an information processing device, an execution path detection method, a program, and a recording medium.
アプリケーションプログラムを実行するプロセッサの処理の高速化や低消費電力化を実現するために、プログラムの局所性に着目した手法が提案されている。この手法は、プログラムを実行する上でクリティカルな命令列を発見し、該命令列の処理の最適化を図ることで処理の高速化や低消費電力化を実現するものである。このようなクリティカルな命令列を発見する手法として、命令列に含まれる分岐命令の実行履歴を利用する手法がある。 In order to realize high-speed processing and low power consumption of a processor that executes an application program, a method that focuses on the locality of the program has been proposed. This technique realizes high-speed processing and low power consumption by finding a critical instruction sequence for executing a program and optimizing the processing of the instruction sequence. As a technique for finding such a critical instruction sequence, there is a technique that uses an execution history of a branch instruction included in the instruction sequence.
例えば特許文献1には、命令列の命令が実行される方向とは逆方向である戻り方向に分岐する分岐命令の実行回数に着目してループ構造の命令部分を検出し、ループ構造の命令の実行回数が多いと判断されるパス経路を記録する分岐履歴記録装置が開示されている。即ち、特許文献1では、プログラムのループ構造の部分に局所性が存在するという仮定の下で、該パス経路を実行頻度の高い命令列の実行パスとして検出する。
For example, in
また、例えば特許文献2には、分岐命令の分岐履歴が格納されるプロファイラテーブルと、戻り方向の分岐先アドレス及び分岐回数が格納される戻り分岐先テーブルとを設け、戻り分岐先テーブルの分岐先アドレスとプロファイラテーブルに格納された分岐履歴とに基づいて、実行頻度の高い命令列の実行パスを検出する推定装置が開示されている。
しかしながら、特許文献1に開示された分岐履歴記録装置では、ソフトウェアで処理する必要がある。そのため、実行頻度の高い命令列の実行パスを検出するための処理時間が長くなり、プロセッサの処理中に、所望の命令列の実行パスを特定することが困難であるという問題がある。
However, the branch history recording apparatus disclosed in
また、特許文献2に開示された推定装置では、膨大な分岐履歴や分岐先アドレスを記録しておく必要があり、分岐履歴や分岐先アドレス等を記憶する記憶領域が膨大になってしまうという問題がある。このような推定装置において、記憶領域を少なくしようとすると、退避等の必要性から処理が中断されてしまい、所望の命令列の実行パスを検出するための処理時間が長くなる。更に、特許文献2におけるSWプロファイラ部による処理が複雑であるため、ハードウェア化が困難であり、ソフトウェアで実現せざるを得なくなる。従って、特許文献1と同様に、プロセッサの処理中に、所望の命令列の実行パスを特定することは困難となる。
In addition, in the estimation apparatus disclosed in
本発明は、以上のような技術的課題に鑑みてなされたものであり、その目的とするところは、少ないメモリ容量で、高速に実行頻度の高い命令列の実行パスを検出できる実行パス検出装置、情報処理装置、実行パス検出方法、その実行パス検出方法をコンピュータに実現させるプログラム、及び該プログラムを記録する記録媒体を提供することにある。 The present invention has been made in view of the technical problems as described above, and an object of the present invention is to execute an execution path detecting apparatus capable of detecting an execution path of an instruction sequence having a high execution frequency at high speed with a small memory capacity. An information processing apparatus, an execution path detection method, a program for causing a computer to implement the execution path detection method, and a recording medium for recording the program.
上記課題を解決するために本発明は、
実行頻度が高い命令列の実行パスを検出するための実行パス検出装置であって、
分岐命令を含む命令列を1ブロックとする命令列ブロックの先頭アドレスの命令の実行回数が格納される実行履歴テーブルと、
前記分岐命令の分岐履歴が格納される分岐履歴テーブルと、
前記分岐命令の分岐履歴を収集する処理を行う分岐履歴管理部とを含み、
前記実行回数が所与の閾値を超えたことを条件に、前記分岐履歴管理部が、前記分岐履歴の収集を開始すると共に、前記実行パスを特定するためのパス情報を、前記分岐履歴に基づいて出力する実行パス検出装置に関係する。
In order to solve the above problems, the present invention
An execution path detection device for detecting an execution path of an instruction sequence having a high execution frequency,
An execution history table in which the number of executions of the instruction at the head address of the instruction sequence block in which an instruction sequence including a branch instruction is one block is stored;
A branch history table storing a branch history of the branch instruction;
A branch history management unit that performs a process of collecting a branch history of the branch instruction,
On the condition that the number of executions exceeds a given threshold, the branch history management unit starts collecting the branch history, and path information for identifying the execution path is based on the branch history. This is related to the execution path detection device that outputs the output.
また本発明に係る実行パス検出装置では、
前記命令列ブロックの先頭アドレスの命令の実行回数をカウントするカウンタを含み、
前記実行履歴テーブルは、
前記先頭アドレスの命令毎に、実行回数を記憶することができる。
In the execution path detection device according to the present invention,
A counter that counts the number of times the instruction at the head address of the instruction sequence block is executed;
The execution history table is
The number of executions can be stored for each instruction at the head address.
上記のいずれかの発明によれば、アプリケーションプログラムの局所性に着目して、高頻度で実行される命令列の繰り返し部分を検出してから、該繰り返し部分の分岐履歴を収集するようにしたので、アプリケーションプログラムにおいて実行頻度が高い命令列の実行パスを検出する際に膨大な分岐履歴を収集する必要がなくなる。そのため、本発明によれば、実行パスの検出精度の低下を抑えつつ、少ないメモリ容量で、高速に実行頻度の高い命令列の実行パスを検出できるようになる。 According to any one of the above-described inventions, focusing on the locality of the application program, since the repeated portion of the instruction sequence executed frequently is detected, the branch history of the repeated portion is collected. Therefore, it is not necessary to collect an enormous branch history when detecting an execution path of an instruction sequence having a high execution frequency in an application program. Therefore, according to the present invention, it is possible to detect an execution path of an instruction sequence having a high execution frequency at a high speed with a small memory capacity while suppressing a decrease in execution path detection accuracy.
また本発明に係る実行パス検出装置では、
前記実行履歴テーブルの記憶領域の少なくとも一部が、前記分岐履歴テーブルの記憶領域と重複していてもよい。
In the execution path detection device according to the present invention,
At least a part of the storage area of the execution history table may overlap with the storage area of the branch history table.
また本発明に係る実行パス検出装置では、
前記分岐履歴テーブルに登録すべき情報の少なくとも一部が、前記実行履歴テーブルの記憶領域に書き込まれてもよい。
In the execution path detection device according to the present invention,
At least a part of information to be registered in the branch history table may be written in a storage area of the execution history table.
上記のいずれかの発明においては、まず実行履歴テーブルを用いて高頻度で実行される命令列の繰り返し部分を検出してから、分岐履歴テーブルに該繰り返し部分の分岐履歴を収集する。そのため、分岐履歴を収集する段階では実行履歴テーブルを不要にできるため、本発明によれば、実行履歴テーブルと分岐履歴テーブルの記憶領域を共用するようにしたので、両テーブルのために必要な記憶容量の削減を図ることができる。 In any one of the above-described inventions, first, a repeated portion of an instruction sequence executed frequently is detected using the execution history table, and then the branch history of the repeated portion is collected in the branch history table. Therefore, the execution history table can be made unnecessary at the stage of collecting the branch history. Therefore, according to the present invention, the storage area for the execution history table and the branch history table is shared. The capacity can be reduced.
また本発明に係る実行パス検出装置では、
前記実行履歴テーブルに、
分岐命令の戻り方向の分岐先アドレスの命令の実行回数が格納されてもよい。
In the execution path detection device according to the present invention,
In the execution history table,
The number of executions of the instruction at the branch destination address in the return direction of the branch instruction may be stored.
本発明によれば、戻り方向の分岐命令の実行履歴のみを収集するようにしたので、少ないメモリ容量で、高頻度で繰り返される実行部分を検出できるようになる。 According to the present invention, since only the execution history of the branch instruction in the return direction is collected, it is possible to detect an execution portion that is frequently repeated with a small memory capacity.
また本発明に係る実行パス検出装置では、
前記実行履歴テーブルが、前記先頭アドレス及び前記実行回数を記憶し、
前記分岐履歴管理部が、
前記閾値を超えた前記実行回数に関連付けて記憶される先頭アドレスを用いて、前記分岐履歴の収集を開始することができる。
In the execution path detection device according to the present invention,
The execution history table stores the start address and the number of executions,
The branch history management unit
The collection of the branch history can be started using a head address stored in association with the number of executions exceeding the threshold.
本発明によれば、実行履歴テーブルを用いて検出した高頻度の繰り返し部分の分岐履歴の収集を行うことができるので、少ないメモリ容量で分岐履歴テーブルを構成できるようになる。 According to the present invention, it is possible to collect the branch history of the frequently repeated portion detected using the execution history table, so that the branch history table can be configured with a small memory capacity.
また本発明に係る実行パス検出装置では、
前記分岐履歴テーブルが、
記憶情報をセットアソシアティブ方式で記憶し、
各セットには、
前記先頭アドレス、当該命令列ブロックに含まれる分岐命令のターゲットアドレス、及び分岐回数が記憶され、
該分岐命令に対応して記憶されたターゲットアドレスのうち分岐回数が最も多いセットのターゲットアドレスを出力することができる。
In the execution path detection device according to the present invention,
The branch history table is
Memorize memorized information by set associative method,
Each set includes
The start address, the target address of a branch instruction included in the instruction sequence block, and the number of branches are stored.
Of the target addresses stored corresponding to the branch instruction, the target address of the set having the largest number of branches can be output.
また本発明に係る実行パス検出装置では、
前記分岐履歴管理部が、
前記分岐命令の分岐先アドレスをインデックスとして前記分岐履歴テーブルを検索して得られたターゲットアドレスをパス情報として出力することができる。
In the execution path detection device according to the present invention,
The branch history management unit
The target address obtained by searching the branch history table using the branch destination address of the branch instruction as an index can be output as path information.
上記のいずれかの発明によれば、分岐履歴テーブルに基づいてターゲットアドレス出力できるので、無駄なソフトウェア処理を省略して、高速に、実行パスを特定できるようになる。 According to any one of the above inventions, since the target address can be output based on the branch history table, it is possible to specify an execution path at high speed while omitting useless software processing.
また本発明に係る実行パス検出装置では、
前記分岐命令の分岐先が前記実行履歴テーブルに記録された先頭アドレスとならないとき、又は予め決められた分岐命令の実行回数が所与のサンプリング時間内に達しなかったとき、
前記分岐履歴管理部が、
前記分岐履歴テーブルの記憶情報を無効化することができる。
In the execution path detection device according to the present invention,
When the branch destination of the branch instruction does not become the start address recorded in the execution history table, or when the predetermined number of executions of the branch instruction does not reach within a given sampling time,
The branch history management unit
The stored information in the branch history table can be invalidated.
本発明によれば、分岐履歴の収集を開始した後に、高頻度で繰り返される実行が行われなかったことを検出して分岐履歴テーブルを無効化するようにしたので、無駄にパス情報を収集する必要がなくなる。 According to the present invention, after the branch history collection is started, the branch history table is invalidated by detecting that the execution is not frequently repeated, so that path information is collected wastefully. There is no need.
また本発明は、
上記のいずれか記載の実行パス検出装置と、
アプリケーションプログラムを実行処理する中央演算処理装置とを含み、
前記パス検出装置からの前記パス情報に基づいて、前記アプリケーションプログラムの処理が最適化される情報処理装置に関係する。
The present invention also provides
Any of the above execution path detection devices;
A central processing unit that executes and executes an application program,
The present invention relates to an information processing apparatus in which processing of the application program is optimized based on the path information from the path detection apparatus.
また本発明は、
上記のいずれか記載の実行パス検出装置と、
アプリケーションプログラムを実行処理する中央演算処理装置と、
前記パス検出装置からの前記パス情報に基づいて、前記アプリケーションプログラムの処理を最適化するパス処理部とを含む情報処理装置に関係する。
The present invention also provides
Any of the above execution path detection devices;
A central processing unit that executes application programs;
The present invention relates to an information processing apparatus including a path processing unit that optimizes processing of the application program based on the path information from the path detection apparatus.
上記のいずれかの発明によれば、少ないメモリ容量で、高速に実行頻度の高い命令列の実行パスを検出できる実行パス検出装置が適用され、処理が最適化された情報処理装置を提供できる。 According to any one of the above-described inventions, an information processing apparatus can be provided in which an execution path detection apparatus that can detect an execution path of an instruction sequence that is frequently executed at high speed with a small memory capacity is applied and processing is optimized.
また本発明は、
実行頻度が高い命令列の実行パスを検出するための実行パス検出方法であって、
分岐命令を含む命令列を1ブロックとする命令列ブロックの先頭アドレスの命令の実行回数を実行履歴テーブルに記憶するステップと、
前記実行回数が所与の閾値を超えたことを条件に前記分岐命令の分岐履歴の収集を開始し、該分岐履歴を分岐履歴テーブルに記憶するステップと、
前記実行パスを特定するためのパス情報を、前記分岐履歴に基づいて出力するステップとを含む実行パス検出方法に関係する。
The present invention also provides
An execution path detection method for detecting an execution path of an instruction sequence having a high execution frequency,
Storing in the execution history table the number of executions of the instruction at the head address of the instruction sequence block having one instruction sequence including a branch instruction as a block;
Starting collecting branch history of the branch instruction on condition that the number of executions exceeds a given threshold, and storing the branch history in a branch history table;
And outputting path information for specifying the execution path based on the branch history.
また本発明に係る実行パス検出方法では、
前記実行履歴テーブルの記憶領域の少なくとも一部が、前記分岐履歴テーブルの記憶領域と重複していてもよい。
In the execution path detection method according to the present invention,
At least a part of the storage area of the execution history table may overlap with the storage area of the branch history table.
また本発明に係る実行パス検出方法では、
前記先頭アドレスが、
分岐命令の戻り方向の分岐先アドレスであり、
前記実行履歴テーブルが、前記先頭アドレス及び前記実行回数を記憶し、
前記閾値を超えた前記実行回数に関連付けて記憶される先頭アドレスを用いて、前記分岐履歴の収集を開始することができる。
In the execution path detection method according to the present invention,
The start address is
The branch destination address in the return direction of the branch instruction,
The execution history table stores the start address and the number of executions,
The collection of the branch history can be started using a head address stored in association with the number of executions exceeding the threshold.
また本発明に係る実行パス検出方法では、
前記分岐履歴テーブルが、
記憶情報をセットアソシアティブ方式で記憶し、
各セットには、
前記先頭アドレス、当該命令列ブロックに含まれる分岐命令のターゲットアドレス、及び分岐回数が記憶され、
該分岐命令に対応して記憶されたターゲットアドレスのうち分岐回数が最も多いセットのターゲットアドレスを出力することができる。
In the execution path detection method according to the present invention,
The branch history table is
Memorize memorized information by set associative method,
Each set includes
The start address, the target address of a branch instruction included in the instruction sequence block, and the number of branches are stored.
Of the target addresses stored corresponding to the branch instruction, the target address of the set having the largest number of branches can be output.
また本発明に係る実行パス検出方法では、
該分岐命令の分岐先アドレスをインデックスとして前記分岐履歴テーブルを検索して得られたターゲットアドレスをパス情報として出力することができる。
In the execution path detection method according to the present invention,
The target address obtained by searching the branch history table using the branch destination address of the branch instruction as an index can be output as path information.
また本発明に係る実行パス検出方法では、
前記分岐命令の分岐先が前記実行履歴テーブルに記録された先頭アドレスとならないとき、又は予め決められた分岐命令の実行回数が所与のサンプリング時間内に達しなかったとき、
前記分岐履歴テーブルの記憶情報を無効化することができる。
In the execution path detection method according to the present invention,
When the branch destination of the branch instruction does not become the start address recorded in the execution history table, or when the predetermined number of executions of the branch instruction does not reach within a given sampling time,
The stored information in the branch history table can be invalidated.
上記のいずれかの発明によれば、少ないメモリ容量で、高速に実行頻度の高い命令列の実行パスを検出できる実行パス検出方法を提供できる。 According to any one of the above-described inventions, it is possible to provide an execution path detection method capable of detecting an execution path of an instruction sequence frequently executed at high speed with a small memory capacity.
また本発明は、
コンピュータに、上記のいずれか記載の実行パス検出方法を実行させるためのプログラムに関係する。
The present invention also provides
The present invention relates to a program for causing a computer to execute any of the execution path detection methods described above.
本発明によれば、少ないメモリ容量で、高速に実行頻度の高い命令列の実行パスを検出できる実行パス検出方法をコンピュータに実現させるプログラムを提供できる。 ADVANTAGE OF THE INVENTION According to this invention, the program which makes a computer implement | achieve the execution path detection method which can detect the execution path of an instruction sequence with high memory frequency at high speed with a small memory capacity can be provided.
また本発明は、
上記記載のプログラムを記録したコンピュータ読み取り可能な記録媒体に関係する。
The present invention also provides
The present invention relates to a computer-readable recording medium on which the program described above is recorded.
本発明によれば、少ないメモリ容量で、高速に実行頻度の高い命令列の実行パスを検出できる実行パス検出方法をコンピュータに実現させるプログラムを記録した記録媒体を提供できる。 ADVANTAGE OF THE INVENTION According to this invention, the recording medium which recorded the program which makes a computer implement | achieve the execution path detection method which can detect the execution path of an instruction sequence with high memory frequency at high speed can be provided.
以下、本発明の実施の形態について図面を用いて詳細に説明する。なお、以下に説明する実施の形態は、特許請求の範囲に記載された本発明の内容を不当に限定するものではない。また以下で説明される構成のすべてが本発明の必須構成要件であるとは限らない。 Hereinafter, embodiments of the present invention will be described in detail with reference to the drawings. The embodiments described below do not unduly limit the contents of the present invention described in the claims. Also, not all of the configurations described below are essential constituent requirements of the present invention.
1. 情報処理装置
図1に、本実施形態における情報処理装置の構成例のブロック図を示す。
1. Information Processing Device FIG. 1 is a block diagram showing a configuration example of an information processing device according to this embodiment.
情報処理装置100は、中央演算処理装置(Central Processing Unit:CPU)10と、アクセラレータ20と、プロファイラ(実行パス推定装置、実行パス検出装置)30とを含む。情報処理装置100は、バス50を含み、バス50を介して、CPU10、アクセラレータ20及びプロファイラ30との間でデータやアドレスのやり取りが行われる。また、情報処理装置100の外部には、メモリバス52を介してバス50と接続されるメモリ110が設けられており、CPU10、アクセラレータ20及びプロファイラ30はバス50及びメモリバス52を介してメモリ110にアクセスできるようになっている。
The
CPU10は、CPU10の内蔵メモリ又はメモリ110に格納されたアプリケーションプログラムを読み込んで、該プログラムに対応した命令を実行する。
The
アクセラレータ20は、CPU10に代わってCPU10が実行すべき処理を行う。アクセラレータ20の処理時間は、CPU10の処理時間より短い。アクセラレータ20の機能は、ハードウェア又はソフトウェアにより実現される。アクセラレータ20の機能がソフトウェアにより実現される場合には、アクセラレータ20がCPU及びメモリを有し、該メモリ又は図1のメモリ110に格納されたアクセラレータ用プログラムを読み込んで該プログラムに対応した処理を実行するCPUによりアクセラレータ20の機能が実現される。
The
このようなアクセラレータ20は、例えば、より処理時間が短くなるように、又はより低消費電力となるように、CPU10が処理すべきプログラムの命令列を最適化させた状態で該プログラムの処理結果を生成する。アクセラレータ20は、例えばCPU10が処理すべきプログラムのうち不要な命令列が削除された命令列を実行することで、該プログラムを実行した場合のCPU10の処理結果と同じ結果をより短時間で得られるようになっている。また、例えばアクセラレータ20は、CPU10が処理すべきプログラムの命令列を並列に処理することで、該プログラムを実行した場合のCPU10の処理結果と同じ結果をより短時間で得られるようになっている。
Such an
プロファイラ(広義には実行パス検出装置)30は、プログラムの実行中に実行頻度の高いループ構造のパス(実行パス、命令パス、ホットパス)を高精度で検出(推定)し、検出したパスを特定するための情報であるホットパス情報(広義にはパス情報)を出力する。プロファイラ30は、CPU10が実行するプログラムを構成する命令列のうち繰り返し実行される命令列を検出し、繰り返し実行される命令列の分岐履歴に基づいて実行頻度の高いパスを特定する処理を行う。
The profiler (execution path detection device in a broad sense) 30 detects (estimates) a path of a loop structure (execution path, instruction path, hot path) that is frequently executed during execution of a program with high accuracy and identifies the detected path Hot path information (pass information in a broad sense), which is information for performing the process, is output. The
更に情報処理装置100の外部には、ホットパス処理部120が設けられている。ホットパス処理部120は、プロファイラ30からのホットパス情報に基づいて実行頻度の高いループ構造のパスを特定し、このパスの処理を最適化することで情報処理装置100の処理時間を短縮させたり情報処理装置100の処理中の消費電力を低減させたりする。
Further, a hot
例えば、ホットパス処理部120は、プロファイラ30からのホットパス情報に基づいて特定した命令列のパスを並列処理させるように命令列を最適化したり、実行不要な命令を削除して命令列を最適化したりする。このとき、ホットパス処理部120は、最適化処理後の命令列をアクセラレータ20や該アクセラレータ20がアクセスするメモリに格納する。
For example, the hot
或いは、例えばホットパス処理部120は、プロファイラ30からのホットパス情報に基づいて特定した命令列のパスの処理時間が短くなるようにアクセラレータ20のハードウェア構成を変更したり、或いは該パスを処理する上で情報処理装置100の消費電力が低減するようにアクセラレータ20のハードウェア構成を変更したりする処理を行う。この場合、アクセラレータ20は動的再構成可能な回路であり、ホットパス処理部120が、動的再構成に必要なハードウェア構成情報をアクセラレータ20に供給する。
Alternatively, for example, the hot
次に、図1の情報処理装置100の処理の概要について説明する。
Next, an outline of processing of the
本実施形態では、基本ブロックと呼ばれる命令列ブロックを単位に、命令列の実行パスを考える。 In this embodiment, an instruction sequence execution path is considered in units of instruction sequence blocks called basic blocks.
図2に、本実施形態における基本ブロックの説明図を示す。 FIG. 2 is an explanatory diagram of basic blocks in the present embodiment.
アプリケーションプログラムを構成する命令列の実行パスを考えると、アプリケーションプログラムを構成する命令は、プログラムの実行の流れを変える分岐命令と、分岐命令以外の他の命令とに区別できる。そして、プログラムを構成する命令が、アドレス値の小さい命令からアドレス値の大きい命令の方向に順番に実行されるため、実行の流れを変える分岐命令毎に、命令列のブロックを区分できる。このブロックが、基本ブロックである。基本ブロックは、例えば直前の基本ブロックの最後の分岐命令の次の命令から始まり、アドレス値の大きい方向に命令が実行されたときの最初の分岐命令で終わる命令列のブロックである。 Considering the execution path of the instruction sequence constituting the application program, the instructions constituting the application program can be distinguished into a branch instruction that changes the flow of program execution and an instruction other than the branch instruction. Since the instructions constituting the program are executed in order from the instruction with the smallest address value to the instruction with the larger address value, the instruction sequence block can be divided for each branch instruction that changes the flow of execution. This block is a basic block. The basic block is, for example, a block of an instruction sequence that starts from the instruction next to the last branch instruction of the immediately preceding basic block and ends with the first branch instruction when the instruction is executed in the direction in which the address value is larger.
図2では、基本ブロックBB1、BB2、・・・、BBK(Kは3以上の正の整数)が示されている。基本ブロックBB1は、このブロックの先頭アドレスBSA1の命令“inst1”に始まり、命令の実行方向に順次命令が実行され、アドレスBIA1の分岐命令“bne”で終わる。ここで分岐命令“bne”が条件分岐命令であるとすると、条件が「真」のときの分岐先アドレスがBSA3、条件が「偽」のときの分岐先アドレスがアドレスBIA1の次のアドレスであるBSA2である。 In FIG. 2, basic blocks BB1, BB2,..., BBK (K is a positive integer of 3 or more) are shown. The basic block BB1 starts with the instruction “inst1” at the head address BSA1 of this block, sequentially executes instructions in the instruction execution direction, and ends with the branch instruction “bne” at the address BIA1. If the branch instruction “bne” is a conditional branch instruction, the branch destination address when the condition is “true” is BSA3, and the branch destination address when the condition is “false” is the address next to the address BIA1. BSA2.
基本ブロックBB2は、このブロックの先頭アドレスBSA2の命令“inst2”に始まり、命令の実行方向に順次命令が実行され、アドレスBIA2の分岐命令“br”で終わる。アドレスBSA2は、アドレスBIA1の分岐命令の分岐先アドレスであるため、アドレスBSA2は分岐ターゲットアドレスBTA1である。 The basic block BB2 starts with the instruction “inst2” at the head address BSA2 of this block, sequentially executes instructions in the instruction execution direction, and ends with the branch instruction “br” at the address BIA2. Since the address BSA2 is a branch destination address of the branch instruction of the address BIA1, the address BSA2 is the branch target address BTA1.
基本ブロックBB3は、このブロックの先頭アドレスBSA3の命令“inst3”に始まり、命令の実行方向に順次命令が実行され、同様にアドレスBIA3の分岐命令(図示せず)で終わる。アドレスBSA3は、アドレスBIA1の分岐命令の分岐先アドレスであるため、アドレスBSA3の分岐ターゲットアドレスBTA2である。 The basic block BB3 starts with the instruction “inst3” at the head address BSA3 of this block, sequentially executes instructions in the instruction execution direction, and similarly ends with a branch instruction (not shown) at the address BIA3. The address BSA3 is a branch target address BTA2 of the address BSA3 because it is the branch destination address of the branch instruction of the address BIA1.
従って、命令の実行パスを、基本ブロックBB1、BB2のパスとして表したり、基本ブロックBB1、BB3のパスとして表したりすることができる。 Therefore, the instruction execution path can be expressed as a path of the basic blocks BB1 and BB2, or can be expressed as a path of the basic blocks BB1 and BB3.
図3に、図1の情報処理装置100の処理の一例の概要のフローを示す。
FIG. 3 shows an outline flow of an example of processing of the
まず、情報処理装置100のプロファイラ30は、アプリケーションプログラムを実行するCPU10の実行履歴を収集し、アプリケーションプログラムを構成する命令列のうち高頻度で繰り返し実行される実行命令部分を検出する(ステップS10)。このとき、アプリケーションプログラムを構成する命令列が、それぞれ1つの分岐命令を含む基本ブロックに区分でき、基本ブロック間の流れでプログラムの実行パスを特定できる。その結果、図4に示すように、例えば基本ブロックFから基本ブロックAに戻るパスが高頻度で繰り返し実行される実行命令部分として検出される。なお、図4では、基本ブロックA〜Fが示されており、基本ブロックAから基本ブロックB〜Gのいずれかの方向にプログラムの実行が流れるものとする。
First, the
図3に示すように、次に、情報処理装置100は、ステップS10で検出した実行頻度の高い実行命令部分の分岐履歴の収集を開始する。そして、情報処理装置100は、収集した分岐履歴情報に基づいてパスを特定するホットパス情報を出力する(ステップS11)。
As illustrated in FIG. 3, the
ホットパス処理部120は、プロファイラ30からのホットパス情報を受けて、上述のようにホットパスの処理の最適化を行い(ステップS12)、一連の処理を終了する(エンド)。
The
図5に、図3のホットパスの説明図を示す。 FIG. 5 is an explanatory diagram of the hot path in FIG.
図5において、図4と同じ基本ブロックA〜Fが示されている。各基本ブロックは、当該基本ブロックの先頭アドレス(Basic block Start Address:BSA)の命令FIと、当該基本ブロックの最終アドレスである分岐命令アドレス(Branch Instruction Address:BIA)の分岐命令BIとを含む。各基本ブロック間を接続する矢印は、分岐命令により処理の流れが変えられたことを示し、この矢印に付される数値は該分岐命令による分岐回数を示す。 5, the same basic blocks A to F as in FIG. 4 are shown. Each basic block includes an instruction FI of a basic block start address (BSA) of the basic block and a branch instruction BI of a branch instruction address (BIA) which is a final address of the basic block. The arrows connecting the basic blocks indicate that the processing flow has been changed by the branch instruction, and the numerical value attached to the arrow indicates the number of branches by the branch instruction.
例えば基本ブロックAの分岐命令BIの分岐先が2つあり、該分岐命令BIが条件分岐命令であることを示す。基本ブロックAから基本ブロックBへの矢印は、例えば基本ブロックAの分岐命令BIの条件が「真」のときの分岐先アドレスが基本ブロックBの先頭アドレスBSAであることを示す。そして、基本ブロックAから基本ブロックBへの処理の流れの変更が、履歴として800回であったことを意味している。また、基本ブロックAから基本ブロックCへの矢印は、例えば基本ブロックAの分岐命令BIの条件が「偽」のときの分岐先アドレスが基本ブロックCの先頭アドレスBSAであることを示す。そして、基本ブロックAから基本ブロックCへの処理の流れの変更が、履歴として200回であったことを意味している。 For example, there are two branch destinations of the branch instruction BI of the basic block A, and the branch instruction BI is a conditional branch instruction. An arrow from the basic block A to the basic block B indicates that the branch destination address when the condition of the branch instruction BI of the basic block A is “true” is the start address BSA of the basic block B, for example. This means that the change in the flow of processing from the basic block A to the basic block B has been 800 times as a history. An arrow from the basic block A to the basic block C indicates that the branch destination address when the condition of the branch instruction BI of the basic block A is “false” is the start address BSA of the basic block C, for example. This means that the change in the flow of processing from the basic block A to the basic block C has been 200 times as a history.
これに対して、例えば基本ブロックDの分岐命令BIの分岐先は1つであり、該分岐命令BIが無条件分岐命令であることを示す。この無条件分岐は、履歴として700回であることを意味する。 On the other hand, for example, the branch instruction BI of the basic block D has one branch destination, indicating that the branch instruction BI is an unconditional branch instruction. This unconditional branch means that the history is 700 times.
以上のような履歴を履歴情報として収集するため、基本ブロックの開始アドレスBSA、分岐先アドレスBTA(Branch Target Address)(広義にはターゲットアドレス)、分岐命令のアドレスBIA、分岐回数がテーブルを用いて管理される。そして、各基本ブロック間の分岐回数が多いルートがホットパスとして特定される。図5では、基本ブロックA、B、D、Fのルートがホットパスとなり、ホットパス情報として、基本ブロックA、B、D、Fの各基本ブロックの先頭アドレス列を出力することでホットパスが特定される。 In order to collect the above history as history information, the start address BSA of the basic block, the branch destination address BTA (Branch Target Address) (target address in a broad sense), the address BIA of the branch instruction, and the number of branches using a table Managed. A route having a large number of branches between each basic block is identified as a hot path. In FIG. 5, the route of the basic blocks A, B, D, and F becomes a hot path, and the hot path is specified by outputting the start address string of each basic block of the basic blocks A, B, D, and F as hot path information. .
その結果、基本ブロックA、B、D、Fのパスの命令列の最適化により一層高い負荷をかける等して情報処理装置100の処理を重点的に最適化することができる。
As a result, the processing of the
このように、本実施形態においては、プログラムの局所性に着目して、高頻度で実行される命令列の繰り返し部分を検出してから、該繰り返し部分の分岐履歴を収集するようにしたので、アプリケーションプログラムのホットパスを検出する際に膨大な分岐履歴を収集する必要がなくなる。そのため、本実施形態によれば、パスの検出精度の低下を抑えつつ、少ないメモリ容量で、高速に実行頻度の高い命令列の実行パスを検出できるようになる。 Thus, in the present embodiment, focusing on the locality of the program, since the repeated portion of the instruction sequence executed at a high frequency is detected, the branch history of the repeated portion is collected. There is no need to collect a huge branch history when detecting a hot path of an application program. Therefore, according to the present embodiment, it is possible to detect an execution path of an instruction sequence having a high execution frequency at a high speed with a small memory capacity while suppressing a decrease in path detection accuracy.
2. プロファイラの説明
次に、このようなホットパスの検出を行う図1のプロファイラ30について説明する。
2. Description of Profiler Next, the
図6に、図1のプロファイラ30の構成の概要を示す。
FIG. 6 shows an outline of the configuration of the
プロファイラ30は、制御部200と、管理テーブル部300とを含む。制御部200は、実行履歴管理部210、分岐履歴管理部220を含む。管理テーブル部300は、実行履歴テーブル310、分岐履歴テーブル320を含む。
The
なお、制御部200の機能は、ソフトウェアで実現されてもよいし、専用のハードウェアにより実現されてもよい。制御部200がソフトウェアで実現される場合、後述する実行パスの検出方法を実現するプログラムを読み込んだプロファイラ30のCPUが処理を行う。また、管理テーブル部300は、後述するように実行履歴テーブル310と分岐履歴テーブル320の記憶領域を共用することが望ましい。
Note that the function of the
実行履歴管理部210は、実行履歴テーブル310を管理する制御を行う。
The execution
図7に、図6の実行履歴テーブル310の構成の概要を示す。 FIG. 7 shows an outline of the configuration of the execution history table 310 of FIG.
実行履歴テーブル310は、複数のエントリを有する。各エントリには、基本ブロックの先頭アドレスBSAに関連付けて(対応して)、該先頭アドレスBSAの命令の実行回数COUNTが記憶される。即ち、基本ブロックの先頭アドレスBSAの命令の実行回数がカウントされ、実行履歴テーブル310には、基本ブロックの先頭アドレスの命令毎に、実行回数が記憶される。 The execution history table 310 has a plurality of entries. Each entry stores the execution count COUNT of the instruction at the head address BSA in association with (corresponding to) the head address BSA of the basic block. That is, the number of executions of the instruction at the basic block start address BSA is counted, and the execution history table 310 stores the execution number for each instruction at the start address of the basic block.
ここで、先頭アドレスBSAは、分岐命令の戻り方向の分岐先アドレスである。そのため、実行履歴テーブル310には、基本ブロックの先頭アドレスBSAではなく、該先頭アドレスBSAを戻り方向の分岐先アドレスとして登録してもよい。このように戻り方向の分岐命令の実行履歴のみを収集することで、少ないメモリ容量で、高頻度で繰り返される実行部分を検出できるようになる。 Here, the head address BSA is a branch destination address in the return direction of the branch instruction. Therefore, in the execution history table 310, instead of the basic block start address BSA, the start address BSA may be registered as a branch destination address in the return direction. By collecting only the execution history of branch instructions in the return direction in this way, it becomes possible to detect an execution portion that is repeated frequently with a small memory capacity.
そこで、実行履歴管理部210は、分岐命令を含む命令列を1ブロックとする基本ブロック(命令列ブロック)の先頭アドレスBSA、該先頭アドレスBSAの命令の実行回数を実行履歴テーブル310に登録、追加、検索等をする管理制御を行う。
Therefore, the execution
図6において、分岐履歴管理部220は、実行履歴テーブル310で管理される基本ブロックの先頭アドレスのうちいずれかの先頭アドレスの命令の実行回数が所与の閾値TH1を超えたことを条件に、分岐命令の分岐履歴の収集を開始し、その後、分岐履歴を収集する処理を行う。
In FIG. 6, the branch
図8に、図6の分岐履歴テーブル320の構成の概要を示す。 FIG. 8 shows an outline of the configuration of the branch history table 320 of FIG.
分岐履歴テーブル320は、複数のエントリを有する。各エントリには、基本ブロックの先頭アドレスBSAに関連付けて、分岐命令のアドレスBIA、該分岐命令の分岐先アドレスBTA、該分岐命令の分岐回数COUNTが記憶される。ここで、先頭アドレスBSAは、分岐命令の戻り方向の分岐先アドレスであったり、分岐命令の順方向の分岐先アドレスであったりする。 The branch history table 320 has a plurality of entries. Each entry stores the address BIA of the branch instruction, the branch destination address BTA of the branch instruction, and the branch count COUNT of the branch instruction in association with the head address BSA of the basic block. Here, the head address BSA is a branch destination address in the return direction of the branch instruction or a branch destination address in the forward direction of the branch instruction.
そこで、分岐履歴管理部220は、基本ブロックの先頭アドレスBSA、分岐命令のアドレス、該分岐命令の分岐先アドレス、分岐回数を分岐履歴テーブル320に登録、追加、検索等をする管理制御を行う。また分岐履歴管理部220は、分岐履歴テーブル320に登録された分岐履歴に基づいてホットパス情報(実行頻度の高い実行パスを特定するためのパス情報)を出力する。
Therefore, the branch
なお、図8において、分岐履歴テーブル320に分岐命令のアドレスBIAを記憶させなくてもよい。しかしながら、分岐履歴テーブル320に分岐命令のアドレスBIAを記憶させることで、分岐先アドレスBTAの情報として分岐命令のアドレスBIAを基準としたオフセット情報を用いることができるので、分岐先アドレスBTAの記憶領域を削減できるようになる。 In FIG. 8, it is not necessary to store the branch instruction address BIA in the branch history table 320. However, by storing the branch instruction address BIA in the branch history table 320, offset information based on the branch instruction address BIA can be used as the branch destination address BTA information. Can be reduced.
ところで、本実施形態では、まず実行履歴テーブル310を用いて高頻度で実行される命令列の繰り返し部分を検出してから、分岐履歴テーブル320に該繰り返し部分の分岐履歴を収集するようにしている。そのため、分岐履歴を収集する段階では、実行履歴テーブル310を不要にできる。そこで、本実施形態では、実行履歴テーブル310と分岐履歴テーブル320の記憶領域を共用し、管理テーブル部300に設けられる記憶容量の削減を図ることができる。 By the way, in the present embodiment, first, a repeated portion of an instruction sequence executed frequently is detected using the execution history table 310, and then the branch history of the repeated portion is collected in the branch history table 320. . Therefore, the execution history table 310 can be eliminated at the stage of collecting branch history. Therefore, in the present embodiment, the storage areas of the execution history table 310 and the branch history table 320 are shared, and the storage capacity provided in the management table unit 300 can be reduced.
図9(A)、図9(B)に、本実施形態における管理テーブル部300の説明図を示す。 FIG. 9A and FIG. 9B are explanatory diagrams of the management table unit 300 in this embodiment.
図9(A)は、管理テーブル部300が有する共用テーブルの構成の概要を示す。共用テーブルは、複数のエントリを有する。各エントリには、基本ブロックの先頭アドレスBSAに関連付けて、分岐命令のアドレスBIA、該分岐命令の分岐先アドレスBTA、該分岐命令の分岐回数COUNTが記憶される。即ち、共用テーブルは、図8に示す分岐履歴テーブル320と同様の構成を有する。 FIG. 9A shows an outline of the configuration of the shared table included in the management table unit 300. The shared table has a plurality of entries. Each entry stores the address BIA of the branch instruction, the branch destination address BTA of the branch instruction, and the branch count COUNT of the branch instruction in association with the head address BSA of the basic block. That is, the shared table has the same configuration as the branch history table 320 shown in FIG.
本実施形態では、図9(A)に示す共用テーブルを用いて、図7に示す実行履歴テーブル310の機能を実現する。 In the present embodiment, the function of the execution history table 310 shown in FIG. 7 is realized using the shared table shown in FIG.
即ち、図9(B)に示すように、図9(A)の管理テーブルのうち分岐命令のアドレスBIAと分岐先アドレスBTAの欄がディセーブルにされる(図9(B)の斜線部分)。その結果、共用履歴テーブルが実行履歴テーブル310として機能する場合には、基本ブロックBSAと回数COUNTの欄のみがイネーブルとなる。これにより、図9(A)に示す共用テーブルで、実行履歴テーブル310及び分岐履歴テーブル320の両方の機能を実現できる。 That is, as shown in FIG. 9B, the branch instruction address BIA and branch destination address BTA fields in the management table of FIG. 9A are disabled (shaded area in FIG. 9B). . As a result, when the shared history table functions as the execution history table 310, only the basic block BSA and the count COUNT fields are enabled. Thereby, the functions of both the execution history table 310 and the branch history table 320 can be realized with the shared table shown in FIG.
このため、本実施形態では、実行履歴テーブル310の記憶領域の少なくとも一部が、分岐履歴テーブル320の記憶領域と重複しているということができる。また、分岐履歴テーブル320に登録すべき情報の少なくとも一部を、実行履歴テーブル310の記憶領域に書き込むことができる。 For this reason, in this embodiment, it can be said that at least a part of the storage area of the execution history table 310 overlaps with the storage area of the branch history table 320. Further, at least a part of information to be registered in the branch history table 320 can be written in the storage area of the execution history table 310.
以下では、管理テーブル部300が、図9(A)に示す共用テーブルの構成を有しているものとする。 In the following, it is assumed that the management table unit 300 has the configuration of the shared table shown in FIG.
2.1 プロファイラの処理例
図10に、本実施形態におけるプロファイラ30の処理の概要のフローを示す。
2.1 Profiler Processing Example FIG. 10 shows an outline flow of processing of the
まず、プロファイラ30の分岐履歴管理部220は、共用テーブルを図9(B)に示すように実行履歴テーブルとして用いるための初期化処理を行う(ステップS20)。
First, the branch
次に実行履歴管理部210は、実行履歴テーブルとして機能する共用テーブルを用いて実行履歴を収集する(ステップS21)。そして、実行履歴テーブルとして機能する共用テーブルに格納される基本ブロックの先頭アドレスの命令の実行回数が所与の閾値TH1を超えたか否かを判断することで、高頻度の繰り返しがあるか否かを判別する(ステップS22)。
Next, the execution
ステップS22において、高頻度の繰り返しがないと判別したとき(ステップS22:N)、実行履歴管理部210は、ステップS21に戻って実行履歴の収集を継続する。
When it is determined in step S22 that there is no high frequency repetition (step S22: N), the execution
ステップS22において、高頻度の繰り返しがあると判別したとき(ステップS22:Y)、実行履歴管理部210は、その旨を分岐履歴管理部220に通知する。実行履歴管理部210又は分岐履歴管理部220は、共用テーブルを図9(A)に示すように分岐履歴テーブルとして用いるための初期化処理を行う(ステップS23)。
When it is determined in step S22 that there is a high-frequency repetition (step S22: Y), the execution
その後、分岐履歴管理部220は、閾値TH1を超えた実行回数に関連付けて記憶される先頭アドレスを用いて、分岐履歴の収集を開始する。そして分岐履歴管理部220は、分岐履歴テーブルとして機能する共用テーブルを用いて分岐履歴の収集を行うと共に、分岐命令が入力される毎に分岐履歴情報に基づいて分岐回数の多い分岐先アドレスをパス情報として出力する(ステップS24)。分岐履歴管理部220は、公知の分岐履歴収集手法を用いて分岐命令、分岐先アドレスを登録、追加、リプレース等を行うが、更に分岐回数についても登録する。
Thereafter, the branch
次に、分岐履歴管理部220は、分岐命令が入力される毎に、分岐履歴テーブルがミスヒットし、且つ該分岐命令の分岐先アドレスが、実行履歴テーブルに一度記録された基本ブロックの先頭アドレスと一致するか否かを検出することで、繰り返し処理の有無を判別する(ステップS25)。繰り返し処理がないと判別されたとき(分岐命令の分岐先が実行履歴テーブルに記録された先頭アドレスとならないとき)(ステップS25:Y)、分岐履歴管理部220は、分岐履歴テーブルの分岐履歴を廃棄(無効化、初期化)し(ステップS26)、ステップS20に戻る(リターン)。
Next, every time a branch instruction is input, the branch
分岐履歴管理部220は、分岐命令の実行回数を保持している。そしてステップS25において、繰り返し処理があると判別されたとき(ステップS25:N)、分岐履歴管理部220は、所与のサンプリング期間内に分岐命令の実行回数が所与の閾値THX以上であるか否かを判別する(ステップS27)。サンプリング期間内に分岐命令の実行回数が閾値THX以上であると判別されたとき(ステップS27:Y)、分岐履歴管理部220は、ステップS24に戻り、分岐履歴の収集とホットパス情報の出力を継続する。一方、サンプリング期間内に分岐命令の実行回数が閾値THX以上ではないと判別されたとき(ステップS27:N)、分岐履歴管理部220は、分岐履歴テーブルの分岐履歴を廃棄(無効化)し(ステップS26)、ステップS20に戻る(リターン)。このように、ステップS27において閾値THX以上繰り返していないか否かを検出することで、ステップS22で検出された高頻度の繰り返し部分について必ずしもホットパスを検出する必要がなくなり、プロファイラ30が検出するホットパス情報の精度を高めることができる。
The branch
以上のように、分岐命令の分岐先が実行履歴テーブルに記録された先頭アドレスとならないとき、又は予め決められた分岐命令の実行回数が所与のサンプリング時間内に達しなかったとき、分岐履歴管理部220が分岐履歴を廃棄できる。
As described above, when the branch destination of the branch instruction does not become the start address recorded in the execution history table, or when the predetermined number of executions of the branch instruction does not reach the given sampling time, the branch history management The
以上のような処理を、コンピュータを機能させるためのプログラムで実現してもよい。この場合、図1のメモリ110又はプロファイラ30の図示しないメモリに上記の処理を実現するためのプログラムを格納しておき、プロファイラ30の図示しないCPUがメモリ110又はプロファイラ30の図示しないメモリのプログラムを読み出すことで、上記の処理を実現できる。また、図1において、例えばメモリ110又はプロファイラ30の図示しないメモリに代えてコンピュータ読み取り可能な記録媒体で上記のプログラムを提供してもよい。この記録媒体は、コンピュータにより使用可能な記憶媒体であって、プログラムやデータなどの情報を格納するものであり、その機能は、光ディスク(CD、DVD)、光磁気ディスク(MO)、磁気ディスク、ハードディスク、磁気テープ、或いはメモリ(ROM)などのハードウェアにより実現できる。プロファイラ30の図示しないCPUは、この記憶媒体に格納される情報に基づいて本発明(本実施形態)の種々の処理を行う。即ちこの記憶媒体には、本発明(本実施形態)の手段を実行(実現)するための情報(プログラム或いはデータ)が格納される。
The above processing may be realized by a program for causing a computer to function. In this case, a program for realizing the above processing is stored in the
図11に、実行履歴管理部210の処理例のフロー図を示す。
FIG. 11 shows a flowchart of a processing example of the execution
まず、実行履歴管理部210は、例えばCPU10による分岐命令の実行を監視し、基本ブロックの先頭アドレスBSAとして該分岐命令の分岐先アドレスの入力を待つ(ステップS40:N)。基本ブロックの先頭アドレスBSAが入力されたとき(ステップS40:Y)、実行履歴管理部210は、該先頭アドレスBSAをインデックスとして、実行履歴テーブルとして機能する共用テーブルを検索する(ステップS41)。
First, the execution
そして、ステップS41において共用テーブルを検索した結果、既に登録された先頭アドレスBSAがあるとき(ステップS42:Y)、実行履歴管理部210は、ステップS41で検索した先頭アドレスBSAに関連付けて記録された実行回数をインクリメントして更新する(ステップS43)。このとき、実行履歴管理部210は、ステップS43で更新した実行回数が所与の閾値TH1を超えたか否かを検出する(ステップS44)。実行回数が閾値TH1を超えたことが検出されたとき(ステップS44:Y)、実行履歴管理部210は、高頻度の繰り返し実行部分が存在したと判断し、当該先頭アドレスBSAを用いた分岐履歴の収集を開始するように分岐履歴収集イネーブルを設定し(ステップS45)、一連の処理を終了する(エンド)。
Then, as a result of searching the shared table in step S41, when there is an already registered head address BSA (step S42: Y), the execution
一方、ステップS41において共用テーブルを検索した結果、既に登録された先頭アドレスBSAがないとき(ステップS42:N)、実行履歴管理部210は、入力された先頭アドレスBSAを実行履歴テーブルとして機能する共用テーブルに登録する処理を行い(ステップS46)、ステップS40に戻る。なお、実際には、先頭アドレスBSAと分岐先アドレスBTAとを比較し、分岐先アドレスが戻り方向であるときに、分岐先アドレスBTAを新たに追加する先頭アドレスBSAとして登録する。このとき、実行履歴テーブルとして機能する共用テーブルでは、必要に応じて記憶情報のリプレースが行われる。
On the other hand, as a result of searching the shared table in step S41, when there is no registered start address BSA (step S42: N), the execution
ステップS44において、実行回数が閾値TH1を超えていないことが検出されたとき(ステップS44:N)、実行履歴管理部210は、ステップS40に戻って次の基本ブロックの先頭アドレスBSAを待つ。
When it is detected in step S44 that the number of executions does not exceed the threshold TH1 (step S44: N), the execution
以上のように、実行履歴管理部210は、実行履歴の収集を行うと共に、収集した実行履歴に基づいて、高頻度で繰り返される実行部分を検出し、分岐履歴の収集開始を指示できるようになっている。
As described above, the execution
図12に、分岐履歴管理部220の処理例のフロー図を示す。
FIG. 12 shows a flowchart of a processing example of the branch
まず、分岐履歴管理部220は、分岐履歴収集イネーブルが設定されているか否かを監視する(ステップS60:N)。分岐履歴収集イネーブルが設定されていることが検出されたとき(ステップS60:Y)、分岐履歴管理部220は、図11のステップS44で閾値TH1を超えたエントリの先頭アドレスBSAの入力を待つ(ステップS61:N)。この先頭アドレスBSAは、分岐命令の分岐先アドレスである。基本ブロックの先頭アドレスBSAが入力されたとき(ステップS61:Y)、分岐履歴管理部220は、該先頭アドレスBSAをインデックスとして、分岐履歴テーブルとして機能する共用テーブルを検索する(ステップS62)。
First, the branch
そして、ステップS62において共用テーブルを検索した結果、既に登録された先頭アドレスBSAがあるとき(ステップS63:Y)、分岐履歴管理部220は、複数の先頭アドレスBSAが登録されているとき(ステップS64:Y)、分岐回数が最も多い分岐先アドレスをホットパス情報として出力する(ステップS65)と共に、当該分岐先アドレスに関連付けて記憶された分岐回数をインクリメントして更新し(ステップS65)、ステップS60に戻る(リターン)。
As a result of searching the shared table in step S62, when there is already registered head address BSA (step S63: Y), the branch
ステップS64において、1つの先頭アドレスBSAのみが登録されているとき(ステップS64:N)、分岐履歴管理部220は、ヒットした分岐先アドレスをホットパス情報として出力すると共に、当該分岐先アドレスに関連付けて記憶された分岐回数をインクリメントして更新し(ステップS66)、ステップS60に戻る(リターン)。
In step S64, when only one head address BSA is registered (step S64: N), the branch
一方、ステップS62において共用テーブルを検索した結果、既に登録された先頭アドレスBSAがないとき(ステップS63:N)、分岐履歴管理部220は、入力された先頭アドレスBSAを分岐履歴テーブルとして機能する共用テーブルに登録する処理を行い(ステップS67)、ステップS60に戻る。このとき、分岐履歴テーブルとして機能する共用テーブルでは、必要に応じて記憶情報のリプレースが行われる。
On the other hand, as a result of searching the shared table in step S62, when there is no registered head address BSA (step S63: N), the branch
以上のように、分岐履歴管理部220は、分岐履歴の収集を行うと共に、収集した分岐履歴に基づいてホットパスを出力できるようになっている。このホットパスは、分岐履歴テーブルを検索して得られた分岐先アドレスを蓄積したホットパス情報として出力される。
As described above, the branch
2.2 プロファイラの構成例
次に、本実施形態における実行履歴テーブル310、分岐履歴テーブル320、実行履歴管理部210、分岐履歴管理部220の要部の構成例について説明する。
2.2 Configuration Example of Profiler Next, configuration examples of main parts of the execution history table 310, the branch history table 320, the execution
本実施形態では、実行履歴テーブル310及び分岐履歴テーブル320が、それぞれ2ウェイ−セットアソシアティブ方式で記憶情報を記憶するものとして説明するが、本発明が、ウェイ数や実行履歴テーブル310及び分岐履歴テーブル320の構成に限定されるものではない。例えば、実行履歴テーブル310及び分岐履歴テーブル320は、フルアソシアティブ方式で記憶情報を記憶してもよい。しかしながら、条件分岐命令の分岐先は2箇所であるため、2ウェイ構成とすることで、条件分岐命令の条件が「真」のときの分岐先アドレスと該条件が「偽」の分岐先アドレスとを記憶でき、分岐先アドレスの記憶管理を効率化できる上に無駄な記憶領域を設ける必要がなくなる。 In the present embodiment, the execution history table 310 and the branch history table 320 will be described as storing the stored information by the 2-way-set associative method. However, the present invention is not limited to the number of ways, the execution history table 310, and the branch history table. The configuration is not limited to 320. For example, the execution history table 310 and the branch history table 320 may store stored information using a full associative method. However, since the branch destination of the conditional branch instruction is two locations, the two-way configuration enables the branch destination address when the condition of the conditional branch instruction is “true” and the branch destination address when the condition is “false”. Can be stored efficiently, and it is not necessary to provide a useless storage area.
図13、図14(A)、図14(B)、図15(A)、図15(B)に、本実施形態における実行履歴テーブル310と実行履歴管理部210の要部の構成例を示す。
FIG. 13, FIG. 14 (A), FIG. 14 (B), FIG. 15 (A), and FIG. 15 (B) show configuration examples of main parts of the execution history table 310 and the execution
実行履歴テーブル310は、2ウェイ−セットアソシアティブ方式で、基本ブロックの先頭アドレスBSA及び該先頭アドレスBSAの命令の実行回数COUNTを記憶する。両方のウェイは同様の構成を有し、各ウェイの記憶情報は公知のLRU(Least Recently Used)方式でリプレース制御されるようになっている。 The execution history table 310 stores the start address BSA of the basic block and the execution count COUNT of the instruction at the start address BSA in a 2-way set associative method. Both ways have the same configuration, and storage information of each way is subjected to replacement control by a known LRU (Least Recently Used) method.
先頭アドレスBSAの例えば下位ビットがデコーダDEC1、DEC2に入力される。各デコーダは、各ウェイのテーブルの1エントリを先頭アドレスBSAの下位ビットに基づいて選択する。各ウェイにおいて選択されたエントリの先頭アドレス及び実行回数COUNTは読み出される。こうして読み出された先頭アドレスは、先頭アドレスレジスタBSA1、BSA2、実行回数は、実行回数レジスタCNT1、CNT2で保持される。 For example, the lower bits of the head address BSA are input to the decoders DEC1 and DEC2. Each decoder selects one entry in each way table based on the lower bits of the head address BSA. The head address of the entry selected in each way and the execution count COUNT are read out. The head address read in this way is held in the head address registers BSA1 and BSA2, and the execution count is held in the execution count registers CNT1 and CNT2.
コンパレータCMP1は、先頭アドレスBSAと先頭アドレスレジスタBSA1の値と比較し、一致したときにヒット信号hita1をアクティブ(例えば「1」)にする。コンパレータCMP2は、先頭アドレスBSAと先頭アドレスレジスタBSA2の値と比較し、一致したときにヒット信号hita2をアクティブ(例えば「1」)にする。 The comparator CMP1 compares the head address BSA with the value of the head address register BSA1, and activates the hit signal hita1 (for example, “1”) when they match. The comparator CMP2 compares the head address BSA with the value of the head address register BSA2, and activates the hit signal hita2 (for example, “1”) when they match.
実行回数レジスタCNT1の値は、インクリメンタINC1(広義にはカウンタ)でインクリメントされる。実行回数レジスタCNT2の値は、インクリメンタINC2(広義にはカウンタ)でインクリメントされる。 The value of the execution count register CNT1 is incremented by an incrementer INC1 (counter in a broad sense). The value of the execution count register CNT2 is incremented by an incrementer INC2 (counter in a broad sense).
セレクタSEL1は、選択制御信号sel1に基づいて、実行回数レジスタCNT1の値又はインクリメンタINC1の出力を選択して、選択出力CNTs1を出力する。そして、選択出力CNTs1により、デコーダDEC1で選択されたエントリの実行回数COUNTを更新する。セレクタSEL2は、選択制御信号sel2に基づいて、実行回数レジスタCNT2の値又はインクリメンタINC2の出力を選択して、選択出力CNTs2を出力する。そして、選択出力CNTs2により、デコーダDEC2で選択されたエントリの実行回数COUNTを更新する。 The selector SEL1 selects the value of the execution count register CNT1 or the output of the incrementer INC1 based on the selection control signal sel1, and outputs a selection output CNTs1. Then, the execution count COUNT of the entry selected by the decoder DEC1 is updated by the selection output CNTs1. The selector SEL2 selects the value of the execution count register CNT2 or the output of the incrementer INC2 based on the selection control signal sel2, and outputs the selection output CNTs2. Then, the execution count COUNT of the entry selected by the decoder DEC2 is updated by the selection output CNTs2.
図14(A)に示すように、実行履歴管理部210又は実行履歴テーブル310は、ヒット判定部212を含む。ヒット判定部212は、ヒット信号hita1、hita2が入力され、選択制御信号sel1、sel2、ライトイネーブルwe1、we2を出力する。
As illustrated in FIG. 14A, the execution
図14(B)に、図14(A)のヒット判定部212の動作説明図を示す。
FIG. 14B shows an operation explanatory diagram of the hit
ヒット判定部212は、ヒット信号hita1がアクティブのとき、選択制御信号sel1をアクティブにしてインクリメンタINC1の出力で実行履歴テーブル310を更新するように制御する。またヒット判定部212は、ヒット信号hita2がアクティブのとき、選択制御信号sel2をアクティブにしてインクリメンタINC2の出力で実行履歴テーブル310を更新するように制御する。
When the hit signal hita1 is active, the
更に、ヒット判定部212は、ヒット信号hita1、hita2が非アクティブのとき、セレクタSEL1、SEL2でいずれも出力されないように制御すると共に、LRU制御ビットLRU1、LRU2を用いてLRU制御を行い、先頭アドレスBSAを基準に分岐先アドレスBTAが戻り方向であるときにライトイネーブルwe1、we2の一方をアクティブにする。ライトイネーブルwe1がアクティブのとき、先頭アドレスBSAがデコーダDEC1で選択されたエントリに書き込まれると共に、実行回数COUNTとして「1」が書き込まれる。ライトイネーブルwe2がアクティブのとき、先頭アドレスBSAがデコーダDEC2で選択されたエントリに書き込まれると共に、実行回数COUNTとして「1」が書き込まれる。
Further, when the hit signals hita1 and hita2 are inactive, the
図15(A)に示すように、実行履歴管理部210又は実行履歴テーブル310は、分岐履歴収集開始制御部214、閾値TH1が設定される閾値設定レジスタ216を含む。分岐履歴収集開始制御部214には、ヒット信号hita1、hita2、選択出力CNTs1、CNTs2、閾値TH1が入力され、分岐履歴収集イネーブルを出力する。
As shown in FIG. 15A, the execution
図15(B)に、図15(A)の分岐履歴収集開始制御部214の動作説明図を示す。
FIG. 15B shows an operation explanatory diagram of the branch history collection
分岐履歴収集開始制御部214は、ヒット信号hita1がアクティブのとき、選択出力CNTs1と閾値TH1とを比較し、選択出力CNTs1が閾値TH以上のとき分岐履歴イネーブルをアクティブ(例えば「1」)に設定する。また分岐履歴収集開始制御部214は、ヒット信号hita2がアクティブのとき、選択出力CNTs2と閾値TH1とを比較し、選択出力CNTs2が閾値TH以上のとき分岐履歴イネーブルをアクティブ(例えば「1」)に設定する。更に分岐履歴収集開始制御部214は、ヒット信号hita1、hita2が共に非アクティブのとき、分岐履歴収集イネーブルを非アクティブに設定する。
The branch history collection
図16、図17(A)、図17(B)に、本実施形態における分岐履歴テーブル320と分岐履歴管理部220の要部の構成例を示す。
FIGS. 16, 17A, and 17B show configuration examples of main parts of the branch history table 320 and the branch
分岐履歴テーブル320は、2ウェイ−セットアソシアティブ方式で、基本ブロックの先頭アドレスBSA、当該基本ブロックの分岐命令の分岐先アドレスBTA、該分岐先アドレスへの分岐回数COUNTを記憶する。なお、図16では、分岐履歴テーブル320に分岐命令のアドレスBIAが記録されないものとする。両方のウェイは同様の構成を有し、各ウェイの記憶情報は公知のLRU方式でリプレース制御されるようになっている。 The branch history table 320 stores the start address BSA of the basic block, the branch destination address BTA of the branch instruction of the basic block, and the branch count COUNT to the branch destination address in a two-way set associative method. In FIG. 16, it is assumed that the branch instruction address BIA is not recorded in the branch history table 320. Both ways have the same configuration, and the storage information of each way is controlled to be replaced by a known LRU method.
先頭アドレスBSAの例えば下位ビットがデコーダDEC3、DEC4に入力される。各デコーダは、各ウェイのテーブルの1エントリを先頭アドレスBSAの下位ビットに基づいて選択する。各ウェイにおいて選択されたエントリの先頭アドレスBSA、分岐先アドレスBTA及び分岐回数COUNTが読み出される。こうして読み出された先頭アドレスは、先頭アドレスレジスタBSA3、BSA4、分岐先アドレスは、分岐先アドレスレジスタBTA3、BTA4、分岐回数は、分岐回数レジスタCNT3、CNT4で保持される。 For example, the lower bits of the head address BSA are input to the decoders DEC3 and DEC4. Each decoder selects one entry in each way table based on the lower bits of the head address BSA. The head address BSA, branch destination address BTA, and branch count COUNT of the entry selected in each way are read. The read start address is held in the start address registers BSA3 and BSA4, the branch destination address is held in the branch destination address registers BTA3 and BTA4, and the branch count is held in the branch count registers CNT3 and CNT4.
コンパレータCMP3は、先頭アドレスBSAと先頭アドレスレジスタBSA3の値と比較し、一致したときにヒット信号hitb1をアクティブ(例えば「1」)にする。コンパレータCMP4は、先頭アドレスBSAと先頭アドレスレジスタBSA4の値と比較し、一致したときにヒット信号hitb2をアクティブ(例えば「1」)にする。 The comparator CMP3 compares the head address BSA with the value of the head address register BSA3, and activates the hit signal hitb1 (for example, “1”) when they match. The comparator CMP4 compares the head address BSA with the value of the head address register BSA4, and activates the hit signal hitb2 (for example, “1”) when they match.
分岐回数レジスタCNT3の値は、インクリメンタINC3(広義にはカウンタ)でインクリメントされる。分岐回数レジスタCNT4の値は、インクリメンタINC4(広義にはカウンタ)でインクリメントされる。 The value of the branch count register CNT3 is incremented by an incrementer INC3 (counter in a broad sense). The value of the branch count register CNT4 is incremented by an incrementer INC4 (counter in a broad sense).
セレクタSEL3は、選択制御信号sel3に基づいて、分岐先アドレスレジスタBTA3又は分岐先アドレスレジスタBTA4の値を選択出力して、ホットパス情報として追加されると共に、次の基本ブロックの先頭アドレスとして分岐履歴テーブル320に入力される。 The selector SEL3 selects and outputs the value of the branch destination address register BTA3 or the branch destination address register BTA4 based on the selection control signal sel3, is added as hot path information, and is also used as the head address of the next basic block. 320 is input.
セレクタSEL4は、選択制御信号sel4に基づいて、分岐回数レジスタCNT3の値又はインクリメンタINC3の出力を選択して、選択出力CNTs3を出力する。そして、選択出力CNTs3により、デコーダDEC3で選択されたエントリの分岐回数COUNTを更新する。セレクタSEL5は、選択制御信号sel5に基づいて、分岐回数レジスタCNT4の値又はインクリメンタINC4の出力を選択して、選択出力CNTs4を出力する。そして、選択出力CNTs4により、デコーダDEC4で選択されたエントリの分岐回数COUNTを更新する。 The selector SEL4 selects the value of the branch count register CNT3 or the output of the incrementer INC3 based on the selection control signal sel4, and outputs the selection output CNTs3. Then, the branch count COUNT of the entry selected by the decoder DEC3 is updated by the selection output CNTs3. The selector SEL5 selects the value of the branch count register CNT4 or the output of the incrementer INC4 based on the selection control signal sel5, and outputs the selection output CNTs4. Then, the branch count COUNT of the entry selected by the decoder DEC4 is updated by the selection output CNTs4.
図17(A)に示すように、分岐履歴管理部220又は分岐履歴テーブル320は、ヒット判定部222を含む。ヒット判定部222には、ヒット信号hitb1、hitb2、選択出力CNTs3、CNTs4が入力され、選択制御信号sel3、sel4、sel5、ライトイネーブルwe3、we4を出力する。
As illustrated in FIG. 17A, the branch
図17(B)に、図17(A)のヒット判定部222の動作説明図を示す。
FIG. 17B illustrates an operation explanatory diagram of the hit
ヒット判定部222は、ヒット信号hitb1がアクティブのとき、選択制御信号sel4をアクティブにしてインクリメンタINC3の出力で分岐履歴テーブル320を更新するように制御する。またヒット判定部222は、ヒット信号hitb2がアクティブのとき、選択制御信号sel5をアクティブにしてインクリメンタINC4の出力で分岐履歴テーブル320を更新するように制御する。
When the hit signal hitb1 is active, the
更に、ヒット判定部222は、ヒット信号hitb1、hitb2がアクティブのとき、分岐回数の大きい方のウェイを選択する。そのため、ヒット判定部222は、選択出力CNTs3が選択出力CNTs4以上のとき、選択制御信号sel4をアクティブに設定すると共に、選択制御信号sel5を非アクティブに設定する。またヒット判定部222は、選択出力CNTs3が選択出力CNTs4より小さいとき、選択制御信号sel4を非アクティブに設定すると共に、選択制御信号sel5をアクティブに設定する。更に、ヒット判定部222は、選択制御信号sel4と同様の制御で選択制御信号sel3を出力する。
Furthermore, the
更にまた、ヒット判定部222は、ヒット信号hitb1、hitb2が非アクティブのとき、セレクタSEL3、SEL4でいずれも出力されないように制御すると共に、LRU制御ビットLRU3、LRU4を用いてLRU制御を行い、今回入力された先頭アドレスBSAを書き込むためのライトイネーブルwe3、we4の一方をアクティブにする。ライトイネーブルwe3がアクティブのとき、先頭アドレスBSAがデコーダDEC3で選択されたエントリに書き込まれると共に、分岐回数COUNTとして「1」が書き込まれる。ライトイネーブルwe4がアクティブのとき、先頭アドレスBSAがデコーダDEC4で選択されたエントリに書き込まれると共に、分岐回数COUNTとして「1」が書き込まれる。
Furthermore, when the hit signals hitb1 and hitb2 are inactive, the
以上のように、分岐履歴テーブル320が、記憶情報をセットアソシアティブ方式で記憶し、各ウェイ(セット)には、基本ブロックの先頭アドレス、当該基本ブロックに含まれる分岐命令の分岐先アドレス(ターゲットアドレス)、及び分岐回数が記憶される。そして、該分岐命令に対応して記憶された分岐命令のうち分岐回数が最も多いウェイ(セット)の分岐命令の分岐先アドレスを出力できる。 As described above, the branch history table 320 stores the storage information by the set associative method. In each way (set), the start address of the basic block and the branch destination address (target address) of the branch instruction included in the basic block are stored. ), And the number of branches is stored. Then, the branch destination address of the branch instruction of the way (set) having the largest number of branches among the branch instructions stored corresponding to the branch instruction can be output.
3. その他
本発明は上記の実施形態に限定されるものではない。
3. Others The present invention is not limited to the above embodiment.
図18に、図1の情報処理装置の変形例のブロック図を示す。 FIG. 18 shows a block diagram of a modification of the information processing apparatus of FIG.
図18において図1と同一部分には同一符号を付し、適宜説明を省略する。本変形例における情報処理装置500は、ホットパス処理部120が情報処理装置500内に設けられる。そして、ホットパス処理部120が、プロファイラ30からのホットパス情報に基づいて最適化処理を行い、最適化処理結果をアクセラレータ20に出力する。ここで、最適化処理結果は、ホットパス中の命令列のうち不要なコードが削除された命令列、ホットパス中の命令列を並列動作させるために変更した命令列、又はアクセラレータ20のハードウェア構成を変更するためのハードウェア構成情報等である。
18, the same parts as those in FIG. 1 are denoted by the same reference numerals, and description thereof will be omitted as appropriate. In the
なお、本発明は上述した実施の形態に限定されるものではなく、本発明の要旨の範囲内で種々の変形実施が可能である。 The present invention is not limited to the above-described embodiment, and various modifications can be made within the scope of the gist of the present invention.
また、本発明のうち従属請求項に係る発明においては、従属先の請求項の構成要件の一部を省略する構成とすることもできる。また、本発明の1の独立請求項に係る発明の要部を、他の独立請求項に従属させることもできる。 In the invention according to the dependent claims of the present invention, a part of the constituent features of the dependent claims can be omitted. Moreover, the principal part of the invention according to one independent claim of the present invention can be made dependent on another independent claim.
10 CPU
20 アクセラレータ
30 プロファイラ
50 バス
100、500 情報処理装置
110 メモリ
120 ホットパス処理部
200 制御部
210 実行履歴管理部
212、222 ヒット判定部
214 実行履歴収集開始制御部
216 閾値設定レジスタ
220 分岐履歴管理部
300 管理テーブル部
310 実行履歴テーブル
320 分岐履歴テーブル
10 CPU
20
Claims (19)
分岐命令を含む命令列を1ブロックとする命令列ブロックの先頭アドレスの命令の実行回数が格納される実行履歴テーブルと、
前記分岐命令の分岐履歴が格納される分岐履歴テーブルと、
前記分岐命令の分岐履歴を収集する処理を行う分岐履歴管理部とを含み、
前記実行回数が所与の閾値を超えたことを条件に、前記分岐履歴管理部が、前記分岐履歴の収集を開始すると共に、前記実行パスを特定するためのパス情報を、前記分岐履歴に基づいて出力することを特徴とする実行パス検出装置。 An execution path detection device for detecting an execution path of an instruction sequence having a high execution frequency,
An execution history table in which the number of executions of the instruction at the head address of the instruction sequence block in which an instruction sequence including a branch instruction is one block is stored;
A branch history table storing a branch history of the branch instruction;
A branch history management unit that performs a process of collecting a branch history of the branch instruction,
On the condition that the number of executions exceeds a given threshold, the branch history management unit starts collecting the branch history, and path information for identifying the execution path is based on the branch history. An execution path detection device characterized by:
前記命令列ブロックの先頭アドレスの命令の実行回数をカウントするカウンタを含み、
前記実行履歴テーブルは、
前記先頭アドレスの命令毎に、実行回数を記憶することを特徴とする実行パス検出装置。 In claim 1,
A counter that counts the number of times the instruction at the head address of the instruction sequence block is executed;
The execution history table is
An execution path detection apparatus for storing the number of executions for each instruction at the head address.
前記実行履歴テーブルの記憶領域の少なくとも一部が、前記分岐履歴テーブルの記憶領域と重複していることを特徴とする実行パス検出装置。 In claim 1 or 2,
An execution path detection apparatus characterized in that at least a part of a storage area of the execution history table overlaps with a storage area of the branch history table.
前記分岐履歴テーブルに登録すべき情報の少なくとも一部が、前記実行履歴テーブルの記憶領域に書き込まれることを特徴とする実行パス検出装置。 In claim 1 or 2,
An execution path detection apparatus, wherein at least part of information to be registered in the branch history table is written in a storage area of the execution history table.
前記実行履歴テーブルに、
分岐命令の戻り方向の分岐先アドレスの命令の実行回数が格納されることを特徴とする実行パス検出装置。 In any one of Claims 1 thru | or 4,
In the execution history table,
An execution path detection device for storing the number of executions of an instruction at a branch destination address in the return direction of a branch instruction.
前記実行履歴テーブルが、前記先頭アドレス及び前記実行回数を記憶し、
前記分岐履歴管理部が、
前記閾値を超えた前記実行回数に関連付けて記憶される先頭アドレスを用いて、前記分岐履歴の収集を開始することを特徴とする実行パス検出装置。 In any one of Claims 1 thru | or 5,
The execution history table stores the start address and the number of executions,
The branch history management unit
The execution path detection apparatus, wherein the branch history collection is started using a head address stored in association with the number of executions exceeding the threshold.
前記分岐履歴テーブルが、
記憶情報をセットアソシアティブ方式で記憶し、
各セットには、
前記先頭アドレス、当該命令列ブロックに含まれる分岐命令のターゲットアドレス、及び分岐回数が記憶され、
該分岐命令に対応して記憶されたターゲットアドレスのうち分岐回数が最も多いセットのターゲットアドレスを出力することを特徴とする実行パス検出装置。 In any one of Claims 1 thru | or 6.
The branch history table is
Memorize memorized information by set associative method,
Each set includes
The start address, the target address of a branch instruction included in the instruction sequence block, and the number of branches are stored.
An execution path detecting apparatus for outputting a set of target addresses having the largest number of branches among the target addresses stored corresponding to the branch instruction.
前記分岐履歴管理部が、
前記分岐命令の分岐先アドレスをインデックスとして前記分岐履歴テーブルを検索して得られたターゲットアドレスをパス情報として出力することを特徴とする実行パス検出装置。 In any one of Claims 1 thru | or 7,
The branch history management unit
An execution path detecting apparatus, wherein a target address obtained by searching the branch history table using a branch destination address of the branch instruction as an index is output as path information.
前記分岐命令の分岐先が前記実行履歴テーブルに記録された先頭アドレスとならないとき、又は予め決められた分岐命令の実行回数が所与のサンプリング時間内に達しなかったとき、
前記分岐履歴管理部が、
前記分岐履歴テーブルの記憶情報を無効化することを特徴とする実行パス検出装置。 In any one of Claims 1 thru | or 8.
When the branch destination of the branch instruction does not become the start address recorded in the execution history table, or when the predetermined number of executions of the branch instruction does not reach within a given sampling time,
The branch history management unit
An execution path detection device that invalidates storage information of the branch history table.
アプリケーションプログラムを実行処理する中央演算処理装置とを含み、
前記実行パス検出装置からの前記パス情報に基づいて、前記アプリケーションプログラムの処理が最適化されることを特徴とする情報処理装置。 The execution path detection device according to any one of claims 1 to 9,
A central processing unit that executes and executes an application program,
An information processing apparatus, wherein processing of the application program is optimized based on the path information from the execution path detection apparatus.
アプリケーションプログラムを実行処理する中央演算処理装置と、
前記実行パス検出装置からの前記パス情報に基づいて、前記アプリケーションプログラムの処理を最適化するパス処理部とを含むことを特徴とする情報処理装置。 The execution path detection device according to any one of claims 1 to 9,
A central processing unit that executes application programs;
An information processing apparatus comprising: a path processing unit that optimizes processing of the application program based on the path information from the execution path detection apparatus.
前記制御部が、分岐命令を含む命令列を1ブロックとする命令列ブロックの先頭アドレスの命令の実行回数を前記実行履歴テーブルに登録するステップと、
前記制御部が、前記実行回数が所与の閾値を超えたことを条件に前記分岐命令の分岐履歴の収集を開始し、該分岐履歴を前記分岐履歴テーブルに登録するステップと、
前記制御部が、前記実行パスを特定するためのパス情報を、前記分岐履歴に基づいて出力するステップとを含むことを特徴とする実行パス検出方法。 In an information processing apparatus having an execution history table, a branch history table, and a control unit, an execution path detection method for detecting an execution path of an instruction sequence having a high execution frequency,
A step wherein said control unit is, for registering the number of times of execution of the instruction of the start address of the instruction sequence blocks that 1 block instruction sequence including a branch instruction to the execution history table,
Wherein the control unit comprises the steps of the execution count begins collecting branch history of the branch instruction on condition that exceeds a given threshold, it registers the branch history in the branch history table,
The control unit includes a step of outputting path information for specifying the execution path based on the branch history.
前記実行履歴テーブルの記憶領域の少なくとも一部が、前記分岐履歴テーブルの記憶領域と重複していることを特徴とする実行パス検出方法。 In claim 12,
An execution path detection method, wherein at least a part of a storage area of the execution history table overlaps with a storage area of the branch history table.
前記先頭アドレスが、
分岐命令の戻り方向の分岐先アドレスであり、
前記実行履歴テーブルが、前記先頭アドレス及び前記実行回数を記憶し、
前記制御部が、前記閾値を超えた前記実行回数に関連付けて記憶される先頭アドレスを用いて、前記分岐履歴の収集を開始することを特徴とする実行パス検出方法。 In claim 12 or 13,
The start address is
The branch destination address in the return direction of the branch instruction,
The execution history table stores the start address and the number of executions,
The execution path detection method , wherein the control unit starts collecting the branch history by using a head address stored in association with the number of executions exceeding the threshold.
前記分岐履歴テーブルが、
記憶情報をセットアソシアティブ方式で記憶し、
各セットには、
前記先頭アドレス、当該命令列ブロックに含まれる分岐命令のターゲットアドレス、及び分岐回数が記憶され、
該分岐命令に対応して記憶されたターゲットアドレスのうち分岐回数が最も多いセットのターゲットアドレスを出力することを特徴とする実行パス検出方法。 In any of claims 12 to 14,
The branch history table is
Memorize memorized information by set associative method,
Each set includes
The start address, the target address of a branch instruction included in the instruction sequence block, and the number of branches are stored.
An execution path detection method, comprising: outputting a set of target addresses having the largest number of branches among the target addresses stored corresponding to the branch instruction.
前記制御部が、該分岐命令の分岐先アドレスをインデックスとして前記分岐履歴テーブルを検索して得られたターゲットアドレスをパス情報として出力することを特徴とする実行パス検出方法。 In any of claims 12 to 15,
An execution path detection method , wherein the control unit outputs a target address obtained by searching the branch history table using a branch destination address of the branch instruction as an index, as path information.
前記分岐命令の分岐先が前記実行履歴テーブルに記録された先頭アドレスとならないとき、又は予め決められた分岐命令の実行回数が所与のサンプリング時間内に達しなかったとき、
前記制御部が、前記分岐履歴テーブルの記憶情報を無効化することを特徴とする実行パス検出方法。 In any of claims 12 to 16,
When the branch destination of the branch instruction does not become the start address recorded in the execution history table, or when the predetermined number of executions of the branch instruction does not reach within a given sampling time,
The execution path detection method , wherein the control unit invalidates the storage information of the branch history table.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2007094075A JP4892387B2 (en) | 2007-03-30 | 2007-03-30 | Execution path detection apparatus, information processing apparatus, execution path detection method, program, and recording medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2007094075A JP4892387B2 (en) | 2007-03-30 | 2007-03-30 | Execution path detection apparatus, information processing apparatus, execution path detection method, program, and recording medium |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2008250867A JP2008250867A (en) | 2008-10-16 |
JP4892387B2 true JP4892387B2 (en) | 2012-03-07 |
Family
ID=39975697
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2007094075A Expired - Fee Related JP4892387B2 (en) | 2007-03-30 | 2007-03-30 | Execution path detection apparatus, information processing apparatus, execution path detection method, program, and recording medium |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP4892387B2 (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPWO2014141352A1 (en) * | 2013-03-11 | 2017-02-16 | 株式会社日立製作所 | System controller |
GB2560749B (en) * | 2017-03-24 | 2020-10-14 | Advanced Risc Mach Ltd | Trace data representation |
Family Cites Families (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP3112861B2 (en) * | 1997-05-19 | 2000-11-27 | 日本電気エンジニアリング株式会社 | Microprocessor |
JP4485772B2 (en) * | 2003-09-17 | 2010-06-23 | 財団法人福岡県産業・科学技術振興財団 | Estimation apparatus, estimation method, computer program for executing estimation processing, and computer-readable recording medium recording the program |
-
2007
- 2007-03-30 JP JP2007094075A patent/JP4892387B2/en not_active Expired - Fee Related
Also Published As
Publication number | Publication date |
---|---|
JP2008250867A (en) | 2008-10-16 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10049056B2 (en) | Deferred RE-MRU operations to reduce lock contention | |
US7117309B2 (en) | Method of detecting sequential workloads to increase host read throughput | |
US9733991B2 (en) | Deferred re-MRU operations to reduce lock contention | |
US6782454B1 (en) | System and method for pre-fetching for pointer linked data structures | |
US6427184B1 (en) | Disk drive with prefetch and writeback algorithm for sequential and nearly sequential input/output streams | |
JPH08212054A (en) | Method for operating of buffer memory and related apparatus | |
JP4067293B2 (en) | Cache control program and cache processing computer | |
JP2003509733A5 (en) | ||
JP2001093220A (en) | Power saving control system and power saving control method in environment of plurality of hard disk drives | |
KR100470516B1 (en) | Distributed tag cache memory system and system for storing data in it | |
JP3497832B2 (en) | Load / store queue | |
JP4892387B2 (en) | Execution path detection apparatus, information processing apparatus, execution path detection method, program, and recording medium | |
US6385720B1 (en) | Branch prediction method and processor using origin information, relative position information and history information | |
JP2000076017A (en) | Magnetic disk controller | |
KR101105127B1 (en) | Buffer cache managing method using ssdsolid state disk extension buffer and apparatus for using ssdsolid state disk as extension buffer | |
KR940000994A (en) | Fast data retrieval from data storage using priority access prediction annotations | |
JP2001184176A (en) | Disk controller | |
CN101158926B (en) | Apparatus and method for saving power in a trace cache | |
JP2009129025A (en) | Stored information arrangement system, stored information arrangement method, and stored information arrangement program | |
US7376797B2 (en) | Cache memory system and method using reference bits | |
KR100801814B1 (en) | Cache memory and control method thereof | |
JPH0477344B2 (en) | ||
CN113703668B (en) | Information query method and system of solid state disk, electronic equipment and storage medium | |
JPH06103128A (en) | Storage device | |
JPH05225058A (en) | Storage controller |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20090902 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20110209 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20110906 |
|
A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20111031 |
|
TRDD | Decision of grant or rejection written | ||
A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 Effective date: 20111129 |
|
A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20111219 |
|
R150 | Certificate of patent or registration of utility model |
Ref document number: 4892387 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 Free format text: JAPANESE INTERMEDIATE CODE: R150 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20141222 Year of fee payment: 3 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
LAPS | Cancellation because of no payment of annual fees |