JP3156343B2 - Data dependency information processing method - Google Patents

Data dependency information processing method

Info

Publication number
JP3156343B2
JP3156343B2 JP05402192A JP5402192A JP3156343B2 JP 3156343 B2 JP3156343 B2 JP 3156343B2 JP 05402192 A JP05402192 A JP 05402192A JP 5402192 A JP5402192 A JP 5402192A JP 3156343 B2 JP3156343 B2 JP 3156343B2
Authority
JP
Japan
Prior art keywords
data dependency
processing
operand
data
intermediate text
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
JP05402192A
Other languages
Japanese (ja)
Other versions
JPH05257706A (en
Inventor
正樹 青木
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.)
Fujitsu Ltd
Original Assignee
Fujitsu 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 Fujitsu Ltd filed Critical Fujitsu Ltd
Priority to JP05402192A priority Critical patent/JP3156343B2/en
Publication of JPH05257706A publication Critical patent/JPH05257706A/en
Application granted granted Critical
Publication of JP3156343B2 publication Critical patent/JP3156343B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Landscapes

  • Devices For Executing Special Programs (AREA)

Description

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

【0001】[0001]

【産業上の利用分野】本発明は、計算機におけるコンパ
イラの処理において、プログラム上のデータ依存関係を
示す情報を保持し利用するための、データ依存関係情報
処理方法に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a data dependency information processing method for retaining and using information indicating data dependency on a program in a compiler process in a computer.

【0002】[0002]

【従来の技術と発明が解決しようとする課題】原始プロ
グラムから目的プログラムを生成するコンパイラの処理
では、通常先ず原始プログラムを解析して、その後の処
理に都合のよいように規定された中間言語による中間テ
キストに変換する。
2. Description of the Related Art In the processing of a compiler for generating a target program from a source program, the source program is usually analyzed first, and an intermediate language defined in a manner suitable for the subsequent processing is used. Convert to intermediate text.

【0003】次に、この中間テキストについて、例えば
共通式の除去、ループの融合整理、メモリアクセスの同
期化等の、いわゆる最適化処理を行って、効率の良い目
的プログラムとなるように修正し、最適化した中間テキ
ストから、目的プログラムを生成する。
[0003] Next, the intermediate text is subjected to so-called optimization processing such as removal of a common expression, fusion and arrangement of loops, synchronization of memory access, etc., so as to be modified so as to become an efficient target program. Generate the target program from the optimized intermediate text.

【0004】前記のような最適化を行う場合に、最適化
対象の検出及び最適化の制約として重要な条件に、公知
のいわゆるデータ依存関係がある。ここでデータ依存関
係とは公知のように、例えば中間テキストの各オペレー
ションのオペランドとなるデータについて、プログラム
論理上から、同一のオペランドの参照と定義との間で一
定の時間的な順序関係が保たれなければならない場合の
両オペランド間の関係である。
[0004] In performing the above-mentioned optimization, an important condition as a constraint of the detection and optimization of the optimization target is a known so-called data dependency. Here, as is well known, for example, data that is an operand of each operation of an intermediate text has a predetermined temporal order relationship between the reference and the definition of the same operand from the viewpoint of program logic. This is the relationship between both operands when they must be drooped.

【0005】そこでコンパイラは、データに付けられた
名前についてビット位置を割り付けた制御情報を設け
て、プログラム解析結果により、或る名前のデータの参
照によって、或る名前のデータが定義される関係を、該
当ビットのオン/オフで表しておく。
Accordingly, the compiler provides control information in which bit positions are assigned to names assigned to data, and based on the result of the program analysis, defines the relationship in which data having a certain name is defined by referring to data having a certain name. , The corresponding bit on / off.

【0006】又、以上の情報では、配列データについて
添字を考慮したデータ依存関係を識別できないので、配
列データの添字を意識したデータ依存関係の識別が必要
になった時点で、オペランドの配列データの添字や、ル
ープの制御情報をもとにして、データの定義及び参照状
況を解析する。
Further, in the above information, the data dependency in consideration of the subscript cannot be identified for the array data. Therefore, when it is necessary to identify the data dependency in consideration of the subscript of the array data, the data of the operand array data is identified. The data definition and reference status are analyzed based on the subscripts and loop control information.

【0007】しかし、データ依存関係を前記のように必
要の都度認識するのは、コンパイラの処理効率が悪い。
又、認識したデータ依存関係を、中間テキスト上の該当
するオペレーションに対応して記憶しておくことになる
ので、最適化過程で中間テキストの位置関係や内部情報
が変更されると、同じデータ依存関係についても、再度
プログラムを解析して認識しなければならない場合が生
じて、更に処理効率を害する。
However, recognizing the data dependency as necessary as described above is inefficient in the processing efficiency of the compiler.
In addition, since the recognized data dependency is stored in correspondence with the corresponding operation on the intermediate text, if the positional relationship or the internal information of the intermediate text is changed in the optimization process, the same data dependency is stored. Regarding the relationship, there is a case where the program must be analyzed and recognized again, which further impairs the processing efficiency.

【0008】本発明は、データ依存関係を示す情報を、
効率良く保持し、利用できるようにしたデータ依存関係
情報処理方法を目的とする。
According to the present invention, information indicating a data dependency is
It is an object of the present invention to provide a data dependency information processing method that can be efficiently stored and used.

【0009】[0009]

【課題を解決するための手段】図1は、本発明の構成を
示す処理の流れ図である。図は、所定言語の原始プログ
ラムから、所定言語の中間テキストを生成し、該中間テ
キストから目的プログラムを生成するコンパイラの処理
における、データ依存関係情報処理方法の構成である。
FIG. 1 is a flow chart of the processing showing the configuration of the present invention. The figure shows the configuration of a data dependency information processing method in the processing of a compiler that generates an intermediate text in a predetermined language from a source program in a predetermined language and generates a target program from the intermediate text.

【0010】本処理方法では、処理ステップ1で該中間
テキストの各オペランドごとに対応して、所定の範囲種
類のデータ依存関係ごとに対応するデータ依存関係識別
子を設ける。
In this processing method, a data dependency identifier corresponding to each data dependency of a predetermined range type is provided in processing step 1 for each operand of the intermediate text.

【0011】処理ステップ3により、該中間テキストの
プログラム論理上の所定のデータ依存関係を解析し、処
理ステップ4〜9により、該データ依存関係を有する該
オペランドの群ごとに異なる数値を、当該オペランドの
当該範囲種類の該データ依存関係識別子に記録する。
At a processing step 3, a predetermined data dependency on the program logic of the intermediate text is analyzed, and at a processing step 4 to 9, a different numerical value for each of the operand groups having the data dependency is assigned to the operand. Is recorded in the data dependency identifier of the range type.

【0012】該中間テキストの最適化処理の場合に、該
データ依存関係識別子によって、必要な該オペランド間
の該データ依存関係の識別を行う。
In the process of optimizing the intermediate text, the data dependency identifier between the operands is identified by the data dependency identifier.

【0013】[0013]

【作用】本発明の処理方法により、中間テキストの各オ
ペランドについて、例えば基本リージョン内、ループ
内、ループ間等の所要の範囲種類ごとにデータ依存関係
識別子が設けられ、各範囲内のデータ依存関係を解析し
て、各関係ごとにユニークな番号が該当の全オペランド
のデータ依存関係識別子に記録される。
According to the processing method of the present invention, for each operand of the intermediate text, a data dependency identifier is provided for each required range type, for example, in a basic region, in a loop, between loops, and the like. Is analyzed, and a unique number for each relationship is recorded in the data dependency identifier of all the corresponding operands.

【0014】従って、最適化処理の中で、データ依存関
係の識別が必要な場合には、所要のオペランドのデータ
依存関係識別子をみれば、データ依存関係の有無が直ち
に分かり、その詳細は同じ番号をデータ依存関係識別子
に持つオペランドを検索して知ることができる。
Therefore, when it is necessary to identify the data dependency during the optimization process, the data dependency identifier of the required operand can be immediately recognized as to whether or not the data dependency exists. Can be found by searching for an operand having a as a data dependency identifier.

【0015】[0015]

【実施例】データ依存関係識別子は、例えば中間テキス
トの各オペランドの領域を拡大して、必要な個数のデー
タ依存関係識別子の領域とすることにより設ける。
DESCRIPTION OF THE PREFERRED EMBODIMENTS A data dependency identifier is provided, for example, by enlarging the area of each operand of an intermediate text to provide a necessary number of data dependency identifier areas.

【0016】各オペランドに設けるデータ依存関係識別
子の個数は、コンパイラの処理上で必要とするプログラ
ム範囲の種類ごとに、異なるデータ依存関係識別子を使
用するように、必要な範囲種類の数に等しくする。
The number of data dependency identifiers provided for each operand is made equal to the number of necessary range types so that different data dependency identifiers are used for each type of program range required in the processing of the compiler. .

【0017】この範囲種類としては、例えば基本リージ
ョン内、ループ内、及びループ間等があるが、その他の
範囲を設けてもよい。ここで基本リージョンとは、コン
パイラで処理の都合等から定める最適化処理の最小範囲
をいうものとする。
The range type includes, for example, in a basic region, in a loop, between loops, and the like, but other ranges may be provided. Here, the basic region refers to the minimum range of the optimization processing determined by the compiler for the convenience of the processing.

【0018】ループ内のデータ依存関係とは、ループの
繰り返しの1回の実行の中でのデータ依存関係を解析対
象とする場合をいうものとし、その中に複数の基本リー
ジョンを含む場合もある(図2(b)に示す例で、で示
す範囲が1つのループ内解析対象の範囲の場合に、及
びはそれぞれ基本リージョンであってよい)。又、ル
ープ間とは、ループの繰り返し相互間に存在するデータ
依存関係をいうものとする。
The data dependency in the loop refers to the case where the data dependency in one execution of the loop iteration is to be analyzed, and may include a plurality of basic regions. (In the example shown in FIG. 2B, when the range indicated by is the range of one in-loop analysis target, and may be basic regions, respectively). The term "between loops" refers to a data dependency existing between repetitions of a loop.

【0019】データ依存関係識別子に記録する数値は、
例えば「0」を無効(データ依存関係について未解析)
の表示、「1」をデータ依存関係が無いことの表示とす
る。データ依存関係が有る場合には、「2」以上の数値
を使用し、依存関係を持つオペランドの群に、その範囲
種類内でユニークな同じ値を与えるようにする。
The numerical value recorded in the data dependency identifier is:
For example, "0" is invalid (data dependency is not analyzed)
And “1” indicates that there is no data dependency. If there is a data dependency, a value greater than or equal to "2" is used to give the group of operands having the dependency the same value unique within the range type.

【0020】図2は、以上のように定めるデータ依存関
係識別子の設定例を示し、図2(a)は基本リージョン内
の例、(b)はループ内の例、(c)はループ間の例である。
図には、説明のために中間テキストに代えて、FORTRAN
言語の原始プログラム形式でプログラムを示し、各変数
の後に付けた長方形枠で、オペランドに対応して設ける
データ依存関係識別子を表す。
FIG. 2 shows an example of setting the data dependency identifier determined as described above. FIG. 2A shows an example in a basic region, FIG. 2B shows an example in a loop, and FIG. It is an example.
The figure uses FORTRAN instead of intermediate text for illustration.
A program is shown in the form of a source program of a language, and a data dependency identifier provided corresponding to an operand is indicated by a rectangular frame attached to each variable.

【0021】各枠内の3数値は基本リージョン内,ルー
プ内,ループ間の順に、各データ依存関係識別子を表す
ものとする。図2(b)においてデータC(I)について
は、基本リージョン内の関係として捕らえられるので、
図示のようにループ内の関係で示す必要は無いが、処理
の便宜上両者に重複して示してもよい。
The three numerical values in each frame represent each data dependency identifier in the order of the basic region, the loop, and the loop. In FIG. 2B, the data C (I) is captured as a relationship in the basic region.
It is not necessary to show the relationship in a loop as shown in the figure, but for convenience of processing, it may be shown in both of them.

【0022】図1に示す処理の流れを、詳細に説明する
と、処理ステップ1の初期設定で、中間テキストの各オ
ペランドについてデータ依存関係識別子の領域を取り、
それらをすべて「0」に設定する。
The processing flow shown in FIG. 1 will be described in detail. In the initial setting of the processing step 1, an area of a data dependency identifier is obtained for each operand of the intermediate text.
Set them all to “0”.

【0023】処理ステップ2で解析対象の範囲種類を決
める。処理ステップ3で中間テキストについて解析し、
現処理対象の範囲種類のデータ依存関係識別子が「0」
であるオペランドについて、データ依存関係を持つオペ
ランドを通常の方法で解析し検索する処理を行う。
In processing step 2, the range type to be analyzed is determined. Analyzing the intermediate text in processing step 3,
The data dependency identifier of the range type of the current processing target is “0”
For the operand of, an operand having a data dependency is analyzed and searched in a usual manner.

【0024】この場合に基本リージョン内、及びループ
内ではプログラム上の上から下の方向の依存関係を求め
る。その結果そのオペランドについて、データ依存関係
が検出されれば、処理ステップ4を経て処理ステップ5
で「2」から始める番号を、使用するごとに+1して更
新して現在の番号値を得、検出したデータ依存関係の全
オペランドのデータ依存関係識別子に、処理ステップ6
で現在の番号値を記録する。
In this case, in the basic region and in the loop, the dependency from the top to the bottom in the program is obtained. As a result, if a data dependency is detected for the operand, the processing goes through processing step 4 to processing step 5
The number starting from “2” is incremented by one each time it is used, and is updated to obtain the current number value, and the data dependency identifiers of all operands of the detected data dependency are set in processing step 6
To record the current number value.

【0025】又、データ依存関係を持たないオペランド
であることが判った場合には、処理ステップ4を経て処
理ステップ7で「1」を、そのオペランドのデータ依存
関係識別子に記録する。
If it is determined that the operand has no data dependency, "1" is recorded in the data dependency identifier of the operand in processing step 7 after processing step 4.

【0026】以上の後、処理ステップ8で識別して、現
処理対象の範囲種類のデータ依存関係識別子に0を持つ
オペランドがあれば、処理ステップ3に戻って以上の処
理を行う。
After the above, if there is an operand identified as 0 in the data dependency identifier of the range type of the current processing target identified in the processing step 8, the processing returns to the processing step 3 and the above processing is performed.

【0027】或る範囲種類について処理が終われば、処
理ステップ9で識別して、未処理の範囲種類があれば処
理ステップ2に戻り、以上の処理を繰り返すものとす
る。
When the processing is completed for a certain range type, it is identified in processing step 9; if there is an unprocessed range type, the process returns to processing step 2 and the above processing is repeated.

【0028】[0028]

【発明の効果】以上の説明から明らかなように本発明に
よれば、計算機におけるコンパイラの処理において、デ
ータ依存関係を示す情報を、効率良く保持し、利用でき
るようになるので、コンパイラの最適化処理の処理効率
を向上するという著しい工業的効果がある。
As is apparent from the above description, according to the present invention, in the processing of the compiler in the computer, the information indicating the data dependency can be efficiently held and used. There is a remarkable industrial effect of improving the processing efficiency of the processing.

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

【図1】 本発明の構成を示す処理の流れ図FIG. 1 is a flowchart of a process showing a configuration of the present invention.

【図2】 データ依存関係識別子の設定例を示す図FIG. 2 is a diagram showing a setting example of a data dependency identifier.

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

1〜9 処理ステップ 1-9 processing steps

Claims (1)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】 所定言語の原始プログラムから、所定言
語の中間テキストを生成し、該中間テキストから目的プ
ログラムを生成するコンパイラの処理において、 該中間テキストの各オペランドごとに対応して、所定の
範囲種類のデータ依存関係ごとに対応するデータ依存関
係識別子を設け(1)、 該中間テキストのプログラム論理上の所定のデータ依存
関係を解析して(3) 、該データ依存関係を有する該オペ
ランドの群ごとに異なる数値を、当該オペランドの当該
範囲種類の該データ依存関係識別子に記録し(2、4〜
9)、 該中間テキストの最適化処理の場合に、該データ依存関
係識別子によって、必要な該オペランド間の該データ依
存関係の識別を行うように構成されていることを特徴と
するデータ依存関係情報処理方法。
1. A compiler for generating an intermediate text in a predetermined language from a source program in a predetermined language and generating a target program from the intermediate text, wherein a predetermined range corresponding to each operand of the intermediate text is provided. A data dependency identifier corresponding to each type of data dependency is provided (1), a predetermined data dependency on the program logic of the intermediate text is analyzed (3), and a group of the operands having the data dependency is analyzed. Is recorded in the data dependency identifier of the range type of the operand (2, 4 to
9), in the case of the intermediate text optimizing process, the data dependency identifier between the operands required is identified by the data dependency identifier. Processing method.
JP05402192A 1992-03-13 1992-03-13 Data dependency information processing method Expired - Fee Related JP3156343B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP05402192A JP3156343B2 (en) 1992-03-13 1992-03-13 Data dependency information processing method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP05402192A JP3156343B2 (en) 1992-03-13 1992-03-13 Data dependency information processing method

Publications (2)

Publication Number Publication Date
JPH05257706A JPH05257706A (en) 1993-10-08
JP3156343B2 true JP3156343B2 (en) 2001-04-16

Family

ID=12958935

Family Applications (1)

Application Number Title Priority Date Filing Date
JP05402192A Expired - Fee Related JP3156343B2 (en) 1992-03-13 1992-03-13 Data dependency information processing method

Country Status (1)

Country Link
JP (1) JP3156343B2 (en)

Also Published As

Publication number Publication date
JPH05257706A (en) 1993-10-08

Similar Documents

Publication Publication Date Title
JPH06259400A (en) Simulation operating method of complicate system
JPH02264329A (en) Automatic program generating device
JPH02217926A (en) Compiler
US11301218B2 (en) Graph-based vectorization for software code optimization references
US11256488B1 (en) Graph-based vectorization for software code optimizations
JP3156343B2 (en) Data dependency information processing method
JP3318051B2 (en) Translation processing method
US8402445B2 (en) Program translation method and notifying instruction inserting method
JP2924882B1 (en) Method and apparatus for creating logic simulation model and recording medium
JP3233245B2 (en) Language processing method
JPH086797A (en) Constant reference optimizing processor
JP2568657B2 (en) Hash collision avoidance method for data driven microprocessor
JP3008483B2 (en) Link processing device
JP2722040B2 (en) Separation of procedural language program components
JP2724235B2 (en) Variable name inference device
JPH04116721A (en) System definition directive analysis system
JPH06119156A (en) Automatic program generating method
JP2001125793A (en) Compiler system, compile method and recording medium
JP2002229787A (en) Program generating device
JPH11259281A (en) Method for designing information system and device therefor and storage medium for storing information system design program
JPH0528075A (en) Communication controller and information processor
JPH11249902A (en) Data processor and storage medium with compile program recorded
JPH0561687A (en) Processing system for compiler
JPH04195587A (en) Logical operation system for information processor
JPH06332719A (en) Compiler code generating device

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: 20010109

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

Free format text: PAYMENT UNTIL: 20080209

Year of fee payment: 7

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

Free format text: PAYMENT UNTIL: 20090209

Year of fee payment: 8

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

Free format text: PAYMENT UNTIL: 20090209

Year of fee payment: 8

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

Free format text: PAYMENT UNTIL: 20100209

Year of fee payment: 9

LAPS Cancellation because of no payment of annual fees