JPH04295960A - Vectorize processing system for compiler - Google Patents

Vectorize processing system for compiler

Info

Publication number
JPH04295960A
JPH04295960A JP3084605A JP8460591A JPH04295960A JP H04295960 A JPH04295960 A JP H04295960A JP 3084605 A JP3084605 A JP 3084605A JP 8460591 A JP8460591 A JP 8460591A JP H04295960 A JPH04295960 A JP H04295960A
Authority
JP
Japan
Prior art keywords
variable
fact
generated
generation unit
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.)
Pending
Application number
JP3084605A
Other languages
Japanese (ja)
Inventor
Akiyoshi Endo
明芳 遠藤
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 JP3084605A priority Critical patent/JPH04295960A/en
Publication of JPH04295960A publication Critical patent/JPH04295960A/en
Pending legal-status Critical Current

Links

Landscapes

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

Abstract

(57)【要約】本公報は電子出願前の出願データであるた
め要約のデータは記録されません。
(57) [Summary] This bulletin contains application data before electronic filing, so abstract data is not recorded.

Description

【発明の詳細な説明】[Detailed description of the invention]

【0001】0001

【産業上の利用分野】本発明は、ベクトル演算の実行が
可能な計算機システム(以下、ベクトル計算機という)
において高級言語で記述された原始プログラムからベク
トル化された目的プログラムを生成するコンパイラのベ
クトル化処理方式に関する。
[Industrial Application Field] The present invention relates to a computer system (hereinafter referred to as a vector computer) capable of performing vector operations.
This paper relates to a vectorization processing method for a compiler that generates a vectorized target program from a source program written in a high-level language.

【0002】0002

【従来の技術】ベクトル計算機においては、ベクトル演
算はスカラ演算に比べて極めて高速な実行が可能となる
。このようなベクトル計算機の能力を最大限に引き出す
ために、ベクトル計算機に係るコンパイラでは、目的プ
ログラム中のベクトル演算により実行される部分の割合
(ベクトル化率)を高めることが重要である。このため
に、コンパイラのベクトル化処理方式が存在する。
2. Description of the Related Art In vector computers, vector operations can be executed much faster than scalar operations. In order to maximize the capabilities of such a vector computer, it is important for a compiler for a vector computer to increase the proportion (vectorization rate) of the portion of the target program that is executed by vector operations. For this purpose, compiler vectorization processing methods exist.

【0003】従来、この種のコンパイラのベクトル化処
理方式では、ループ中に定義/引用されている変数が1
回の繰り返し中に確実に定義されている場合には当該変
数を配列化することによりベクトル化することができた
が、ループ中に条件分岐が存在して変数が定義されるか
否かが繰り返し毎の条件の成否(成立/不成立)に依存
している場合には当該ループをベクトル化することはで
きなかった。
Conventionally, in the vectorization processing method of this type of compiler, the number of variables defined/quoted in a loop is one
If the variable is definitely defined during the loop, it can be vectorized by making it into an array, but there is a conditional branch in the loop and it is difficult to determine whether the variable is defined or not. If the loop depends on the success or failure (satisfaction/non-satisfaction) of each condition, it is not possible to vectorize the loop.

【0004】0004

【発明が解決しようとする課題】上述した従来のコンパ
イラのベクトル化処理方式では、ループ中に条件分岐が
存在して変数が定義されるか否かが繰り返し毎の条件の
成否に依存している場合には当該ループをベクトル化す
ることができないので、ベクトル計算機に対する目的プ
ログラムのベクトル化率が低くなるという欠点があった
[Problem to be Solved by the Invention] In the conventional compiler vectorization processing method described above, there is a conditional branch in the loop, and whether or not a variable is defined depends on the success or failure of the condition at each iteration. In this case, the loop cannot be vectorized, so the vectorization rate of the target program for the vector computer is low.

【0005】本発明の目的は、上述の点に鑑み、ループ
中に条件分岐が存在して変数が定義されるか否かが繰り
返し毎の条件の成否に依存しているという事実(ある変
数が特定の条件下でのみ定義されているという事実。以
下、変数定義条件依存事実という)をベクトル化を不可
とする要因から取り除き、ベクトル計算機に対する目的
プログラムのベクトル化率を高め、目的プログラムの実
行時間の短縮を図るコンパイラのベクトル化処理方式を
提供することにある。
An object of the present invention is to take into account the fact that a conditional branch exists in a loop and whether or not a variable is defined depends on the success or failure of a condition in each iteration. By removing the fact that variables are defined only under specific conditions (hereinafter referred to as variable definition condition dependency fact) from factors that make vectorization impossible, the vectorization rate of the target program for vector computers can be increased, and the execution time of the target program can be reduced. The object of the present invention is to provide a compiler vectorization processing method that reduces the time required.

【0006】[0006]

【課題を解決するための手段】本発明のコンパイラのベ
クトル化処理方式は、ベクトル計算機のために高級言語
で記述された原始プログラムからベクトル化された目的
プログラムを生成するコンパイラにおいて、構文解析部
により生成された中間テキストプログラム中のループに
おいて変数定義条件依存事実を検出する依存関係解析部
と、この依存関係解析部により検出された変数定義条件
依存事実に係る条件の成否を反映した1次係数を生成す
る係数処理部と、前記依存関係解析部により検出された
変数定義条件依存事実に係る条件の成否を反映した定数
項を生成する定数項処理部と、前記依存関係解析部によ
り検出された変数定義条件依存事実に係る変数に対応す
る作業配列を生成する作業配列生成部と、前記係数処理
部により生成された1次係数,前記定数項処理部により
生成された定数項および前記作業配列生成部により生成
された作業配列を有する1次漸化式を生成し変数定義条
件依存事実に係る条件が成立した場合における変数定義
条件依存事実に係る変数の定義を当該1次漸化式で置換
する漸化式生成部と、変数定義条件依存事実に係るルー
プ中の変数定義条件依存事実に係る変数へのアクセスを
前記作業配列生成部により生成された作業配列の要素へ
のアクセスで置換する変数置換部と、前記作業配列生成
部により生成された作業配列の先頭要素に変数定義条件
依存事実に係るループの実行直前の変数定義条件依存事
実に係る変数の値を代入する中間テキストを生成し当該
ループの直前に当該中間テキストを挿入する初期値代入
生成部と、変数定義条件依存事実に係る変数に前記作業
配列生成部により生成された作業配列の最後に定義され
た要素の値を代入する中間テキストを生成し変数定義条
件依存事実に係るループの直後に当該中間テキストを挿
入する終値保証生成部と、中間テキストに対するベクト
ル化処理を行いベクトル中間テキストを生成するベクト
ルテキスト生成部とを有する。
[Means for Solving the Problems] The compiler vectorization processing method of the present invention is a compiler that generates a vectorized object program from a source program written in a high-level language for a vector computer. A dependency relationship analysis unit that detects variable definition condition dependency facts in a loop in the generated intermediate text program, and a primary coefficient that reflects the success or failure of the condition related to the variable definition condition dependency fact detected by this dependency relationship analysis unit. a constant term processing unit that generates a constant term that reflects the success or failure of a condition related to the variable definition condition dependency fact detected by the dependency analysis unit; and a variable detected by the dependency analysis unit. a working array generation unit that generates a working array corresponding to a variable related to a definition condition dependent fact; a primary coefficient generated by the coefficient processing unit; a constant term generated by the constant term processing unit; and the working array generation unit. Generates a linear recurrence formula with a working array generated by a variable substitution unit that replaces access to a variable related to a variable definition condition dependent fact in a loop related to a variable definition condition dependent fact with an access to an element of a work array generated by the work array generation unit; Then, generates intermediate text that assigns the value of the variable related to the variable definition condition dependent fact immediately before the execution of the loop related to the variable definition condition dependent fact to the first element of the work array generated by the work array generation unit, and An initial value assignment generation unit that inserts the intermediate text immediately before, and an intermediate text that assigns the value of the last defined element of the work array generated by the work array generation unit to the variable related to the variable definition condition dependency fact. The present invention includes a final value guarantee generation unit that inserts the intermediate text immediately after the loop related to the generated variable definition condition dependent fact, and a vector text generation unit that performs vectorization processing on the intermediate text to generate vector intermediate text.

【0007】[0007]

【作用】本発明のコンパイラのベクトル化処理方式では
、依存関係解析部が構文解析部により生成された中間テ
キストプログラム中のループにおいて変数定義条件依存
事実を検出し、係数処理部が依存関係解析部により検出
された変数定義条件依存事実に係る条件の成否を反映し
た1次係数を生成し、定数項処理部が依存関係解析部に
より検出された変数定義条件依存事実に係る条件の成否
を反映した定数項を生成し、作業配列生成部が依存関係
解析部により検出された変数定義条件依存事実に係る変
数に対応する作業配列を生成し、漸化式生成部が係数処
理部により生成された1次係数,定数項処理部により生
成された定数項および作業配列生成部により生成された
作業配列を有する1次漸化式を生成し変数定義条件依存
事実に係る条件が成立した場合における変数定義条件依
存事実に係る変数の定義を当該1次漸化式で置換し、変
数置換部が変数定義条件依存事実に係るループ中の変数
定義条件依存事実に係る変数へのアクセスを作業配列生
成部により生成された作業配列の要素へのアクセスで置
換し、初期値代入生成部が作業配列生成部により生成さ
れた作業配列の先頭要素に変数定義条件依存事実に係る
ループの実行直前の変数定義条件依存事実に係る変数の
値を代入する中間テキストを生成し当該ループの直前に
当該中間テキストを挿入し、終値保証生成部が変数定義
条件依存事実に係る変数に作業配列生成部により生成さ
れた作業配列の最後に定義された要素の値を代入する中
間テキストを生成し変数定義条件依存事実に係るループ
の直後に当該中間テキストを挿入し、ベクトルテキスト
生成部が中間テキストに対するベクトル化処理を行いベ
クトル中間テキストを生成する。
[Operation] In the vectorization processing method of the compiler of the present invention, the dependency analysis section detects the variable definition condition dependence fact in the loop in the intermediate text program generated by the syntax analysis section, and the coefficient processing section detects the dependency fact in the intermediate text program generated by the syntax analysis section. The constant term processing unit generates a linear coefficient that reflects the success or failure of the condition related to the variable definition condition dependence fact detected by the dependency relationship analysis unit. The constant term is generated, the work array generation unit generates a work array corresponding to the variable related to the variable definition condition dependence fact detected by the dependency relationship analysis unit, and the recurrence expression generation unit generates the 1 generated by the coefficient processing unit. Variable definition conditions when a linear recurrence formula having an order coefficient, a constant term generated by the constant term processing unit, and a work array generated by the work array generation unit is generated, and the condition related to the variable definition condition dependence fact is satisfied. The definition of the variable related to the dependent fact is replaced by the linear recurrence formula, and the variable replacement unit generates access to the variable related to the variable definition condition dependent fact in the loop related to the variable definition condition dependent fact by the work array generation unit. The initial value assignment generation unit replaces the first element of the work array generated by the work array generation unit with the variable definition condition dependence fact immediately before the execution of the loop related to the variable definition condition dependence fact. Generates an intermediate text that assigns the value of the variable related to the loop, inserts the intermediate text immediately before the loop, and the final value guarantee generation unit assigns the value of the work array generated by the work array generation unit to the variable related to the variable definition condition dependency fact. Generates an intermediate text that assigns the value of the last defined element, inserts the intermediate text immediately after the loop related to the variable definition condition dependency fact, and the vector text generation unit performs vectorization processing on the intermediate text to create a vector intermediate text. generate.

【0008】[0008]

【実施例】次に、本発明について図面を参照して詳細に
説明する。
DESCRIPTION OF THE PREFERRED EMBODIMENTS Next, the present invention will be explained in detail with reference to the drawings.

【0009】図1は、本発明のコンパイラのベクトル化
処理方式の一実施例の構成を示すブロック図である。本
実施例のコンパイラのベクトル化処理方式は、コンパイ
ラ1と、原始プログラム15と、目的プログラム16と
を含んで構成されている。
FIG. 1 is a block diagram showing the configuration of an embodiment of a compiler vectorization processing method according to the present invention. The compiler vectorization processing method of this embodiment includes a compiler 1, a source program 15, and a target program 16.

【0010】コンパイラ1は、制御部2と、構文解析部
3と、ベクトル化部4と、目的プログラム生成部5と、
依存関係解析部6と、係数処理部7と、定数項処理部8
と、作業配列生成部9と、漸化式生成部10と、変数置
換部11と、初期値代入生成部12と、終値保障生成部
13と、ベクトルテキスト生成部14とを含んで構成さ
れている。
The compiler 1 includes a control section 2, a syntax analysis section 3, a vectorization section 4, a target program generation section 5,
Dependency analysis section 6, coefficient processing section 7, and constant term processing section 8
, a work array generation section 9, a recurrence formula generation section 10, a variable substitution section 11, an initial value substitution generation section 12, a final price guarantee generation section 13, and a vector text generation section 14. There is.

【0011】図2は、原始プログラム15に存在するル
ープの一例を示す図である。なお、図中のIおよびNは
正整数である。
FIG. 2 is a diagram showing an example of a loop existing in the source program 15. Note that I and N in the figure are positive integers.

【0012】図3は、図2に示す原始プログラム15中
のループに基づいて構文解析部3により生成される中間
テキスト列を示す図である。なお、図中のiおよびnは
正整数である(図4および図5においても同様)。
FIG. 3 is a diagram showing an intermediate text string generated by the parser 3 based on the loop in the source program 15 shown in FIG. Note that i and n in the figure are positive integers (the same applies to FIGS. 4 and 5).

【0013】図4は、図3に示す中間テキスト列に基づ
いてベクトル化部4の制御により生成されるベクトル化
の可能な中間テキスト列を示す図である。
FIG. 4 is a diagram showing a vectorizable intermediate text string generated under the control of the vectorizer 4 based on the intermediate text string shown in FIG.

【0014】図5は、図4に示す中間テキスト列に基づ
いてベクトル化部4の制御により生成されるベクトル中
間テキスト列(ベクトル化された中間テキスト列)を示
す図である。
FIG. 5 is a diagram showing a vector intermediate text string (vectorized intermediate text string) generated under the control of the vectorizer 4 based on the intermediate text string shown in FIG.

【0015】次に、このように構成された本実施例のコ
ンパイラのベクトル化処理方式の動作について説明する
。なお、ここでは図2に示すループが存在する原始プロ
グラム15のコンパイルが行われる場合の動作について
説明する。
Next, the operation of the vectorization processing method of the compiler of this embodiment configured as described above will be explained. Here, the operation when the source program 15 including the loop shown in FIG. 2 is compiled will be described.

【0016】コンパイラ1内の制御部2は、以下に示す
コンパイラ1における一連の処理において、統括的な制
御を行う(以下の説明では制御部2には言及しない)。
The control section 2 in the compiler 1 performs overall control in a series of processes in the compiler 1 described below (the control section 2 will not be mentioned in the following explanation).

【0017】構文解析部3は、原始プログラム15の構
文解析を行って図3に示す中間テキスト列(ループ)を
含む中間テキストプログラムを生成する。
The syntactic analysis unit 3 performs syntactic analysis of the source program 15 to generate an intermediate text program including an intermediate text string (loop) shown in FIG.

【0018】構文解析部3から制御を移されたベクトル
化部4は、構文解析部3によって生成された中間テキス
トプログラム中のループを検出し、検出した各ループを
順次ベクトル化する。以下の説明では、図3に示すルー
プを対象とするベクトル化について述べる。
The vectorization unit 4 to which control is transferred from the syntax analysis unit 3 detects loops in the intermediate text program generated by the syntax analysis unit 3, and sequentially vectorizes each detected loop. In the following explanation, vectorization for the loop shown in FIG. 3 will be described.

【0019】ベクトル化部4は、当該ループのベクトル
化に際して、まず依存関係解析部6を呼び出す。
The vectorization section 4 first calls the dependency analysis section 6 when vectorizing the loop.

【0020】依存関係解析部6は、当該ループ中の変数
および配列の定義/引用状況を解析し、当該ループのベ
クトル化の可能性を調べる。その解析において、当該ル
ープにおいて変数定義条件依存事実が存在するか否かを
判断する。当該ループにおいては、「変数xが特定の条
件「y(i)>0」下でのみ定義されている」という変
数定義条件依存事実が存在するので、依存関係解析部6
はその変数定義条件依存事実を検出する。
The dependency analysis unit 6 analyzes the definition/citation status of variables and arrays in the loop, and examines the possibility of vectorization of the loop. In the analysis, it is determined whether a variable definition condition dependent fact exists in the loop. In this loop, there is a variable definition condition dependent fact that "variable x is defined only under a specific condition 'y(i)>0'", so the dependency analysis unit 6
detects a fact that depends on the variable definition condition.

【0021】依存関係解析部6により変数定義条件依存
事実が検出されたので、ベクトル化部4は係数処理部7
,定数項処理部8,作業配列生成部9,漸化式生成部1
0,変数置換部11,初期値代入生成部12および終値
保障生成部13を順次呼び出し、当該ループをベクトル
化の可能な図4に示す中間テキスト列に変形する。その
過程において、各部は以下に示すような処理を行う。
Since the dependency relationship analysis unit 6 has detected the variable definition condition dependency fact, the vectorization unit 4 uses the coefficient processing unit 7
, constant term processing unit 8, work array generation unit 9, recurrence expression generation unit 1
0, the variable replacement section 11, the initial value assignment generation section 12, and the final value guarantee generation section 13 are sequentially called to transform the loop into an intermediate text string shown in FIG. 4 that can be vectorized. In this process, each part performs the following processing.

【0022】係数処理部7は、条件「y(i)>0」が
成立した場合に0となり成立しない場合に1となる1次
係数「1−s(i)」を生成する(そのために、s(i
)を定義する中間テキスト17を生成する)。
[0022] The coefficient processing unit 7 generates a linear coefficient "1-s(i)" which becomes 0 when the condition "y(i)>0" is satisfied and becomes 1 when it does not hold (therefore, s(i
).

【0023】定数項処理部8は、条件「y(i)>0」
が成立した場合に変数xに本来代入されるべき値となり
成立しない場合に0となる定数項「t(i)」を生成す
る(そのために、配列要素t(i)を定義する中間テキ
スト18を生成する)。
The constant term processing unit 8 satisfies the condition "y(i)>0"
Generates a constant term "t(i)" which is the value that should be assigned to the variable x if it holds true and becomes 0 if it does not hold (to do this, the intermediate text 18 that defines the array element t(i) is generated. generate).

【0024】なお、本実施例では、係数処理部7および
定数項処理部8による処理において、配列tおよびsの
全ての要素が目的プログラム16の実行前に0に初期化
されていることを仮定している。
In this embodiment, it is assumed that all elements of the arrays t and s are initialized to 0 before execution of the target program 16 in the processing by the coefficient processing section 7 and the constant term processing section 8. are doing.

【0025】作業配列生成部9は、変数xに対応する作
業配列xxを生成する。
The work array generation unit 9 generates a work array xx corresponding to the variable x.

【0026】漸化式生成部10は、「1−s(i)」を
1次係数とし配列要素t(i)を定数項とする作業配列
xxに関する1次漸化式「xx(i+1)=(1−s(
i))*xx(i)+t(i)」を示す中間テキスト1
9を生成し、当該ループにおける変数xの定義を示す中
間テキストをその中間テキスト19で置換する。
The recurrence formula generation unit 10 generates a linear recurrence formula "xx(i+1)= (1-s(
Intermediate text 1 indicating “i))*xx(i)+t(i)”
9 is generated, and the intermediate text indicating the definition of the variable x in the loop is replaced with the intermediate text 19.

【0027】変数置換部11は、当該ループ中の変数x
へのアクセスを示す中間テキストを、作業配列xxの要
素へのアクセスを示す中間テキスト20で置換する。
The variable substitution unit 11 replaces the variable x in the loop.
Intermediate text 20 indicating access to an element of working array xx is replaced with intermediate text 20 indicating access to an element of working array xx.

【0028】初期値代入生成部12は、作業配列xxの
先頭要素xx(1)に当該ループ実行直前の変数xの値
を代入する中間テキスト21を生成し、当該ループの直
前にその中間テキスト21を挿入する。
The initial value assignment generation unit 12 generates an intermediate text 21 that assigns the value of the variable x immediately before execution of the loop to the first element xx(1) of the work array xx. Insert.

【0029】終値保障生成部13は、変数xに作業配列
xxの最後に定義された要素xx(n+1)の値を代入
する中間テキスト22(終値保障のための中間テキスト
)を生成し、当該ループの直後にその中間テキスト22
を挿入する。
The closing price guarantee generation unit 13 generates intermediate text 22 (intermediate text for closing price guarantee) that assigns the value of the last defined element xx(n+1) of the work array xx to the variable x, and Immediately after that intermediate text 22
Insert.

【0030】以上のような中間テキスト列の変形処理(
図3に示す中間テキスト列から図4に示す中間テキスト
列への変形処理)の後に、ベクトル化部4はベクトルテ
キスト生成部14を呼び出す。
Transformation processing of the intermediate text string as described above (
After the process of transforming the intermediate text string shown in FIG. 3 into the intermediate text string shown in FIG. 4), the vectorization unit 4 calls the vector text generation unit 14.

【0031】ベクトルテキスト生成部14は、図4に示
す中間テキスト列に対してベクトル化処理を施し、図5
に示すベクトル中間テキスト列を生成する。図5に示す
ベクトル中間テキスト列においては、図4中の一次漸化
式を示す中間テキスト19がベクトル漸化式命令を示す
ベクトル中間テキスト23で置換されている。
The vector text generation unit 14 performs vectorization processing on the intermediate text string shown in FIG.
Generate the vector intermediate text string shown in In the vector intermediate text string shown in FIG. 5, the intermediate text 19 indicating the linear recurrence formula in FIG. 4 is replaced with the vector intermediate text 23 indicating the vector recurrence formula command.

【0032】ベクトル化部4は、以上のような図3に示
すループのベクトル化を含む中間テキストプログラム中
の各ループのベクトル化を可能な限り行い、目的プログ
ラム生成部5に制御を渡す。
The vectorization unit 4 vectorizes each loop in the intermediate text program as much as possible, including the vectorization of the loops shown in FIG. 3 as described above, and passes control to the target program generation unit 5.

【0033】目的プログラム生成部5は、図5に示すベ
クトル中間テキスト列を含む中間テキストプログラムか
ら、ベクトル化された目的プログラム16を生成する。
The target program generating section 5 generates a vectorized target program 16 from an intermediate text program including the vector intermediate text string shown in FIG.

【0034】[0034]

【発明の効果】以上説明したように本発明は、依存関係
解析部,係数処理部,定数項処理部,作業配列生成部,
漸化式生成部,変数置換部,初期値代入生成部,終値保
障生成部およびベクトルテキスト生成部を設けることに
より、従来のコンパイラのベクトル化処理方式ではベク
トル化できなかったループをベクトル化することができ
、ベクトル計算機に対する目的プログラムのベクトル化
率を高めることができ、目的プログラムの実行時間を短
縮することができるという効果がある。
[Effects of the Invention] As explained above, the present invention has a dependency analysis section, a coefficient processing section, a constant term processing section, a work array generation section,
By providing a recurrence formula generation section, a variable substitution section, an initial value assignment generation section, a final value guarantee generation section, and a vector text generation section, it is possible to vectorize loops that could not be vectorized using the vectorization processing method of conventional compilers. This has the effect of increasing the vectorization rate of the target program for the vector computer and shortening the execution time of the target program.

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

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

【図2】図1中の原始プログラムに存在するループの一
例を示す図である。
FIG. 2 is a diagram showing an example of a loop existing in the source program in FIG. 1;

【図3】図2に示すループに基づいて図1中の構文解析
部により生成される中間テキスト列を示す図である。
FIG. 3 is a diagram showing an intermediate text string generated by the parser in FIG. 1 based on the loop shown in FIG. 2;

【図4】図3に示す中間テキスト列に基づいて図1中の
ベクトル化部の制御により生成されるベクトル化の可能
な中間テキスト列を示す図である。
4 is a diagram showing a vectorizable intermediate text string generated under control of the vectorization unit in FIG. 1 based on the intermediate text string shown in FIG. 3; FIG.

【図5】図4に示す中間テキスト列に基づいて図1中の
ベクトル化部の制御により生成されるベクトル中間テキ
スト列を示す図である。
FIG. 5 is a diagram showing a vector intermediate text string generated under control of the vectorization unit in FIG. 1 based on the intermediate text string shown in FIG. 4;

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

1  コンパイラ 2  制御部 3  構文解析部 4  ベクトル化部 5  目的プログラム生成部 6  依存関係解析部 7  係数処理部 8  定数項処理部 9  作業配列生成部 10  漸化式生成部 11  変数置換部 12  初期値代入生成部 13  終値保障生成部 14  ベクトルテキスト生成部 15  原始プログラム 16  目的プログラム 17〜22  中間テキスト 23  ベクトル中間テキスト 1 Compiler 2 Control section 3 Syntax analysis section 4 Vectorization section 5 Target program generation section 6 Dependency analysis section 7 Coefficient processing section 8 Constant term processing section 9 Work array generation section 10 Recurrence formula generation unit 11 Variable replacement part 12 Initial value assignment generation section 13 Closing price guarantee generation section 14 Vector text generation section 15 Primitive program 16 Purpose program 17-22 Intermediate text 23 Vector intermediate text

Claims (1)

【特許請求の範囲】[Claims] 【請求項1】  ベクトル計算機のために高級言語で記
述された原始プログラムからベクトル化された目的プロ
グラムを生成するコンパイラにおいて、構文解析部によ
り生成された中間テキストプログラム中のループにおい
て変数定義条件依存事実を検出する依存関係解析部と、
この依存関係解析部により検出された変数定義条件依存
事実に係る条件の成否を反映した1次係数を生成する係
数処理部と、前記依存関係解析部により検出された変数
定義条件依存事実に係る条件の成否を反映した定数項を
生成する定数項処理部と、前記依存関係解析部により検
出された変数定義条件依存事実に係る変数に対応する作
業配列を生成する作業配列生成部と、前記係数処理部に
より生成された1次係数,前記定数項処理部により生成
された定数項および前記作業配列生成部により生成され
た作業配列を有する1次漸化式を生成し変数定義条件依
存事実に係る条件が成立した場合における変数定義条件
依存事実に係る変数の定義を当該1次漸化式で置換する
漸化式生成部と、変数定義条件依存事実に係るループ中
の変数定義条件依存事実に係る変数へのアクセスを前記
作業配列生成部により生成された作業配列の要素へのア
クセスで置換する変数置換部と、前記作業配列生成部に
より生成された作業配列の先頭要素に変数定義条件依存
事実に係るループの実行直前の変数定義条件依存事実に
係る変数の値を代入する中間テキストを生成し当該ルー
プの直前に当該中間テキストを挿入する初期値代入生成
部と、変数定義条件依存事実に係る変数に前記作業配列
生成部により生成された作業配列の最後に定義された要
素の値を代入する中間テキストを生成し変数定義条件依
存事実に係るループの直後に当該中間テキストを挿入す
る終値保証生成部と、中間テキストに対するベクトル化
処理を行いベクトル中間テキストを生成するベクトルテ
キスト生成部とを有することを特徴とするコンパイラの
ベクトル化処理方式。
Claim 1: In a compiler that generates a vectorized target program from a source program written in a high-level language for a vector computer, a variable definition condition dependency fact is detected in a loop in an intermediate text program generated by a syntax analysis unit. a dependency analysis unit that detects
a coefficient processing unit that generates a first-order coefficient that reflects the success or failure of a condition related to the variable definition condition dependency fact detected by the dependency relationship analysis unit; and a condition related to the variable definition condition dependency fact detected by the dependency relationship analysis unit a constant term processing unit that generates a constant term reflecting the success or failure of the process; a work array generation unit that generates a work array corresponding to a variable related to the variable definition condition dependence fact detected by the dependency relationship analysis unit; and the coefficient processing unit. A linear recurrence formula having a linear coefficient generated by the constant term processing unit, a constant term generated by the constant term processing unit, and a work array generated by the work array generation unit is generated, and a condition related to a variable definition condition dependence fact is generated. A recurrence expression generation unit that replaces the definition of a variable related to a variable definition condition dependent fact with the corresponding linear recurrence formula when , and a variable related to a variable definition condition dependent fact in a loop related to the variable definition condition dependent fact. a variable replacement unit that replaces access to with an access to an element of the work array generated by the work array generation unit; and a variable definition condition dependent fact related to the first element of the work array generated by the work array generation unit. An initial value assignment generation unit that generates an intermediate text to which a value of a variable related to a variable definition condition dependent fact immediately before execution of a loop is inserted and inserts the intermediate text immediately before the loop; a final value guarantee generation unit that generates intermediate text to which the value of the element defined at the end of the work array generated by the work array generation unit is assigned, and inserts the intermediate text immediately after the loop related to the variable definition condition dependence fact; A vectorization processing method for a compiler, comprising: a vector text generation unit that performs vectorization processing on intermediate text to generate vector intermediate text.
JP3084605A 1991-03-25 1991-03-25 Vectorize processing system for compiler Pending JPH04295960A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP3084605A JPH04295960A (en) 1991-03-25 1991-03-25 Vectorize processing system for compiler

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP3084605A JPH04295960A (en) 1991-03-25 1991-03-25 Vectorize processing system for compiler

Publications (1)

Publication Number Publication Date
JPH04295960A true JPH04295960A (en) 1992-10-20

Family

ID=13835321

Family Applications (1)

Application Number Title Priority Date Filing Date
JP3084605A Pending JPH04295960A (en) 1991-03-25 1991-03-25 Vectorize processing system for compiler

Country Status (1)

Country Link
JP (1) JPH04295960A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH05189472A (en) * 1992-01-16 1993-07-30 Nec Corp Vectorization processing system for compiler

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH05189472A (en) * 1992-01-16 1993-07-30 Nec Corp Vectorization processing system for compiler

Similar Documents

Publication Publication Date Title
KR930008769B1 (en) System for generating software source code component
US5355494A (en) Compiler for performing incremental live variable analysis for data-parallel programs
JPH0814817B2 (en) Automatic vectorization method
US5067068A (en) Method for converting an iterative loop of a source program into parellelly executable object program portions
US5692196A (en) System and method for conditionally compiling a software compilation unit
JP3539613B2 (en) Array summary analysis method for loops containing loop jump statements
JPH05189472A (en) Vectorization processing system for compiler
US5778232A (en) Automatic compiler restructuring of COBOL programs into a proc per paragraph model
Alias et al. On the recognition of algorithm templates
McKinley Dependence analysis of arrays subscriptecl by index arrays
JPH04295960A (en) Vectorize processing system for compiler
Mossin Partial evaluation of general parsers
CN118092931A (en) Function vectorization method and system based on guidance statement
Ruf et al. Opportunities for online partial evaluation
Silber et al. The Nestor library: A tool for implementing fortran source to source transfromations
Girault Elimination of redundant messages with a two-pass static analysis algorithm
Logothetis et al. Compiling short‐circuit boolean expressions in one pass
JP2701246B2 (en) Compiler vectorization method
JP3057904B2 (en) Vectorization method
Acharya Principle of Programming Language
JPH0269867A (en) Vectorizing system
JP2674489B2 (en) Vectorization processor
Behera Principle of Programming Language
Dow et al. Undoing Code Transformations in an Independent Order
Song et al. An unfolding-based loop optimization technique