JP2001159983A - Scheduling method of common subexpression recognition type instruction - Google Patents

Scheduling method of common subexpression recognition type instruction

Info

Publication number
JP2001159983A
JP2001159983A JP34368199A JP34368199A JP2001159983A JP 2001159983 A JP2001159983 A JP 2001159983A JP 34368199 A JP34368199 A JP 34368199A JP 34368199 A JP34368199 A JP 34368199A JP 2001159983 A JP2001159983 A JP 2001159983A
Authority
JP
Japan
Prior art keywords
instruction
common
common expression
expression
cluster
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.)
Pending
Application number
JP34368199A
Other languages
Japanese (ja)
Inventor
Noriyasu Mori
教安 森
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hitachi Ltd
Original Assignee
Hitachi Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hitachi Ltd filed Critical Hitachi Ltd
Priority to JP34368199A priority Critical patent/JP2001159983A/en
Publication of JP2001159983A publication Critical patent/JP2001159983A/en
Pending legal-status Critical Current

Links

Landscapes

  • Multi Processors (AREA)
  • Devices For Executing Special Programs (AREA)

Abstract

PROBLEM TO BE SOLVED: To efficiently use information of common subexpression elimination and to enhance the degree of parallelism of an instruction in an instruction scheduling processing. SOLUTION: Information about an intermediate language 32 to which common subexpression elimination 6 is performed is registered in a common information table 4, the information is applied to the scheduling processing 2 by referring to it, and a processing different from the normal processing is performed for the scheduling of the instruction has become the common subexpression. A scheduling result is registered in a schedule information table 5. In particular, in the case of target architecture in which a plurality of clusters exist, the common subexpression is arranged in different clusters as far as possible. The instruction scheduling processing 2 refers to the information of the common subexpression deleted by the common subexpression elimination and a scheduling method is selected depending on whether the common subexpression elimination has been performed.

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【発明の属する技術分野】本発明は、コンパイラのコン
パイル方法に係わり、特に命令スケジューリング機構を
持つコンパイル方法で、効率的な命令スケジューリング
を可能にすることにより、オブジェクトプログラムの処
理性能を向上させる共通式認識型命令スケジューリング
方法に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a compiling method for a compiler, and more particularly to a compiling method having an instruction scheduling mechanism, which enables efficient instruction scheduling to improve the processing performance of an object program. The present invention relates to a cognitive instruction scheduling method.

【0002】[0002]

【従来の技術】高級言語で記述されたプログラムを機械
命令に変換するコンパイラでは、生成する機械語を所定
の順序に並べ替えて生成するのが一般的である。この命
令の並べ替え処理のことを、命令スケジューリングと呼
ぶ。命令スケジューリングは、コンパイル時に命令を静
的に並べ替えるものであり、(一般的には)VLIW
(Very Long Instruction Wo
rd)等のハードウエアが命令並び替えの機能を持たな
いアーキテクチャをターゲットとするコンパイラの場合
には、必須の機能である。また、RISC(Reduc
ed Instruction Set Comput
er)等の実行時にハードウェアが動的に命令を並べ替
える機能を持っている場合でも、処理性能向上のため
に、コンパイラが命令スケジューリングを行うのが一般
的である。
2. Description of the Related Art Generally, a compiler that converts a program described in a high-level language into machine instructions generates the machine language by rearranging the generated machine language in a predetermined order. This instruction rearrangement processing is called instruction scheduling. Instruction scheduling is a static reordering of instructions at compile time, and (generally) VLIW
(Very Long Instruction Wo
This is an essential function in the case of a compiler that targets an architecture in which hardware such as rd) does not have an instruction rearranging function. In addition, RISC (Reduc
ed Instruction Set Comput
er), the compiler generally performs instruction scheduling to improve processing performance even when hardware has a function of dynamically rearranging instructions during execution.

【0003】コンパイラのターゲットアーキテクチャに
は、クラスタと呼ばれる構成を備える場合がある。クラ
スタとは、演算を行う演算器と、演算すべきデータを保
持するレジスタ等を一まとまりとして持つもので、複数
のクラスタを並列に配置することで、命令並列度向上と
スケーラビリティを確保しようとするものである。各ク
ラスタはシステムバス等により結ばれており、命令語レ
ベルでのデータ転送が可能になっているのが普通であ
る。各クラスタが固有のレジスタを備える分散レジスタ
構成をとっているため、全体としてまとまった処理を行
うためには、クラスタ間のデータ転送が必要となる。こ
のようなクラスタ構成は、VLIWアーキテクチャに多
くみられ、クラスタ構成VLIWアーキテクチャと呼ば
れている。
A target architecture of a compiler sometimes has a configuration called a cluster. A cluster is a unit that has an arithmetic unit that performs operations, registers that hold data to be operated, and the like. By arranging a plurality of clusters in parallel, it aims to improve instruction parallelism and ensure scalability. Things. Each cluster is connected by a system bus or the like, and data transfer at an instruction word level is generally enabled. Since each cluster has a distributed register configuration including a unique register, data transfer between clusters is required to perform a collective process as a whole. Such a cluster configuration is often found in the VLIW architecture, and is called a cluster configuration VLIW architecture.

【0004】クラスタ構成VLIWアーキテクチャをタ
ーゲットとするコンパイラは、命令スケジューリング時
に、逐次命令列を複数クラスタで実行する命令列へと変
換する必要がある。この逐次命令列のクラスタへの分割
(及び、分割に伴って必要となるクラスタ間データ転送
命令の挿入)を、以降ではクラスタリングと呼ぶことに
する。クラスタリングは命令スケジューリングの一部で
あり、クラスタ構成VLIWコンパイラでは、命令スケ
ジューリング時にクラスタリング処理も併せて行うのが
一般的である。クラスタリング処理の一般的課題とし
て、命令分割方法が挙げられる。レジスタは各クラスタ
に固有なので、命令分割によりクラスタ間データ転送が
必要となる場合がある。
A compiler targeting the cluster configuration VLIW architecture needs to convert a sequential instruction sequence into an instruction sequence to be executed in a plurality of clusters at the time of instruction scheduling. The division of the sequential instruction sequence into clusters (and the insertion of an inter-cluster data transfer instruction necessary for the division) is hereinafter referred to as clustering. Clustering is a part of instruction scheduling, and in a cluster configuration VLIW compiler, it is common to perform clustering at the time of instruction scheduling. A general problem of the clustering process is an instruction division method. Since the register is unique to each cluster, data transfer between clusters may be required due to instruction division.

【0005】例えば、 a = b + c; (1) d = a + e; (2) という逐次命令列があったとき、(1)と(2)を異なるクラ
スタへ分割すると、 a. 0 = b.0 + c.0; (3) a.1 = a.0; (4) d.1 = a.1 + e.1; (5) の様に、中間語(4)のようなクラスタ間データ転送命令
を生成する必要が生じる。
For example, when there is a sequential instruction sequence of a = b + c; (1) d = a + e; (2), when (1) and (2) are divided into different clusters, a. b.0 + c.0; (3) a.1 = a.0; (4) d.1 = a.1 + e.1; (5) It becomes necessary to generate an inter-data transfer instruction.

【0006】尚、上記の低レベル中間語の例で、「.」
以下はクラスタ番号を表している。即ち、「a.0」は、
クラスタ0にあるデータaを示しており、中間語(4)は、
クラスタ0のaを、クラスタ1のaに転送する命令である。
以降では、この表記方法を踏襲する。(1)と(2)を同一ク
ラスタに配置した場合は、(4)のような命令は不要とな
る。上記の例は、同一の値である「a」を複数クラスタ
に分散させたため、実行サイクル数が長くなってしまう
わけである。一方、相互に依存関係のない命令列の場合
は、独立して実行可能であるため、分割した方がよい場
合もある。
In the example of the low-level intermediate language, "."
The following shows the cluster number. That is, "a.0"
This shows data a in cluster 0, and the intermediate language (4) is
This is an instruction to transfer a of cluster 0 to a of cluster 1.
In the following, this notation will be followed. When (1) and (2) are arranged in the same cluster, the instruction as in (4) becomes unnecessary. In the above example, since the same value “a” is distributed to a plurality of clusters, the number of execution cycles increases. On the other hand, in the case of instruction sequences that do not depend on each other, since they can be executed independently, in some cases it is better to divide them.

【0007】例えば、 a = b * c; (6) d = a + e; (7) f = a + g; (8) のような例の場合、(6)の実行に時間がかかるのであれ
ば、(7)(8)を実行するまでにクラスタ間データ転送を実
行する余裕があり、(7)(8)を複数クラスタで並列実行す
ることも可能である。この場合、(6)〜(8)を同一クラス
タで実行するより高速に処理することが可能である。な
お、同一クラスタで実行する場合は、クラスタ間転送命
令が不要であるが、(7)(8)は逐次実行せざるをえず、そ
の分だけ処理が遅くなる。
For example, in the case of a = b * c; (6) d = a + e; (7) f = a + g; (8), it takes time to execute (6). For example, there is room to execute inter-cluster data transfer before (7) and (8) are executed, and (7) and (8) can be executed in parallel in a plurality of clusters. In this case, it is possible to perform processing at higher speed than when (6) to (8) are executed in the same cluster. In the case of executing in the same cluster, an inter-cluster transfer instruction is unnecessary, but (7) and (8) must be executed sequentially, and the processing is delayed by that much.

【0008】上記の例で示したとおり、同一データの参
照を含む命令を、同一クラスタに置くべきか、あるいは
複数クラスタに分割すべきかは、スケジューリング状況
に応じて判断する必要があり、クラスタ構成VLIWを
対象とするコンパイラにおいて、命令スケジューリング
(クラスタリング)は、処理性能を左右する課題となっ
ている。ところで、ある命令列で共通して使用するデー
タを複数クラスタにコピーすると、命令列間の依存が少
なくなり、スケジューリングしたときの命令並列度の向
上を見込む事が出来る。クラスタ間データ転送命令を挿
入するオーバヘッドよりも、命令並列度の向上効果が大
きい場合には、データを分散させる価値があるわけであ
る。一般に、全ての命令列で共通して使用するデータと
して引数やスタックポインタ等が想定されるため、最初
にこれらの値を全クラスタに転送するクラスタリング戦
略が有効な場合も多い。
As shown in the above example, it is necessary to determine whether an instruction including a reference to the same data should be placed in the same cluster or divided into a plurality of clusters according to the scheduling situation. In compilers targeting, instruction scheduling (clustering) is a problem that affects processing performance. By the way, if data commonly used in a certain instruction sequence is copied to a plurality of clusters, dependence between the instruction sequences is reduced, and an improvement in instruction parallelism at the time of scheduling can be expected. If the effect of improving the degree of instruction parallelism is greater than the overhead of inserting an inter-cluster data transfer instruction, it is worth distributing the data. Generally, an argument, a stack pointer, and the like are assumed as data commonly used in all instruction sequences. Therefore, a clustering strategy of first transferring these values to all clusters is often effective.

【0009】一方、コンパイラの最適化処理として、古
くから行われている伝統的最適化と呼ばれる処理の一つ
に、共通式の削除(共通部分式の削除とも呼ばれるが、
本質的差異はないので、以下では単に共通式の削除と呼
ぶ)がある。共通式の削除は、(オペランドも演算も同
じ)同一の命令を複数行う場合、最初の演算結果を使う
ようにして処理性能の向上を図るものである。例えば、
図5に示す中間語を図6のように変換することで、処理
性能の向上が見込まれる。共通式の削除の結果得られる
共通式の演算結果を格納するテンポラリ変数(以降で
は、共通式演算結果定義変数と呼ぶ)は、以下の命令列
で共通に使われるデータそのものであり、複数クラスタ
に転送するデータとして有望である。しかし、共通式の
削除は、高レベル中間語である逐次命令列に対して行わ
れるのが一般的で、複数クラスタを意識した低レベル中
間語に対する処理である命令スケジューリングとは、独
立した処理であった。
On the other hand, as one of the optimization processes performed by the compiler, one of the processes called traditional optimization which has been performed for a long time, common expression elimination (also called common subexpression elimination,
Since there is no essential difference, there is a common expression elimination in the following). The deletion of the common expression is intended to improve the processing performance by using the first operation result when executing the same instruction (same in operand and operation). For example,
By converting the intermediate language shown in FIG. 5 as shown in FIG. 6, an improvement in processing performance can be expected. A temporary variable that stores the operation result of the common expression obtained as a result of the deletion of the common expression (hereinafter, referred to as a common expression operation result definition variable) is the data itself that is commonly used in the following instruction sequence, and is stored in multiple clusters. Promising as data to be transferred. However, deletion of the common expression is generally performed for a sequential instruction sequence that is a high-level intermediate language, and is independent of instruction scheduling that is a process for a low-level intermediate language that is aware of multiple clusters. there were.

【0010】クラスタ構成VLIWにおける命令スケジ
ューリングに関しては、例えば、Emre Ozer, Sanjeev B
anerjia, Thomas M. Conte "Unified Assign and Sched
ule:A New Approach to Scheduling for Clustered Reg
ister File Microarchitecture", Proceedings of the
31st Annual ACM/IEEE International Symposium onMic
roarchitecture, pp.308-315に詳述されている。
Regarding instruction scheduling in the cluster configuration VLIW, for example, Emre Ozer, Sanjeev B
anerjia, Thomas M. Conte "Unified Assign and Sched
ule: A New Approach to Scheduling for Clustered Reg
ister File Microarchitecture ", Proceedings of the
31st Annual ACM / IEEE International Symposium onMic
Roarchitecture, pp. 308-315.

【0011】[0011]

【発明が解決しようとする課題】前述のように、従来技
術においては、命令スケジューリング処理において、共
通式削除の情報を活用していなかったため、共通式削除
が命令スケジューリング効果を阻害する場合が生じ、処
理性能の向上の妨げとなっていた。つまり、従来では、
共通式削除最適化のデータは、命令スケジューリング処
理に反映されることがなく、これらは別個の処理で行わ
れていたので、コンパイルされたプログラムの性能は効
果が悪いという問題があった。
As described above, in the prior art, in the instruction scheduling process, the information of the common expression deletion is not utilized, so that the common expression deletion may hinder the instruction scheduling effect. This hindered the improvement of processing performance. In other words, conventionally,
The data of the common-expression elimination optimization is not reflected in the instruction scheduling process, and these are performed in separate processes, so that there is a problem that the performance of the compiled program is ineffective.

【0012】そこで、本発明の目的は、これら従来の問
題を解決し、共通式削除の情報を用いた命令スケジュー
リングを行うことができ、特にクラスタ構成アーキテク
チャをターゲットとするコンパイラに対して、より効率
的な命令スケジューリングを行うことで、オブジェクト
プログラムの処理性能を向上させることが可能な共通式
認識型命令スケジューリング方法を提供することにあ
る。
An object of the present invention is to solve these conventional problems and to perform instruction scheduling using information on common expression elimination. Particularly, it is more efficient for a compiler targeting a cluster configuration architecture. An object of the present invention is to provide a common-recognition-type instruction scheduling method capable of improving the processing performance of an object program by performing efficient instruction scheduling.

【0013】[0013]

【課題を解決するための手段】上記目的を達成するた
め、本発明の共通式認識型命令スケジューリング方法で
は、共通式削除を行った時、共通式削除に関連した中
間語の情報を保持しておき、また、命令スケジューリン
グ処理において、共通式削除情報をデータ分散候補とし
て参照し、クラスタリング処理を行うことを特徴として
いる(図3参照)。また、命令スケジューリング処理
が、命令をクラスタに配分するクラスタリング処理を行
い、共通式削除情報に基づくスケジューリング方法の選
択がクラスタリング方法の選択であることも特徴として
いる(図15参照)。また、命令クラスタリング処理
が、共通式削除情報を用いて共通式削除された命令を相
互に異なるクラスタ配置を指向することも特徴としてい
る(図17参照)。また、同一演算の複数回実行を代
行する共通式演算結果変数定義情報と、共通式演算結果
変数で置き換える複数箇所の演算群を示す共通式演算結
果置換情報を備えることも特徴としている(図10,図
11参照)。さらに、共通式削除情報に基づくスケジ
ューリング方法の選択がクラスタ間データ転送方法の選
択であり、クラスタ間データ転送方法の選択が、命令の
演算結果の格納クラスタを示すデスティネーションクラ
スタの選択であり、また全クラスタに対するデータの同
時転送である全域クラスタ転送を有するクラスタ構成
で、デスティネーションクラスタの選択候補として全域
クラスタ転送を有することも特徴としている(図20、
図21参照)。これにより、共通データの効率的クラス
タ間転送が適用できるので、命令並列度向上によるオブ
ジェクトプログラムの処理性能の向上に寄与する。
In order to achieve the above object, according to the common-expression-recognition-type instruction scheduling method of the present invention, when a common expression is deleted, information on an intermediate language related to the common expression is retained. Also, in the instruction scheduling process, the clustering process is performed by referring to the common expression deletion information as a data distribution candidate (see FIG. 3). It is also characterized in that the instruction scheduling process performs a clustering process of allocating instructions to clusters, and the selection of a scheduling method based on the common expression deletion information is a selection of a clustering method (see FIG. 15). It is also characterized in that the instruction clustering process directs instructions whose common expression has been deleted using the common expression deletion information to different cluster arrangements (see FIG. 17). It is also characterized by having common-expression operation result variable definition information for performing the same operation a plurality of times and common-expression operation result replacement information indicating a plurality of operation groups to be replaced with the common expression operation result variable (FIG. 10). , See FIG. 11). Further, the selection of the scheduling method based on the common expression deletion information is the selection of the inter-cluster data transfer method, the selection of the inter-cluster data transfer method is the selection of the destination cluster indicating the storage cluster of the instruction operation result, and In the cluster configuration having the whole area cluster transfer which is the simultaneous transfer of data to all the clusters, it is also characterized by having the whole area cluster transfer as a destination cluster selection candidate (FIG. 20,
See FIG. 21). As a result, efficient inter-cluster transfer of common data can be applied, thereby contributing to an improvement in the processing performance of an object program by improving the degree of instruction parallelism.

【0014】[0014]

【発明の実施の形態】以下、本発明の実施例を、図面に
より詳細に説明する。本発明は、共通式削除情報を利用
したコンパイラの命令スケジューリング方法であって、
具体的には、共通式削除を行った中間語の情報を命令ス
ケジューリング処理に適用し、共通式となった命令のス
ケジューリングは、通常とは異なる処理を行う。特に、
複数のクラスタが存在するターゲットアーキテクチャの
場合には、共通式をできる限り異なるクラスタに配置す
ることで、命令並列度を向上させることができる。尚、
以下の説明では、コンパイラの中間語は、同等な命令語
の形式で示す。また、複数クラスタでの並列実行状況を
明示するため、クラスタ毎の実行命令を縦にならべた形
式で表す。
Embodiments of the present invention will be described below in detail with reference to the drawings. The present invention provides a compiler instruction scheduling method using common expression deletion information,
Specifically, the information on the intermediate language from which the common expression has been deleted is applied to the instruction scheduling process, and the scheduling of the instruction that has become the common expression is performed in a different manner from the usual process. In particular,
In the case of the target architecture in which a plurality of clusters exist, the degree of instruction parallelism can be improved by arranging the common expression in different clusters as much as possible. still,
In the following description, the intermediate language of the compiler is shown in the form of an equivalent instruction word. In order to clearly show the parallel execution status in a plurality of clusters, the execution instructions for each cluster are represented in a vertical format.

【0015】図1は、本発明のコンパイル方法が適用さ
れる計算機システムの構成図である。計算機システム
は、CPU101、ディスプレイ装置102、キーボー
ド103、主記憶装置104、外部記憶装置105より
構成されている。キーボード103より、ユーザからの
コンパイラ起動命令を受け付ける。また、コンパイラ終
了メッセージや、エラーメッセージは、ディスプレイ装
置102に表示される。また、外部記憶装置105に
は、ソースプログラム106とオブジェクトプログラム
107が格納される。主記憶装置104には、コンパイ
ラ108があり、コンパイル過程で必要となる中間語
3、共通式情報テーブル4、命令スケジューリング情報
テーブル5が格納される。コンパイル処理は、CPU1
01によって、制御される。
FIG. 1 is a configuration diagram of a computer system to which the compiling method of the present invention is applied. The computer system includes a CPU 101, a display device 102, a keyboard 103, a main storage device 104, and an external storage device 105. The keyboard 103 receives a compiler activation command from the user. Further, a compiler end message and an error message are displayed on the display device 102. The external storage device 105 stores a source program 106 and an object program 107. The main storage device 104 includes a compiler 108, which stores an intermediate language 3, a common expression information table 4, and an instruction scheduling information table 5, which are required in the compilation process. The compiling process is performed by the CPU 1
01 is controlled.

【0016】(第1の実施例)図2は、本発明の第1の
実施例を示すコンパイラの処理手順の概略を示すフロー
チャートである。先ず、構文解析処理(201)では、
ソースプログラム106を入力として字句構文解析を行
ない、中間語3を出力する。次に、共通式削除処理
(6)は中間語3を入力とし、共通式を認識し共通式を
削除した後、中間語3を出力する。次に、命令スケジュ
ーリング処理(2)は、中間語3を入力とし、逐次命令
列を複数クラスタに配置する命令スケジューリング処理
を行ない、中間語3を出力する。次のコード生成処理
(202)は、中間語を最終的なオブジェクトプログラ
ム107の形式に変換する。
(First Embodiment) FIG. 2 is a flowchart showing an outline of a processing procedure of a compiler according to a first embodiment of the present invention. First, in the syntax analysis processing (201),
The lexical analysis is performed using the source program 106 as an input, and the intermediate language 3 is output. Next, in the common expression deletion process (6), the intermediate language 3 is input, the common expression is recognized, the common expression is deleted, and then the intermediate language 3 is output. Next, in the instruction scheduling process (2), the intermediate language 3 is input, the instruction scheduling process for arranging sequential instruction sequences in a plurality of clusters is performed, and the intermediate language 3 is output. In the next code generation process (202), the intermediate language is converted into the final object program 107 format.

【0017】図3は、本発明の第1の実施例を示す共通
式認識型命令スケジューリング方法フローチャートであ
る。なお、図3のフローは、図2の共通式削除処理
(6)と命令スケジューリング処理(2)の手順をさら
に詳細に表したものである。先ず、共通式登録処理(6
1)により、中間語3中の共通式情報を抽出し、共通式
情報テーブル4を作成する。次に、共通式削除処理(6
2)により、中間語3中の共通式を削除するとともに、
削除結果を反映するように共通式情報テーブル4を更新
する。この共通式削除中間語変換処理(62)で、中間
語ノードは、共通式削除された共通式削除関連中間語
と、削除変換されなかった中間語ノードとに分類され
る。共通式削除処理ステップ(6)の次に、命令スケジ
ューリング処理(2)を行う。
FIG. 3 is a flow chart of a method of scheduling a common type recognition instruction according to the first embodiment of the present invention. Note that the flow of FIG. 3 shows the procedure of the common expression deletion processing (6) and the instruction scheduling processing (2) of FIG. 2 in more detail. First, common expression registration processing (6
According to 1), common expression information in the intermediate language 3 is extracted, and a common expression information table 4 is created. Next, common expression deletion processing (6
According to 2), common expressions in intermediate language 3 are deleted, and
The common expression information table 4 is updated to reflect the deletion result. In the common expression deleted intermediate language conversion process (62), the intermediate language nodes are classified into common expression deleted related intermediate words whose common expressions have been deleted and intermediate word nodes that have not been deleted and converted. After the common expression deletion processing step (6), the instruction scheduling processing (2) is performed.

【0018】この命令スケジューリング処理(2)は、
未処理中間語ノードopの存在判定を行うステップ30
1、opが共通式削除関連中間語ノードか否かを判定する
ステップ302、および後述の図4の命令スケジューリ
ング処理(2)の中で示されているopの命令配置位置を
決定する命令配置位置決定処理(21)と、opを並列化
中間語ノードへ変換する際の演算結果格納場所を決定す
るDESTクラスタ(デスティネーションクラスタ)決
定処理(22)で構成される。また、命令配置位置決定
処理(21)は、共通式削除関連ノードの場合に行う共
通式削除認識型命令配置決定処理(3031)と、それ
以外の場合の従来技術型命令配置決定処理(3032)
に分かれる。同様に、DESTクラスタ決定処理(2
2)も、共通式削除関連ノードの場合に行う共通式削除
認識式型DESTクラスタ決定処理(3041)と、そ
れ以外の場合の従来技術型DESTクラスタ決定処理
(3042)に分かれる。各処理に関しては図12から
図16で詳しく述べる。
This instruction scheduling process (2)
Step 30 for determining the existence of the unprocessed intermediate language node op
1. Step 302 for determining whether or not op is a common-expression-deletion-related intermediate language node, and an instruction arrangement position for determining the instruction arrangement position of op shown in the instruction scheduling process (2) of FIG. The processing includes a determination process (21) and a DEST cluster (destination cluster) determination process (22) for determining a storage location of an operation result when converting an op into a parallelized intermediate language node. The instruction arrangement position determination process (21) is performed by a common expression deletion recognition type instruction arrangement determination process (3031) performed in the case of a common expression deletion related node, and the conventional technology type instruction arrangement determination process (3032) in other cases.
Divided into Similarly, DEST cluster determination processing (2
2) is also divided into a common-expression-deletion-recognition-type DEST cluster determination process (3041) performed in the case of a common-expression-deletion-related node, and a conventional-type DEST cluster determination process (3042) in other cases. Each process will be described in detail with reference to FIGS.

【0019】図4は、図3で示した共通式認識型命令ス
ケジューリング処理の入出力となる中間語やテーブル類
の関係を示した処理構成図である。但し、中間語3は全
般的に参照するため、入出力関係は主要なもののみを示
している。共通式削除処理(6)は、共通式登録処理
(61)と共通式削除中間語変換処理(62)で構成さ
れる。共通式登録処理(61)は、共通式削除前中間語
31を入力とし、共通式の情報を収集した共通式情報テ
ーブル4を生成する。共通式情報テーブル4は、共通式
集合の一覧を格納する共通式テーブル41と、各エント
リが対応する中間語ノードの情報を収集した命令ノード
テーブル42から成る。共通式削除中間語変換処理(6
2)は、共通式削除前中間語31と共通式情報テーブル
4を入力とし、共通式削除後中間語32を生成するとと
もに、共通式削除に伴う中間語の変換内容を命令ノード
テーブル42に記録する。命令配置位置決定処理(2
1)と、DESTクラスタ決定処理(22)を含む命令
スケジューリング処理(2)は、共通式削除後中間語3
2と共通式情報テーブル4を入力とし、複数クラスタに
命令を配置した命令スケジューリング後の並列化中間語
33を生成する。
FIG. 4 is a processing configuration diagram showing the relationship between intermediate words and tables used as inputs and outputs in the common expression recognition type instruction scheduling processing shown in FIG. However, since the intermediate language 3 is generally referred to, only the main input / output relationship is shown. The common expression deletion process (6) includes a common expression registration process (61) and a common expression deletion intermediate language conversion process (62). The common expression registration process (61) receives the common language before deleting the common expression 31 as input and generates a common expression information table 4 in which information on common expressions is collected. The common expression information table 4 includes a common expression table 41 that stores a list of common expression sets, and an instruction node table 42 that collects information on intermediate nodes corresponding to each entry. Common expression deleted intermediate language conversion processing (6
2), the intermediate language 31 before the common expression is deleted and the common expression information table 4 are input, the intermediate language 32 after the common expression is deleted is generated, and the conversion contents of the intermediate language accompanying the common expression deletion are recorded in the instruction node table 42. I do. Instruction placement position determination processing (2
1) and the instruction scheduling processing (2) including the DEST cluster determination processing (22),
2 and the common expression information table 4 as inputs, and generates an instruction-scheduled parallelized intermediate language 33 in which instructions are arranged in a plurality of clusters.

【0020】命令配置位置決定処理(21)は、共通式
削除後中間語32と共通式情報テーブル4を入力とし、
スケジュール情報テーブル5に含まれる命令配置テーブ
ル51への登録及び参照を行いながら、中間語ノードの
配置位置を決定する。次のDESTクラスタ決定処理
(32)は、命令配置テーブル51を参考に、中間語ノ
ードのDESTクラスタの決定を行う。次に、具体的な
適用例の説明のため、処理対象である中間語の例を挙げ
ておく。本実施例は、複数クラスタを持つアーキテクチ
ャに対するコンパイラであり、その並列化中間語33
は、クラスタを表現できる形式が必要となる。本実施例
の説明では、各クラスタに配置された命令が同一サイク
ルに並列に実行されることを表現するため、実行サイク
ルを縦軸にとり、そのサイクルで実行する命令(簡単の
ため、1サイクル当り各クラスタで1命令のみ実行可能
とする)を横に配置することにする。また、中間語がク
ラスタを意識する必要があるのは、命令スケジューリン
グ後中間語33においてであり、それ以前の中間語3
1、32では特に意識する必要はない。
The instruction arrangement position determination processing (21) receives the common expression-removed intermediate language 32 and the common expression information table 4 as inputs,
While registering and referring to the instruction arrangement table 51 included in the schedule information table 5, the arrangement position of the intermediate language node is determined. In the next DEST cluster determination process (32), the DEST cluster of the intermediate language node is determined with reference to the instruction arrangement table 51. Next, for the purpose of explaining a specific application example, an example of an intermediate language to be processed will be described. The present embodiment is a compiler for an architecture having a plurality of clusters.
Requires a format that can represent a cluster. In the description of the present embodiment, in order to express that the instructions arranged in each cluster are executed in parallel in the same cycle, the execution cycle is set on the vertical axis, and the instructions executed in that cycle (for simplicity, per cycle) (It is possible to execute only one instruction in each cluster). Also, the intermediate language needs to be aware of the cluster in the intermediate language 33 after instruction scheduling, and in the intermediate language 3 before that.
In 1 and 32, there is no need to be particularly conscious.

【0021】図5及び図6は、本発明における共通式削
除前と後の中間語構成例を示す図である。ここでは全命
令が逐次実行を想定した逐次中間語列となっている。図
5には共通式削除前中間語が示されており、002行、003
行、004行、005行に共通式「a+b」が存在する。006行〜
009行には共通式はなく、クラスタ1とクラスタ2に分け
られた命令式が配列されている。図6には共通式削除後
中間語が示されており、共通式「a+b」の演算が共通式演
算結果変数tの参照に置き換えられ、共通式演算結果変
数tの定義を行う共通式演算結果変数定義命令が101行
に挿入されている。共通式削除は、図5の中間語を図6
の中間語に変換する最適化処理である。
FIGS. 5 and 6 show examples of the intermediate language configuration before and after the elimination of the common expression in the present invention. Here, all instructions are sequential intermediate word strings assuming sequential execution. FIG. 5 shows the intermediate language before the common expression is deleted.
The common expression “a + b” exists in lines 004, 005, and 005. Line 006 ~
There is no common expression in line 009, and instruction expressions divided into cluster 1 and cluster 2 are arranged. FIG. 6 shows an intermediate language after the common expression is deleted. The operation of the common expression “a + b” is replaced with the reference of the common expression operation result variable t, and the common expression that defines the common expression operation result variable t. An operation result variable definition instruction is inserted in line 101. Common expression elimination is shown in FIG.
This is an optimization process for converting into an intermediate language.

【0022】図7は、本発明における命令スケジューリ
ング後の中間語例を示す図である。ここでは共通式削除
後の中間並列化中間語構成例であり、各命令が複数クラ
スタに配置された並列化中間語列となっている。すなわ
ち、図6の中間語を命令スケジューリング処理により並
列配置した例が示されている。例えば、204行では、ク
ラスタ0で命令「t.2 = t」、クラスタ1で命令「x1 =
t」をそれぞれ実行することを表している。204行のクラ
スタ2、クラスタ3のように空白になっている個所はな
にも命令を実行しないこと(NOP)を示している。以
降では、これらクラスタに配置された個別命令を示すた
め、行番号とクラスタ番号を組み合わせて、配置位置を
「行番号―クラスタ番号」で示すことにする。例えば、
図7の配置位置(201,0)には命令「t=a+b」が配置され、
配置位置(201,1)はNOPである。尚、並列化中間語表
記においては、命令の演算結果格納クラスタ(DESTクラ
スタ)が「.n」の形式で指定可能であり、例えば図7の
配置位置(204,0)の「t.2 = t」では、DESTクラスタ
はクラスタ2となっている。尚、本実施例では、命令の
右辺にある演算のオペランドとなる変数は、全て命令が
配置されたクラスタでの使用に限られる。そのため、右
辺の変数のクラスタ番号は省略可能となっている。例え
ば、図7の配置位置(204,0)の「t.2 = t」の右辺の
「t」は、「t.0」と等価である。
FIG. 7 is a diagram showing an example of an intermediate language after instruction scheduling in the present invention. This is an example of the configuration of the intermediate parallelized intermediate language after the removal of the common expression, in which each instruction is a parallelized intermediate language string arranged in a plurality of clusters. That is, an example is shown in which the intermediate words in FIG. 6 are arranged in parallel by the instruction scheduling process. For example, in line 204, the instruction “t.2 = t” in cluster 0 and the instruction “x1 =
t "respectively. A blank portion such as cluster 2 and cluster 3 in line 204 indicates that no instruction is executed (NOP). Hereinafter, in order to indicate the individual instructions arranged in these clusters, the line number and the cluster number are combined, and the arrangement position is indicated by “line number-cluster number”. For example,
The instruction “t = a + b” is arranged at the arrangement position (201, 0) in FIG.
The arrangement position (201, 1) is NOP. In the parallelized intermediate language notation, the operation result storage cluster (DEST cluster) of the instruction can be specified in the form of “.n”. For example, “t.2 = At “t”, the DEST cluster is cluster 2. In the present embodiment, all variables serving as operands of the operation on the right side of the instruction are limited to use in the cluster where the instruction is arranged. Therefore, the cluster number of the variable on the right side can be omitted. For example, “t” on the right side of “t.2 = t” at the arrangement position (204,0) in FIG. 7 is equivalent to “t.0”.

【0023】図7のような並列中間語は、最終的な機械
命令による実行過程を表しており、行の数はそのまま実
行サイクル数に対応している。即ち、並列中間語の行数
は、オブジェクトプログラムの処理性能を示している。
そこで、簡単のため、本実施例では、全ての演算は1サ
イクルで実行できると仮定することにする。これによ
り、例えば、図7の例では、全命令の実行サイクル数は
6となる。以降では、図4に示す共通式削除処理
(6)、命令スケジューリング処理(2)の細部の説明
を行なう。説明にあたっては、図5の中間語を入力例と
し、各種テーブルの出力例を逐次示していく。そこで、
先ず、各種テーブルの構成例を説明してから、処理手順
の説明を行なう。以下に、図4に示す共通式情報テーブ
ル4、スケジューリング情報テーブル5の順にその構成
例を述べる。
The parallel intermediate language as shown in FIG. 7 represents an execution process by a final machine instruction, and the number of lines directly corresponds to the number of execution cycles. That is, the number of lines of the parallel intermediate language indicates the processing performance of the object program.
Therefore, for simplicity, in the present embodiment, it is assumed that all operations can be executed in one cycle. Thereby, for example, in the example of FIG. 7, the number of execution cycles of all instructions is six. Hereinafter, the details of the common expression deletion processing (6) and the instruction scheduling processing (2) shown in FIG. 4 will be described. In the explanation, the intermediate language of FIG. 5 is used as an input example, and output examples of various tables are sequentially shown. Therefore,
First, a configuration example of various tables will be described, and then a processing procedure will be described. Hereinafter, a configuration example will be described in the order of the common expression information table 4 and the scheduling information table 5 shown in FIG.

【0024】図8は、図5の例に対して求めた共通式集
合テーブル41の構成例を示す図である。共通式集合テ
ーブル41は、プログラム中に出現する共通式ごとに、
エントリが作成される。各共通式には、一意な共通式集
合番号が付与されており、その共通式集合番号により各
エントリがアクセス可能となっている。各エントリは、
共通式番号欄411、演算式欄412、共通式集合欄4
13、演算結果定義欄414、演算結果変数欄415で
構成される。共通式番号欄411には、共通式集合テー
ブルのエントリ番号、演算式欄412には、対応する共
通式の演算式(代入の右辺)が格納される。また、共通
式集合欄413は、認識した共通式集合の情報が、命令
ノードテーブル42のエントリ番号の形式で格納され
る。この共通式集合の各要素である命令ノードテーブル
エントリの演算式欄424が共通の演算となっている。
演算結果定義欄414は、共通演算の演算を行う共通演
算結果定義命令を命令ノードテーブルのエントリ番号の
形式で保持している。結果変数名称欄415は、共通式
削除を行う場合の共通式定義変数(テンポラリ変数)名
称が格納される。この共通式定義変数は、共通式集合の
1つに対してユニークな名称が与えられるもので、図9
に示す共通式削除中間語変換426の結果を明示するた
めに設けられている。
FIG. 8 is a diagram showing a configuration example of the common expression set table 41 obtained for the example of FIG. The common expression set table 41 contains, for each common expression appearing in the program,
An entry is created. Each common expression is assigned a unique common expression set number, and each entry is accessible by the common expression set number. Each entry is
Common expression number column 411, arithmetic expression column 412, common expression set column 4
13, an operation result definition column 414, and an operation result variable column 415. The common expression number column 411 stores the entry number of the common expression set table, and the operation expression column 412 stores the operation expression of the corresponding common expression (the right side of the assignment). The common expression set column 413 stores information on the recognized common expression set in the form of an entry number of the instruction node table 42. The operation expression column 424 of the instruction node table entry which is each element of the common expression set is a common operation.
The operation result definition column 414 holds a common operation result definition instruction for performing the operation of the common operation in the form of an entry number of the instruction node table. The result variable name column 415 stores the name of a common expression definition variable (temporary variable) when the common expression is deleted. This common expression definition variable is given a unique name for one of the common expression sets.
Is provided to clarify the result of the common expression deletion intermediate language conversion 426 shown in FIG.

【0025】図9は、図5の例に対して求めた命令ノー
ドテーブル42の構成例を示す図である。命令ノードテ
ーブル42は、中間語3の各ノードの情報を説明するた
めにテーブル形式で表したものである。各エントリは、
中間語の個々のノードの情報をテーブルに変換したもの
であり、相互にアクセス可能である。各エントリは、命
令番号欄421、出現行番号欄422、定義変数欄42
3、演算式欄424、所属共通式番号欄425、共通式
削除中間語変換欄426で構成される。命令番号欄42
1には、命令ノードテーブル42のエントリ番号が格納
され、出現行番号欄422には、当該エントリに対応す
る中間語ノードの出現位置が行番号の形式で格納され
る。出現行番号欄422の中間語位置により、対応する
中間語ノードの全ての情報を得ることができる。例え
ば、共通式変数定義命令の挿入や共通式出現削除変換等
も可能である。本実施例では、図7で示したように、中
間語の行番号の形式で示してある。
FIG. 9 is a diagram showing a configuration example of the instruction node table 42 obtained for the example of FIG. The instruction node table 42 is represented in a table format for explaining information of each node of the intermediate language 3. Each entry is
The information of each node of the intermediate language is converted into a table, and is mutually accessible. Each entry has an instruction number column 421, an appearance line number column 422, a definition variable column 42
3, an arithmetic expression column 424, a belonging common expression number column 425, and a common expression deleted intermediate language conversion column 426. Instruction number column 42
1 stores the entry number of the instruction node table 42, and the appearance line number column 422 stores the appearance position of the intermediate language node corresponding to the entry in the form of a line number. All information on the corresponding intermediate language node can be obtained from the intermediate language position in the appearance line number column 422. For example, insertion of a common expression variable definition instruction, common expression occurrence deletion conversion, and the like are also possible. In the present embodiment, as shown in FIG. 7, it is shown in the form of an intermediate language line number.

【0026】定義変数欄423、演算式欄424には、
(代入演算である場合)それぞれ対応する中間語ノード
の左辺の変数(命令のデスティネーション)、右辺の演
算式(命令の演算及びそのオペランド)が格納される。
所属共通式番号欄425は、所属する共通式集合を示す
共通式集合テーブル41のエントリ番号が格納される。
共通式削除中間語変換欄426には、共通式削除変換を
行う場合の中間語変換内容が格納される。例えば、共通
式定義変数の挿入を行う場合には「定義挿入」、共通式
使用点での共通式使用の共通式変数への置換の場合に
は、「使用置換」といった情報が格納される。尚、空欄
の場合は、共通式削除が行われず、中間語変換も行われ
ないことを表している。
In the definition variable column 423 and the arithmetic expression column 424,
(In the case of an assignment operation) The variable on the left side (destination of the instruction) and the operation expression on the right side (the operation of the instruction and its operand) of the corresponding intermediate language node are stored.
The belonging common expression number column 425 stores the entry number of the common expression set table 41 indicating the belonging common expression set.
The common expression deleted intermediate language conversion column 426 stores intermediate language conversion contents when performing common expression deleted conversion. For example, information such as "definition insertion" is stored when a common expression definition variable is inserted, and "use replacement" is stored when a common expression is replaced with a common expression variable at a common expression usage point. Note that a blank column indicates that no common expression is deleted and no intermediate language conversion is performed.

【0027】図10及び図11は、図8及び図9の共通
式情報テーブルに従って、図5で示した中間語に対して
共通式削除中間語変換を行った後の、共通式テーブル4
1、命令ノードテーブル42の例を示す図である。共通
式削除中間語変換を行った後の状態を示しているだけ
で、テーブル構成は図8及び図9と同様である。図12
は、図4における命令配置位置決定処理(21)が、中
間語ノードの命令配置位置決定の際に使用する、命令配
置テーブル51の構成例を示す図である。各エントリ
は、命令ノードと1対1に対応しており、各エントリの
内容は、図6で示した中間語を命令配置する場合の内容
を表している。各エントリは、命令番号欄511、出現
行番号欄512、定義変数欄513、演算式欄514、
所属共通式番号欄515、共通式削除中間語変換欄51
6、配置クラスタ番号欄517で構成される。511か
ら516の各欄は、図11のエントリ番号を示せば得ら
れる情報を、説明の簡略化のため設けてある。その内容
は、図11の対応する欄と同じなので、説明は省略す
る。配置クラスタ番号欄517は、当該エントリに対応
する命令ノードが配置されたクラスタ番号を格納する。
以上で、本実施例で用いる各種テーブル構成の説明を終
る。
FIGS. 10 and 11 show the common expression table 4 after performing the common expression deletion intermediate word conversion on the intermediate words shown in FIG. 5 in accordance with the common expression information tables of FIGS. 8 and 9.
1 is a diagram showing an example of an instruction node table 42. The table configuration is the same as that in FIGS. 8 and 9, only showing the state after the common expression-removed intermediate language conversion. FIG.
FIG. 5 is a diagram illustrating a configuration example of an instruction arrangement table 51 used by the instruction arrangement position determination process (21) in FIG. 4 when determining an instruction arrangement position of an intermediate language node. Each entry has a one-to-one correspondence with an instruction node, and the content of each entry represents the content when the intermediate language shown in FIG. Each entry includes an instruction number column 511, an appearance line number column 512, a definition variable column 513, an arithmetic expression column 514,
Affiliation common expression number column 515, common expression deletion intermediate language conversion column 51
6, an arrangement cluster number column 517. In columns 511 to 516, information obtained by indicating the entry numbers in FIG. 11 is provided for simplification of description. The contents are the same as the corresponding columns in FIG. The allocation cluster number column 517 stores the cluster number where the instruction node corresponding to the entry is allocated.
This concludes the description of various table configurations used in this embodiment.

【0028】以下、これらのテーブルを生成/参照する
各種処理の説明をフローに従って順に行なう。図13
は、図4における共通式登録処理(61)のフローチャ
ートである。共通式登録処理(61)は、中間語3を逐
次走査し、共通式を検出したならば、その共通式情報を
収集・登録した共通式情報テーブル4を生成する。以
下、その手順を説明する。先ず、共通式テーブルエント
リ番号ceiを0で初期化する(ステップ1301)。
次に、未処理中間語ノードがあるか否かを判定し(ステ
ップ1302)、未処理中間語ノードがなくなるまで、
ステップ1303以下の処理を行なう。未処理中間語ノ
ードNがある場合には、先ず、命令ノードテーブル42
に新規エントリeeを確保し、中間語ノードNの情報を
格納する(ステップ1303)。次に、Nの共通式候補
(=eeの演算式欄424の内容)をcceとする(ス
テップ1304)。
Hereinafter, various processes for generating / referencing these tables will be sequentially described in accordance with the flow. FIG.
5 is a flowchart of a common-type registration process (61) in FIG. The common expression registration process (61) sequentially scans the intermediate language 3 and, if a common expression is detected, generates a common expression information table 4 in which the common expression information is collected and registered. Hereinafter, the procedure will be described. First, the common expression table entry number cei is initialized with 0 (step 1301).
Next, it is determined whether or not there is an unprocessed intermediate language node (step 1302).
Step 1303 and subsequent steps are performed. If there is an unprocessed intermediate language node N, first, the instruction node table 42
, A new entry ee is secured, and information on the intermediate language node N is stored (step 1303). Next, N common expression candidates (contents of the operation expression column 424 of = ee) are set as cce (step 1304).

【0029】尚、中間語の形式によってはNに対して複
数の共通式候補cceが考えられるが、本実施例では一
意に定まるものとする(本質的違いはないので)。次
に、cceが共通式テーブル41に既登録か否かを調べ
る(ステップ1305)。この判定は、共通式テーブル
41に、演算式欄412が共通式候補cceと一致する
エントリがあるかどうかで行える。既登録であった場合
には、共通式テーブルの該当エントリをceとし(ステ
ップ1306)、 ceの共通式集合欄にeeを追加す
ることで、 eeを共通式要素集合に登録する(ステッ
プ1307)。一方、cceが共通式テーブルに未登録
の場合には、命令ノードテーブル42に既登録か否かを
調べる(ステップ1308)。この判定は、命令ノード
テーブル42に、演算式欄424が共通式候補cceと
一致するエントリがあるかどうかで行える。一致する場
合には、共通式集合テーブルのエントリ番号ceiをイ
ンクリメントし、cceを共通式テーブル41に登録し
た後(ステップ1309)、ステップ1302に戻って
次の中間語ノードの処理を行う。cceが命令ノードテ
ーブルに未登録の場合には、次の中間語ノードの処理を
行う。全ての中間語ノードを処理し終わった時点で(ス
テップ1302)、処理を終了する。
Note that a plurality of common expression candidates cce can be considered for N depending on the format of the intermediate language. However, in this embodiment, they are uniquely determined (because there is no essential difference). Next, it is checked whether or not cce is already registered in the common expression table 41 (step 1305). This determination can be made based on whether or not the common expression table 41 has an entry in the arithmetic expression column 412 that matches the common expression candidate cce. If it is already registered, the corresponding entry of the common expression table is set to ce (step 1306), and ee is added to the common expression set column of ce, thereby registering ee in the common expression element set (step 1307). . On the other hand, if cce is not registered in the common expression table, it is checked whether or not cce is already registered in the instruction node table 42 (step 1308). This determination can be made based on whether or not there is an entry in the instruction node table 42 in which the operation expression column 424 matches the common expression candidate cce. If they match, the entry number cei of the common expression set table is incremented, cce is registered in the common expression table 41 (step 1309), and the process returns to step 1302 to process the next intermediate language node. If cce is not registered in the instruction node table, the process for the next intermediate language node is performed. When all the intermediate language nodes have been processed (step 1302), the processing ends.

【0030】なお、図8および図9は、図5で示された
中間語に対し上記の処理を行なった結果を示す共通式情
報テーブル4の例を示している。例えば、エントリ42
71、エントリ4272は、図5の002行及び、00
3行の演算の情報が格納されている。この2つの演算
は、図8のエントリ416で示される共通式集合の構成
要素となっており、共通式集合欄413に共通式として
登録されている。
FIGS. 8 and 9 show examples of the common expression information table 4 showing the result of performing the above processing on the intermediate language shown in FIG. For example, entry 42
71 and entry 4272 are the 002 line and the 00
Information of three rows of operations is stored. These two operations are constituent elements of the common expression set indicated by the entry 416 in FIG. 8, and are registered in the common expression set column 413 as common expressions.

【0031】図14は、共通式削除中間語変換処理62
のフローチャートである。共通式削除中間語変換処理6
2は、共通式情報テーブル4を逐次走査し、共通式削除
が可能な共通式集合に対し、対応する中間語命令群を共
通式削除前中間語31から共通式削除後中間語32へと
変換する。以下、その手順を説明する。先ず、未処理共
通式集合エントリuceがあるか否かを判定し(ステップ
1401)、未処理共通式集合がなくなるまで、ステッ
プ1402以下の処理を行なう。未処理共通式集合uce
がある場合には、先ず、共通式演算結果定義命令cer
を生成する。共通式演算結果定義命令cerの生成で
は、共通式演算結果変数tを生成した後(ステップ14
02)、共通式演算結果定義命令cerを生成する(ステ
ップ1403)。次に、定義挿入位置dipの算出した
後、共通式演算結果定義命令cerを中間語に挿入する
(ステップ1404)。そして、命令ノードテーブル4
2の新規テーブルエントリnteを変換種別を「定義挿
入」として作成し、cerのノード情報を格納する(ステ
ップ1405)。
FIG. 14 shows a common expression deleted intermediate language conversion process 62.
It is a flowchart of FIG. Common expression deletion intermediate language conversion processing 6
2 sequentially scans the common expression information table 4 and, for a common expression set capable of common expression deletion, converts the corresponding intermediate language instruction group from the intermediate language 31 before common expression deletion to the intermediate language 32 after common expression deletion. I do. Hereinafter, the procedure will be described. First, it is determined whether or not there is an unprocessed common expression set entry uce (step 1401), and the processing from step 1402 is performed until there is no unprocessed common expression set. Unprocessed common expression set uce
If there is, first, the common expression operation result definition instruction cer
Generate In the generation of the common expression calculation result definition instruction cer, the common expression calculation result variable t is generated (step 14).
02), a common expression calculation result definition instruction cer is generated (step 1403). Next, after calculating the definition insertion position dip, the common expression calculation result definition instruction cer is inserted into the intermediate language (step 1404). Then, the instruction node table 4
A new table entry nte of No. 2 is created with a conversion type of "definition insertion", and the node information of cer is stored (step 1405).

【0032】次に、uceの共通式集合欄の内容をCES
とし(ステップ1406)、CESに未処理共通式集合
要素ucesがあるか否かを判定し(ステップ1407)、
未処理共通式集合要素がなくなるまで、ステップ140
8以下の処理を行う。すなわち、未処理共通式集合要素
ucesがある場合には、先ず、その共通式集合要素が示す
命令ノードテーブルのエントリをECESとする(ステ
ップ1408)。次に、ECESの示す中間語の演算式
を、共通式変数tの使用に置き換えるとともに、ECE
Sの変換種別を「使用置換」とし命令ノードテーブルに
反映させる(ステップ1409)。ステップ1409実
行後は、ステップ1407に戻り、次の共通式集合要素
の処理を行う。尚、定義挿入位置は、共通式集合の要素
の内最初に実行される命令ノードの直前であり、本実施
例では、共通式集合に最初に登録された要素の直前とな
る。また、共通式演算結果変数は、一意に定まる名称の
変数を任意に生成すればよい。
Next, the contents of the common expression set column of uce are expressed as CES
(Step 1406), and it is determined whether or not there is an unprocessed common expression set element uces in the CES (step 1407).
Step 140 until there are no unprocessed common expression set elements
8 and below are performed. That is, the unprocessed common expression set element
If there is uces, first, the entry of the instruction node table indicated by the common expression set element is set as ECES (step 1408). Next, the arithmetic expression of the intermediate language indicated by ECES is replaced with the use of the common expression variable t, and the ECE
The conversion type of S is set to “use replacement” and reflected in the instruction node table (step 1409). After the execution of step 1409, the process returns to step 1407 to process the next common expression set element. The definition insertion position is immediately before the instruction node to be executed first among the elements of the common expression set, and in this embodiment, immediately before the element registered in the common expression set. Further, as the common expression calculation result variable, a variable having a uniquely determined name may be arbitrarily generated.

【0033】なお、図10及び図11は、上記の処理を
行なった結果を示す共通式集合テーブル41と、命令ノ
ードテーブル42の構成例を示している。例えば、図1
0のエントリ417は、図11のエントリ4273、4
274、4275、4276で表される共通式集合に対
する共通式削除の様子を表している。即ち、エントリ4
277が共通式演算結果定義挿入で、エントリ4273
〜エントリ4276が、共通式の使用置換を表してい
る。実際、エントリ4277に対応する中間語は共通式
演算結果定義が挿入されている図6の101行であり、
102行の共通式は、共通式変数tに置き換えられてい
る。また、エントリ4273に対応する中間語である図
6の102行では、共通式の使用置換が行われているこ
とが分かる。尚、以降では、共通式削除変換された中間
語群を共通式関連中間語と呼ぶことにする。図10及び
図11では、共通式削除関連中間語は、エントリ427
3、4274、4275、4276、及びエントリ42
77が相当する。以上で、共通式削除手順の説明を終わ
る。次に、共通式認識型命令スケジューリングの手順を
説明する。
FIGS. 10 and 11 show examples of the configuration of the common expression set table 41 and the instruction node table 42 showing the results of the above processing. For example, FIG.
0 entry 417 is the entry 4273, 4
It shows a state of common expression deletion for a common expression set represented by 274, 4275, and 4276. That is, entry 4
277 is a common expression operation result definition insertion, and entry 4273
Entry 4276 represents a common expression usage replacement. In fact, the intermediate language corresponding to entry 4277 is line 101 in FIG. 6 where the common expression operation result definition is inserted.
The common expression on line 102 has been replaced by a common expression variable t. In addition, in line 102 of FIG. 6, which is an intermediate language corresponding to the entry 4273, it can be seen that the common expression is used and replaced. In the following, the group of intermediate expressions subjected to the common expression deletion conversion will be referred to as common expression-related intermediate words. In FIGS. 10 and 11, the common expression deletion-related intermediate language is the entry 427.
3, 4274, 4275, 4276 and entry 42
77 is equivalent. This concludes the description of the common expression deletion procedure. Next, the procedure of the common type recognition type instruction scheduling will be described.

【0034】図15は、図4に示す共通式認識型命令ス
ケジューリング処理(2)のフローチャートである。共
通式認識型命令スケジューリング処理(2)は、逐次実
行型中間語32を逐次走査し、複数クラスタに対応した
並列実行型中間語33を生成する。尚、命令スケジュー
リングは、全中間語を順にスケジューリングするのでは
なく、特定の手順で中間語をスケジューリング単位に分
割し、そのスケジューリング単位中間語をスケジューリ
ングするのが一般的である。この、命令スケジューリン
グの中間語処理単位は、共通式削除を行う場合の中間語
処理単位とも異なる場合もある。スケジューリング中間
語処理単位をどのようにするかは、本発明においては本
質的ではないので、以降の説明では省略し、単に中間語
を逐次走査して処理する形式とする。
FIG. 15 is a flowchart of the common type recognition type instruction scheduling process (2) shown in FIG. The common expression recognition type instruction scheduling process (2) sequentially scans the sequential execution intermediate language 32 to generate a parallel execution intermediate language 33 corresponding to a plurality of clusters. In general, instruction scheduling does not schedule all intermediate words in order, but divides intermediate words into scheduling units according to a specific procedure, and schedules the intermediate words in the scheduling unit. The intermediate language processing unit of the instruction scheduling may be different from the intermediate language processing unit when the common expression is deleted. How the scheduling intermediate language processing unit is performed is not essential in the present invention, and is omitted in the following description, and the intermediate language is simply scanned sequentially and processed.

【0035】以下、共通式認識型命令スケジューリング
処理(2)の手順を説明する。先ず、スケジュール単位
での相対命令実行サイクル数pを0で初期化する(ステ
ップ1501)。次に、未処理中間語ノードopがあるか
否かを判定し(ステップ1502)、全ての中間語ノー
ドを処理するまでステップ1503以下の処理を反復実
行する。opの処理では、先ず、opのスケジュール情報設
定処理(ステップ1503)を行い、opのスケジュール
情報をスケジュール情報テーブル5に設定する。次に、
現在の配置領域で、opの命令配置が可能か否かを判定し
(ステップ1504)、配置不能な場合は、ステップ1
505でp=p+1として配置領域を広げ、ステップ1
503以降で、再度命令配置を試みる。ステップ150
4で配置可能であった場合は、配置位置決定処理(15
06)に進む。この配置位置決定処理(1506)によ
り、不適と判断された場合も、ステップ1505に進
み、ステップ1503以降の処理を続行する。配置位置
決定処理(1506)で配置位置が決定した場合は、割
当てクラスタACと実行サイクル位置apが決定する。次
に、opのDESTクラスタ決定処理(1507)で演算結果
の転送クラスタを決定した後、命令配置処理(150
8)で、そのスケジュール位置<ap,AC>へ命令を配置
する(配置可能性判定処理(1504)は図16で、配
置位置決定処理(1506)は図17で詳細を説明す
る)。
The procedure of the common type recognition type instruction scheduling process (2) will be described below. First, the relative instruction execution cycle number p for each schedule is initialized to 0 (step 1501). Next, it is determined whether or not there is an unprocessed intermediate language node op (step 1502), and the processing from step 1503 is repeated until all intermediate language nodes are processed. In the process of the op, first, the schedule information setting process of the op is performed (step 1503), and the schedule information of the op is set in the schedule information table 5. next,
It is determined whether or not the instruction placement of the op is possible in the current placement area (step 1504).
In step 505, the arrangement area is expanded by setting p = p + 1, and step 1
After 503, instruction placement is tried again. Step 150
4, the arrangement position determination processing (15)
Go to 06). Even if it is determined by this arrangement position determination processing (1506) that it is inappropriate, the process proceeds to step 1505, and the processing after step 1503 is continued. When the arrangement position is determined in the arrangement position determination processing (1506), the allocation cluster AC and the execution cycle position ap are determined. Next, after determining the transfer cluster of the operation result in the DEST cluster determination processing of op (1507), the instruction placement processing (150
In step 8), the instruction is arranged at the schedule position <ap, AC> (the arrangement possibility determination processing (1504) will be described in detail with reference to FIG. 16 and the arrangement position determination processing (1506) will be described in detail with reference to FIG. 17).

【0036】尚、スケジュール処理は、専用のスケジュ
ール表を構成し、そのスケジュール表上でスケジュール
領域の設定や、配置可能性を判定するするのが一般的で
ある。しかし、本発明では、その詳細は本質的ではな
い。本発明の説明にあたっては、並列中間語表現で十分
であるので、スケジュール状況の説明は並列中間語の形
式で示す。また、未処理クラスタの存在判定処理では、
クラスタを優先度でソートし、優先度の高い順にクラス
タを選択することも可能である。しかし、これら従来技
術におけるクラスタ優先度の設定は、現在のスケジュー
リング状況や命令のオペランドの性質等のスケジュール
処理内の情報から判定するものである。本発明は、共通
式削除情報をクラスタ優先情報として用いるものである
が、これら従来技術におけるクラスタ優先情報は、本発
明とは直接関係がない。これらの優先度を設定し、優先
度の高い順にクラスタを選択してもよいが、本質的な関
係はない。未処理クラスタの選択は、優先度順でも、単
なるクラスタ番号順でも構わない。そこで、本実施例で
は、特にこれら従来技術におけるクラスタ優先度は設定
しないことにする。
In the schedule processing, it is general to configure a dedicated schedule table and determine the setting of a schedule area and the possibility of arrangement on the schedule table. However, in the present invention, the details are not essential. In the description of the present invention, since the parallel intermediate language expression is sufficient, the description of the schedule situation is shown in the form of the parallel intermediate language. In the process of determining the existence of an unprocessed cluster,
It is also possible to sort the clusters by priority and select the clusters in descending order of priority. However, the setting of the cluster priorities in these prior arts is determined from information in the schedule processing such as the current scheduling status and the nature of the operand of the instruction. Although the present invention uses the common type deletion information as the cluster priority information, these prior art cluster priority information is not directly related to the present invention. These priorities may be set, and clusters may be selected in descending order of priority, but there is no essential relationship. The selection of unprocessed clusters may be performed in the order of priority or simply in the order of cluster numbers. Therefore, in this embodiment, particularly, the cluster priorities in these prior arts are not set.

【0037】図16は、図15のステップ1504で示
した配置可能性判定処理のフローチャートである。先
ず、未処理状態クラスタCが存在するかどうかを判定し
(ステップ1601)、未処理クラスタがなくなるま
で、ステップ1602以下の処理を行なう。未処理クラ
スタがある場合には、opが現在の配置領域に配置可能か
か否かを判定する(ステップ1602)。配置不能な場
合は、ステップ1601に進み、次のクラスタでの配置
を試みる。ステップ1602の判定がYesのとき、ス
テップ1603で配置可能と判定し、処理を終了する。
ステップ1602の判定がNoのとき全てのクラスタで配
置不能であるので、ステップ1604で配置不能と判定
し、処理を終了する。
FIG. 16 is a flowchart of the placement possibility determination processing shown in step 1504 of FIG. First, it is determined whether or not an unprocessed cluster C exists (step 1601), and the processes from step 1602 are performed until there is no unprocessed cluster. If there is an unprocessed cluster, it is determined whether or not the op can be arranged in the current arrangement area (step 1602). If placement is not possible, the process proceeds to step 1601 to try placement in the next cluster. If the determination in step 1602 is Yes, it is determined in step 1603 that placement is possible, and the process ends.
When the determination in step 1602 is No, placement is not possible in all clusters, so it is determined in step 1604 that placement is not possible, and the process ends.

【0038】図17は、図15のステップ1506で示
した命令配置位置決定処理(21)のフローチャートで
ある。命令配置位置決定処理(21)は、与えられた命
令opの、与えられた配置領域〈p,C〉での配置位置
の決定を行う。以下、その手順を説明する。先ず、op
の命令配置テーブルエントリをEとする(ステップ17
01)。次に、opが共通式削除関連中間語ノードであ
るか否かを判定する(1702)。この判定は、Eの所
属共通式番号欄515から容易に判定できる。共通式削
除関連中間語ノードである場合には、Eの所属共通式欄
515から共通式テーブルエントリCEを取得し(ステ
ップ1703)、その共通式集合欄から共通式集合CE
Sを取得する(ス扱ップ1704)。
FIG. 17 is a flowchart of the instruction arrangement position determination processing (21) shown in step 1506 of FIG. The instruction arrangement position determination process (21) determines an arrangement position of a given instruction op in a given arrangement area <p, C>. Hereinafter, the procedure will be described. First, op
Is set to E (step 17).
01). Next, it is determined whether or not op is a common expression deletion related intermediate language node (1702). This determination can be made easily from the belonging common expression number column 515 of E. If it is a common expression deletion-related intermediate language node, the common expression table entry CE is obtained from the belonging common expression column 515 of E (step 1703), and the common expression set CE is obtained from the common expression set column.
S is obtained (step 1704).

【0039】次に、CESに未処理集合要素ceseがある
かどうかを判定し(ステップ1705)、存在する場合
には、ceseが配置済みか否かを調べる(ステップ170
6)。この配置済みか否かの判定は、命令配置テーブル
51の配置クラスタ番号欄が空白かどうかで容易に判定
できる。ceseが配置済みであった場合は、その配置クラ
スタをcls(ステップ1707)とし、clsが配置判定ク
ラスタCと一致するか否かを調べる(ステップ170
8)。一致した場合は、Cへの配置を不適と判断し、C
に配置しない(ステップ1709)ことにして、処理を
終了する。ステップ1705で全ての既配置命令の配置
クラスタとの比較が終了した場合には、Eの配置クラス
タ欄にCを記録した後(ステップ1710)、Cに配置
することにして(ステップ1711)、処理を終了す
る。ステップ1702で共通式削除関連中間語ノードで
はないと判定されたときには、割当てクラスタ判定結果
を「適」として(ステップ1711)、処理を終了す
る。
Next, it is determined whether or not there is an unprocessed set element cese in the CES (step 1705). If so, it is checked whether or not the cese has been arranged (step 170).
6). This determination as to whether or not the allocation has been completed can be easily made based on whether or not the allocation cluster number column of the instruction allocation table 51 is blank. If cese has been arranged, the arrangement cluster is set to cls (step 1707), and it is checked whether or not cls matches the arrangement determination cluster C (step 170).
8). If they match, it is determined that the arrangement on C is inappropriate,
(Step 1709), and the process ends. If the comparison of all the placed instructions with the placed clusters is completed in step 1705, C is recorded in the placed cluster column of E (step 1710), and then placed in C (step 1711). To end. If it is determined in step 1702 that the node is not a common expression deletion-related intermediate language node, the assignment cluster determination result is determined as “suitable” (step 1711), and the process ends.

【0040】なお、図12は、図6で示された中間語3
2と、図10、図11で示された共通式情報テーブルを
入力とし、図13から図17までの処理を行った結果を
示す命令配置テーブルの構成例となっている。図12の
エントリ5181から5184は、図11に示された命
令ノードテーブルの共通式4273から4276の命令
配置状況を示している。これらのエントリ5181から
5184の配置クラスタ番号欄は、全て異なっているこ
とが分る。また、図7は、図6で示された中間語32
と、図10,図11で示された共通式情報テーブルを入
力とし、図13から図17までの処理を行なった結果を
示す中間語53の例となっている。この中間語例でも、
共通式として認識された中間語ノードが、全て異なるク
ラスタに配置されていることがわかる。以上により本実
施例の説明を終了する。次に、本発明の実施例の効果に
ついて、従来の技術との比較のために、先ず従来の技術
による命令スケジューリング方法について説明する。
FIG. 12 shows the intermediate language 3 shown in FIG.
2 and the common expression information table shown in FIGS. 10 and 11 as inputs, and is an example of the configuration of an instruction arrangement table showing the results of performing the processing from FIG. 13 to FIG. Entries 5181 to 5184 in FIG. 12 show the instruction arrangement statuses of the common expressions 4273 to 4276 in the instruction node table shown in FIG. It can be seen that the arrangement cluster number columns of these entries 5181 to 5184 are all different. FIG. 7 shows the intermediate language 32 shown in FIG.
And the common expression information table shown in FIG. 10 and FIG. 11 as input, and is an example of the intermediate language 53 showing the result of performing the processing from FIG. 13 to FIG. In this intermediate example,
It can be seen that the intermediate language nodes recognized as common expressions are all arranged in different clusters. This concludes the description of the present embodiment. Next, the effect of the embodiment of the present invention will be described first in order to compare with the conventional technique.

【0041】図18は、従来技術の命令スケジューリン
グ処理手順を示すフローチャートである。図18は、本
発明の一実施例である図15の処理の従来技術を示す手
順であって、ここでは、図15のステップ1501と1
502は当然の処理として省略されている。図15のス
テップ1503が図18のステップ0801に該当す
る。先ず、中間語opのスケジュール情報を設定し(ス
テップ1801)、未処理クラスタがあるか否かを判定
する(ステップ1802)。未処理クラスタがある場合
には、pをインクリメントし(ステップ1803)、配
置領域を広げた後、ステップ1801以下でスケジュー
リング処理を続行する。ステップ1802で未処理クラ
スタCが存在する場合には、現在の配置領域で配置可能
か否かを判定し(ステップ1804)、不可能な場合に
はステップ1802に進んで処理を続行する。ステップ
1804で配置可能と判定された場合には、その配置位
置に決定し(ステップ1805)、opのDESTクラ
スタを配置クラスタCとして(ステップ1806)、処
理を終了する。
FIG. 18 is a flowchart showing the procedure of the conventional instruction scheduling process. FIG. 18 shows a conventional procedure of the processing of FIG. 15 according to one embodiment of the present invention. Here, steps 1501 and 1 in FIG.
Step 502 is omitted as a matter of course. Step 1503 in FIG. 15 corresponds to step 0801 in FIG. First, schedule information of the intermediate language op is set (step 1801), and it is determined whether or not there is an unprocessed cluster (step 1802). If there is an unprocessed cluster, p is incremented (step 1803), and after expanding the arrangement area, the scheduling process is continued from step 1801 onward. If there is an unprocessed cluster C in step 1802, it is determined whether or not it can be arranged in the current arrangement area (step 1804). If not, the process proceeds to step 1802 to continue the processing. If it is determined in step 1804 that the DEST cluster can be arranged (step 1805), the op-position DEST cluster is set as the arrangement cluster C (step 1806), and the process ends.

【0042】図19は、図18で示した従来技術におけ
る命令スケジューリング処理の結果を示す中間語の図で
ある。この命令スケジューリング結果では、実行サイク
ル数が9であるが、図7で示した本発明の実施例のスケ
ジューリング結果では、実行サイクル数は6サイクルで
あることがわかる。本実施例によれば、共通式削除情報
を用いた命令スケジューリングにより、実行命令の並列
度の向上が可能となり、オブジェクトプログラムの処理
性能の向上を図ることができる。
FIG. 19 is an intermediate language diagram showing the result of the instruction scheduling process in the prior art shown in FIG. Although the number of execution cycles is 9 in the instruction scheduling result, the number of execution cycles is 6 in the scheduling result of the embodiment of the present invention shown in FIG. According to the present embodiment, the parallelism of the execution instructions can be improved by the instruction scheduling using the common expression deletion information, and the processing performance of the object program can be improved.

【0043】(第2の実施例)次に、本発明の第2の実
施例について説明する。第2の実施例では、第1の実施
例の場合と比較して、コンパイラのターゲットアーキテ
クチャが多少異なる。すなわち、命令のデスティネーシ
ョンで指定するDESTクラスタの指定は、全てのクラ
スタ同一の演算結果を転送することができるもので、c.
a = a+bのように指定する。左辺の「c.a」は、右辺の
演算「a+b」の演算結果cが、全クラスタに転送される
ことを示している。このDESTクラスタの全クラスタ
領域指定は、プログラム全体で頻繁に使われると予想さ
れる変数(以下、常用変数と呼ぶ)のに対して指定する
のが一般的である。常用変数としては、例えば、関数の
引数や、配列の先頭アドレス等、変数の役割から判断さ
れて選択されるのが一般的である。尚、この第2実施例
の処理の大部分とテーブル構成等は、第1の実施例と同
様であるため、以下では概略のみを説明する。
(Second Embodiment) Next, a second embodiment of the present invention will be described. In the second embodiment, the target architecture of the compiler is slightly different from that in the first embodiment. That is, the designation of the DEST cluster designated by the instruction destination is such that the same operation result can be transferred to all clusters, and c.
Specify as a = a + b. “Ca” on the left side indicates that the operation result c of the operation “a + b” on the right side is transferred to all clusters. In general, the entire cluster area of the DEST cluster is specified for a variable that is expected to be frequently used in the entire program (hereinafter, referred to as a common variable). The common variable is generally selected based on the role of the variable, such as the argument of a function or the head address of an array. Note that most of the processing in the second embodiment, the table configuration, and the like are the same as those in the first embodiment, and therefore, only the outline will be described below.

【0044】図20は、本発明の第2の実施例である共
通式変数の全クラスタターゲット指定する場合の図15
のステップ1507のDESTクラスタ決定処理の手順
を示すフローチャートである。先ず、opが共通式削除
関連中間語であるか否かを判定し(ステップ200
1)、そうであった場合には、ステップ2002に進
み、opが共通式演算結果定義命令か否かを判定する
(ステップ2002)。この判定は、命令配置テーブル
51の共通式削除中間語変換欄516を参照することに
より容易に行うことができる。opが共通式演算結果定
義命令であった場合には、opのDESTクラスタを全
域クラスタとし(ステップ2003)、処理を終了す
る。ステップ2002でNoと判定されたときには、ス
テップ2004以下で、通常のDESTクラスタ設定処
理(従来技術と同等)を行う。すなわち、opのDES
T変数をDとし(ステップ2004)、Dが常用変数か
否かを判定し(ステップ2005)、常用変数のときに
は、DESTクラスタを全域クラスタとする(ステップ
2003)。また、常用変数でないときには、DEST
クラスタをopの配置クラスタとして(ステップ200
6)、処理を終了する。
FIG. 20 shows a second embodiment of the present invention in which all cluster targets of common expression variables are designated.
10 is a flowchart showing the procedure of DEST cluster determination processing in step 1507 of FIG. First, it is determined whether or not op is a common expression deletion related intermediate language (step 200).
1) If it is, the process proceeds to step 2002, and it is determined whether or not op is a common expression calculation result definition instruction (step 2002). This determination can be easily made by referring to the common expression deleted intermediate language conversion column 516 of the instruction arrangement table 51. If op is a common expression operation result definition instruction, the DEST cluster of op is set as the entire area cluster (step 2003), and the process ends. When No is determined in step 2002, normal DEST cluster setting processing (equivalent to the prior art) is performed in step 2004 and thereafter. That is, DES of op
The T variable is set to D (step 2004), and it is determined whether or not D is a common variable (step 2005). If D is a common variable, the DEST cluster is set to an entire cluster (step 2003). If it is not a common variable, DEST
Let the cluster be an op placement cluster (step 200
6), end the process.

【0045】図21は、本発明の第2の実施例を示す共
通式変数の全クラスタターゲット指定する場合のスケジ
ューリング結果を示す命令スケジューリング後中間語の
例を示す図である。なお、bが関数引数であり、常用変
数と仮定した。図21の処理サイクル数は5サイクルで
ある。
FIG. 21 is a diagram showing an example of an intermediate language after instruction scheduling showing a scheduling result when all cluster targets of the common expression variables are designated according to the second embodiment of the present invention. It is assumed that b is a function argument and is a common variable. The number of processing cycles in FIG. 21 is five.

【0046】図22は、従来技術による命令スケジュー
リング手順を示すフローチャートであって、本発明の第
2の実施例と同一のアーキテクチャにおける従来の命令
スケジューリング手順を示している。なお、図20のス
テップ2004以下と同じであるため、処理手順の説明
は省略する。図23は、従来技術による命令スケジュー
リング結果を示す命令スケジューリング後中間語の例を
示す図であって、本発明の第2の実施例と同一アーキテ
クチャにおける従来の命令スケジューリング手順を示し
ている。DESTクラスタの全域クラスタ指定は、引数
と仮定したbに対してのみ行われている。図23の実行
サイクル数は9サイクルであり、図21の場合よりも遅
いことが分かる。本実施例においては、共通式削除情報
を用いたDESTクラスタ決定処理により、実行命令の
並列度の向上が図れ、オブジェクトプログラムの処理性
能の向上に寄与することができる。
FIG. 22 is a flowchart showing a conventional instruction scheduling procedure, and shows a conventional instruction scheduling procedure in the same architecture as the second embodiment of the present invention. Note that since the processing is the same as step 2004 and subsequent steps in FIG. 20, the description of the processing procedure is omitted. FIG. 23 is a diagram showing an example of an intermediate language after instruction scheduling showing the result of instruction scheduling according to the prior art, and shows a conventional instruction scheduling procedure in the same architecture as the second embodiment of the present invention. The whole-area cluster designation of the DEST cluster is performed only for b as an argument. It can be seen that the number of execution cycles in FIG. 23 is nine, which is later than the case in FIG. In the present embodiment, the DEST cluster determination processing using the common expression deletion information can improve the degree of parallelism of the execution instructions, and can contribute to the improvement in the processing performance of the object program.

【0047】[0047]

【発明の効果】以上説明したように、本発明によれば、
コンパイラは共通式削除の情報を用いた命令スケジュー
リングを行うことができ、この共通式削除の情報は命令
スケジューリング処理に有用な情報であるため、処理性
能の向上が図れる。特に、クラスタ構成アーキテクチャ
をターゲットとするコンパイラにおいては、命令のクラ
スタ配置や演算結果の転送先クラスタ指定において、よ
り効率的な命令スケジューリングが可能となるため、オ
ブジェクトプログラムの処理性能の向上に寄与すること
ができる。
As described above, according to the present invention,
The compiler can perform instruction scheduling using the information on common expression deletion. Since this information on common expression deletion is information useful for instruction scheduling processing, the processing performance can be improved. In particular, compilers targeting a cluster configuration architecture can contribute to improving the processing performance of object programs because more efficient instruction scheduling is possible when arranging instruction clusters and specifying destination clusters for operation results. Can be.

【図面の簡単な説明】[Brief description of the drawings]

【図1】本発明を実施するコンパイラが稼働する計算機
システムの構成図である。
FIG. 1 is a configuration diagram of a computer system on which a compiler embodying the present invention operates.

【図2】本発明を実施するコンパイラの処理手順を示す
フローチャートである。
FIG. 2 is a flowchart illustrating a processing procedure of a compiler that implements the present invention.

【図3】本発明の第1の実施例を示すコンパイラの共通
式削除処理(6)と命令スケジューリング処理(2)の
フローチャートである。
FIG. 3 is a flowchart of a compiler common expression deletion process (6) and an instruction scheduling process (2) according to the first embodiment of the present invention.

【図4】本発明におけるコンパイラの共通式削除処理
(6)と命令スケジューリング処理(2)の機能構成図
である。
FIG. 4 is a functional configuration diagram of a common expression deletion process (6) and an instruction scheduling process (2) of the compiler according to the present invention.

【図5】本発明による中間語の例(共通式削除前の中間
語31の構成例)を示す図である。
FIG. 5 is a diagram showing an example of an intermediate language according to the present invention (a configuration example of the intermediate language 31 before deleting a common expression).

【図6】本発明による中間語の例(共通式削除後の中間
語32の構成例)を示す図である。
FIG. 6 is a diagram showing an example of an intermediate language according to the present invention (a configuration example of the intermediate language 32 after removing a common expression).

【図7】本発明による中間語の例(命令スケジューリン
グ後の中間語33の例)を示す図である。
FIG. 7 is a diagram showing an example of an intermediate language (an example of an intermediate language 33 after instruction scheduling) according to the present invention.

【図8】図4における共通式テーブル41の構成例を示
す図である。
FIG. 8 is a diagram showing a configuration example of a common expression table 41 in FIG. 4;

【図9】図4における命令ノードテーブル42の構成例
を示す図である。
9 is a diagram showing a configuration example of an instruction node table 42 in FIG.

【図10】図4における共通式削除後の共通式テーブル
41の例を示す図である。
FIG. 10 is a diagram showing an example of a common expression table 41 after common expression deletion in FIG. 4;

【図11】図4における共通式削除後の命令ノードテー
ブルの例を示す図である。
11 is a diagram illustrating an example of an instruction node table after a common expression is deleted in FIG. 4;

【図12】図4における命令配置テーブル51の構成例
を示す図である。
FIG. 12 is a diagram showing a configuration example of an instruction arrangement table 51 in FIG. 4;

【図13】図4における共通式登録処理(61)のフロ
ーチャートである。
FIG. 13 is a flowchart of a common expression registration process (61) in FIG.

【図14】図4における共通式削除中間語変換処理(6
2)のフローチャートである。
FIG. 14 is a diagram illustrating a common expression deleted intermediate language conversion process (6) in FIG.
It is a flowchart of 2).

【図15】図4における命令スケジューリング処理
(2)のフローチャートである。
FIG. 15 is a flowchart of an instruction scheduling process (2) in FIG. 4;

【図16】図4における命令配置可能性判定処理のフロ
ーチャートである。
FIG. 16 is a flowchart of an instruction placement possibility determination process in FIG. 4;

【図17】図4における命令配置位置決定処理(21)
のフローチャートである。
FIG. 17 is an instruction arrangement position determination process (21) in FIG. 4;
It is a flowchart of FIG.

【図18】従来技術における命令配置位置決定処理のフ
ローチャートである。
FIG. 18 is a flowchart of an instruction arrangement position determination process in the related art.

【図19】従来技術におけるスケジューリング結果を示
す中間語の例を示す図である。
FIG. 19 is a diagram showing an example of an intermediate language indicating a scheduling result in the related art.

【図20】本発明の第2の実施例を示すDESTクラス
タ決定処理(22)のフローチャートである。
FIG. 20 is a flowchart of a DEST cluster determination process (22) showing the second embodiment of the present invention.

【図21】本発明の第2の実施例を示すスケジューリン
グ結果を示す中間語33を示す図である。
FIG. 21 is a diagram illustrating an intermediate language 33 indicating a scheduling result according to the second embodiment of the present invention.

【図22】従来技術のDESTクラスタ決定処理のフロ
ーチャートである。
FIG. 22 is a flowchart of a DEST cluster determination process of the related art.

【図23】本発明の第2の実施例を示す中間語33の構
成図である。
FIG. 23 is a configuration diagram of an intermediate language 33 showing a second embodiment of the present invention.

【符号の説明】[Explanation of symbols]

101…CPU、102…ディスプレイ装置、103…
キーボード、104…主記憶装置、105…外部記憶装
置、106…ソースプログラム、107…オブジェクト
プログラム、108…コンパイラ、3…中間語、4…共
通式情報テーブル、5…スケジューリング情報テーブ
ル、31…共通式削除前中間語、32…共通式削除後中
間語、33…スケジューリング後中間語、41…共通式
テーブル、42…命令ノードテーブル、51…命令配置
テーブル。
101 CPU, 102 display device, 103
Keyboard, 104 main storage device, 105 external storage device, 106 source program, 107 object program, 108 compiler, 3 intermediate language, 4 common expression information table, 5 scheduling information table, 31 common expression Intermediate language before deletion, 32: Intermediate language after common expression deletion, 33: Intermediate language after scheduling, 41: Common expression table, 42: Instruction node table, 51: Instruction arrangement table.

Claims (5)

【特許請求の範囲】[Claims] 【請求項1】 プログラムで示される演算式を解析し、
共通化可能である場合に共通式として認識する共通式認
識ステップと、共通式として認識した演算式群に対し、
一回目の演算結果を、後続の演算式と置き換える共通式
削除ステップと、予め定まっているターゲットアーキテ
クチャの命令配置制約のもとで、プログラムを構成する
命令群を配置する命令スケジューリングステップを有す
るコンパイル方法であって、 上記命令スケジューリングステップが、上記共通式削除
ステップが削除した共通式の情報を参照するステップ
と、 共通式削除が行われたか否かによってスケジューリング
の方法を選択するステップとを有することを特徴とする
共通式認識型命令スケジューリング方法。
1. Analyzing an arithmetic expression represented by a program,
For a common expression recognition step of recognizing a common expression when commonization is possible,
A compiling method including a common expression deleting step of replacing a first operation result with a subsequent operation expression, and an instruction scheduling step of arranging an instruction group constituting a program under an instruction arrangement constraint of a predetermined target architecture. Wherein the instruction scheduling step includes a step of referring to information of the common expression deleted by the common expression deletion step, and a step of selecting a scheduling method depending on whether or not the common expression deletion has been performed. A featured common expression recognition type instruction scheduling method.
【請求項2】 請求項1に記載の共通式認識型命令スケ
ジューリング方法において、 上記ターゲットアーキテクチャが、相互に通信可能な独
立した演算手段と記憶手段を備える処理構成単位である
クラスタを有するクラスタ構成アーキテクチャである場
合に、上記命令スケジューリングステップが、命令をク
ラスタに配分するクラスタリング処理を行うステップを
有し、 上記共通式削除情報に基づくスケジューリング方法の選
択がクラスタリング方法の選択であることを特徴とする
共通式認識型命令スケジューリング方法。
2. A method according to claim 1, wherein said target architecture has a cluster which is a processing unit having independent operation means and storage means capable of communicating with each other. Wherein the instruction scheduling step includes a step of performing a clustering process of allocating instructions to clusters, and the selection of the scheduling method based on the common expression deletion information is the selection of a clustering method. Expression-aware instruction scheduling method.
【請求項3】 請求項2に記載の共通式認識型命令スケ
ジューリング方法において、 上記命令クラスタリングステップが、上記共通式削除情
報を用いて共通式削除された命令を相互に異なるクラス
タ配置を指向することを特徴とする共通式認識型命令ス
ケジューリング方法。
3. The common expression recognition type instruction scheduling method according to claim 2, wherein the instruction clustering step directs instructions whose common expression has been deleted using the common expression deletion information to different cluster arrangements. A common expression recognition type instruction scheduling method, characterized in that:
【請求項4】 請求項1から3のいずれか一つの共通式
認識型命令スケジューリング方法において、 上記共通式削除情報が、同一演算の複数回実行を代行す
る共通式演算結果変数定義情報と、共通式演算結果変数
で置き換える複数個所の演算群を示す共通式演算結果置
換情報を備えることを特徴とする共通式認識型命令スケ
ジューリング方法。
4. The common-expression-recognition-type instruction scheduling method according to claim 1, wherein the common-expression deletion information includes common-expression-operation-result-variable-information that performs the same operation a plurality of times. A common expression recognition type instruction scheduling method, comprising: common expression operation result replacement information indicating a plurality of operation groups to be replaced with an expression operation result variable.
【請求項5】 請求項2の共通式認識型命令スケジュー
リング方法において、 上記共通式削除情報に基づくスケジューリング方法選択
がクラスタ間データ転送方法の選択であり、 上記クラスタ間データ転送方法の選択が、命令の演算結
果の格納クラスタを示すデスティネーションクラスタの
選択であり、 上記ターゲットアーキテクチャが備えるクラスタ間の相
互通信手段位として、全クラスタに対するデータの同時
転送である全域クラスタ転送を有するクラスタ構成アー
キテクチャである場合に、上記デスティネーションクラ
スタの選択候補として全域クラスタ転送を有することを
特徴とする共通式認識型命令スケジューリング方法。
5. The common type recognition type instruction scheduling method according to claim 2, wherein the selection of the scheduling method based on the common type deletion information is a selection of an inter-cluster data transfer method, and the selection of the inter-cluster data transfer method is an instruction. Is a selection of a destination cluster indicating a storage cluster of the calculation result of the above, and a cluster configuration architecture having an entire cluster transfer that is a simultaneous transfer of data to all clusters as a means of intercommunication between clusters provided in the target architecture. A common type recognition type instruction scheduling method, characterized in that the destination cluster selection candidate includes an entire cluster transfer.
JP34368199A 1999-12-02 1999-12-02 Scheduling method of common subexpression recognition type instruction Pending JP2001159983A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP34368199A JP2001159983A (en) 1999-12-02 1999-12-02 Scheduling method of common subexpression recognition type instruction

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP34368199A JP2001159983A (en) 1999-12-02 1999-12-02 Scheduling method of common subexpression recognition type instruction

Publications (1)

Publication Number Publication Date
JP2001159983A true JP2001159983A (en) 2001-06-12

Family

ID=18363432

Family Applications (1)

Application Number Title Priority Date Filing Date
JP34368199A Pending JP2001159983A (en) 1999-12-02 1999-12-02 Scheduling method of common subexpression recognition type instruction

Country Status (1)

Country Link
JP (1) JP2001159983A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007121457A (en) * 2005-10-25 2007-05-17 Sony Corp Information processor, information processing method, and program
US8612958B2 (en) 2008-12-25 2013-12-17 Panasonic Corporation Program converting apparatus and program conversion method

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007121457A (en) * 2005-10-25 2007-05-17 Sony Corp Information processor, information processing method, and program
US8738674B2 (en) 2005-10-25 2014-05-27 Sony Corporation Information processing apparatus, information processing method and program
US8612958B2 (en) 2008-12-25 2013-12-17 Panasonic Corporation Program converting apparatus and program conversion method

Similar Documents

Publication Publication Date Title
JP3797471B2 (en) Method and apparatus for identifying divisible packets in a multi-threaded VLIW processor
US6305014B1 (en) Lifetime-sensitive instruction scheduling mechanism and method
JP5733860B2 (en) Efficient parallel computation of dependency problems
US6826677B2 (en) Renaming registers to values produced by instructions according to assigned produce sequence number
US6760906B1 (en) Method and system for processing program for parallel processing purposes, storage medium having stored thereon program getting program processing executed for parallel processing purposes, and storage medium having stored thereon instruction set to be executed in parallel
JP4979875B2 (en) Retargetable compilation system and method
US7181730B2 (en) Methods and apparatus for indirect VLIW memory allocation
JPH06250846A (en) Compiling device
JP3777541B2 (en) Method and apparatus for packet division in a multi-threaded VLIW processor
WO2009158690A2 (en) Bulk-synchronous graphics processing unit programming
JP2004220583A (en) Method and system for executing global processor resource assignment in assembler
US20020083423A1 (en) List scheduling algorithm for a cycle-driven instruction scheduler
JP2005141380A (en) Template compile method
JP5576605B2 (en) Program conversion apparatus and program conversion method
JP2005129001A (en) Apparatus and method for program execution, and microprocessor
JP2001159983A (en) Scheduling method of common subexpression recognition type instruction
CN113721899A (en) GPDSP-oriented lightweight efficient assembly code programming method and system
JP6933001B2 (en) Parallelization method, parallelization tool
JP2008523523A (en) Compiling method, compiling device and computer system for loop in program
JPH04307624A (en) Loop optimization system
JP2729795B2 (en) Parallel computer and control method thereof
JP2002041283A (en) Sub-pipeline translation structure and how to provide binary compatibility
JPH03135630A (en) Instruction scheduling system
JP2004094581A (en) Compiler program equipped with parallel extended capability, its recording medium, compile method, and compile device
JP3634712B2 (en) Compiler device