JPH10207854A - Compiler instruction parallelizing system - Google Patents

Compiler instruction parallelizing system

Info

Publication number
JPH10207854A
JPH10207854A JP2436297A JP2436297A JPH10207854A JP H10207854 A JPH10207854 A JP H10207854A JP 2436297 A JP2436297 A JP 2436297A JP 2436297 A JP2436297 A JP 2436297A JP H10207854 A JPH10207854 A JP H10207854A
Authority
JP
Japan
Prior art keywords
parallel operation
operation suppression
instruction
graph
dependency
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
JP2436297A
Other languages
Japanese (ja)
Inventor
Takashi Miyamoto
敬士 宮本
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.)
NEC Corp
Original Assignee
NEC Corp
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 NEC Corp filed Critical NEC Corp
Priority to JP2436297A priority Critical patent/JPH10207854A/en
Publication of JPH10207854A publication Critical patent/JPH10207854A/en
Pending legal-status Critical Current

Links

Abstract

PROBLEM TO BE SOLVED: To generate a high-speed object code by increasing the parallelism of the object code (object code for a computer which has arithmetic units capable of operating in parallel). SOLUTION: A dependency and parallel operation suppression graph generation part 321 generates a dependency and parallel operation suppression graph as a directional graph representing dependency relation and parallel operation suppression relation between instructions. A path latency and parallel operation suppression number calculation part 322 calculates a path latency and parallel operation suppression number on the basis of the dependency and parallel operation suppression graph generated by the dependency and parallel operation suppression graph generation part 321 and adds the calculation result to the dependency and parallel operation suppression graph. A scheduling part 323 schedules codes in parallel according to the dependency and parallel operation suppression graph to which the calculation result of the path latency and parallel operation suppression number is added.

Description

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

【0001】[0001]

【発明の属する技術分野】本発明は、コンパイラ命令並
列化方式に関し、特に並列に動作し得る複数の演算ユニ
ットを持つ計算機(コンピュータ)用の目的コードを生
成するコンパイラにおけるコンパイラ命令並列化方式に
関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a compiler instruction parallelizing method, and more particularly to a compiler instruction parallelizing method in a compiler for generating an object code for a computer (computer) having a plurality of operation units that can operate in parallel.

【0002】[0002]

【従来の技術】従来より、この種のコンパイラ命令並列
化方式は、上記のような計算機(複数命令を並列に実行
可能な計算機であり、同時に動作し得る複数の演算ユニ
ットを持つ計算機)用の目的コードの効率を高めるため
に用いられている。
2. Description of the Related Art Conventionally, this kind of compiler instruction parallelization method is used for a computer as described above (a computer which can execute a plurality of instructions in parallel and has a plurality of operation units which can operate simultaneously). Used to increase the efficiency of purpose codes.

【0003】従来のこの種のコンパイラ命令並列化方式
としては、例えば、以下の〜に示す特許公報に記載
されたものがあった。
[0003] As a conventional parallel instruction system of this kind, there are, for example, the ones described in the following patent gazettes.

【0004】 特開平6−250847号公報には、
並列論理型言語の命令をVLIW(Very Long
Instruction Word)方式の並列計算
機で実行できるようなVLIW命令に変換する技術が記
載されている。この公報に記載されたコンパイラ命令並
列化方式では、並列論理型言語がコンパイラにより抽象
命令列に変換された後に、並列論理型言語の特徴が生か
されて並列にスケジューリングされ、さらに命令間の依
存関係に基づいて並列にスケジューリングが行われる。
Japanese Patent Application Laid-Open No. Hei 6-250847 discloses that
VLIW (Very Long)
There is described a technique for converting a VLIW instruction into a VLIW instruction that can be executed by a parallel computer of an Instruction Word) system. In the compiler instruction parallelization method described in this publication, after a parallel logic type language is converted into an abstract instruction sequence by a compiler, scheduling is performed in parallel by taking advantage of the features of the parallel logic type language, and furthermore, the dependency between instructions Scheduling is performed in parallel based on

【0005】 特開平6−295246号公報には、
後向きコード圧縮フェーズによりスケジュールを行うこ
とによって、レジスタの使用量を削減してシステムの処
理の遅延を防止し、処理の効率化を図る技術が記載され
ている。この公報に記載されたコンパイラ命令並列化方
式では、前向きリストスケジューリングという、依存関
係に基づいて並列にスケジューリングを行う方式が適用
された後に、後向きコード圧縮フェーズにより命令が移
動されて、レジスタの使用量の削減が行われる。
[0005] JP-A-6-295246 discloses that
A technique is described in which scheduling is performed in a backward code compression phase to reduce the amount of registers used, to prevent delays in system processing, and to improve processing efficiency. In the compiler instruction parallelization method described in this publication, after a method called forward list scheduling, in which scheduling is performed in parallel based on dependencies, is applied, instructions are moved in a backward code compression phase, and register usage is reduced. Is reduced.

【0006】 特開平6−131195号公報には、
既存マシン用に作成されたアセンブルテキストが表現す
る命令列中の、各命令の依存関係を解析する命令解析手
段による解析結果に基づいて、命令の並べ替えを行う技
術が記載されている。この公報に記載されたコンパイラ
命令並列化方式では、アセンブルテキストが表す命令列
をもとに命令依存グラフが作成されることによって命令
間の依存関係が解析され、この結果に基づいて並列にス
ケジューリングが行われる。
[0006] JP-A-6-131195 discloses that
A technique is described in which instructions are rearranged based on an analysis result of an instruction analysis unit that analyzes a dependency of each instruction in an instruction string represented by an assemble text created for an existing machine. In the compiler instruction parallelization method described in this publication, an instruction dependency graph is created based on an instruction sequence represented by an assemble text to analyze dependencies between instructions, and scheduling is performed in parallel based on the result. Done.

【0007】[0007]

【発明が解決しようとする課題】上述した従来のコンパ
イラ命令並列化方式には、複数命令を並列に実行するこ
とが可能であり同時に動作し得る複数の演算ユニットを
持つ計算機(ある種のマイクロプロセッサ等)におい
て、依存関係(ある命令が書き込んだレジスタを他の命
令で読み出すなどの原因により発生する、命令間の実行
順序の関係)および資源競合(同一の演算ユニットを複
数の命令が使用できないこと)以外の原因により発生す
る命令間の並列動作が不可能になる関係が生じる場合
に、必ずしも目的コードの最適なスケジューリングを行
うことができないという問題点があった。
The above-described conventional compiler instruction parallelization system includes a computer (a certain type of microprocessor) having a plurality of arithmetic units capable of executing a plurality of instructions in parallel and operating simultaneously. ) And resource conflicts (the same arithmetic unit cannot be used by multiple instructions), such as dependencies (relationships between instructions that occur due to reading registers written by one instruction with other instructions). In the case where there occurs a relationship in which parallel operations between instructions that occur due to causes other than the above occur, it is not always possible to optimally schedule the target code.

【0008】このような問題点が生じる理由は、目的コ
ードのスケジューリングが命令間の依存関係および資源
競合のみに基づいて行なわれているためである。
The reason that such a problem occurs is that the scheduling of the object code is performed based only on the dependencies between instructions and resource conflicts.

【0009】なお、依存関係および資源競合以外の原因
により発生する命令間の並列動作が不可能になるという
関係(以下、これを「並列動作抑制関係」という)は、
本発明の属する技術分野に含まれるマイクロプロセッサ
ではしばしば発生するものである。例えば、2個の演算
ユニットを持つペンティアム(Pentium)プロセ
ッサ(アメリカ合衆国インテル(Intel)社製)で
は、他命令と並列に実行できない命令や、特定の演算ユ
ニットでその命令を実行する時に限って他命令と並列に
実行できるという命令がある。これらの命令における制
限は、命令間の依存関係や資源競合では扱うことができ
ない。
[0009] The relationship in which parallel operations between instructions caused by causes other than dependencies and resource conflicts become impossible (hereinafter referred to as "parallel operation suppression relationship") is as follows.
It often occurs in a microprocessor included in the technical field to which the present invention belongs. For example, in a Pentium processor (manufactured by Intel Corporation of the United States) having two operation units, an instruction that cannot be executed in parallel with another instruction, or another instruction only when the instruction is executed by a specific operation unit There is an instruction that can be executed in parallel. Restrictions on these instructions cannot be handled by dependencies or resource conflicts between the instructions.

【0010】本発明の目的は、上述の点に鑑み、並列に
動作し得る複数の演算ユニットを持つ計算機用の目的コ
ードを生成するコンパイラにおいて、目的コードの並列
性を高めることにより高速な目的コードを生成すること
ができるコンパイラ命令並列化方式を提供することにあ
る。
SUMMARY OF THE INVENTION In view of the above, it is an object of the present invention to provide a compiler for generating a target code for a computer having a plurality of operation units which can operate in parallel. It is an object of the present invention to provide a compiler instruction parallelizing method capable of generating a compiler instruction.

【0011】[0011]

【課題を解決するための手段】本発明のコンパイラ命令
並列化方式は、命令間の依存関係および並列動作抑制関
係を表現する有向グラフである依存・並列動作抑制グラ
フを生成する依存・並列動作抑制グラフ生成部と、前記
依存・並列動作抑制グラフ生成部により生成される依存
・並列動作抑制グラフに基づいてパスレイテンシおよび
並列動作抑制数を計算し、その計算結果を依存・並列動
作抑制グラフに追加するパスレイテンシ・並列動作抑制
数計算部と、前記パスレイテンシ・並列動作抑制数計算
部によりパスレイテンシおよび並列動作抑制数の計算結
果が追加された依存・並列動作抑制グラフに基づいてコ
ードの並列なスケジューリングを行うスケジューリング
部とを有する。
SUMMARY OF THE INVENTION A compiler instruction parallelization method according to the present invention is a dependency / parallel operation suppression graph for generating a dependence / parallel operation suppression graph which is a directed graph expressing a dependency relationship between instructions and a parallel operation suppression relationship. The path latency and the number of parallel operation suppressions are calculated based on the generation unit and the dependency / parallel operation suppression graph generated by the dependency / parallel operation suppression graph generation unit, and the calculation result is added to the dependence / parallel operation suppression graph. A parallel scheduling of codes based on a dependency / parallel operation suppression graph in which a path latency / parallel operation suppression number calculation unit and a path latency / parallel operation suppression number calculation result are added by the path latency / parallel operation suppression number calculation unit. And a scheduling unit for performing

【0012】なお、本発明のコンパイラ命令並列化方式
は、特に、以下のおよびに示す構成要素を有するよ
うに構成することができる。
Incidentally, the compiler instruction parallelizing method of the present invention can be constituted so as to have the following components.

【0013】 前記依存・並列動作抑制グラフ生成部
により生成された依存・並列動作抑制グラフに対して、
有向木のルートから有向辺に従ってノードを辿ることに
より各命令のパスレイテンシを決定し、各ノードから出
ている無向辺の数を計算することにより並列動作抑制数
を決定する前記パスレイテンシ・並列動作抑制数計算部
The dependency / parallel operation suppression graph generated by the dependence / parallel operation suppression graph generation unit:
Determining the path latency of each instruction by tracing a node from the root of the directed tree in accordance with the directed side, and calculating the number of undirected sides emanating from each node to determine the number of parallel operation suppressions・ Parallel operation suppression number calculator

【0014】 最初にパスレイテンシが大きい命令か
ら順にスケジューリングし、同じパスレイテンシの命令
については並列動作抑制数が大きい命令から順にスケジ
ューリングする前記スケジューリング部
[0014] The scheduling unit that schedules instructions in order from the one with the highest path latency and schedules the instructions with the same path latency in the order from the instruction with the largest parallel operation suppression number.

【0015】[0015]

【発明の実施の形態】次に、本発明の実施の形態につい
て、図面を参照して詳細に説明する。
Next, an embodiment of the present invention will be described in detail with reference to the drawings.

【0016】[0016]

【実施例】【Example】

(1) 本発明の第1の実施例 図1(a)および(b)は、本発明のコンパイラ命令並
列化方式の第1の実施例の構成を示すブロック図であ
る。
(1) First Embodiment of the Present Invention FIGS. 1A and 1B are block diagrams showing the configuration of a first embodiment of the compiler instruction parallelization system of the present invention.

【0017】図1(a)に示すように、本実施例のコン
パイラ命令並列化方式は、フロントエンド2と、バック
エンド3とを含むコンパイラ100によって実現され
る。コンパイラ100は、入力コード1を入力とし、目
的コード4を出力とする。
As shown in FIG. 1A, the compiler instruction parallelization method of this embodiment is realized by a compiler 100 including a front end 2 and a back end 3. The compiler 100 receives an input code 1 as an input, and outputs a target code 4 as an output.

【0018】フロントエンド2は、入力コード1である
プログラムの字句解析および構文・意味解析を行い、中
間言語コードを出力する。
The front end 2 performs lexical analysis and syntax / semantic analysis of the program as the input code 1, and outputs an intermediate language code.

【0019】バックエンド3は、中間言語最適化部31
と、コードスケジューリング部32と、目的コード生成
部33とを含む。
The back end 3 includes an intermediate language optimization unit 31
And a code scheduling unit 32 and a target code generation unit 33.

【0020】中間言語最適化部31は、中間言語コード
に対して広域最適化および局所最適化を行う。
The intermediate language optimizing unit 31 performs wide area optimization and local optimization on the intermediate language code.

【0021】コードスケジューリング部32は、中間言
語コードの命令を並列実行性が高くなるように並べ替え
る。このコードスケジューリング部32が、本発明の主
要部に該当する。
The code scheduling unit 32 rearranges the instructions of the intermediate language code so as to increase the parallel execution. The code scheduling unit 32 corresponds to a main part of the present invention.

【0022】目的コード生成部33は、中間言語コード
を目的コード4に変換する。
The target code generator 33 converts the intermediate language code into the target code 4.

【0023】次に、図1(b)を参照して、コードスケ
ジューリング部32の詳細な構成を説明する。
Next, the detailed configuration of the code scheduling unit 32 will be described with reference to FIG.

【0024】コードスケジューリング部32は、依存・
並列動作抑制グラフ生成部321と、パスレイテンシ・
並列動作抑制数計算部322と、スケジューリング部3
23とを含む。
The code scheduling unit 32
The parallel operation suppression graph generation unit 321 and the path latency
Parallel operation suppression number calculation section 322 and scheduling section 3
23.

【0025】依存・並列動作抑制グラフ生成部321
は、中間言語コードを構成する命令間の依存性を解析
し、この解析結果に基づき有向グラフを構築する。さら
に、依存・並列動作抑制グラフ生成部321は、並列動
作抑制関係も解析し、先に構築した有向グラフに並列動
作抑制関係を追加する。このようにして構築された有向
グラフを依存・並列動作抑制グラフと呼ぶ。
The dependency / parallel operation suppression graph generator 321
Analyzes the dependencies between the instructions that make up the intermediate language code, and builds a directed graph based on this analysis. Further, the dependency / parallel operation suppression graph generator 321 also analyzes the parallel operation suppression relationship, and adds the parallel operation suppression relationship to the previously constructed directed graph. The directed graph constructed in this manner is called a dependency / parallel operation suppression graph.

【0026】パスレイテンシ・並列動作抑制数計算部3
22は、依存・並列動作抑制グラフを用いて、パスレイ
テンシと並列動作抑制数とを計算する。
Path Latency / Parallel Operation Suppression Number Calculator 3
22 calculates the path latency and the number of parallel operation suppressions using the dependence / parallel operation suppression graph.

【0027】スケジューリング部323は、依存・並列
動作抑制グラフとパスレイテンシおよび並列動作抑制数
とを用いて、中間言語コードの命令の並べ替えを行う。
The scheduling unit 323 rearranges instructions of the intermediate language code using the dependence / parallel operation suppression graph, the path latency, and the number of parallel operation suppressions.

【0028】図2は、コードスケジューリング部32の
処理を示す流れ図である。この処理は、依存関係有向グ
ラフ表現ステップ201と、並列動作抑制関係解析ステ
ップ202と、パスレイテンシ計算ステップ203と、
並列動作抑制数計算ステップ204と、中間言語コード
命令並べ替えステップ205とからなる。
FIG. 2 is a flowchart showing the processing of the code scheduling unit 32. This process includes a dependency directed graph expression step 201, a parallel operation suppression relation analysis step 202, a path latency calculation step 203,
It comprises a parallel operation suppression number calculation step 204 and an intermediate language code instruction rearranging step 205.

【0029】図3は、依存・並列動作抑制グラフ生成部
321が生成する有向グラフ(依存・並列動作抑制グラ
フ)を説明するための図である。
FIG. 3 is a diagram for explaining a directed graph (dependent / parallel operation suppression graph) generated by the dependence / parallel operation suppression graph generation unit 321.

【0030】図4は、スケジューリング部323による
スケジューリング結果である出力コードの一例を示す図
である。
FIG. 4 is a diagram showing an example of an output code as a result of scheduling by the scheduling section 323.

【0031】図5は、本実施例のコンパイラ命令並列化
方式の動作を説明するための図であり、本発明のコンパ
イラ命令並列化方式を使用しないと仮定した時のスケジ
ューリング結果である出力コードの一例を示す図であ
る。
FIG. 5 is a diagram for explaining the operation of the compiler instruction parallelizing method of the present embodiment. The output code of the output code which is the scheduling result when the compiler instruction parallelizing method of the present invention is not used is assumed. It is a figure showing an example.

【0032】次に、このように構成された本実施例のコ
ンパイラ命令並列化方式の動作について説明する。
Next, the operation of the compiler instruction parallelizing system of the present embodiment configured as described above will be described.

【0033】第1に、図1(a)に示すコンパイラ10
0の概略的な動作について説明する。
First, the compiler 10 shown in FIG.
The general operation of 0 will be described.

【0034】コンパイラ100内のフロントエンド2
は、入力コード1を中間言語コードに変換する。この中
間言語コードは、バックエンド3に渡される。
Front end 2 in compiler 100
Converts the input code 1 into an intermediate language code. This intermediate language code is passed to the back end 3.

【0035】バックエンド3においては、まず、中間言
語最適化部31が、中間言語コードに対して局所最適化
および広域最適化を行う。
In the back end 3, first, the intermediate language optimizing unit 31 performs local optimization and wide area optimization on the intermediate language code.

【0036】次に、コードスケジューリング部32は、
並列実行性を高めるための命令の並べ替えを行う。
Next, the code scheduling unit 32
Instructions are rearranged to improve parallel execution.

【0037】さらに、目的コード生成部33は、中間言
語コードを目的コード4に変換し、コンパイラ100の
出力コードである目的コード4を生成する。
Further, the object code generation unit 33 converts the intermediate language code into the object code 4 and generates the object code 4 which is the output code of the compiler 100.

【0038】第2に、図1(a)および(b)と共に図
2,図3,および図4を参照して、本発明の中心となる
コードスケジューリング部32における動作について説
明する。
Second, the operation of the code scheduling unit 32, which is the main part of the present invention, will be described with reference to FIGS. 2, 3 and 4 together with FIGS. 1 (a) and 1 (b).

【0039】コードスケジューリング部32では、最初
に依存・並列動作抑制グラフ生成部321が、依存・並
列動作抑制グラフを生成する。
In the code scheduling unit 32, first, the dependence / parallel operation suppression graph generation unit 321 generates a dependence / parallel operation suppression graph.

【0040】すなわち、依存・並列動作抑制グラフ生成
部321は、依存・並列動作抑制グラフを生成するため
に、まず命令間の依存関係を解析し、その依存関係を有
向グラフ(初期の依存・並列動作抑制グラフ)で表現す
る(ステップ201)。
That is, in order to generate a dependency / parallel operation suppression graph, the dependency / parallel operation suppression graph generator 321 first analyzes the dependencies between instructions, and converts the dependencies into directed graphs (initial dependency / parallel operations). (Inhibition graph) (step 201).

【0041】図3に示された依存・並列動作抑制グラフ
の一例により、依存・並列動作抑制グラフによって表現
される依存関係を説明する。依存・並列動作抑制グラフ
では、中間言語コードの各命令は有向グラフのノードで
表現される。図3中の「a」および「B」等は命令を表
すノードである。また、依存・並列動作抑制グラフで
は、依存関係は有向グラフの有向辺で表現される。図3
では、例えば命令Bは命令aに依存しているので、ノー
ドaからノードBへの有向辺が存在する。
The dependency expressed by the dependency / parallel operation suppression graph will be described with reference to an example of the dependence / parallel operation suppression graph shown in FIG. In the dependency / parallel operation suppression graph, each instruction of the intermediate language code is represented by a node of the directed graph. “A” and “B” in FIG. 3 are nodes representing instructions. In the dependency / parallel operation suppression graph, the dependency is expressed by a directed edge of the directed graph. FIG.
For example, since the instruction B depends on the instruction a, there is a directed edge from the node a to the node B.

【0042】次に、依存・並列動作抑制グラフ生成部3
21は、依存・並列動作抑制グラフを生成するために、
並列動作抑制関係を解析し、その解析結果を依存・並列
動作抑制グラフに追加する(ステップ202)。
Next, the dependency / parallel operation suppression graph generator 3
21 is to generate a dependency / parallel operation suppression graph,
The parallel operation suppression relationship is analyzed, and the analysis result is added to the dependency / parallel operation suppression graph (step 202).

【0043】並列動作抑制関係とは、先に述べたよう
に、依存関係および資源競合以外の原因により2個の命
令の並列動作が不可能となる関係をいう。一例として
は、「パイプライン動作で一部共通回路を使用すること
により、2個の命令が別々の演算ユニットで実行される
にもかかわらず、並列実行できないという関係」が考え
られる。並列動作抑制関係は、依存・並列動作抑制グラ
フにおいて無向辺で表現される。再び図3で説明する
と、例えば命令Bと命令eとは並列動作抑制関係にある
ので、ノードBとノードeとは無向辺で結ばれている。
As described above, the parallel operation suppression relationship refers to a relationship in which parallel operation of two instructions becomes impossible due to causes other than the dependency relationship and resource conflict. As an example, "a relationship in which two instructions are executed in separate operation units but cannot be executed in parallel even though two instructions are executed by using a common circuit in a pipeline operation" is considered. The parallel operation suppression relationship is represented by an undirected side in the dependency / parallel operation suppression graph. Referring again to FIG. 3, for example, since the instruction B and the instruction e have a parallel operation suppression relationship, the node B and the node e are connected by an undirected side.

【0044】パスレイテンシ・並列動作抑制数計算部3
22は、まず、依存・並列動作抑制グラフに基づいてパ
スレイテンシを計算し、その計算結果を依存・並列動作
抑制グラフに追加する(ステップ203)。
Path Latency / Parallel Operation Suppression Number Calculator 3
22 first calculates the path latency based on the dependence / parallel operation suppression graph, and adds the calculation result to the dependence / parallel operation suppression graph (step 203).

【0045】パスレイテンシとは、依存・並列動作抑制
グラフにおいて、各命令が最短で実行可能となるサイク
ル数(各ノードについて、そのノードが含まれる有向木
のルートに該当する命令からの最短実行可能サイクル
数)をいう。以後説明の都合上全ての命令の実行に要す
るサイクル数は1であると仮定しているが、これ以外の
場合でも本発明のコンパイラ命令並列化方式が適用可能
であることはいうまでもない。
The path latency is defined as the number of cycles at which each instruction can be executed in the shortest time in the dependency / parallel operation suppression graph (for each node, the shortest execution time from the instruction corresponding to the root of the directed tree including the node) Number of possible cycles). Hereinafter, for convenience of explanation, it is assumed that the number of cycles required for execution of all instructions is 1, but it is needless to say that the compiler instruction parallelization method of the present invention can be applied to other cases.

【0046】図3を参照すると、例えば命令Bは命令a
に依存しているので、命令aの実行が完了しないと命令
Bが実行可能とならない。命令aは依存している命令が
ないので、この依存・並列動作抑制グラフでは最初に実
行可能であり、この場合には、命令aのパスレイテンシ
として0が与えられる。前述の仮定により命令aの実行
に要するサイクル数は1であるから、命令Bのパスレイ
テンシは1となる。図3では、パスレイテンシを、各ノ
ードの近くにおけるカッコで囲まれない数で表してい
る。
Referring to FIG. 3, for example, an instruction B is an instruction a
Therefore, the instruction B cannot be executed unless the execution of the instruction a is completed. Since the instruction a has no dependent instruction, it can be executed first in this dependence / parallel operation suppression graph. In this case, 0 is given as the path latency of the instruction a. Since the number of cycles required to execute the instruction a is 1 based on the above assumption, the path latency of the instruction B is 1. In FIG. 3, the path latency is represented by a number near parentheses and not enclosed in parentheses.

【0047】続いて、パスレイテンシ・並列動作抑制数
計算部322は、依存・並列動作抑制グラフに基づいて
並列動作抑制数を計算し、その計算結果を依存・並列動
作抑制グラフに追加する(ステップ204)。
Subsequently, the path latency / parallel operation suppression number calculation unit 322 calculates the parallel operation suppression number based on the dependence / parallel operation suppression graph, and adds the calculation result to the dependence / parallel operation suppression graph (step 204).

【0048】並列動作抑制数とは、各命令について、そ
の命令と並列動作抑制関係にある命令の数をいう。した
がって、依存・並列動作抑制グラフでは、命令に対応す
るノードから出ている無向辺の数が並列動作抑制数に該
当する。図3を参照すると、例えば命令Bの並列動作抑
制数は1である。図3では、並列動作抑制数を、各ノー
ドの近くにおけるカッコで囲まれた数で表している。た
だし、カッコで囲まれた数が存在しない命令(ノード)
については、その命令の並列動作抑制数は0である。
The number of parallel operation suppressions refers to the number of instructions having a parallel operation suppression relationship with each instruction. Therefore, in the dependence / parallel operation suppression graph, the number of undirected sides emerging from the node corresponding to the instruction corresponds to the parallel operation suppression number. Referring to FIG. 3, for example, the parallel operation suppression number of the instruction B is one. In FIG. 3, the number of parallel operation suppressions is represented by the number enclosed in parentheses near each node. However, instructions (nodes) that do not have a number enclosed in parentheses
, The parallel operation suppression number of the instruction is zero.

【0049】スケジューリング部333は、以上のよう
にして最終的に構築された依存・並列動作抑制グラフに
基づいて、中間言語コードの命令の並べ替え(所定のス
ケジューリング)を行う(ステップ205)。
The scheduling unit 333 rearranges the instructions of the intermediate language code (predetermined scheduling) based on the dependency / parallel operation suppression graph finally constructed as described above (step 205).

【0050】スケジューリング部333の動作につい
て、図3と図4とを参照して説明する。説明の都合上、
目的コード4は、並列に動作する2個の演算ユニット
(これらを演算ユニットおよび演算ユニットとす
る)を持つ計算機向けの目的コードであると仮定する。
また、命令が実行される演算ユニットは命令毎に決まっ
ており、図3の依存・並列動作抑制グラフに含まれる命
令については、命令a,e,f,およびhが演算ユニッ
トで実行され、命令B,C,D,およびGが演算ユニ
ットで実行されるものと仮定する。
The operation of the scheduling section 333 will be described with reference to FIGS. For the sake of explanation,
It is assumed that the object code 4 is an object code for a computer having two operation units operating in parallel (these are referred to as an operation unit and an operation unit).
Further, the operation unit in which the instruction is executed is determined for each instruction. For the instructions included in the dependence / parallel operation suppression graph of FIG. 3, the instructions a, e, f, and h are executed by the operation unit. Assume that B, C, D, and G are executed in an arithmetic unit.

【0051】本発明では、並列なスケジューリングの方
法として、従来の技術であるリストスケジューリングを
基本とするが、本発明の特徴である並列動作抑制数を考
慮したスケジューリングが行われる。リストスケジュー
リングでは、依存・並列動作抑制グラフにおいて、スケ
ジューリング可能な命令(依存されている命令でスケジ
ューリングが未了なものがないような命令)の中でパス
レイテンシが最大の命令がスケジューリングの候補とさ
れ、逆向きに(後に実行される命令から順に)スケジュ
ーリングされた命令列が決定される。
In the present invention, the parallel scheduling method is based on the conventional list scheduling, but the scheduling is performed in consideration of the parallel operation suppression number which is a feature of the present invention. In the list scheduling, in the dependence / parallel operation suppression graph, among the schedulable instructions (instructions whose scheduling is not completed among the dependent instructions), the instruction having the largest path latency is determined as a candidate for scheduling. , An instruction sequence scheduled in the reverse direction (in order from the instruction executed later) is determined.

【0052】図4は、本実施例のコンパイラ命令並列化
方式によってスケジューリングされた命令列を示す図で
ある。図4の命令列は、最初のクロックで命令aと命令
Dとが実行され、次のクロックで命令fと命令Gとが実
行され、さらに以下同様に各命令が実行されることを想
定してスケジューリングされた命令列である。このよう
な命令列を決定するにあたっては、前述のリストスケジ
ューリングの方法に従い、後に実行される命令、すなわ
ち命令eと命令Cとから始め、逆向きにスケジューリン
グされることになる。
FIG. 4 is a diagram showing an instruction sequence scheduled by the compiler instruction parallelization method of this embodiment. The instruction sequence shown in FIG. 4 assumes that the instruction a and the instruction D are executed at the first clock, the instruction f and the instruction G are executed at the next clock, and thereafter, the respective instructions are executed similarly. This is a scheduled instruction sequence. In determining such an instruction sequence, in accordance with the above-described list scheduling method, scheduling is started in the order of instructions to be executed later, that is, the instruction e and the instruction C, and the scheduling is performed in the reverse direction.

【0053】図3に戻り、図4に示す命令列がスケジュ
ーリングされる過程を示す。最初は、どの命令もスケジ
ューリングされていないため、スケジューリングの候補
となり得る命令は、命令C,e,f,およびh(有向辺
の開始ノードとなっていない命令)となる。このうちパ
スレイテンシが最大なものは命令Cであるので、まずこ
の命令Cがスケジュール(演算ユニットに対するスケ
ジュール)される。残りの3個の命令e,f,およびh
は全てパスレイテンシが1であり、また全て演算ユニッ
トで実行されるので、命令Cと資源競合を起こさない
ため、通常のリストスケジューリングの方法でこれらの
命令の中から任意に1個の命令が選択されることにな
る。
Returning to FIG. 3, the process of scheduling the instruction sequence shown in FIG. 4 will be described. At first, since no instruction is scheduled, the instructions that can be candidates for scheduling are the instructions C, e, f, and h (instructions that are not the start nodes of the directed sides). Since the instruction C having the highest path latency is the instruction C, the instruction C is first scheduled (scheduled for the arithmetic unit). The remaining three instructions e, f, and h
Have a path latency of 1 and are all executed by the arithmetic unit, so that there is no resource contention with the instruction C. Therefore, one instruction can be arbitrarily selected from these instructions by a normal list scheduling method. Will be done.

【0054】本発明の方法では、このようにパスレイテ
ンシが等しく、既にスケジュール済みの命令と資源競合
を起こさない命令がスケジュール候補となった場合に
は、並列動作抑制数が最大な命令が選択される。ただ
し、既にスケジュール済みの命令と並列動作抑制関係と
なる命令は除かれる。図3では、命令eの並列動作抑制
数が最大であるため、演算ユニットにはこの命令eが
実行されるようにスケジュールされる。
According to the method of the present invention, when an instruction having the same path latency and causing no resource conflict with an already-scheduled instruction is a candidate for a schedule, the instruction having the maximum number of parallel operations suppressed is selected. You. However, instructions that have a parallel operation suppression relationship with already scheduled instructions are excluded. In FIG. 3, since the number of parallel operation suppressions of the instruction e is the maximum, the arithmetic unit is scheduled to execute the instruction e.

【0055】以下同様にして、図4に示すスケジューリ
ング結果を得るためのスケジューリングが行われる。
In the same manner, scheduling for obtaining the scheduling result shown in FIG. 4 is performed.

【0056】図5に、本発明の方法によらず、演算ユニ
ットで命令e,f,およびhの3個の命令から1個の
命令が選択される時点で、命令hが選択されるとした時
の残りのスケジューリング結果を示す。本発明の方法で
スケジュールした結果である図4のスケジューリング結
果に比べると、明らかに実行サイクル数が多くなってお
り、生成される目的コードの性能が低下していることが
分かる。
FIG. 5 shows that the instruction h is selected when one of three instructions e, f and h is selected in the arithmetic unit, regardless of the method of the present invention. The remaining scheduling results of the time are shown. Compared to the scheduling result of FIG. 4, which is the result of the scheduling according to the method of the present invention, it can be seen that the number of execution cycles is clearly larger and the performance of the generated target code is lower.

【0057】(2) 本発明の第2の実施例 図6は、本発明のコンパイラ命令並列化方式の第2の実
施例の構成を示すブロック図である。なお、コードスケ
ジューリング部7の構成は、図1(b)に示すコードス
ケジューリング部32の構成と同様である。
(2) Second Embodiment of the Present Invention FIG. 6 is a block diagram showing the configuration of a second embodiment of the compiler instruction parallelization system of the present invention. The configuration of the code scheduling unit 7 is the same as the configuration of the code scheduling unit 32 shown in FIG.

【0058】本実施例のコンパイラ命令並列化方式は、
フロントエンド2と、バックエンド5と、スケジュール
前目的コード6と、コードスケジューリング部7とを含
むコンパイラ200によって実現される。コンパイラ2
00は、入力コード1を入力とし、目的コード4を出力
とする。
The compiler instruction parallelization method of this embodiment is as follows.
This is realized by a compiler 200 including a front end 2, a back end 5, a pre-schedule target code 6, and a code scheduling unit 7. Compiler 2
00, the input code 1 is input and the object code 4 is output.

【0059】フロントエンド2は、入力コード1である
プログラムの字句解析および構文・意味解析を行い、中
間言語コードを出力する。
The front end 2 performs lexical analysis and syntax / semantic analysis of the program as the input code 1, and outputs an intermediate language code.

【0060】バックエンド5は、中間言語最適化部31
と、目的コード生成部33とを含み、中間言語コードに
基づいてスケジュール前目的コード6を出力する。
The back end 5 includes an intermediate language optimization unit 31
And a target code generation unit 33, and outputs the pre-schedule target code 6 based on the intermediate language code.

【0061】コードスケジューリング部7は、スケジュ
ール前目的コード6の命令を並列実行性が高くなるよう
に並べ替える。
The code scheduling unit 7 rearranges the instructions of the pre-schedule target code 6 so as to increase the parallel executability.

【0062】図6に示されるように、コードスケジュー
リング部7は、図1に示された第1の実施例におけるバ
ックエンド3(本実施例ではバックエンド5)に含まれ
ず、バックエンド5によって出力されるスケジュール前
目的コード6を入力する位置に存在する。この点で、第
2の実施例の構成は第1の実施例の構成と異なる。
As shown in FIG. 6, the code scheduling unit 7 is not included in the back end 3 (the back end 5 in this embodiment) in the first embodiment shown in FIG. It exists at the position where the pre-schedule purpose code 6 to be input is input. In this point, the configuration of the second embodiment is different from the configuration of the first embodiment.

【0063】次に、このように構成された本実施例のコ
ンパイラ命令並列化方式の動作について説明する。
Next, the operation of the compiler instruction parallelizing system according to the present embodiment thus configured will be described.

【0064】第1の実施例においては、コードスケジュ
ーリング部32は中間言語最適化部31が出力する中間
言語コードに対してコードスケジューリング(上述した
ような本発明に特有のコードスケジューリング)を行っ
ていた。これに対して、本実施例(第2の実施例)のコ
ンパイラ命令並列化方式においては、コードスケジュー
リング部7はバックエンド5が出力するスケジュール前
目的コード6に対して所定のコードスケジューリングを
行う。その他の動作については、第1の実施例と第2の
実施例とにおいて、同じである。
In the first embodiment, the code scheduling unit 32 performs code scheduling (the above-described code scheduling unique to the present invention) on the intermediate language code output from the intermediate language optimizing unit 31. . On the other hand, in the compiler instruction parallelization method of the present embodiment (second embodiment), the code scheduling unit 7 performs predetermined code scheduling on the pre-schedule target code 6 output from the back end 5. Other operations are the same in the first embodiment and the second embodiment.

【0065】[0065]

【発明の効果】以上説明したように、本発明によると、
並列動作抑制関係を反映させた依存・並列動作抑制グラ
フを構築すると共に、パスレイテンシおよび並列動作抑
制数を計算することによって、並列コードスケジューリ
ングの効率が向上し、目的コードの実行性能が向上する
という効果が生じる。
As described above, according to the present invention,
By constructing a dependency / parallel operation suppression graph that reflects the parallel operation suppression relationship and calculating the path latency and the number of parallel operation suppressions, the efficiency of parallel code scheduling is improved, and the execution performance of the target code is improved. The effect occurs.

【0066】このような効果が生じる理由は、依存・並
列動作抑制グラフに基づいて並列動作抑制数の大きい命
令を先にスケジュールすることによって、スケジューリ
ング処理の後の段階で並列動作抑制関係によるスケジュ
ーリング制約が発生するのを防ぐことができるためであ
る。
The reason why such an effect occurs is that an instruction having a large parallel operation suppression number is scheduled first based on the dependence / parallel operation suppression graph, so that the scheduling constraint due to the parallel operation suppression relation at a later stage of the scheduling process. This is because it is possible to prevent the occurrence of.

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

【図1】本発明のコンパイラ命令並列化方式の第1の実
施例の構成を示すブロック図である(特に、(b)はコ
ードスケジューリング部の詳細な構成を示すブロック図
である)。
FIG. 1 is a block diagram showing a configuration of a first embodiment of a compiler instruction parallelization system according to the present invention (particularly, FIG. 1 (b) is a block diagram showing a detailed configuration of a code scheduling unit).

【図2】図1(b)に示すコードスケジューリング部の
処理を示す流れ図である。
FIG. 2 is a flowchart showing processing of a code scheduling unit shown in FIG. 1 (b).

【図3】図1(b)に示すコードスケジューリング部が
生成する有向グラフ(依存・並列動作抑制グラフ)の一
例を示す図である。
FIG. 3 is a diagram illustrating an example of a directed graph (a dependency / parallel operation suppression graph) generated by a code scheduling unit illustrated in FIG.

【図4】図1(b)中のスケジューリング部によるスケ
ジューリング結果である出力コードの一例を示す図であ
る。
FIG. 4 is a diagram showing an example of an output code as a result of scheduling by a scheduling unit in FIG. 1 (b).

【図5】図1(a)に示すコンパイラ命令並列化方式の
動作を説明するための図であり、本発明のコンパイラ命
令並列化方式を使用しないと仮定した時のスケジューリ
ング結果である出力コードの一例を示す図である。
FIG. 5 is a diagram for explaining the operation of the compiler instruction parallelization method shown in FIG. 1 (a), and is a scheduling result of an output code which is a scheduling result when the compiler instruction parallelization method of the present invention is not used; It is a figure showing an example.

【図6】本発明のコンパイラ命令並列化方式の第2の実
施例の構成を示すブロック図である。
FIG. 6 is a block diagram showing a configuration of a second embodiment of the compiler instruction parallelization system of the present invention.

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

1 入力コード 2 フロントエンド 3,5 バックエンド 4 目的コード 6 スケジュール前目的コード 7,32 コードスケジューリング部 31 中間言語最適化部 33 目的コード生成部 100,200 コンパイラ 321 依存・並列動作抑制グラフ生成部 322 パスレイテンシ・並列動作抑制数計算部 323 スケジューリング部 DESCRIPTION OF SYMBOLS 1 Input code 2 Front end 3, 5 Back end 4 Object code 6 Object code before schedule 7, 32 Code scheduling part 31 Intermediate language optimization part 33 Object code generation part 100, 200 Compiler 321 Dependence and parallel operation suppression graph generation part 322 Path Latency / Parallel Operation Suppression Number Calculation Unit 323 Scheduling Unit

Claims (4)

【特許請求の範囲】[Claims] 【請求項1】 命令間の依存関係および並列動作抑制関
係を表現する有向グラフである依存・並列動作抑制グラ
フを生成する依存・並列動作抑制グラフ生成部と、 前記依存・並列動作抑制グラフ生成部により生成される
依存・並列動作抑制グラフに基づいてパスレイテンシお
よび並列動作抑制数を計算し、その計算結果を依存・並
列動作抑制グラフに追加するパスレイテンシ・並列動作
抑制数計算部と、 前記パスレイテンシ・並列動作抑制数計算部によりパス
レイテンシおよび並列動作抑制数の計算結果が追加され
た依存・並列動作抑制グラフに基づいてコードの並列な
スケジューリングを行うスケジューリング部とを有する
ことを特徴とするコンパイラ命令並列化方式。
1. A dependency / parallel operation suppression graph generation unit that generates a dependence / parallel operation suppression graph that is a directed graph expressing a dependency relationship between instructions and a parallel operation suppression relationship, and the dependency / parallel operation suppression graph generation unit A path latency / parallel operation suppression number calculating unit that calculates a path latency and a number of parallel operation suppressions based on the generated dependency / parallel operation suppression graph, and adds the calculation result to the dependence / parallel operation suppression graph; A compiler instruction having a dependency in which the calculation results of the path latency and the number of parallel operation suppressions are added by the parallel operation suppression number calculation unit; and a scheduling unit for performing parallel scheduling of codes based on the parallel operation suppression graph. Parallelization method.
【請求項2】 前記依存・並列動作抑制グラフ生成部に
より生成された依存・並列動作抑制グラフに対して、有
向木のルートから有向辺に従ってノードを辿ることによ
り各命令のパスレイテンシを決定し、各ノードから出て
いる無向辺の数を計算することにより並列動作抑制数を
決定する前記パスレイテンシ・並列動作抑制数計算部
と、 最初にパスレイテンシが大きい命令から順にスケジュー
リングし、同じパスレイテンシの命令については並列動
作抑制数が大きい命令から順にスケジューリングする前
記スケジューリング部とを有することを特徴とする請求
項1記載のコンパイラ命令並列化方式。
2. A path latency of each instruction is determined by tracing a node from a root of a directed tree to a directed edge with respect to the dependency / parallel operation suppression graph generated by the dependence / parallel operation suppression graph generation unit. The path latency / parallel operation suppression number calculation unit that determines the number of parallel operation suppressions by calculating the number of undirected sides emerging from each node. 2. The compiler instruction parallelizing method according to claim 1, further comprising: the scheduling unit that schedules an instruction having a path latency in order from an instruction having a large parallel operation suppression number.
【請求項3】 中間言語コードに対してスケジューリン
グを行う前記スケジューリング部を有することを特徴と
する請求項1または請求項2記載のコンパイラ命令並列
化方式。
3. The compiler instruction parallelizing method according to claim 1, further comprising the scheduling unit for performing scheduling on the intermediate language code.
【請求項4】 スケジュール前目的コードに対してスケ
ジューリングを行う前記スケジューリング部を有するこ
とを特徴とする請求項1または請求項2記載のコンパイ
ラ命令並列化方式。
4. The compiler instruction parallelizing method according to claim 1, further comprising the scheduling section for performing scheduling on a pre-schedule object code.
JP2436297A 1997-01-23 1997-01-23 Compiler instruction parallelizing system Pending JPH10207854A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2436297A JPH10207854A (en) 1997-01-23 1997-01-23 Compiler instruction parallelizing system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2436297A JPH10207854A (en) 1997-01-23 1997-01-23 Compiler instruction parallelizing system

Publications (1)

Publication Number Publication Date
JPH10207854A true JPH10207854A (en) 1998-08-07

Family

ID=12136096

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2436297A Pending JPH10207854A (en) 1997-01-23 1997-01-23 Compiler instruction parallelizing system

Country Status (1)

Country Link
JP (1) JPH10207854A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002268895A (en) * 2001-03-09 2002-09-20 Nec Corp Instruction scheduling device and method

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002268895A (en) * 2001-03-09 2002-09-20 Nec Corp Instruction scheduling device and method

Similar Documents

Publication Publication Date Title
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
JP3664473B2 (en) Program optimization method and compiler using the same
JP4042604B2 (en) Program parallelization apparatus, program parallelization method, and program parallelization program
US10372429B2 (en) Method and system for generating accelerator program
JP3896087B2 (en) Compiler device and compiling method
JP4339907B2 (en) Optimal code generation method and compiling device for multiprocessor
JP3311462B2 (en) Compile processing unit
JP2921190B2 (en) Parallel execution method
US7856629B2 (en) Compiler apparatus
JPH04307625A (en) Loop optimization system
JPH01108638A (en) Parallelized compilation system
US20010039654A1 (en) Compiler processing system for generating assembly program codes for a computer comprising a plurality of arithmetic units
Reissmann et al. Efficient control flow restructuring for GPUs
JP3311381B2 (en) Instruction scheduling method in compiler
Xue et al. A lifetime optimal algorithm for speculative PRE
JPH10207854A (en) Compiler instruction parallelizing system
JP3032030B2 (en) Loop optimization method and apparatus
Kirchhoff et al. Increasing efficiency in data flow oriented model driven software development for softcore processors
US20090187895A1 (en) Device, method, program, and recording medium for converting program
Natarajan et al. Spill-free parallel scheduling of basic blocks
Smelyanskiy et al. Probabilistic predicate-aware modulo scheduling
JP2789977B2 (en) Execution information collection program generation device
JP3551352B2 (en) Loop splitting method
JP2000163266A (en) Instruction execution system
JPH1196018A (en) Compiling device, its method and computer-readable recording medium recording compiling execution program