JP3658771B2 - Compiler device - Google Patents

Compiler device Download PDF

Info

Publication number
JP3658771B2
JP3658771B2 JP01564194A JP1564194A JP3658771B2 JP 3658771 B2 JP3658771 B2 JP 3658771B2 JP 01564194 A JP01564194 A JP 01564194A JP 1564194 A JP1564194 A JP 1564194A JP 3658771 B2 JP3658771 B2 JP 3658771B2
Authority
JP
Japan
Prior art keywords
data
citation
classification
dependency
data dependency
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
JP01564194A
Other languages
Japanese (ja)
Other versions
JPH07225753A (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 JP01564194A priority Critical patent/JP3658771B2/en
Publication of JPH07225753A publication Critical patent/JPH07225753A/en
Application granted granted Critical
Publication of JP3658771B2 publication Critical patent/JP3658771B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Landscapes

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

Description

【0001】
【産業上の利用分野】
本発明は計算機の原始プログラムを翻訳してベクトル化部分を有する目的プログラムを生成するコンパイラの処理を行うコンパイラ装置に関する。
【0002】
【従来の技術と発明が解決しようとする課題】
広く知られているように、C言語と呼ばれるプログラミング言語等には、ポインタ機能があり、ポインタとして宣言された変数を使って、その変数の値をアドレスとするデータを引用する、いわゆるポインタ間接引用を原始プログラムに記述することができる。
【0003】
図2はポインタ間接引用を含むC言語のプログラムの例であり、図2(a)において▲1▼行は、次の▲2▼行以下で関数定義を行い、その関数はfunc1() であることを示す。
【0004】
▲3▼はdouble型データの宣言、▲4▼行はint 型データの宣言で、double型データには配列データaとポインタ(*で示す) pがある。
▲5▼行は、端末から値を十進数("%d"で示す) として読み込んで変数j(&jで変数jのアドレスを示す) に代入すること、▲6▼行は、a[j]のアドレスを求めてポインタpに代入することを示す。
【0005】
▲7▼行はプログラムのループを記述する for文であって、変数iを値0から9まで、1づつ増加しながら、続く▲8▼行の代入文を繰り返すことを示す。
▲8▼行で代入先を示すp[i]がポインタ間接引用であって、ポインタpが指示するデータを先頭の要素とする配列のi番目の要素を示す。
【0006】
よく知られているように、一般に for文等で構成されるループによる配列の計算部分は、ベクトル処理装置で処理するようにベクトル化した目的プログラムを生成するための主要な対象である。
【0007】
従って、ベクトル化機能を持つコンパイラは最適化処理として、先ずループ内のデータ引用のうち、少なくとも一方が値を定義するデータ引用であり、同じ配列データに関する2個のデータ引用のすべての組合せについて、データ依存関係を調べて、それらの各データ引用対ごとについてのデータ依存関係を表す値を設定したデータ依存関係表を作成する。
【0008】
次に、そのデータ依存関係表を参照して、データ依存関係が無いか、又はその影響を避けるようプログラムを変更できる場合には変更して、ベクトル化目的プログラムを生成する。
【0009】
しかし、従来ポインタ間接引用が含まれる場合には、次のような状況が発生する可能性を持つことから、無条件に最適化をしないようにしている。即ち、そのループのデータ引用対について、前記のデータ依存関係表に設定する値をすべて無条件に「?」としてデータ依存関係の解析不能を示すようにし、従ってそのデータ依存関係表を参照する最適化処理では、ベクトル化不能と判断せざるを得ないようにする。
【0010】
このように処置する理由は次のとおりである。例えば図2(a)の例で、for文の実行直前の変数jとaの値が次の通りであったとする。
j=2
a=( 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,.....)
ベクトル化しないで、順次実行すれば、 for文実行後のaは、
a=( 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2,13,14,.....)
となることは、プログラムを追えば明らかである。
【0011】
しかしベクトル化すると、実行前のaの値の列を一斉にベクトル処理装置のベクトルレジスタに読み込んでおき、それをパイプライン式の演算器に送り込んで演算し、パイプラインから順次出てくる結果を、例えばベクトルレジスタの別の領域に順次格納しておいて、一斉にaの領域へ書き込むようにするので、実行後のaの値は、
a=( 1, 2, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,13,14,.....)
となり、前記のaの結果と異なる。
【0012】
以上のとおり、ベクトル化すると、プログラムの記述上意図したのと異なる動きをし、その結果演算結果が異なってしまうので、このような結果になる場合にはベクトル化してはならない。
【0013】
次に、図2(b)はポインタ間接引用を使用した別の例で、(a)と類似した文で
あるので個々の説明を省略するが、この例の場合には▲7▼行でポインタ間接引用が参照に使用され、間接引用先の変数bも▲8▼行で参照のみに使用されているために、ベクトル化してもポインタ間接引用に起因する前記(b)の例のような結果は発生しない。
【0014】
即ち、図2(b)の例のような場合には、ポインタ間接引用があっても、ベクトル化して効率のよい目的プログラムを生成できることが望まれる。
本発明は、ポインタ間接引用があってもベクトル化してよいことを比較的容易に判定できる場合を効率よく選別して、ベクトル化範囲を拡大したコンパイラ装置を目的とする。
【0015】
【課題を解決するための手段】
図1は、本発明の構成を示すブロック図である。
図はコンパイラ装置の構成であって、ポインタ機能を有するプログラミング言語で記述された原始プログラムを、解析部1が解析し、データ依存関係設定部3が、該解析結果に従い、ループをなすプログラム部分のデータ引用から取り出す2個のデータ引用の組合せのうち少なくとも一方のデータ引用が値を定義するデータ引用であるすべての各組合せについてデータ依存関係を解析し、データ依存関係が有る各組合せ、及びデータ依存関係の解析不能の各組合せについて、各組合せの表示と所定のデータ依存関係値とをデータ依存関係表に設定するデータ依存関係設定処理を行い、最適化実施部4が、該データ依存関係表を参照して、ベクトル化の可否を識別し、ベクトル化可能な場合に必要な最適化を行い、コード生成部5が該最適化結果に従い、ベクトル化可能部分をベクトル化した目的プログラムを生成するコンパイラ装置であって、データ引用分類部2を設ける。
【0016】
データ引用分類部2は、該原始プログラムの解析結果について、各データ引用を判別し、各該データ引用がポインタ間接引用、外部変数についての引用、及びアドレスを取られている変数の引用の何れかであることを条件として、当該データ引用をA分類とし、A分類に属さない場合に当該データ引用をB分類とする。
【0017】
データ依存関係設定部3は、データ引用分類部2の分類したB分類の全データ引用のみについて、該データ依存関係設定処理を行い、A分類の全データ引用から取り出す、2個のデータ引用の組合せのうち少なくとも一方のデータ引用が値を定義するデータ引用であるすべての各組合せについて、無条件に解析不能を示す該データ依存関係値をデータ依存関係表に設定する。
【0018】
【作用】
本発明のコンパイラ装置により、ポインタ間接引用についても、データ依存関係の無いことが明確な場合には、ベクトル化の可否が解析されて、可能な場合はベクトル化が実施される。
【0019】
【実施例】
図3は、図1のデータ引用分類部2の処理の流れの一例を示す図であり、解析部1の解析結果による forループ等のベクトル化候補部分について、データ引用を順次調べるものとし、処理ステップ10で一つのデータ引用を取り出す。
【0020】
処理ステップ11で、そのデータ引用がポインタ間接引用(即ち、ポインタをpとして、前記説明のようにp[i]の形で行われている引用)か識別し、ポインタ
間接引用であれば処理ステップ14で分類Aのデータ引用とする。
【0021】
ポインタ間接引用でなければ、処理ステップ12で、そのデータ引用が外部変数 (即ち、関数定義等の外で定義されている変数) か識別し、外部変数であれば処理ステップ14で分類Aのデータ引用とする。これは、以上のような外部変数であれば、外部でアドレスを取られている (後述) ことがあり得るからである。
【0022】
以上の何れでもなければ、処理ステップ13で、そのデータ引用がアドレスを取られているか識別する。
ここで、アドレスを取られているとは、データ引用の配列変数が、そのアドレスを求められて、そのアドレス値をポインタに代入することが記述されれていることを言うものとし、従って前記説明のプログラムの例において&演算子の対象になっている変数が典型的な例であるが、その他にもプログラミング言語の仕様上暗にアドレスを取られることになる場合についても考慮するものとする。
【0023】
以上の識別の結果、アドレスを取られていれば処理ステップ14で分類Aのデータ引用とし、以上3条件の何れでもない場合は処理ステップ15で、そのデータ引用を分類Bとし、以上の分類処理を、すべてのデータ引用について行ったか処理ステップ16で識別して繰り返す。
【0024】
前記図2(b) のプログラム例のデータ引用について、以上の処理による分類結果を説明すると、この例では forループ内のデータ引用としてp[i]、a[i]、b[i]及びa[i+100]があるので、それらを順次取り出して調べる。
【0025】
その結果、p[i]はポインタ間接引用の条件に該当し、a[i]は3条件の何れにも該当せず、b[i]はポインタ間接引用でも、外部変数でもないが、アドレスを取られている (図2(b) の▲5▼行) 条件に該当し、a[i+100]は何れの条件にも該当しないので、p[i]とb[i]が分類A、a[i]とa[i+100]が分類Bとなる。
【0026】
図4は、図1のデータ依存関係設定部3の処理の流れの一例を示す図であり、データ引用分類部2の分類結果により、各分類ごとに2個のデータ引用の対ごとに、データ依存関係を順次調べるものとし、先ず分類Aについて処理ステップ20で一対のデータ引用を取り出す。
【0027】
処理ステップ21で取り出した対の両データ引用が共に参照であれば(何れも、値を定義するデータ引用でなければ)、このデータ引用対についてデータ依存関係は無いので処理の必要が無いものとする。
【0028】
対の少なくとも一方が値を定義するデータ引用であれば、処理ステップ22で、その対のデータ引用と、データ依存関係の値として「?」(解析不能)とをデータ依存関係表に設定する。
【0029】
以上の処理を、分類Aに分類されたデータ引用のすべての2個の組合せについて行うように、処理ステップ23で識別しながら、以上の処理を繰り返し、分類Aの処理を終わると次に分類Bを処理する。
【0030】
なお、前記例のプログラムの場合に、分類Aのデータ引用はp[i]とb[i]であったので、この対を処理すると、両者ともにデータ参照であるので、データ依存関係は無いと判断される。
【0031】
分類Bについては、2個のデータ引用の対ごとのデータ依存関係を、従来のデータ依存関係の解析処理と同様にして処理し、必要な各対についてデータ依存関係をデータ依存関係表に設定する。
【0032】
即ち、処理ステップ24で分類Bのデータ引用の1対を取り出し、処理ステップ25、26で取り出した対の少なくとも一方が値を定義し、且つ同じ配列データのデータ引用であればデータ依存関係の解析を要するものとし、それ以外の対についてはデータ依存関係は無いので処理の必要が無いものとする。
【0033】
データ依存関係の解析は処理ステップ27で、両データ引用の添字間の必要な計算等を行って識別し、データ依存関係有りと判断した場合には、処理ステップ28でデータ依存関係表にその対のデータ引用と、データ依存関係の計算結果の値とを設定する。
【0034】
例えば、前記例で分類Bになったa[i]とa[i+100]の対については、両データ引用の添字iとi+100とについて、両者の差をとって-100を得、それを forループの増分1及びループ変数の係数1で割った結果の-100を計算値として求め、これをデータ依存関係の設定値とする。
【0035】
この値は、これは後に図1の最適化実施部4が、通常の従来通りの処理により、ベクトル化の可否判断をし、又必要な場合に適当な最適化を行ってベクトル化可能にするための判断データとして使用する。
【0036】
処理ステップ24から処理ステップ28までの以上の処理を、分類Bに分類されたデータ引用のすべての2個の組合せについて行うように、処理ステップ29で識別しながら処理を繰り返し、分類Bの処理を終わる。
【0037】
最適化実施部4は、以上で作成されたデータ依存関係表を参照して最適化処理を行う。
その処理は従来と同様であるので詳細を省略するが、データ依存関係表に従来のように無条件にデータ依存関係「?」が設定されるのではなく、本発明により前記プログラム例の forループであれば、a[i]とa[i+100]の対のみについて、計算されたデータ依存関係値「-100」が設定されているので、それに基づいて実効的な最適化処理が実施される。
【0038】
【発明の効果】
以上の説明から明らかなように本発明によれば、計算機プログラムのコンパイルにおけるベクトル化による最適化処理に際し、ポインタ間接引用についても、データ依存関係の無いことが明確な場合には、ベクトル化の可否が解析されて、可能な場合はベクトル化が実施されるようになるので、ベクトル化率を向上して効率の良い目的プログラムを生成できるという著しい工業的効果がある。
【図面の簡単な説明】
【図1】 本発明の構成を示すブロック図
【図2】 プログラム例を説明する図
【図3】 本発明の処理の流れ図(その1)
【図4】 本発明の処理の流れ図(その2)
【符号の説明】
1 解析部
2 データ引用分類部
3 データ依存関係設定部
4 最適化実施部
5 コード生成部
10〜16、20〜29 処理ステップ
[0001]
[Industrial application fields]
The present invention relates to a compiler apparatus that performs processing of a compiler that translates a computer source program and generates a target program having a vectorized portion.
[0002]
[Prior art and problems to be solved by the invention]
As is widely known, a programming language called C language has a pointer function and uses a variable declared as a pointer to quote data whose value is the address of the variable, so-called pointer indirect quoting. Can be described in the source program.
[0003]
FIG. 2 shows an example of a C language program including indirect pointer citation. In FIG. 2 (a), line (1) defines a function in the following line (2) and below, and the function is func1 (). It shows that.
[0004]
(3) is a declaration of double type data, (4) is a declaration of int type data, and double type data includes array data a and pointer (indicated by *) p.
Line (5) reads the value from the terminal as a decimal number (indicated by "% d") and assigns it to variable j (indicating the address of variable j by & j), line (6): a [j] Is obtained and assigned to the pointer p.
[0005]
Line (7) is a for statement describing a loop of the program, and indicates that the variable (i) is incremented by 1 from 0 to 9 and the assignment statement in line (8) is repeated.
{Circle over (8)} p [i] indicating the assignment destination in the line indicates pointer indirect citation, and indicates the i-th element of the array having the data indicated by the pointer p as the first element.
[0006]
As is well known, the calculation part of an array by a loop generally composed of a for sentence or the like is a main object for generating a target program vectorized so as to be processed by a vector processing device.
[0007]
Therefore, a compiler having a vectorization function, as an optimization process, first, at least one of the data citations in the loop is a data citation that defines a value, and for all combinations of two data citations for the same array data, The data dependency relationship is examined, and a data dependency relationship table in which a value indicating the data dependency relationship for each data citation pair is set is created.
[0008]
Next, with reference to the data dependency relationship table, if there is no data dependency or the program can be changed to avoid the influence, the data dependency relationship table is changed to generate a vectorized object program.
[0009]
However, in the case where conventional pointer indirect citation is included, there is a possibility that the following situation may occur, so optimization is not unconditionally performed. That is, for the data citation pair of the loop, all the values set in the data dependency table are unconditionally set to “?” To indicate that the data dependency relationship cannot be analyzed, and accordingly, the optimum data reference table is referred to. In the conversion process, it must be determined that vectorization is impossible.
[0010]
The reason for this treatment is as follows. For example, in the example of FIG. 2A, assume that the values of variables j and a immediately before the for statement is executed are as follows.
j = 2
a = (1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14, .....)
If executed sequentially without vectorization, a after executing the for statement is
a = (1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2,13,14 .....)
It will be clear if you follow the program.
[0011]
However, when vectorization is performed, the sequence of values a before execution is read into the vector register of the vector processing unit all at once, sent to a pipeline type arithmetic unit, and the result sequentially output from the pipeline is obtained. For example, since the data is sequentially stored in different areas of the vector register and written to the area of a at the same time, the value of a after execution is
a = (1, 2, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,13,14, .....)
Which is different from the result of a.
[0012]
As described above, since vectorization moves differently from what is intended in the description of the program, and as a result, the calculation result is different, it should not be vectorized when such a result is obtained.
[0013]
Next, FIG. 2 (b) is another example using pointer indirect citation, and since it is a sentence similar to (a), individual explanation is omitted. In this example, the pointer is on line (7). Since indirect citation is used for reference and the variable b of the indirect citation destination is also used only for reference in line (8), the result as in the example of (b) above that is caused by pointer indirect citation even when vectorized Does not occur.
[0014]
That is, in the case of the example of FIG. 2B, it is desired that an efficient target program can be generated by vectorization even if there is pointer indirect citation.
An object of the present invention is to provide a compiler apparatus in which the vectorization range is expanded by efficiently selecting a case where it is possible to relatively easily determine that vectorization is possible even if there is a pointer indirect citation.
[0015]
[Means for Solving the Problems]
FIG. 1 is a block diagram showing the configuration of the present invention.
The figure shows the configuration of a compiler apparatus, in which an analysis unit 1 analyzes a source program described in a programming language having a pointer function, and a data dependency setting unit 3 shows a program portion forming a loop according to the analysis result. Data dependency is analyzed for all combinations in which at least one of the two data citation combinations extracted from the data citation is a data citation that defines a value, and each combination having a data dependency and data dependency For each combination whose relationship cannot be analyzed, a data dependency setting process for setting the display of each combination and a predetermined data dependency value in the data dependency table is performed, and the optimization executing unit 4 displays the data dependency table. With reference to this, the possibility of vectorization is identified, and if necessary, the code generation unit 5 performs optimization necessary for vectorization. According to a compiler apparatus for generating an object program obtained by vectorizing the vectorization moiety, provided data reference classification section 2.
[0016]
The data citation classification unit 2 discriminates each data citation with respect to the analysis result of the source program, and each of the data citations is one of a pointer indirect citation, a citation about an external variable, and a citation of a variable whose address is taken. If the data citation does not belong to the A class, the data citation is set to the B class.
[0017]
The data dependency setting unit 3 performs the data dependency setting processing only for all data citations of the B classification classified by the data citation classification unit 2 and combines two data citations extracted from all the data citations of the A classification For each combination in which at least one of the data citations is a data citation that defines a value, the data dependency value indicating unconditional analysis is set in the data dependency table.
[0018]
[Action]
When it is clear that the pointer indirect citation has no data dependency, the compiler apparatus of the present invention analyzes whether or not vectorization is possible, and performs vectorization if possible.
[0019]
【Example】
FIG. 3 is a diagram illustrating an example of the processing flow of the data citation classification unit 2 in FIG. 1. Data citations are sequentially examined for vectorization candidate portions such as for loops based on the analysis result of the analysis unit 1. Step 10 retrieves one data citation.
[0020]
In processing step 11, it is identified whether the data citation is a pointer indirect citation (that is, a citation made in the form of p [i] as described above, where p is a pointer). The data is classified as category A in 14.
[0021]
If it is not a pointer indirect citation, it is determined at processing step 12 whether the data citation is an external variable (ie, a variable defined outside a function definition, etc.). Quote. This is because an external address such as the one described above may have an external address (described later).
[0022]
If none of the above, then step 13 identifies whether the data citation is addressed.
Here, taking an address means that the array variable of the data reference describes that the address is obtained and the address value is assigned to the pointer. In the example of the program, the variable that is the target of the & operator is a typical example, but other cases where the address is implicitly taken into account in the specification of the programming language are also considered.
[0023]
As a result of the above identification, if the address is taken, the data citation of the classification A is determined in the processing step 14, and if none of the above three conditions is satisfied, the data citation is determined as the classification B in the processing step 15. Has been done for all data citations or is identified in processing step 16 and repeated.
[0024]
Regarding the data citation in the program example of FIG. 2 (b), the classification result by the above processing will be described. In this example, p [i], a [i], b [i] and a Since there are [i + 100], they are taken out and examined sequentially.
[0025]
As a result, p [i] corresponds to the condition of indirect pointer citation, a [i] does not correspond to any of the three conditions, and b [i] is neither a pointer indirect citation nor an external variable. ([5] line in Fig. 2 (b)) is applicable, and a [i + 100] does not correspond to any condition, so p [i] and b [i] are classified as A, a [i] and a [i + 100] are classified as B.
[0026]
FIG. 4 is a diagram illustrating an example of the processing flow of the data dependency setting unit 3 in FIG. 1. According to the classification result of the data citation classification unit 2, data for each pair of two data citations is classified for each classification. It is assumed that the dependency relations are sequentially examined. First, a pair of data citations are extracted from the processing step 20 for the classification A.
[0027]
If both data citations in the pair extracted in processing step 21 are both references (both are not data citations that define values), there is no data dependency on this data citation pair, so no processing is necessary. To do.
[0028]
If at least one of the pairs is a data citation that defines a value, in processing step 22, the data citation of the pair and “?” (Unanalyzable) are set in the data dependency table as the data dependency value.
[0029]
The above processing is repeated while identifying in the processing step 23 so that the above processing is performed for all two combinations of the data citation classified into the classification A. When the processing of the classification A is completed, the classification B Process.
[0030]
In the case of the program of the above example, the data citation of the classification A was p [i] and b [i]. Therefore, when this pair is processed, since both are data references, there is no data dependency. To be judged.
[0031]
For classification B, the data dependency for each pair of two data citations is processed in the same manner as the conventional data dependency analysis processing, and the data dependency is set in the data dependency table for each required pair. .
[0032]
That is, if a pair of classification B data citations is extracted in processing step 24 and at least one of the pairs extracted in processing steps 25 and 26 defines a value, and the data citation of the same sequence data is analyzed, the data dependency is analyzed. It is assumed that there is no data dependency for the other pairs and no processing is required.
[0033]
The data dependency analysis is performed in processing step 27 by performing necessary calculations between the subscripts of both data citations, and if it is determined that there is a data dependency, the data dependency table is displayed in processing step 28. Set the data citation and the value of the data dependency calculation result.
[0034]
For example, for the pair of a [i] and a [i + 100] that are classified as B in the above example, the difference between the subscripts i and i + 100 of both data citations is taken to obtain -100, The result is divided by the increment of for loop 1 and the coefficient 1 of the loop variable to obtain -100 as a calculated value, and this is set as the data dependency setting value.
[0035]
This value is determined later by the optimization execution unit 4 of FIG. 1 by using the usual conventional processing to determine whether or not vectorization is possible, and if necessary, it is optimized and vectorized. It is used as judgment data.
[0036]
In order to perform the above processing from processing step 24 to processing step 28 for all two combinations of data citations classified into classification B, the processing is repeated while identifying in processing step 29, and processing of classification B is performed. End.
[0037]
The optimization execution unit 4 performs optimization processing with reference to the data dependency table created as described above.
Since the processing is the same as in the prior art, the details are omitted, but the data dependence “?” Is not unconditionally set in the data dependence table as in the past. If so, the calculated data dependency value “-100” is set only for the pair of a [i] and a [i + 100], and effective optimization processing is performed based on the data dependency value “−100”. The
[0038]
【The invention's effect】
As is clear from the above description, according to the present invention, in the optimization process by vectorization in the compilation of a computer program, if it is clear that there is no data dependency for pointer indirect citation, whether or not vectorization is possible Is analyzed, and vectorization is performed when possible. Therefore, there is a remarkable industrial effect that the vectorization rate can be improved and an efficient target program can be generated.
[Brief description of the drawings]
FIG. 1 is a block diagram showing a configuration of the present invention. FIG. 2 is a diagram for explaining an example of a program. FIG. 3 is a flowchart of processing according to the present invention (part 1).
FIG. 4 is a flowchart of the processing of the present invention (part 2).
[Explanation of symbols]
DESCRIPTION OF SYMBOLS 1 Analysis part 2 Data quotation classification part 3 Data dependence setting part 4 Optimization execution part 5 Code generation part
10-16, 20-29 processing steps

Claims (1)

ポインタ機能を有するプログラミング言語で記述された原始プログラムを、解析部が解析し、
データ依存関係設定部が、該解析結果に従い、ループをなすプログラム部分のデータ引用から取り出す2個のデータ引用の組合せのうち少なくとも一方のデータ引用が値を定義するデータ引用であるすべての各組合せについてデータ依存関係を解析し、データ依存関係が有る各組合せ、及びデータ依存関係の解析不能の各組合せについて、各組合せの表示と所定のデータ依存関係値とをデータ依存関係表に設定するデータ依存関係設定処理を行い、
最適化実施部が、該データ依存関係表を参照して、該解析結果のベクトル化の可否を識別し、ベクトル化可能な場合にベクトル化し
コード生成部がベクトル化結果に従い、ベクトル化可能部分をベクトル化した目的プログラムを生成するコンパイラ装置であって、
データ引用分類部を設け、該データ引用分類部は、該解析部が解析した原始プログラムの解析結果について、各データ引用を判別し、各該データ引用がポインタ間接引用、外部変数についての引用、及びアドレスを取られている変数の引用の何れかであることを条件として、当該データ引用をA分類とし、A分類に属さない場合をB分類とし、
該データ依存関係設定部は更に該データ引用分類部の分類したB分類の全データ引用のみについて、該データ依存関係設定処理を行い、A分類の全データ引用から取り出した2個のデータ引用の組合せのうち少なくとも一方のデータ引用が値を定義するデータ引用であるすべての各組合せについて、無条件に解析不能を示す該データ依存関係値をデータ依存関係表に設定するように構成されていることを特徴とするコンパイラ装置。
The analysis unit analyzes a source program written in a programming language having a pointer function,
The data dependency setting unit , for each combination in which at least one data citation is a data citation that defines a value among the two data citation combinations extracted from the data citation of the program part forming a loop according to the analysis result Data dependency that analyzes data dependency and sets display of each combination and predetermined data dependency value in data dependency table for each combination that has data dependency and combination that cannot be analyzed Perform the setting process,
The optimization execution unit refers to the data dependency table to identify whether or not the analysis result can be vectorized .
According code generator is the vector of a result, a compiler apparatus for generating an object program obtained by vectorizing the vectorization moiety,
A data citation classification unit is provided, the data citation classification unit determines each data citation for the analysis result of the source program analyzed by the analysis unit , and each data citation is a pointer indirect citation, a citation for an external variable, and On the condition that it is one of the citations of the variable whose address is taken, the data citation is classified as A classification, and the case where it does not belong to A classification is classified as B classification,
The data dependency setting unit further only for all data citations classified B classification of the data cited classification unit performs the data dependency setting process, taken from all the data quoted in the A classification out the two data reference For each combination in which at least one of the data citations is a data citation defining a value, the data dependency value indicating unconditional analysis is set in the data dependency table. A compiler apparatus characterized by that.
JP01564194A 1994-02-10 1994-02-10 Compiler device Expired - Fee Related JP3658771B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP01564194A JP3658771B2 (en) 1994-02-10 1994-02-10 Compiler device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP01564194A JP3658771B2 (en) 1994-02-10 1994-02-10 Compiler device

Publications (2)

Publication Number Publication Date
JPH07225753A JPH07225753A (en) 1995-08-22
JP3658771B2 true JP3658771B2 (en) 2005-06-08

Family

ID=11894351

Family Applications (1)

Application Number Title Priority Date Filing Date
JP01564194A Expired - Fee Related JP3658771B2 (en) 1994-02-10 1994-02-10 Compiler device

Country Status (1)

Country Link
JP (1) JP3658771B2 (en)

Also Published As

Publication number Publication date
JPH07225753A (en) 1995-08-22

Similar Documents

Publication Publication Date Title
US5230053A (en) Processor scheduling method for iterative loops
US6253371B1 (en) Method for supporting parallelization of source program
EP0533813B1 (en) Method for representing scalar data dependencies for an optimizing compiler
US5815719A (en) Method and apparatus for easy insertion of assembler code for optimization
US7035996B2 (en) Generating data type token value error in stream computer
US6041181A (en) Method of, system for, and computer program product for providing quick fusion in WHERE constructs
Lomet Data flow analysis in the presence of procedure calls
US20230107200A1 (en) Program generation apparatus, program generation method and program
JP3658771B2 (en) Compiler device
Krawiec et al. Counterexample-Driven Genetic Programming: Stochastic Synthesis of Provably Correct Programs.
US20230086862A1 (en) Program generation apparatus, program generation method and program
JP3057904B2 (en) Vectorization method
JPH02236638A (en) Register allocation managing system
JP3246043B2 (en) Compiler unit
JP3464019B2 (en) Register allocation method
JPH0440742B2 (en)
JPH11242598A (en) Compiling method and device, object program executing method and device and program storage medium
JP2842057B2 (en) Objective program generator
JP2748582B2 (en) Compile processing unit
JP3412323B2 (en) Vectorization processing device
JPH0373026A (en) Compile system
JPS61285544A (en) Program executing method
JP3167386B2 (en) Automatic program parallelization method
JPH0291766A (en) Control dependence analyzing system
JPS62269238A (en) Compiling system

Legal Events

Date Code Title Description
A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20040330

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20040528

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20050222

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20050307

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

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

Free format text: PAYMENT UNTIL: 20080325

Year of fee payment: 3

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

Free format text: PAYMENT UNTIL: 20090325

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20100325

Year of fee payment: 5

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

Free format text: PAYMENT UNTIL: 20100325

Year of fee payment: 5

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

Free format text: PAYMENT UNTIL: 20110325

Year of fee payment: 6

LAPS Cancellation because of no payment of annual fees