JPH05257707A - Compiling system - Google Patents

Compiling system

Info

Publication number
JPH05257707A
JPH05257707A JP5451892A JP5451892A JPH05257707A JP H05257707 A JPH05257707 A JP H05257707A JP 5451892 A JP5451892 A JP 5451892A JP 5451892 A JP5451892 A JP 5451892A JP H05257707 A JPH05257707 A JP H05257707A
Authority
JP
Japan
Prior art keywords
array
intermediate word
arrangement
vector
word
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
JP5451892A
Other languages
Japanese (ja)
Inventor
Ichiro Honma
一朗 本間
Tetsuo Nishida
哲夫 西田
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hitachi Software Engineering Co Ltd
Hitachi Ltd
Original Assignee
Hitachi Software Engineering Co Ltd
Hitachi Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hitachi Software Engineering Co Ltd, Hitachi Ltd filed Critical Hitachi Software Engineering Co Ltd
Priority to JP5451892A priority Critical patent/JPH05257707A/en
Publication of JPH05257707A publication Critical patent/JPH05257707A/en
Pending legal-status Critical Current

Links

Abstract

PURPOSE:To directly vectorize an operation expression directly describing arrangement without degrading performance as a compiler by efficiently converting intermediate work/arrangement information into an intermediate word. CONSTITUTION:A compiler 1 is composed of a syntax analysis part 2, intermediate part (provided with a vector transformation part and an optimizing part) 3 and code generation part 4. An intermediate word 6 remaining the form of arrangement operation for the operation expression of arrangement is generated, it is judged whether the operand of the intermediate word 6 expresses the entire arrangement or not and when the entire arrangement is expressed, information indicating a vector length, initial value and increased component value required for generating a vector instruction is added to the intermediate word 6 based on information indicating the size of arrangement for the operation expression of arrangement. Then, the intermediate word 6 is converted into an intermediate word 7 capable of generating the vector instruction, and the vector instruction is generated by the converted intermediate word 7. When the entire arrangement is not expressed the intermediate word is deformed into a loop repeating intermediate word, and the vector instruction is generated by the deformed intermediate word.

Description

【発明の詳細な説明】Detailed Description of the Invention

【0001】[0001]

【産業上の利用分野】本発明は、配列演算機能により記
述されたプログラムをベクトルプロセッサシステム上で
効率的に実行させるための目的プログラムを生成するコ
ンパイル方式に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a compiling method for generating a target program for efficiently executing a program described by an array operation function on a vector processor system.

【0002】[0002]

【従来の技術】従来、ソースプログラム中のループ繰返
し型の配列演算を、ベクトルプロセッサシステム上で実
行させるためのベクトル化方法として、「コンパイラ」
(1981年 中田育男 産業図書,第258頁から第
263頁に)に説明されている方法が知られている。
2. Description of the Related Art Conventionally, a "compiler" has been used as a vectorizing method for executing a loop iteration type array operation in a source program on a vector processor system.
The method described in (1981, Ikuo Nakata Sangyo Tosho, pp. 258 to 263) is known.

【0003】[0003]

【発明が解決しようとする課題】しかしながら、上記文
献に説明されているベクトル化方法では、配列を直接記
述した演算式をベクトル化する場合について考慮されて
いないため、配列を直接記述した演算式のベクトル化を
行う場合には、配列要素の演算を繰り返す形の中間語に
一旦変形したうえでベクトル化を行なわなければなら
ず、しかも変形後の状態からベクトル化を行う為には、
配列データフロー解析および添字解析を行わなければな
らない。このため、コンパイラとしての性能が劣化する
といった問題がある。
However, the vectorization method described in the above document does not consider the case of vectorizing an arithmetic expression that directly describes an array. In the case of vectorization, it must be transformed into an intermediate word in the form of repeating the operation of array elements and then vectorized, and in order to perform vectorization from the transformed state,
Sequence data flow analysis and subscript analysis must be performed. Therefore, there is a problem that the performance as a compiler deteriorates.

【0004】本発明の目的は、コンパイラとしての性能
を劣化させることなく、配列を直接記述した演算式を直
接ベクトル化することができるコンパイル方式を提供す
ることである。
An object of the present invention is to provide a compiling method capable of directly vectorizing an arithmetic expression directly describing an array without degrading the performance as a compiler.

【0005】[0005]

【課題を解決するための手段】上記目的を解決するため
に本発明は、配列演算式を配列演算の形を残した中間語
を生成し、その中間語のオペランドが配列全体を表して
いるか否かを判定し、配列全体を表しているならば配列
演算式の配列の大きさを表す情報をもとにベクトル命令
を生成するために必要なベクトル長、初期値、増分値を
示す情報を前記中間語に付加し、ベクトル命令を生成す
ることが可能な中間語に変形し、この変形した中間語に
よってベクトル命令を生成し、配列全体を表していなけ
れば、ループ繰返し型の中間語に変形し、この変形した
中間語によってベクトル命令を生成するようにした。
In order to solve the above object, the present invention generates an intermediate word in which an array operation expression is left in the form of array operation, and whether the operand of the intermediate word represents the entire array. If it represents the entire array, the information indicating the vector length, the initial value, and the increment value necessary for generating the vector instruction based on the information indicating the size of the array of the array operation expression is added. It is added to an intermediate word and transformed into an intermediate word capable of generating a vector instruction, and this transformed intermediate word generates a vector instruction. , The vector command is generated by this modified intermediate language.

【0006】[0006]

【作用】上記手段によれば、配列演算式を配列演算の形
を残した中間語を生成し、その中間語のオペランドが配
列全体を表しているか否かを判定し、配列全体を表して
いるならば配列演算式の配列の大きさを表す情報をもと
にベクトル命令を生成するために必要なベクトル長、初
期値、増分値を示す情報を前記中間語に付加し、ベクト
ル命令を生成することが可能な中間語に変形するので、
配列のベクトル化可否のチェックのための配列データフ
ロー解析および添字解析配列などの依存関係のチェック
が不要であり、中間語の変形も少なくて済むためコンパ
イラの処理性能を劣化させることなく、配列を直接記述
した演算式を直接ベクトル化することができる。
According to the above-mentioned means, an intermediate word in which the array operation expression is left in the form of array operation is generated, it is judged whether or not the operand of the intermediate word represents the entire array, and the entire array is represented. If so, information indicating the vector length, initial value, and increment value necessary to generate a vector instruction based on the information indicating the array size of the array operation expression is added to the intermediate word to generate a vector instruction. Because it is transformed into an intermediate language that is possible,
Array data flow analysis and subscript analysis to check the availability of vectorization of the array is not required, and the dependency of the array is not required. Directly written arithmetic expressions can be vectorized.

【0007】[0007]

【実施例】以下、本発明の一実施例を図を参照しつつ説
明する。
An embodiment of the present invention will be described below with reference to the drawings.

【0008】図1は本発明をFORTRANコンパイラ
に適用した場合の一実施例を示す全体構成図であり、コ
ンパイラ1は構文解析部2、中間部3、コード生成部4
とによって構成されている。
FIG. 1 is an overall configuration diagram showing an embodiment in which the present invention is applied to a FORTRAN compiler. The compiler 1 includes a syntax analysis unit 2, an intermediate unit 3, and a code generation unit 4.
It is composed of and.

【0009】構文解析部2は、FORTRANソースプ
ログラム5を入力して、中間語・配列情報6に変換す
る。また、ベクトル変換部や最適化部を含む中間部3
は、中間語・配列情報6を入力して、ベクトル変換を行
った後の中間語7に変換する。さらに、コード生成部4
は、中間語7に基づいて目的プログラム8を生成する。
The syntactic analysis unit 2 inputs the FORTRAN source program 5 and converts it into intermediate language / sequence information 6. In addition, the intermediate unit 3 including the vector conversion unit and the optimization unit
Inputs the intermediate word / array information 6 and converts it into the intermediate word 7 after vector conversion. Furthermore, the code generator 4
Generates an object program 8 based on the intermediate language 7.

【0010】本発明は中間部3に係わり、中間語・配列
情報6を中間語7に効率的に変換させるものである。
The present invention relates to the intermediate part 3 and efficiently converts the intermediate word / array information 6 into the intermediate word 7.

【0011】以下、FORTRANプログラムの例を挙
げて詳細な動作を説明する。
The detailed operation will be described below with reference to an example of the FORTRAN program.

【0012】図2はFORTRANソースプログラム5
の一例を示すものであるが、この例に記述されているプ
ログラム部9は配列要素ごとにループ繰り返しにより計
算する従来からの表現形式であるとする。これに対し、
プログラム部10は配列演算機能を用いてプログラム部
9と同じ配列演算を表したものとする。
FIG. 2 shows a FORTRAN source program 5
However, it is assumed that the program unit 9 described in this example has a conventional expression format in which each array element is calculated by loop iteration. In contrast,
It is assumed that the program unit 10 uses the array operation function to represent the same array operation as the program unit 9.

【0013】このようなFORTRANソースプログラ
ム5が構文解析部2に入力された場合、構文解析部2は
プログラム部9に対しては図3に示すようなループ繰返
しによって表現された中間語17を生成する。同様に、
プログラム部10に対しては図4に示すような配列演算
の形を残した中間語19を生成する。
When such a FORTRAN source program 5 is input to the syntactic analysis unit 2, the syntactic analysis unit 2 generates an intermediate word 17 represented by loop iteration as shown in FIG. To do. Similarly,
For the program unit 10, an intermediate word 19 which retains the form of array operation as shown in FIG. 4 is generated.

【0014】そこで、中間部3はこのような中間語1
7,19に対してベクトル変換処理を行う。
Therefore, the intermediate part 3 has such an intermediate language 1
Vector conversion processing is performed on 7 and 19.

【0015】図5はそのベクトル変換処理の手順を示す
フローチャートであり、まず、中間語・配列情報6から
入力した中間語17,19について配列演算があるかど
うかを調べ(ステップS50)、なければ、ベクトル化
が可能かどうかを調べる(ステップS51)。この場
合、ループ繰り返し計算プログラムを変数や配列の依存
関係解析によってベクトル化が可能かどうかは前述の文
献「コンパイラ」に説明されているので、ここではその
説明を省略する。
FIG. 5 is a flow chart showing the procedure of the vector conversion process. First, it is checked whether or not there is an array operation for the intermediate words 17 and 19 input from the intermediate word / array information 6 (step S50). , It is checked whether vectorization is possible (step S51). In this case, whether or not the loop iterative calculation program can be vectorized by the dependency analysis of variables and arrays is described in the above-mentioned document "Compiler", and therefore the description thereof is omitted here.

【0016】図2の例のプログラム部9のように配列演
算でない場合の中間語17を調べた時、ベクトル化が可
能であると判断した場合、図6に示すようなベクトル命
令生成可能な中間語18に変形する(ステップS5
2)。
When it is determined that vectorization is possible when the intermediate word 17 which is not an array operation like the program unit 9 in the example of FIG. 2 is examined, it is possible to generate a vector instruction as shown in FIG. It is transformed into word 18 (step S5)
2).

【0017】これに対し、プログラム部10のように配
列演算で記述された場合の中間語19については、配列
演算有りとなるので、次に、そのオペランド(A=B+
C)が全て配列全体を表しているか否かを判定する(ス
テップS53)。
On the other hand, since the intermediate word 19 described in the program unit 10 by the array operation has the array operation, the operand (A = B +) is next calculated.
It is determined whether or not all of C) represent the entire array (step S53).

【0018】この判定において、配列演算のオペランド
の一部が配列全体を表していなければ、ループ繰り返し
型の中間語17の形に変形する(ステップS54)。
In this determination, if part of the operands of the array operation does not represent the entire array, it is transformed into the loop repeat type intermediate word 17 (step S54).

【0019】しかし、オペランドが全て配列全体を表し
ている場合は、その配列情報で示される配列の大きさ
(100×100=10000)の情報をもとにして、
ベクトル長,初期値,増分値を計算する(ステップS5
5)。続いて、その計算により求めたベクトル長,初期
値,増分値の情報を中間語19に付加し、図6に示すよ
うなベクトル命令生成可能な中間語18に変形する。
However, when all the operands represent the entire array, based on the information of the array size (100 × 100 = 10000) indicated by the array information,
Calculate vector length, initial value, and increment value (step S5)
5). Then, the information of the vector length, the initial value and the increment value obtained by the calculation is added to the intermediate word 19 and transformed into the intermediate word 18 capable of generating a vector instruction as shown in FIG.

【0020】従って、プログラム部10については、ベ
クトル命令を直接生成することが可能な中間語18に変
形するので、配列のベクトル化可否のチェックのための
配列データフロー解析および添字解析配列などの依存関
係のチェックが不要であり、また中間語の変形も少なく
て済むためコンパイラの処理性能を劣化させることな
く、配列を直接記述した演算式を直接ベクトル化するこ
とができる。
Therefore, the program unit 10 is transformed into the intermediate language 18 capable of directly generating a vector instruction, and therefore, the dependency of the array data flow analysis and the subscript analysis array for checking the vectorization of the array is performed. It is possible to directly vectorize an arithmetic expression that directly describes an array without degrading the processing performance of the compiler because it does not require checking of relations and requires less transformation of intermediate language.

【0021】[0021]

【発明の効果】以上説明したように本発明によれば、配
列演算式を配列演算の形を残した中間語を生成し、その
中間語のオペランドが配列全体を表しているか否かを判
定し、配列全体を表しているならば配列演算式の配列の
大きさを表す情報をもとにベクトル命令を生成するため
に必要なベクトル長、初期値、増分値を示す情報を前記
中間語に付加し、ベクトル命令を生成することが可能な
中間語に変形し、この変形した中間語によってベクトル
命令を生成し、配列全体を表していなければ、ループ繰
返し型の中間語に変形し、この変形した中間語によって
ベクトル命令を生成するようにしたため、コンパイラと
しての性能を劣化させることなく、配列を直接記述した
演算式を直接ベクトル化することができるという効果が
ある。
As described above, according to the present invention, an intermediate word in which the array operation expression is left in the form of array operation is generated, and it is determined whether or not the operand of the intermediate word represents the entire array. , If the entire array is represented, information indicating the vector length, initial value, and increment value required to generate a vector instruction based on the information indicating the array size of the array operation expression is added to the intermediate word. Then, it is transformed into an intermediate language capable of generating a vector instruction, and a vector instruction is generated by this transformed intermediate language, and if it does not represent the entire array, it is transformed into a loop repeating intermediate language and this transformed Since the vector instruction is generated by the intermediate language, there is an effect that the arithmetic expression directly describing the array can be directly vectorized without degrading the performance as a compiler.

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

【図1】本発明を適用したFORTRANコンパイラの
一実施例を示す全体構成図である。
FIG. 1 is an overall configuration diagram showing an embodiment of a FORTRAN compiler to which the present invention is applied.

【図2】実施例におけるFORTRANソースプログラ
ムの例を示す説明図である。
FIG. 2 is an explanatory diagram showing an example of a FORTRAN source program in the embodiment.

【図3】実施例における繰り返し型の配列計算の中間語
表現を示す説明図である。
FIG. 3 is an explanatory diagram showing an intermediate language expression of repetitive type array calculation in an example.

【図4】実施例における配列演算の中間語表現を示す説
明図である。
FIG. 4 is an explanatory diagram showing an intermediate language expression of an array operation in the embodiment.

【図5】実施例におけるベクトル変換部のベクトル変換
処理を示すフローチャートである。
FIG. 5 is a flowchart showing a vector conversion process of a vector conversion unit in the embodiment.

【図6】実施例においてベクトル変換を実施した後の中
間語表現を示す説明図である。
FIG. 6 is an explanatory diagram showing an intermediate language expression after vector conversion is performed in the example.

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

1…コンパイラ、2…構文解析部、3…中間部、4…コ
ード生成部、5…FORTRANソースプログラム、6
…中間語・配列情報、7…中間語、8…目的プログラ
ム、9…FORTRANソースプログラムの繰り返し型
配列計算のプログラム部、109…FORTRANソー
スプログラムの配列演算のプログラム部、17…繰り返
し型配列計算の中間語、18…ベクトル化した中間語、
19…配列演算の中間語。
1 ... Compiler, 2 ... Syntax analysis unit, 3 ... Intermediate unit, 4 ... Code generation unit, 5 ... FORTRAN source program, 6
... intermediate language / sequence information, 7 ... intermediate language, 8 ... object program, 9 ... repeated array calculation program part of FORTRAN source program, 109 ... array operation program part of FORTRAN source program, 17 ... repeated array calculation Intermediate language, 18 ... Vectorized intermediate language,
19 ... Intermediate language of array operation.

───────────────────────────────────────────────────── フロントページの続き (72)発明者 西田 哲夫 神奈川県横浜市中区尾上町6丁目81番地 日立ソフトウェアエンジニアリング株式会 社内 ─────────────────────────────────────────────────── ─── Continuation of the front page (72) Inventor Tetsuo Nishida 6-81 Onoe-cho, Naka-ku, Yokohama-shi, Kanagawa Hitachi Software Engineering Co., Ltd. In-house

Claims (1)

【特許請求の範囲】[Claims] 【請求項1】 配列演算機能を有する高級プログラミン
グ言語をベクトル命令を含む機械語に翻訳するコンパイ
ル方式において、 配列演算式を配列演算の形を残した中間語を生成し、そ
の中間語のオペランドが配列全体を表しているか否かを
判定し、配列全体を表しているならば配列演算式の配列
の大きさを表す情報をもとにベクトル命令を生成するた
めに必要なベクトル長、初期値、増分値を示す情報を前
記中間語に付加し、ベクトル命令を生成することが可能
な中間語に変形し、この変形した中間語によってベクト
ル命令を生成し、配列全体を表していなければ、ループ
繰返し型の中間語に変形し、この変形した中間語によっ
てベクトル命令を生成することを特徴とするコンパイル
方式。
1. In a compile method for translating a high-level programming language having an array operation function into a machine language including vector instructions, an array operation expression is generated as an intermediate word in which an array operation form is left, and the operand of the intermediate word is It is determined whether or not it represents the entire array, and if it represents the entire array, the vector length, initial value, necessary to generate a vector instruction based on the information indicating the size of the array of the array operation expression, Information indicating an increment value is added to the intermediate word, transformed into an intermediate word capable of generating a vector instruction, and the transformed intermediate word generates a vector instruction. If the whole array is not represented, loop iteration is performed. A compile method characterized by transforming into a type intermediate language and generating vector instructions by this transformed intermediate language.
JP5451892A 1992-03-13 1992-03-13 Compiling system Pending JPH05257707A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP5451892A JPH05257707A (en) 1992-03-13 1992-03-13 Compiling system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP5451892A JPH05257707A (en) 1992-03-13 1992-03-13 Compiling system

Publications (1)

Publication Number Publication Date
JPH05257707A true JPH05257707A (en) 1993-10-08

Family

ID=12972875

Family Applications (1)

Application Number Title Priority Date Filing Date
JP5451892A Pending JPH05257707A (en) 1992-03-13 1992-03-13 Compiling system

Country Status (1)

Country Link
JP (1) JPH05257707A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2009211458A (en) * 2008-03-05 2009-09-17 Nec Corp Compiler, variable-optimizing device, method, and program

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2009211458A (en) * 2008-03-05 2009-09-17 Nec Corp Compiler, variable-optimizing device, method, and program

Similar Documents

Publication Publication Date Title
US4833606A (en) Compiling method for vectorizing multiple do-loops in source program
US6233733B1 (en) Method for generating a Java bytecode data flow graph
US6993756B2 (en) Optimization apparatus that decreases delays in pipeline processing of loop and computer-readable storage medium storing optimization program
US5349665A (en) Compiler vectorizing system
Alias et al. On the recognition of algorithm templates
KR0125605B1 (en) Method and device for verifying operation of machine language program
JPH05257707A (en) Compiling system
Silber et al. The Nestor library: A tool for implementing fortran source to source transfromations
Le Meur et al. An environment for building customizable software components
JPH0540780A (en) Vectorizing processing system
US5437035A (en) Method and apparatus for compiling a program incending a do-statement
JP2701246B2 (en) Compiler vectorization method
JP2956591B2 (en) Method and apparatus for parallelizing a loop having a conditional jump out of the loop
JPH04343140A (en) Parallelized processing system
JPH09160784A (en) Paralleled compiling system
JP3034582B2 (en) Compile processing method
JP2674489B2 (en) Vectorization processor
JP2865694B2 (en) Compilation method
JPH06222928A (en) Loop optimizing method
JPH0512033A (en) Parallel compiling system
JPH06282440A (en) Program editing method, program editing and executing method, and computer system
JP2539070B2 (en) Compiler processor
JPH06290206A (en) Vectorization systen
JPH0795272B2 (en) Compile method
JPH08221276A (en) Compiler