JPH0264766A - Vectorizing processing system - Google Patents

Vectorizing processing system

Info

Publication number
JPH0264766A
JPH0264766A JP21606888A JP21606888A JPH0264766A JP H0264766 A JPH0264766 A JP H0264766A JP 21606888 A JP21606888 A JP 21606888A JP 21606888 A JP21606888 A JP 21606888A JP H0264766 A JPH0264766 A JP H0264766A
Authority
JP
Japan
Prior art keywords
loop
program
length
vector
work
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
JP21606888A
Other languages
Japanese (ja)
Other versions
JPH0754511B2 (en
Inventor
Akikazu Abe
安部 曉一
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 JP21606888A priority Critical patent/JPH0754511B2/en
Publication of JPH0264766A publication Critical patent/JPH0264766A/en
Publication of JPH0754511B2 publication Critical patent/JPH0754511B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Landscapes

  • Complex Calculations (AREA)
  • Devices For Executing Special Programs (AREA)

Abstract

PURPOSE:To prevent the processing from being affected by the length of a working vector by assigning a working vector area for an actual length portion dynamically when actual length is longer than the fixed loop length and releasing it at the time when it becomes unnecessary. CONSTITUTION:A source analyzing part 21 in a compiler 2 analyzes a course program 1, detects an involved loop, adding a mark to it and transfers it to a vector analyzing part 22. The analyzing part 22 analyzes the loop to which the mark is added, when a vectoring possible part and a vectoring impossible part are involved in the loop, adds the different mark to the vectorizing possible part and transfers it to a loop dividing processing part 23. At the processing part 23, when loop length necessary at a stage at which the program is executed actually is shorter than the fixed length, an assigned working vector area is used as it is, when the actual loop length is longer than it, it is used with the actual loop length dynamically. Then, when the working vector area becomes unnecessary, a program part to execute releasing is inserted into the program corresponding to the program 1.

Description

【発明の詳細な説明】 (産業上の利用分野) 本発明はコンパイラにおけるベクトル化処理方式に関し
、特に作業ベクトルを用いてループ分割を行い、ベクト
ル化するときの方式に関するものである。
DETAILED DESCRIPTION OF THE INVENTION (Field of Industrial Application) The present invention relates to a vectorization processing method in a compiler, and particularly to a method for performing loop division using work vectors and vectorizing the same.

〔従来の技術〕[Conventional technology]

ベクトル演算機能を備えた電子計算機システムでは、複
数の規則的に並んだデータ列(ベクトルデータ)間の演
算をベクトル命令によって一度に高速に実行できるため
、電子計算機システムの性能を充分発揮するためにもベ
クトル実行できるプログラム部分はベクトル命令に置き
換えることが好ましく、そのため、コンパイル方式の高
級言語(例えばFORTRAN)で記述されたソースプ
ログラムをコンパイルして目的プログラムを生成する際
に、プログラムを解析してベクトル命令への置き換え(
ベクトル化)を行うようにしている。
In computer systems equipped with vector calculation functions, calculations between multiple regularly arranged data sequences (vector data) can be executed at high speed at once using vector instructions. It is preferable to replace program parts that can be executed with vector instructions with vector instructions. Therefore, when compiling a source program written in a compilation-based high-level language (for example, FORTRAN) to generate a target program, the program is analyzed and vector instructions are used. Replacement with instructions (
vectorization).

なお、ベクトル化が可能な部分は、ソースプログラム上
では一般にループ構造で表現されている。
Note that portions that can be vectorized are generally expressed as loop structures in the source program.

ところで、ベクトル化がそのまま可能なループの他に、
ベクトル化可能部分とベクトル化不可能部分とを含むル
ープがあり、そのようなループをベクトル化する場合に
は、そのループをベクトル化可能部分とベクトル化不可
能部分とに分け、別々のループに分割した上で、ベクト
ル化可能部分に対してはベクトル実行するプログラム部
分を生成し、ベクトル化率可能部゛分に対してはスカラ
実行するプログラム部分を生成し、両者を含んだ目的プ
ログラムを出力するようにしている。
By the way, in addition to loops that can be vectorized as is,
If you have a loop that has a vectorizable part and a non-vectorizable part, and you want to vectorize such a loop, you can separate the loop into the vectorizable part and the non-vectorizable part and put them into separate loops. After dividing, a program part for vector execution is generated for the vectorizable part, a program part for scalar execution is generated for the part for which vectorization rate is possible, and a target program containing both is output. I try to do that.

しかしながら、分割点にまたがって定義・参照されてい
る変数が存在する場合には、そのままでは分割は行えず
、そのため、従来、そのような変数に対しては、ループ
長と等しいか、それ以上の長さ(コンパイル時点でルー
プ長が不明の場合にはコンパイラが仮定した長さ)を持
つ作業ベクトルを割り当て、変数の定義・参照を作業ベ
クトルの定義・参照に置き換えることにより、変数の定
義・参照関係を分割に適するように変え、ベクトル化を
促進していた。
However, if there are variables that are defined or referenced across the division points, division cannot be performed as is. By allocating a work vector with a length (the length assumed by the compiler if the loop length is unknown at the time of compilation) and replacing variable definitions and references with work vector definitions and references, variable definitions and references can be performed. It changed the relationships to be suitable for partitioning and promoted vectorization.

第3図はFORTRAN言語で記述されたソースプログ
ラム中のDOループの一例であり、ループ中にベクトル
化可能部分とベクトル化不可能部分とを含むと共に、ベ
クトル化可能部分とベクトル化不可能部分とを分割した
際に分割点にまたがって定義・参照されている変数が存
在する場合の例である。なお、このDOループは、 「配列A、  B、  C,Dの1番目の要素A (1
) 、 B (1)C(1) 、 D (I)について
、要素A (1) 、 B (1)の積を変数Xに格納
し、要素c (1) 、 D (1)の積を変数Yに格
納し、変数X、Yの値を出力する。」という処理を1番
目の要素からN番目の要素まで繰り返し行うという処理
手順を記述している。
Figure 3 is an example of a DO loop in a source program written in the FORTRAN language, which includes a vectorizable part and a non-vectorizable part, and a vectorizable part and a non-vectorizable part. This is an example of a case where there are variables defined and referenced across the dividing points when dividing. Note that this DO loop is executed as follows: “The first element A (1
) , B (1) C (1) , D (I), store the product of elements A (1) and B (1) in variable X, and store the product of elements c (1) and D (1) in variable Store in Y and output the values of variables X and Y. This describes a processing procedure in which the process ``is repeated from the 1st element to the Nth element.

従来のコンパイラは、このままではこのDOループをベ
クトル化することができないので、ベクトル化可能部分 X=A (+) *B (1) Y=C(1)*D (+) と、ベクトル化不可能部分 WRITE (6,*> X、Y とを分割して別のループとし、分割点にまたがって定義
されている変数X、Yをそれぞれ作業ベクトルWX、W
Yに置き換え、第4図に示すように、ベクトル化可能部
分 WX (1)=A (1)*B (r)WY (1)=
C(+)*D (1) を含むループ■をベクトル実行するプログラム部分と、
ベクトル化不可能部分 WRITE (6,*)WX (1)、WY (1)を
含むループ■をスカラ実行するプログラム部分とを含む
目的プログラムを生成するようにしていた。
Conventional compilers cannot vectorize this DO loop as is, so the vectorizable part X=A (+) *B (1) Y=C(1)*D (+) and the non-vectorizable part Possible part WRITE (6, *> Divide X, Y into another loop, and set variables X and Y defined across the division points to work vectors WX and W, respectively.
As shown in FIG. 4, the vectorizable part WX (1)=A (1)*B (r)WY (1)=
A program part that vector-executes a loop ■ containing C(+)*D (1);
An objective program is generated that includes a program part that scalar executes a loop (2) including the non-vectorizable part WRITE (6, *) WX (1) and WY (1).

第5図は生成された目的プログラムの構造を概念的に示
した図であり、第5図のプログラム部分■は第4図のル
ープ■に対応しており、ベクトル命令で高速に実行が可
能な部分である。また、第5図のプログラム部分■は第
4図のループ■に対応しており、スカラ命令でN回繰り
返される部分である。
Figure 5 is a diagram conceptually showing the structure of the generated target program, and the program part ■ in Figure 5 corresponds to the loop ■ in Figure 4, and can be executed at high speed with vector instructions. It is a part. Furthermore, the program portion (2) in FIG. 5 corresponds to the loop (2) in FIG. 4, and is a portion that is repeated N times using a scalar instruction.

〔発明が解決しようとする課題] 従来のベクトル化処理方式は上述したように実行される
ものであり、ベクトル化の促進に役立つものであるが、
ループ長と同じかそれ以上の長さを持つ作業ベクトルが
必要となることから、次のような欠点があった。
[Problems to be Solved by the Invention] The conventional vectorization processing method is executed as described above, and is useful for promoting vectorization.
Since a work vector with a length equal to or longer than the loop length is required, it has the following drawbacks.

(1)ループ長が非常に長い場合、あるいは、作業ベク
トルが同時に多数必要とされる場合にあっては、作業ベ
クトル領域のサイズが大きくなり、システム中の他のプ
ログラムで利用可能なメモリを圧迫する。
(1) When the loop length is very long or when a large number of work vectors are required at the same time, the size of the work vector area becomes large and takes up the memory available to other programs in the system. do.

(2)ループ長がコンパイル時に不明の場合はコンパイ
ラが仮定した長さの作業ベクトルが設定されるが、実際
の動作においてその設定値より長いループ長で実行され
ると、正常に動作が行われない。
(2) If the loop length is unknown at compile time, a work vector of the length assumed by the compiler is set, but in actual operation, if the loop length is longer than the set value, the operation will not work normally. do not have.

(3)実行時にループ長が変わる場合は、そのループの
取り得る最大の長さで作業ベクトルを割り当てておく必
要があるため、ループ長の変動が大きい場合は作業ベク
トルとして割り当てられた領域の使用効率が悪い。
(3) If the loop length changes during execution, it is necessary to allocate a work vector with the maximum length that the loop can take, so if the loop length fluctuates significantly, use the area allocated as a work vector. ineffective.

本発明は上記の点に鑑み提案されたものであり、その目
的とするところは、作業ベクトルの長さの長・短、既知
・不明および一定・可変に影響されないベクトル化処理
方式を提供することにある。
The present invention has been proposed in view of the above points, and its purpose is to provide a vectorization processing method that is not affected by the length of a work vector, whether it is long or short, known or unknown, and constant or variable. It is in.

【課題を解決するための手段〕[Means to solve problems]

本発明は上記の目的を達成するため、コンパイル方式の
高級言語で記述されたソースプログラム中のループを検
出・解析してベクトル化可能部分とベクトル化不可能部
分とに対応した別々のループに分割し、分割点にまたが
って定義・参照されている変数に作業ベクトルを割り当
て、ベクトル実行するプログラム部分とスカラ実行する
プログラム部分とから構成される目的プログラムを生成
するベクトル化処理方式において、 目的プログラム中に、コンパイラが設定した所定の長さ
の作業ベクトル領域を確保するプログラム部分と、実際
の長さが前記所定の長さを越える場合に新たに作業ベク
トル領域を動的に確保して割り当てるプログラム部分と
、新たに割り当てた作業ベクトル領域が不要になった場
合に当該作業ベクトル領域を解放するプログラム部分と
を挿入するようにしている。
In order to achieve the above object, the present invention detects and analyzes loops in a source program written in a compiled high-level language and divides them into separate loops corresponding to vectorizable parts and non-vectorizable parts. In a vectorization processing method that allocates work vectors to variables that are defined and referenced across division points, and generates a target program consisting of a program part that executes vectors and a program part that executes scalar, A program part that secures a work vector area of a predetermined length set by the compiler, and a program part that dynamically allocates and allocates a new work vector area when the actual length exceeds the predetermined length. and a program part that releases the newly allocated work vector area when the work vector area is no longer needed.

〔作用〕[Effect]

本発明のベクトル化処理方式にあっては、コンパイル方
式の高級言語で記述されたソースプログラム中のループ
を検出・解析してベクトル化可能部分とベクトル化不可
能部分とに対応した別々のループに分割し、分割点にま
たがって定義・参照されている変数に作業ベクトルを割
り当て、ベクトル実行するプログラム部分とスカラ実行
するプログラム部分とから構成される目的プログラムを
生成すると共に、目的プログラム中に、コンパイラが設
定した所定の長さの作業ベクトル領域を確保するプログ
ラム部分と、実際の長さが前記所定の長さを越える場合
に新たに作業ベクトル領域を動的に確保して割り当てる
プログラム部分と、新たに割り当てた作業ベクトル領域
が不要になった場合に当該作業ベクトル領域を解放する
プログラム部分とを挿入する。
The vectorization processing method of the present invention detects and analyzes loops in a source program written in a compiled high-level language and separates them into separate loops corresponding to vectorizable parts and non-vectorizable parts. It divides the program, assigns work vectors to variables defined and referenced across the division points, generates an objective program consisting of a vector execution program part and a scalar execution program part. A program part that secures a work vector area of a predetermined length set by the user, a program part that dynamically allocates and allocates a new work vector area when the actual length exceeds the predetermined length, and A program part is inserted that releases the work vector area allocated to the work vector area when the work vector area is no longer needed.

〔実施例〕〔Example〕

以下、本発明の実施例につき図面を参照して説明する。 Embodiments of the present invention will be described below with reference to the drawings.

第1図は本発明のベクトル化処理方式を適用したコンパ
イラの一実施例の構成図である。
FIG. 1 is a block diagram of an embodiment of a compiler to which the vectorization processing method of the present invention is applied.

第1図において、コンパイラ2は、ソース解析部21と
、ベクトル化解析部22と、ループ分割処理部23と、
中間テキスト生成部24と、中間テキスト最適化部25
と、目的プログラム生成部26とから構成され、ソース
プログラム1を入力し、いったん中間テキスト3に変換
し、最適此処・理を施した後に目的プログラム4を生成
する機能を存している。なお、ループ分割処理部23は
、ループ分割部231と、ループ長決定部232と、作
業ベクトル割当部233と、動的作業ベクトル割当制御
挿入部234とから構成され、中間テキスト生成部24
は、ベクトル中間テキスト生成部241と、スカラ中間
テキスト生成部242とから構成されている。
In FIG. 1, the compiler 2 includes a source analysis section 21, a vectorization analysis section 22, a loop division processing section 23,
Intermediate text generation unit 24 and intermediate text optimization unit 25
and a target program generating section 26, which has the function of inputting the source program 1, converting it into intermediate text 3, and generating the target program 4 after performing the optimum processing. The loop division processing section 23 includes a loop division section 231 , a loop length determination section 232 , a work vector allocation section 233 , and a dynamic work vector allocation control insertion section 234 .
consists of a vector intermediate text generation section 241 and a scalar intermediate text generation section 242.

以下、上記の実施例の各部の機能および動作を説明する
The functions and operations of each part of the above embodiment will be explained below.

先ず、コンパイラ2内のソース解析部21は、供給され
たソースプログラムlを解析し、プログラム中に含まれ
るループを検出し、それにマークを付け、ベクトル化解
析部22に渡す。
First, the source analysis unit 21 in the compiler 2 analyzes the supplied source program l, detects loops included in the program, marks them, and passes them to the vectorization analysis unit 22.

ベクトル化解析部22は、マークが付けられたループを
解析し、ループ中にベクトル化可能部分とベクトル化不
可能部分とが含まれる場合には、ベクトル化可能部分に
別のマークを付け、ループ分割処理部23に渡す。また
、ループ中にベクトル化可能部分だけが含まれる場合あ
るいはベクトル化不可能部分だけが含まれる場合には、
ループを形成しない部分とともに中間テキスト生成部2
4に渡す。
The vectorization analysis unit 22 analyzes the marked loop, and if the loop includes a vectorizable part and a non-vectorizable part, adds another mark to the vectorizable part, and It is passed to the division processing unit 23. Also, if the loop contains only vectorizable parts or non-vectorizable parts,
Intermediate text generation unit 2 along with parts that do not form a loop
Pass it to 4.

ループ分割処理部23内のループ分割部231は、ベク
トル化可能部分とベクトル化不可能部分とをそれぞれ別
々のループを形成するように分割し、中間テ千スト生成
部24内のベクトル中間テキスト生成部241またはス
カラ中間テキスト生成部242を呼び出すことによって
、ベクトル化可能部分のループおよびベクトル化不可能
部分のループに対する中間テキスト3を生成する。
The loop division unit 231 in the loop division processing unit 23 divides the vectorizable part and the non-vectorizable part so as to form separate loops, and generates a vector intermediate text in the intermediate test test generation unit 24. By calling the section 241 or the scalar intermediate text generation section 242, the intermediate text 3 for the loop in the vectorizable part and the loop in the non-vectorizable part is generated.

次に、ループ長決定部232は、ループ長がコンパイラ
2に既知の場合には、ある定められた長さ(コンパイラ
に対するオプションや指示によって決まる値)を越えて
いるか否かを調べ、越えている場合にはその定められた
長さを分割されたループのループ長とし、越えていない
場合には元のループ長そのものを分割されたループのル
ープ長とする。また、ループ長が不明の場合には前述の
定められた長さを分割されたループのループ長とする。
Next, if the loop length is known to the compiler 2, the loop length determining unit 232 checks whether the loop length exceeds a certain predetermined length (a value determined by an option or instruction to the compiler), and In this case, the predetermined length is used as the loop length of the divided loop, and in the case that the predetermined length is not exceeded, the original loop length itself is used as the loop length of the divided loop. Furthermore, if the loop length is unknown, the above-described determined length is used as the loop length of the divided loop.

作業ベクトル割当部233は、ループ長決定部232で
決められた長さで作業ベクトルを固定領域に割り当てる
The work vector allocation unit 233 allocates the work vector to the fixed area with the length determined by the loop length determination unit 232.

動的作業ベクトル割当制御挿入部234は、コンパイル
しているプログラムが実際に実行された段階で必要とさ
れる実際のループ長が、ループ長決定部232で決めら
れた長さと等しいかあるいはそれより短い場合には、作
業ベクトル割当部233で割り当てられた作業ベクトル
領域をそのまま使用し、実際のループ長の方が長い場合
には、動的に実際のループ長で作業ベクトル領域を確保
してそれを使用し、当該ループの実行を終了した時点で
当該作業ベクトル領域が不要となった場合に解放を行う
動作を行うプログラム部分(制御テキスト)をソースプ
ログラムlに対応する本体のプログラムに挿入する。
The dynamic work vector allocation control insertion unit 234 determines whether the actual loop length required when the program being compiled is actually executed is equal to or greater than the length determined by the loop length determination unit 232. If it is shorter, the work vector area allocated by the work vector allocation unit 233 is used as is, and if the actual loop length is longer, the work vector area is dynamically allocated using the actual loop length and used. is used to insert into the main program corresponding to the source program l a program part (control text) that performs an operation to release the work vector area when it is no longer needed at the end of the execution of the loop.

次いで、中間テキスト生成部24およびループ分割処理
部23によって生成された中間テキスト3は、中間テキ
スト最適化部25において周知の最適化処理が施された
後、目的プログラム生成部26に渡され、目的プログラ
ム生成部26では渡された中間テキスト3から目的プロ
グラム4が生成される。
Next, the intermediate text 3 generated by the intermediate text generation unit 24 and the loop division processing unit 23 is subjected to well-known optimization processing in the intermediate text optimization unit 25, and then passed to the target program generation unit 26, The program generation unit 26 generates a target program 4 from the passed intermediate text 3.

第2図は従来例の説明で使用した第3図のソースプログ
ラムに対し、上記の本発明を適用したコンパイラ2によ
って生成された目的プログラムの構造の概念図である。
FIG. 2 is a conceptual diagram of the structure of a target program generated by the compiler 2 to which the present invention is applied to the source program of FIG. 3 used in the explanation of the conventional example.

従来例による目的プログラムを示す第5図と比較してわ
かるように、作業ベクトルWX、WYのベースアドレス
をコンパイル時に割当てた領域を指すよう設定するプロ
グラム部分■と、実際のループ長Nがコンパイル時に設
定した長さmより長いか否かをチエツクし、長ければ長
さNで動的に作業ベクトルWX、WY用の領域を確保し
、作業ベクトルwx、wyに対するベースアドレスを再
設定するプログラム部分■と、確保した領域を解放する
プログラム部分■とが、ループ分割処理部23の動的作
業ベクトル割当制御挿入部234により目的プログラム
中に挿入されている。よって、この目的プログラムを実
行する場合、必要に応じて動的に作業ベクトル領域の割
り当て・解放が行われ、システム中の利用可能メモリを
有効に利用しながら、部分ベクトル化による性能向上を
図ることができる。
As can be seen by comparing with Figure 5, which shows the target program according to the conventional example, the program part ■ sets the base address of the work vectors WX and WY to point to the area allocated at the time of compilation, and the actual loop length N is determined at the time of compilation. A program part that checks whether the length is longer than the set length m, and if it is longer, dynamically secures an area for the work vectors WX and WY using the length N, and resets the base address for the work vectors wx and wy.■ and a program part (2) for releasing the secured area are inserted into the target program by the dynamic work vector allocation control insertion unit 234 of the loop division processing unit 23. Therefore, when this target program is executed, the work vector area is dynamically allocated and released as necessary, and the available memory in the system is effectively used while performance is improved through partial vectorization. Can be done.

〔発明の効果] 以上説明したように、本発明のベクトル化処理方式にあ
っては、作業ベクトルを用いてループを分割するときに
、分割された各ループのループ長を適度に定め、実際の
ループ長が定めたループ長より長い場合には、実際の長
さ分だけ動的に作業ベクトル領域を割り当て、不要とな
った時点で解放する機能を備えた目的プログラムを生成
するようにしているので、ループ長が長く作業ベクトル
領域のサイズが大きい場合あるいはループ長が変動する
ような場合であっても、システム全体としてのメモリの
使用が圧迫されたり使用効率が低下するということがな
くなる効果がある。
[Effects of the Invention] As explained above, in the vectorization processing method of the present invention, when dividing a loop using a work vector, the loop length of each divided loop is determined appropriately, and the actual If the loop length is longer than the specified loop length, the target program is generated with a function to dynamically allocate a work vector area for the actual length and release it when it is no longer needed. , even when the loop length is long and the size of the work vector area is large, or when the loop length fluctuates, there is no pressure on the memory usage of the entire system and there is no reduction in usage efficiency. .

また、実際のループ長がコンパイラが定めたループ長よ
り長い場合であっても、実際の長さ分だけの作業ベクト
ル領域がシステムの空きメモリから確保され、正常な動
作が保証されるという効果もある。
Additionally, even if the actual loop length is longer than the loop length determined by the compiler, a work vector area for the actual length is secured from the system's free memory, ensuring normal operation. be.

【図面の簡単な説明】[Brief explanation of the drawing]

第1図は本発明のベクトル化処理方式を適用したコンパ
イラの一実施例の構成図、 第2図は本発明によって生成された目的プログラムの構
造の概念図、 第3図はソースプログラム中のDo小ループ例を示す図
、 第4図はDO小ループ分割した状態を示す図および、 第5図は従来のコンパイラで生成された目的プログラム
の構造の概念図である。 図において、 ■・・・・・・・・・ソースプログラム2・・・・・・
・・・コンパイラ 21・・・・・・ソース解析部 22・・・・・・ベクトル化解析部 23・・・・・・ループ分割処理部 231・・・ループ分割部 232・・・ループ長決定部 233・・・作業ベクトル割当部 234・・・動的作業ベクトル割当制御挿入部24・・
・・・・中間テキスト生成部 241・・・ベクトル中間テキスト生成部242・・・
スカラ中間テキスト生成部25・・・・・・中間テキス
ト最適化部26・・・・・・目的プログラム生成部3・
・・・・・・・・中間テキスト 4・・・・・・・・・目的プログラム 生F8.盲七丁二目白シブログラムのオ糞造の概念図第
2図 大流イ列の構成図 第1図 Do  +0 1=1.N X =A(1)*B (1) Y=C(1)*O(1) 10  W日ITE(6,*)X、Y ソースフブロクラム中のOOループの1列を示を7第3
図 Do/レープを分書りし丁ご1大力を示す図第4図 生成さt↑二目酌ブロクラムの構造のR倉図第5図
FIG. 1 is a block diagram of an embodiment of a compiler to which the vectorization processing method of the present invention is applied. FIG. 2 is a conceptual diagram of the structure of a target program generated by the present invention. FIG. 4 is a diagram showing an example of a small loop, FIG. 4 is a diagram showing a state in which a DO small loop is divided, and FIG. 5 is a conceptual diagram of the structure of a target program generated by a conventional compiler. In the figure, ■・・・・・・・・・Source program 2・・・・・・
... Compiler 21 ... Source analysis section 22 ... Vectorization analysis section 23 ... Loop division processing section 231 ... Loop division section 232 ... Loop length determination Section 233...Work vector allocation section 234...Dynamic work vector allocation control insertion section 24...
...Intermediate text generation unit 241...Vector intermediate text generation unit 242...
Scalar intermediate text generation unit 25...Intermediate text optimization unit 26...Object program generation unit 3.
・・・・・・Intermediate text 4・・・・・・・・・Objective program student F8. Conceptual diagram of Oshitsuzukuri of the blind 7-chome, white sibling program Figure 2 Configuration diagram of the main stream A sequence Figure 1 Do +0 1=1. N X = A(1)*B (1) Y=C(1)*O(1) 10 WdayITE(6,*) Third
Diagram Do/Rape is divided into sections to show the power of the book. Figure 4. Generated T

Claims (1)

【特許請求の範囲】[Claims] コンパイル方式の高級言語で記述されたソースプログラ
ム中のループを検出・解析してベクトル化可能部分とベ
クトル化不可能部分とに対応した別々のループに分割し
、分割点にまたがって定義・参照されている変数に作業
ベクトルを割り当て、ベクトル実行するプログラム部分
とスカラ実行するプログラム部分とから構成される目的
プログラムを生成するベクトル化処理方式において、目
的プログラム中に、コンパイラが設定した所定の長さの
作業ベクトル領域を確保するプログラム部分と、実際の
長さが前記所定の長さを越える場合に新たに作業ベクト
ル領域を動的に確保して割り当てるプログラム部分と、
新たに割り当てた作業ベクトル領域が不要になった場合
に当該作業ベクトル領域を解放するプログラム部分とを
挿入することを特徴としたベクトル化処理方式。
It detects and analyzes loops in a source program written in a compiled high-level language, divides them into separate loops corresponding to vectorizable parts and non-vectorizable parts, and defines and references them across the division points. In a vectorization processing method that allocates a work vector to a variable in the program and generates a target program consisting of a program part to be executed as a vector and a program part to be executed as a scalar. a program part that secures a work vector area; a program part that dynamically allocates and allocates a new work vector area when the actual length exceeds the predetermined length;
A vectorization processing method characterized by inserting a program part that releases a newly allocated work vector area when the work vector area is no longer needed.
JP21606888A 1988-08-30 1988-08-30 Vectorization processing method Expired - Lifetime JPH0754511B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP21606888A JPH0754511B2 (en) 1988-08-30 1988-08-30 Vectorization processing method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP21606888A JPH0754511B2 (en) 1988-08-30 1988-08-30 Vectorization processing method

Publications (2)

Publication Number Publication Date
JPH0264766A true JPH0264766A (en) 1990-03-05
JPH0754511B2 JPH0754511B2 (en) 1995-06-07

Family

ID=16682766

Family Applications (1)

Application Number Title Priority Date Filing Date
JP21606888A Expired - Lifetime JPH0754511B2 (en) 1988-08-30 1988-08-30 Vectorization processing method

Country Status (1)

Country Link
JP (1) JPH0754511B2 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7770556B2 (en) 2007-07-24 2010-08-10 Hitachi, Ltd. Multi-hole injector, in-cylinder gasoline injection type internal combustion engine and control method for the engine
CN114579083A (en) * 2022-05-09 2022-06-03 上海擎昆信息科技有限公司 Data processing device and method based on vector processor

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7770556B2 (en) 2007-07-24 2010-08-10 Hitachi, Ltd. Multi-hole injector, in-cylinder gasoline injection type internal combustion engine and control method for the engine
CN114579083A (en) * 2022-05-09 2022-06-03 上海擎昆信息科技有限公司 Data processing device and method based on vector processor
CN114579083B (en) * 2022-05-09 2022-08-05 上海擎昆信息科技有限公司 Data processing device and method based on vector processor

Also Published As

Publication number Publication date
JPH0754511B2 (en) 1995-06-07

Similar Documents

Publication Publication Date Title
US5978588A (en) Method and apparatus for profile-based code placement using a minimum cut set of the control flow graph
JPH0814817B2 (en) Automatic vectorization method
Click Global code motion/global value numbering
US5946491A (en) Register allocation method and apparatus for gernerating spill code as a function of register pressure compared to dual thresholds
KR101645035B1 (en) Apparatus and Method for controlling parallel programming
JP2921190B2 (en) Parallel execution method
JPH0264766A (en) Vectorizing processing system
JP3871312B2 (en) Program conversion method, data processing apparatus using the same, and program
Autrey et al. Initial results for glacial variable analysis
JP3032030B2 (en) Loop optimization method and apparatus
JPH03135630A (en) Instruction scheduling system
JPS63168773A (en) Loop multiplex vector processing system
JP2853604B2 (en) Vectorization processing method of infinite loop
JPS63120369A (en) Program transformation device
JP3152194B2 (en) Compiling device, compiling method, and recording medium recording compiler
JP3464019B2 (en) Register allocation method
JP3558500B2 (en) Parallel computer system and execution process allocation method
JPH05324346A (en) Vectorization system
JPS6364173A (en) Automatic vectorization system
JP5821697B2 (en) Compiling method, compiling program, and compiling device
JP2870218B2 (en) Parallel execution instruction sequence generation method
JPS63120367A (en) Program transformation device
JPH0512033A (en) Parallel compiling system
JPH0373026A (en) Compile system
JPH04256132A (en) Optimization system for substitute sentence of high level program language