JP2000276356A - Compiler, compiling method and storage medium recording complier program - Google Patents

Compiler, compiling method and storage medium recording complier program

Info

Publication number
JP2000276356A
JP2000276356A JP11081103A JP8110399A JP2000276356A JP 2000276356 A JP2000276356 A JP 2000276356A JP 11081103 A JP11081103 A JP 11081103A JP 8110399 A JP8110399 A JP 8110399A JP 2000276356 A JP2000276356 A JP 2000276356A
Authority
JP
Japan
Prior art keywords
instruction
intermediate language
instructions
generating
sequence
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.)
Granted
Application number
JP11081103A
Other languages
Japanese (ja)
Other versions
JP3323147B2 (en
Inventor
Tetsuya Fujisawa
哲也 藤澤
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 Software Kobe Ltd
Original Assignee
NEC Software Kobe 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 NEC Software Kobe Ltd filed Critical NEC Software Kobe Ltd
Priority to JP08110399A priority Critical patent/JP3323147B2/en
Publication of JP2000276356A publication Critical patent/JP2000276356A/en
Application granted granted Critical
Publication of JP3323147B2 publication Critical patent/JP3323147B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Landscapes

  • Devices For Executing Special Programs (AREA)

Abstract

PROBLEM TO BE SOLVED: To obtain a compiler capable of generating an instruction string of a high execution speed at a short processing time. SOLUTION: An intermediate word generation means 102 generates an intermediate word 107 from a source program 106. An instruction rearrangement range determination means 103 inspects an instruction string of the intermediate word 107, selects an instruction having no depending relation with an unselected instruction, sets up an instruction rearrangement range, and generates a 1st instruction string 108. An instruction scheduling means 104 rearranges instructions in the instruction rearrangement range so as to execute the intermediate word 107 more quickly to generate a 2nd instruction string 109. An Object program generation means 105 generates an object program 110 from the 2nd instruction string 109. The limited number of instructions included in the instruction rearrangement range is previously set up.

Description

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

【0001】[0001]

【発明の属する技術分野】本発明はトレーススケジュー
リング法を用いた最適化コンパイラの、特に命令並び替
え範囲の決定を行うコンパイル装置、コンパイル方法お
よびコンパイラプログラムを記録した記録媒体に関す
る。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to an optimizing compiler using a trace scheduling method, and more particularly to a compiling apparatus for determining an instruction rearrangement range, a compiling method, and a recording medium on which a compiler program is recorded.

【0002】[0002]

【従来の技術】従来のトレーススケジューリング法を用
いた最適化コンパイラシステムの一例が、「1990年6
月、情報処理、Vol.31、No.6、764〜767ページ、中谷登
志男、VLIW計算機のためのコンパイラ技術、4.トレ
ース・スケジューリング法」に記載されている。
2. Description of the Related Art An example of an optimizing compiler system using a conventional trace scheduling method is disclosed in "1990 June.
Moon, Information Processing, Vol. 31, No. 6, pages 764-767, Toshio Nakatani, Compiler Technology for VLIW Computers, 4. Trace Scheduling Method ".

【0003】従来のトレーススケジューリング法を用い
た最適化コンパイラシステムは、「ソースプログラムを
中間語に翻訳する翻訳手段」と、「中間語の命令列を並
び替える範囲を決定する並び替え範囲決定手段」と、そ
の範囲の中で「中間語をより速く実行できるよう並び替
える命令並び替え手段」と、「並び替えられた中間語を
機械語命令として出力する機械語命令生成手段」から構
成されている。
A conventional optimizing compiler system using a trace scheduling method includes a "translating means for translating a source program into an intermediate language" and a "rearranging range determining means for determining a range in which an instruction sequence of an intermediate language is rearranged". And "instruction rearranging means for rearranging the intermediate language so that it can be executed faster" and "machine language instruction generating means for outputting the rearranged intermediate language as a machine language instruction". .

【0004】このような構成を有する従来の最適化コン
パイラシステムは次のように動作する。 (1)ソースプログラムを中間語に翻訳する。 (2)中間語の命令列から、命令の並び替えを行う範囲
を決定する。
A conventional optimizing compiler system having such a configuration operates as follows. (1) Translate the source program into an intermediate language. (2) A range in which instructions are rearranged is determined from the intermediate language instruction sequence.

【0005】この命令の並び替え範囲の決定は、以下の
ような手順で行う。 (2−1)中間語の命令列から処理の流れを示す流れ図
を作成する。 (2−2)その流れ図の中で、予想される実行回数が最
も多い命令を探す。 (2−3)実行回数が最も多い命令から流れ図を前後に
たどり、命令の並び替え範囲を決定する。 (3)命令並び替え範囲の中で命令を並び替える。
The determination of the instruction rearrangement range is performed in the following procedure. (2-1) Create a flowchart showing the flow of processing from the instruction sequence of the intermediate language. (2-2) In the flowchart, search for an instruction having the largest expected number of executions. (2-3) The flow chart is traced back and forth from the instruction with the largest number of executions to determine the instruction rearrangement range. (3) The instructions are rearranged in the instruction rearrangement range.

【0006】この命令の並び替えは、以下のような手順
で行う。 (3−1)命令並び替えの範囲の中で命令間の依存関係
を解析し、ある時点で、その命令の使用するデータがそ
ろっており、実行可能状態にある命令をすべて抽出す
る。 (3−2)実行可能状態にある命令のうち、その命令の
実行に要する資源と、先行する他の命令の実行に要する
資源とが衝突しない命令をひとつ選択し、プロセッサの
資源を割り当てる。 (3−3)すべての命令の処理が終わるまで繰り返すこ
とで、命令を選択された順に並び替える。 (4)並び替えた中間語を機械語命令として出力する。
The rearrangement of the instructions is performed in the following procedure. (3-1) Analyze dependencies between instructions in the range of instruction rearrangement, and at a certain point in time, extract all instructions that have data used by the instruction and are in an executable state. (3-2) Among instructions in the executable state, select one instruction in which the resource required for executing the instruction does not conflict with the resource required for executing another preceding instruction, and allocate the processor resources. (3-3) The instructions are rearranged in the selected order by repeating the processing until all the instructions are processed. (4) Output the rearranged intermediate language as a machine language instruction.

【0007】[0007]

【発明が解決しようとする課題】上述した従来のコンパ
イラシステムの第1の問題点は、並び替えの対象となる
命令の数が多くなると、各命令を並び替えるのに要する
時間が多くなり過ぎるということである。
A first problem of the above-mentioned conventional compiler system is that when the number of instructions to be rearranged increases, the time required to rearrange the instructions becomes too long. That is.

【0008】その理由は、ある命令の並び替えを行おう
とした場合に、依存関係のない他のすべての命令に対し
て要求する資源が衝突しないかどうかを調べる必要があ
るためである。
[0008] The reason is that, when an instruction is rearranged, it is necessary to check whether resources required for all other instructions having no dependency do not conflict with each other.

【0009】第2の問題点は、上述の問題を回避するた
めに、並び替えの対象とする命令を制限すると、命令の
並び替え範囲に選ばれた命令と選ばれなかった命令との
間でデータの転送が行われ、実行速度が低下するという
ことである。
A second problem is that, in order to avoid the above-mentioned problem, if the instructions to be rearranged are restricted, an instruction selected in the instruction rearrangement range and an instruction not selected are not selected. This means that the data is transferred and the execution speed is reduced.

【0010】その理由は、命令の並び順に並び替え対象
の命令を決定すると、並び替えの対象にならなかった命
令で使用するデータを定義する命令にもプロセッサの資
源(レジスタ)が割り当てられるが、レジスタの個数が
有限であるために、先行する命令の演算結果を常にレジ
スタ上に保持しておくことは出来ず、メモリとレジスタ
の間でデータの転送が行われるためである。
[0010] The reason is that when the instructions to be rearranged are determined in the order of the instructions, the resources (registers) of the processor are also allocated to the instructions that define the data used by the instructions that have not been rearranged. Because the number of registers is finite, the operation result of the preceding instruction cannot always be held in the register, and data is transferred between the memory and the register.

【0011】本発明の目的は、短い処理時間で実行速度
の速い命令列を生成できるように命令並び替えを行うコ
ンパイル装置、コンパイル方法およびコンパイラプログ
ラムを記録した記録媒体を提供することにある。
An object of the present invention is to provide a compiling apparatus, a compiling method, and a recording medium on which a compiling program is recorded, which rearranges instructions so that an instruction sequence with a high execution speed can be generated in a short processing time.

【0012】[0012]

【課題を解決するための手段】本発明のコンパイル装置
は、ソースプログラムから中間語を生成する中間語生成
手段と、前記中間語の命令列を調査して選ばれなかった
命令との間に依存関係がない命令を選んで命令並び替え
範囲を設定した第1の命令列を生成する命令並び替え範
囲決定手段と、前記第1の命令列から前記命令並び替え
範囲内の命令を並び替えて第2の命令列を生成する命令
スケジュール手段と、前記第2の命令列からオブジェク
トプログラムを生成するオブジェクトプログラム生成手
段とを備えたことを特徴とする。
SUMMARY OF THE INVENTION A compiling apparatus according to the present invention has a dependency between an intermediate language generating means for generating an intermediate language from a source program and an instruction not selected by examining the instruction sequence of the intermediate language. Instruction rearrangement range determining means for generating a first instruction sequence in which an instruction having no relation is selected and setting an instruction rearrangement range; and reordering instructions within the instruction rearrangement range from the first instruction sequence. And an object program generating means for generating an object program from the second instruction string.

【0013】本発明のコンパイル装置は、前記命令並べ
替え範囲に含まれる命令の限界数をあらかじめ設定した
ことを特徴としてもよい。
[0013] The compiling apparatus of the present invention may be characterized in that the limit number of instructions included in the instruction rearrangement range is set in advance.

【0014】本発明のコンパイル装置は、前記命令スケ
ジュール手段は、前記命令並び替え範囲内の命令を前記
中間語をより速く実行できるよう並び替えて前記第2の
命令列を生成することを特徴としてもよい。
[0014] In the compiling apparatus of the present invention, the instruction schedule means may rearrange the instructions in the instruction rearrangement range so that the intermediate language can be executed faster, and generate the second instruction sequence. Is also good.

【0015】本発明のコンパイル方法は、ソースプログ
ラムから中間語を生成し、前記中間語の命令列を調査し
て選ばれなかった命令との間に依存関係がない命令を選
んで命令並び替え範囲を設定した第1の命令列を生成
し、前記第1の命令列から前記命令並び替え範囲内の命
令を並び替えて第2の命令列を生成し、前記第2の命令
列からオブジェクトプログラムを生成することを特徴と
する。
According to the compile method of the present invention, an intermediate language is generated from a source program, an instruction sequence of the intermediate language is examined, and an instruction having no dependency with respect to an instruction which is not selected is selected. Is generated, a second instruction sequence is generated by rearranging the instructions in the instruction rearrangement range from the first instruction sequence, and an object program is generated from the second instruction sequence. It is characterized by generating.

【0016】本発明のコンパイル方法は、前記命令並べ
替え範囲に含まれる命令の限界数をあらかじめ設定した
ことを特徴としてもよい。
The compile method of the present invention may be characterized in that a limit number of instructions included in the instruction rearrangement range is set in advance.

【0017】本発明のコンパイル方法は、前記命令並び
替え範囲内の命令を前記中間語をより速く実行できるよ
う並び替えて前記第2の命令列を生成することを特徴と
してもよい。
The compile method according to the present invention may be characterized in that the instructions in the instruction rearrangement range are rearranged so that the intermediate language can be executed more quickly, and the second instruction sequence is generated.

【0018】本発明の記録媒体は、ソースプログラムか
ら中間語を生成する中間語生成処理と、前記中間語の命
令列を調査して選ばれなかった命令との間に依存関係が
ない命令を選んで命令並び替え範囲を設定した第1の命
令列を生成する命令並び替え範囲決定処理と、前記第1
の命令列から前記命令並び替え範囲内の命令を並び替え
て第2の命令列を生成する命令スケジュール処理と、前
記第2の命令列からオブジェクトプログラムを生成する
オブジェクトプログラム生成処理とをコンピュータに実
行させるためのコンパイラプログラムを記録したことを
特徴とする。
According to the recording medium of the present invention, an intermediate language generation process for generating an intermediate language from a source program, and an instruction having no dependency between an instruction not selected by examining the instruction sequence of the intermediate language are selected. An instruction rearrangement range determining process for generating a first instruction sequence in which an instruction rearrangement range is set, and
Executing, in a computer, an instruction schedule process of rearranging instructions in the instruction rearrangement range from the instruction sequence to generate a second instruction sequence, and an object program generating process of generating an object program from the second instruction sequence. The program is characterized by recording a compiler program for causing the program to execute.

【0019】本発明の記録媒体は、前記命令並べ替え範
囲に含まれる命令の限界数をあらかじめ設定したことを
特徴としてもよい。
The recording medium of the present invention may be characterized in that a limit number of instructions included in the instruction rearrangement range is set in advance.

【0020】本発明の記録媒体は、前記命令スケジュー
ル処理は、前記命令並び替え範囲内の命令を前記中間語
をより速く実行できるよう並び替えて前記第2の命令列
を生成することを特徴としてもよい。
[0020] In the recording medium of the present invention, the instruction schedule processing rearranges the instructions in the instruction rearrangement range so that the intermediate language can be executed faster, thereby generating the second instruction sequence. Is also good.

【0021】[0021]

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

【0022】図1は本発明の第1の実施の形態の構成を
示すブロック図である。図1を参照すると、コンパイル
装置101は、中間語生成手段102、命令並び替え範
囲決定手段103、命令スケジュール手段104、オブ
ジェクトプログラム生成手段105から構成されてい
る。
FIG. 1 is a block diagram showing the configuration of the first embodiment of the present invention. Referring to FIG. 1, the compiling device 101 includes an intermediate language generating unit 102, an instruction rearranging range determining unit 103, an instruction scheduling unit 104, and an object program generating unit 105.

【0023】中間語生成手段102は、ソースプログラ
ム106を読み込み、構文解析および意味解析を行い、
中間語107を生成する。
The intermediate language generating means 102 reads the source program 106, performs syntax analysis and semantic analysis,
The intermediate language 107 is generated.

【0024】命令並び替え範囲決定手段103は、中間
語107から処理の流れを表すフローグラフを作成する
フローグラフ作成手段111と、各命令の依存関係を調
査する依存関係判定手段112と、依存関係のある命令
群とそれ以外の命令群とを並び替える命令並び替え手段
113を備える。この命令並び替え範囲決定手段103
は、中間語107から第1の命令列108を生成する。
The instruction rearrangement range determining means 103 includes: a flow graph creating means 111 for creating a flow graph representing a processing flow from the intermediate language 107; a dependency determining means 112 for examining the dependency of each instruction; An instruction rearranging unit 113 for rearranging an instruction group having a command and another instruction group is provided. This instruction rearrangement range determining means 103
Generates a first instruction sequence 108 from the intermediate language 107.

【0025】命令スケジュール手段104は、第1の命
令列108から中間語107をより速く実行できるよう
並び替えた第2の命令列109を生成する。
The instruction schedule means 104 generates a second instruction sequence 109 from the first instruction sequence 108 which is rearranged so that the intermediate language 107 can be executed faster.

【0026】オブジェクトプログラム生成手段105
は、第2の命令列109からオブジェクトプログラム1
10を生成する。
Object program generating means 105
Is the object program 1 from the second instruction sequence 109.
Generate 10.

【0027】次に、図1および図2を参照して本実施の
形態の全体の動作について詳細に説明する。図2は命令
並び替え範囲決定手段103の動作を示すフローチャー
トである。ステップ201〜204はフローグラフ作成
手段111の動作である。ステップ205以降は依存関
係判定手段112と命令並べ替え手段113との動作で
ある。
Next, the overall operation of the present embodiment will be described in detail with reference to FIGS. FIG. 2 is a flowchart showing the operation of the instruction rearrangement range determining means 103. Steps 201 to 204 are operations of the flow graph creation unit 111. Step 205 and subsequent steps are operations of the dependency determination unit 112 and the instruction rearranging unit 113.

【0028】まず、図2の初期化処理(ステップ20
1)で命令並び替え範囲決定手段103の初期化を行
う。
First, the initialization process shown in FIG.
In 1), the instruction rearrangement range determining means 103 is initialized.

【0029】ステップ202で中間語がまだあるかどう
かを調べ、もしまだあれば、中間語取り出し処理(ステ
ップ203)に進み、中間語107から中間語をひとつ
取り出す。
At step 202, it is checked whether or not there is an intermediate word. If there is, an intermediate word extracting process (step 203) is performed to extract one intermediate word from the intermediate word 107.

【0030】さらに、中間語変換処理(ステップ20
4)に進み、ステップ203で取り出したひとつの中間
語をひとつの命令に変換する。
Further, an intermediate language conversion process (step 20)
Proceeding to 4), one intermediate language extracted in step 203 is converted into one instruction.

【0031】次に、依存関係解析処理(ステップ20
5)に進み、ステップ204で変換した命令が使用する
データを定義している命令が命令チェーンに登録されて
いればステップ204で変換した命令が使用するデータ
を定義している命令をチェーンから解除する。
Next, a dependency analysis process (step 20)
Proceeding to 5), if an instruction defining data used by the instruction converted in step 204 is registered in the instruction chain, release the instruction defining data used by the converted instruction in step 204 from the chain. I do.

【0032】さらに、命令チェーン登録処理(ステップ
206)に進み、ステップ204で変換した命令を命令
チェーンに登録する。
Further, the process proceeds to an instruction chain registration process (step 206), and the instruction converted in step 204 is registered in the instruction chain.

【0033】ステップ202〜ステップ206を中間語
107の中に中間語がひとつもなくなるまで繰り返す。
Steps 202 to 206 are repeated until there is no intermediate language in the intermediate language 107.

【0034】この段階で、命令チェーンには定義したデ
ータをそれ以降のどの命令でも使用されない命令、ある
いはデータを定義しない命令が登録されている。
At this stage, in the instruction chain, an instruction whose defined data is not used in any subsequent instructions or an instruction whose data is not defined is registered.

【0035】次に、ステップ207で命令チェーンが存
在するか、命令並び替え範囲に含まれる命令の限界数を
越えていないかどうかを調べ、もし、命令チェーンが存
在し、命令並び替え範囲に含まれる命令の限界数を越え
ていなければ、命令選択処理1(ステップ208)に進
み、命令チェーンからひとつ命令を取り出す。命令並び
替え範囲に含まれる命令の限界数は、あらかじめ設定し
ておく。
Next, at step 207, it is checked whether or not the instruction chain exists or does not exceed the limit number of instructions included in the instruction rearrangement range. If the number does not exceed the limit number of instructions to be executed, the process proceeds to instruction selection processing 1 (step 208), and one instruction is taken out of the instruction chain. The limit number of instructions included in the instruction rearrangement range is set in advance.

【0036】さらに、命令マーク処理(ステップ20
9)に進み、命令にマークする。
Further, the instruction mark processing (step 20)
Go to 9) and mark the instruction.

【0037】次に、ステップ210でステップ208で
選択した命令が使用するデータがあるかどうかを調べ、
もし、存在すれば、再帰呼出し処理(ステップ211)
に進み、命令が使用するデータを定義する命令、さらに
その命令が使用するデータを定義する命令・・・といっ
た風に再帰的に、ステップ209〜ステップ211を繰
り返す。
Next, at step 210, it is checked whether or not there is data used by the instruction selected at step 208.
If it exists, recursive call processing (step 211)
Steps 209 to 211 are recursively repeated, such as an instruction for defining data used by the instruction, an instruction for defining data used by the instruction, and so on.

【0038】もし、依存する命令がなければ、再帰的処
理から抜け出し、最終的にステップ207から処理を繰
り返す。
If there is no dependent instruction, the process exits from the recursive process and finally repeats the process from step 207.

【0039】次に、ステップ212に進み命令列を順に
たどる。まだ、最後でなければ、命令選択処理2(ステ
ップ213)に進み、命令をひとつ選択する。
Next, the flow advances to step 212 to sequentially follow the instruction sequence. If it is not the last, the process proceeds to the instruction selection process 2 (step 213) to select one instruction.

【0040】さらに、ステップ214に進み、ステップ
213で選択した命令がステップ209でマークされて
いるかどうかを調べる。
Further, the process proceeds to step 214, and it is checked whether or not the instruction selected in step 213 is marked in step 209.

【0041】もし、マークされていなければ、命令並び
替え処理(ステップ215)に進み、その命令を命令列
の最後に付け足す。
If it is not marked, the process proceeds to the instruction rearrangement process (step 215), and the instruction is added to the end of the instruction sequence.

【0042】ステップ212〜ステップ215を命令列
がなくなるまで繰り返す。
Steps 212 to 215 are repeated until there is no instruction sequence.

【0043】この段階で、命令列はステップ209でマ
ークされた命令とステップ209でマークされていない
命令がそれぞれ連続している。
At this stage, in the instruction sequence, the instruction marked in step 209 and the instruction not marked in step 209 are respectively continuous.

【0044】次に命令並び替え範囲決定処理(ステップ
216)に進み、命令列のうちステップ209でマーク
された命令の含まれる範囲を命令並び替え範囲として決
定する。
Next, the process proceeds to the instruction rearrangement range determination processing (step 216), and the range of the instruction sequence that includes the instruction marked in step 209 is determined as the instruction rearrangement range.

【0045】最後に、終了処理(ステップ217)に進
み処理を終わる。
Finally, the process proceeds to an end process (step 217) to end the process.

【0046】このようにして、命令並び替え範囲決定手
段103で第1の命令列108を生成する。命令スケジ
ュール手段104では、第1の命令列108の内、命令
並び替え範囲として決定された範囲内の命令を、中間語
をより速く実行できるように並べ替えて、第2の命令列
109を生成する。
Thus, the first instruction sequence 108 is generated by the instruction rearrangement range determining means 103. The instruction schedule unit 104 rearranges the instructions in the range determined as the instruction rearrangement range in the first instruction sequence 108 so that the intermediate language can be executed faster, and generates the second instruction sequence 109. I do.

【0047】次に、本発明の第2の実施の形態について
説明する。図3は本発明の第2の実施の形態の構成を示
すブロック図である。図3を参照すると、第2の実施の
形態は、コンパイル装置101と記録媒体121を含
む。記録媒体121は、コンパイラプログラムを記録し
ている。この記録媒体121は、磁気ディスク、半導体
メモリ、光ディスク、その他の記録媒体であってよい。
Next, a second embodiment of the present invention will be described. FIG. 3 is a block diagram showing a configuration of the second exemplary embodiment of the present invention. Referring to FIG. 3, the second embodiment includes a compiling device 101 and a recording medium 121. The recording medium 121 records a compiler program. This recording medium 121 may be a magnetic disk, a semiconductor memory, an optical disk, or another recording medium.

【0048】コンパイラプログラムは記録媒体121か
らコンパイル装置101に読み込まれ、第1の実施の形
態における中間語生成手段102、命令並び替え範囲決
定手段103、命令スケジュール手段104、オブジェ
クトプログラム生成手段105の処理と同様の処理を行
う。
The compiler program is read from the recording medium 121 into the compiling device 101, and is processed by the intermediate language generating means 102, the instruction rearranging range determining means 103, the instruction scheduling means 104, and the object program generating means 105 in the first embodiment. The same processing is performed.

【0049】コンパイラプログラムは、ソースプログラ
ム106から中間語107を生成する中間語生成処理
と、中間語107の命令列を調査して選ばれなかった命
令との間に依存関係がない命令を選んで命令並び替え範
囲を設定した第1の命令列108を生成する命令並び替
え範囲決定処理と、第1の命令列108から命令並び替
え範囲内の命令を中間語をより速く実行できるよう並び
替えて第2の命令列109を生成する命令スケジュール
処理と、第2の命令列109からオブジェクトプログラ
ム110を生成するオブジェクトプログラム生成処理と
を行う。命令並べ替え範囲に含まれる命令の限界数はあ
らかじめ設定しておく。
The compiler program selects an instruction having no dependency between the intermediate language generation processing for generating the intermediate language 107 from the source program 106 and the instruction not selected by examining the instruction sequence of the intermediate language 107. An instruction rearrangement range determination process for generating a first instruction sequence 108 in which an instruction rearrangement range is set, and rearranging the instructions in the instruction rearrangement range from the first instruction sequence 108 so that the intermediate language can be executed faster. An instruction schedule process for generating the second instruction sequence 109 and an object program generation process for generating the object program 110 from the second instruction sequence 109 are performed. The limit number of instructions included in the instruction rearrangement range is set in advance.

【0050】[0050]

【発明の効果】以上説明したように、本発明は、命令の
並び替え範囲に含まれる命令の最大数を越えないため、
さらに、命令の並び替え範囲として選んだ命令は、選ば
れなかった命令との間にデータの依存が存在しないの
で、境界でデータの転送が行われないため、処理時間の
著しい増加を招くことなく、実行速度の速い命令列を生
成することができるという効果がある。
As described above, the present invention does not exceed the maximum number of instructions included in the instruction rearrangement range.
Furthermore, the instruction selected as the instruction rearrangement range has no data dependency between the instruction not selected and the data is not transferred at the boundary, so that the processing time does not significantly increase. Thus, there is an effect that an instruction sequence with a high execution speed can be generated.

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

【図1】本発明の第1の実施の形態の構成を示すブロッ
ク図である。
FIG. 1 is a block diagram showing a configuration of a first exemplary embodiment of the present invention.

【図2】命令並び替え範囲決定手段の動作を示すフロー
チャートである。
FIG. 2 is a flowchart showing an operation of an instruction rearrangement range determining unit.

【図3】本発明の第2の実施の形態の構成を示すブロッ
ク図である。
FIG. 3 is a block diagram showing a configuration of a second exemplary embodiment of the present invention.

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

101 コンパイル装置 102 中間語生成手段 103 命令並び替え範囲決定手段 104 命令スケジュール手段 105 オブジェクトプログラム生成手段 106 ソースプログラム 107 中間語 108 第1の命令列 109 第2の命令列 110 オブジェクトプログラム 111 フローグラフ作成手段 112 依存関係判定手段 113 命令並び替え手段 121 記録媒体 Reference Signs List 101 Compiling device 102 Intermediate language generating means 103 Instruction rearranging range determining means 104 Instruction scheduling means 105 Object program generating means 106 Source program 107 Intermediate language 108 First instruction string 109 Second instruction string 110 Object program 111 Flow graph creating means 112 Dependency determining means 113 Instruction rearranging means 121 Recording medium

Claims (9)

【特許請求の範囲】[Claims] 【請求項1】 ソースプログラムから中間語を生成する
中間語生成手段と、前記中間語の命令列を調査して選ば
れなかった命令との間に依存関係がない命令を選んで命
令並び替え範囲を設定した第1の命令列を生成する命令
並び替え範囲決定手段と、前記第1の命令列から前記命
令並び替え範囲内の命令を並び替えて第2の命令列を生
成する命令スケジュール手段と、前記第2の命令列から
オブジェクトプログラムを生成するオブジェクトプログ
ラム生成手段とを備えたことを特徴とするコンパイル装
置。
An instruction rearranging range is selected by selecting an intermediate language generating means for generating an intermediate language from a source program, and selecting an instruction having no dependency between the instruction sequence of the intermediate language and an instruction not selected. Instruction rearrangement range determining means for generating a first instruction sequence in which is set, and instruction scheduling means for rearranging instructions within the instruction rearrangement range from the first instruction sequence to generate a second instruction sequence. And an object program generating means for generating an object program from the second instruction sequence.
【請求項2】 前記命令並べ替え範囲に含まれる命令の
限界数をあらかじめ設定したことを特徴とする請求項1
記載のコンパイル装置。
2. The method according to claim 1, wherein a limit number of instructions included in the instruction rearrangement range is set in advance.
Compiling device as described.
【請求項3】 前記命令スケジュール手段は、前記命令
並び替え範囲内の命令を前記中間語をより速く実行でき
るよう並び替えて前記第2の命令列を生成することを特
徴とする請求項1または2記載のコンパイル装置。
3. The second instruction sequence according to claim 1, wherein the instruction schedule unit rearranges the instructions within the instruction rearrangement range so that the intermediate language can be executed faster. 2. The compiling device according to item 2.
【請求項4】 ソースプログラムから中間語を生成し、
前記中間語の命令列を調査して選ばれなかった命令との
間に依存関係がない命令を選んで命令並び替え範囲を設
定した第1の命令列を生成し、前記第1の命令列から前
記命令並び替え範囲内の命令を並び替えて第2の命令列
を生成し、前記第2の命令列からオブジェクトプログラ
ムを生成することを特徴とするコンパイル方法。
4. An intermediate language is generated from a source program,
By examining the instruction sequence of the intermediate language, an instruction having no dependency with the instruction not selected is selected, and a first instruction sequence in which an instruction rearrangement range is set is generated. A compiling method comprising: rearranging instructions within the instruction rearrangement range to generate a second instruction sequence; and generating an object program from the second instruction sequence.
【請求項5】 前記命令並べ替え範囲に含まれる命令の
限界数をあらかじめ設定したことを特徴とする請求項4
記載のコンパイル方法。
5. The method according to claim 4, wherein a limit number of instructions included in the instruction rearrangement range is set in advance.
Compilation method described.
【請求項6】 前記命令並び替え範囲内の命令を前記中
間語をより速く実行できるよう並び替えて前記第2の命
令列を生成することを特徴とする請求項4または5記載
のコンパイル方法。
6. The compiling method according to claim 4, wherein the instructions in the instruction rearrangement range are rearranged so that the intermediate language can be executed faster, and the second instruction sequence is generated.
【請求項7】 ソースプログラムから中間語を生成する
中間語生成処理と、前記中間語の命令列を調査して選ば
れなかった命令との間に依存関係がない命令を選んで命
令並び替え範囲を設定した第1の命令列を生成する命令
並び替え範囲決定処理と、前記第1の命令列から前記命
令並び替え範囲内の命令を並び替えて第2の命令列を生
成する命令スケジュール処理と、前記第2の命令列から
オブジェクトプログラムを生成するオブジェクトプログ
ラム生成処理とをコンピュータに実行させるためのコン
パイラプログラムを記録したことを特徴とする記録媒
体。
7. An instruction rearrangement range in which an intermediate language generating process for generating an intermediate language from a source program and an instruction having no dependency between the instruction sequence of the intermediate language and an instruction not selected are selected. Instruction rearrangement range determination processing for generating a first instruction sequence in which is set, and instruction schedule processing for rearranging instructions within the instruction rearrangement range from the first instruction sequence to generate a second instruction sequence. And a compiler program for causing a computer to execute an object program generation process for generating an object program from the second instruction sequence.
【請求項8】 前記命令並べ替え範囲に含まれる命令の
限界数をあらかじめ設定したことを特徴とする請求項7
記載の記録媒体。
8. The method according to claim 7, wherein a limit number of instructions included in the instruction rearrangement range is set in advance.
The recording medium according to the above.
【請求項9】 前記命令スケジュール処理は、前記命令
並び替え範囲内の命令を前記中間語をより速く実行でき
るよう並び替えて前記第2の命令列を生成することを特
徴とする請求項7または8記載の記録媒体。
9. The instruction schedule process according to claim 7, wherein the instructions in the instruction rearrangement range are rearranged so that the intermediate language can be executed faster, and the second instruction sequence is generated. 8. The recording medium according to 8.
JP08110399A 1999-03-25 1999-03-25 Compiling device, compiling method, and recording medium recording compiler program Expired - Fee Related JP3323147B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP08110399A JP3323147B2 (en) 1999-03-25 1999-03-25 Compiling device, compiling method, and recording medium recording compiler program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP08110399A JP3323147B2 (en) 1999-03-25 1999-03-25 Compiling device, compiling method, and recording medium recording compiler program

Publications (2)

Publication Number Publication Date
JP2000276356A true JP2000276356A (en) 2000-10-06
JP3323147B2 JP3323147B2 (en) 2002-09-09

Family

ID=13737061

Family Applications (1)

Application Number Title Priority Date Filing Date
JP08110399A Expired - Fee Related JP3323147B2 (en) 1999-03-25 1999-03-25 Compiling device, compiling method, and recording medium recording compiler program

Country Status (1)

Country Link
JP (1) JP3323147B2 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2020240830A1 (en) * 2019-05-31 2020-12-03 三菱電機株式会社 Detection device, detection method, and detection program

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2020240830A1 (en) * 2019-05-31 2020-12-03 三菱電機株式会社 Detection device, detection method, and detection program
JPWO2020240830A1 (en) * 2019-05-31 2021-10-21 三菱電機株式会社 Detection device, detection method, and detection program

Also Published As

Publication number Publication date
JP3323147B2 (en) 2002-09-09

Similar Documents

Publication Publication Date Title
US5606697A (en) Compiler system for language processing program
JP2004302706A (en) Program parallelization device, program parallelization method, and program parallelization program
EP0428560A1 (en) Machine process for translating programs in binary machine language into another binary machine language
JPH04307625A (en) Loop optimization system
JP2002149416A (en) Method for optimizing program and compiler using the same
JP2006338616A (en) Compiler device
JP2000035893A (en) Method for statically initializing arrangement of data processing system, data processing method, data processing system and computer readable storage medium storing program making computer execute its control procedure
JP3651774B2 (en) Compiler and its register allocation method
US20130262824A1 (en) Code generation method, and information processing apparatus
JP2002527816A (en) Program optimization apparatus and method
JP2008305337A (en) Program converter, program conversion method, program, storage medium, debugging device, debugging method and program development system
JP3323147B2 (en) Compiling device, compiling method, and recording medium recording compiler program
JP2001125792A (en) Optimization promoting device
US20080282237A1 (en) Method and Apparatus For Generating Execution Equivalence Information
JPH02176938A (en) Machine language instruction optimizing system
JP3608993B2 (en) Compiler device and recording medium recording compiler program
JP3473391B2 (en) Program processing method, program processing device, and recording medium
JP7026563B2 (en) High-level synthesis method, high-level synthesis program, high-level synthesis device
JP3152194B2 (en) Compiling device, compiling method, and recording medium recording compiler
JP3018783B2 (en) Compilation method
JP3551352B2 (en) Loop splitting method
JPH11154093A (en) Program compiler and storage medium recording compiler program
JPH0561687A (en) Processing system for compiler
JP2004062324A (en) Optimizing compiler, method of optimizing program, program and storage medium
JPH11195011A (en) Language translation processor, language translation processing method and record medium recording language translation processing program

Legal Events

Date Code Title Description
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20020604

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

S533 Written request for registration of change of name

Free format text: JAPANESE INTERMEDIATE CODE: R313533

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20080628

Year of fee payment: 6

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20090628

Year of fee payment: 7

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20100628

Year of fee payment: 8

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20100628

Year of fee payment: 8

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20110628

Year of fee payment: 9

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20120628

Year of fee payment: 10

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20120628

Year of fee payment: 10

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20130628

Year of fee payment: 11

S111 Request for change of ownership or part of ownership

Free format text: JAPANESE INTERMEDIATE CODE: R313111

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

LAPS Cancellation because of no payment of annual fees