JPH07225753A - Compiler system - Google Patents

Compiler system

Info

Publication number
JPH07225753A
JPH07225753A JP1564194A JP1564194A JPH07225753A JP H07225753 A JPH07225753 A JP H07225753A JP 1564194 A JP1564194 A JP 1564194A JP 1564194 A JP1564194 A JP 1564194A JP H07225753 A JPH07225753 A JP H07225753A
Authority
JP
Japan
Prior art keywords
data
citation
quotation
classification
citations
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
JP1564194A
Other languages
Japanese (ja)
Other versions
JP3658771B2 (en
Inventor
Kiyobumi Suzuki
清文 鈴木
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

Landscapes

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

Abstract

PURPOSE:To provide a compiler system for deciding the validity of vectorization and executing the vectorization even when there is pointer indirect quotation concerning the processing of a compiler at a computer. CONSTITUTION:A source program is analyzed by an analysis part 1, a data dependence relation setting part 3 performs data dependence relation setting processing, an optimization executing part 4 executes optimization while referring to a data dependence relation table, a code generating part 5 generates an object program prepared by vectorizing an vectorization enabled part, a data quotation classification part 2 discriminates each of data quotation concerning the analyzed result of the source program, defines each of data quotation of the pointer indirect quotation, quotation concerning an external variable and quotation of a variable processed with an address as A classification and defines the other quotation as B classification, and the data dependence relation setting part 3 performs the data dependence relation setting processing only for all the data quotation included in the B classification and the analysis of only a pair of data quotation included in the A classification is unconditionally made impossible.

Description

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

【0001】[0001]

【産業上の利用分野】本発明は計算機の原始プログラム
を翻訳してベクトル化部分を有する目的プログラムを生
成するコンパイラの処理を行うコンパイラ装置に関す
る。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a compiler device for translating a source program of a computer and generating a target program having a vectorized portion.

【0002】[0002]

【従来の技術と発明が解決しようとする課題】広く知ら
れているように、C言語と呼ばれるプログラミング言語
等には、ポインタ機能があり、ポインタとして宣言され
た変数を使って、その変数の値をアドレスとするデータ
を引用する、いわゆるポインタ間接引用を原始プログラ
ムに記述することができる。
2. Description of the Related Art As is widely known, a programming language called C has a pointer function, and a variable declared as a pointer is used to set the value of the variable. A so-called pointer indirect reference for quoting data whose address is can be described in the source program.

【0003】図2はポインタ間接引用を含むC言語のプ
ログラムの例であり、図2(a)において行は、次の
行以下で関数定義を行い、その関数はfunc1() であるこ
とを示す。
FIG. 2 shows an example of a C language program including pointer indirect reference. In FIG. 2 (a), a line defines a function below the next line, indicating that the function is func1 (). .

【0004】はdouble型データの宣言、行はint 型
データの宣言で、double型データには配列データaとポ
インタ(*で示す) pがある。行は、端末から値を十
進数("%d"で示す) として読み込んで変数j(&jで変数
jのアドレスを示す) に代入すること、行は、a[j]の
アドレスを求めてポインタpに代入することを示す。
Is a declaration of double type data, a line is a declaration of int type data, and the double type data includes array data a and pointer (indicated by *) p. The line reads the value from the terminal as a decimal number (indicated by "% d") and assigns it to variable j (& j indicates the address of variable j). The line finds the address of a [j] and sets the pointer. Indicates that the value is assigned to p.

【0005】行はプログラムのループを記述する for
文であって、変数iを値0から9まで、1づつ増加しな
がら、続く行の代入文を繰り返すことを示す。行で
代入先を示すp[i]がポインタ間接引用であって、ポイン
タpが指示するデータを先頭の要素とする配列のi番目
の要素を示す。
A line describes a loop in a program for
The statement indicates that the assignment statement in the subsequent line is repeated while the variable i is incremented by 1 from 0 to 9. In the row, p [i] indicating the assignment destination is a pointer indirect reference, and indicates the i-th element of the array whose head element is the data pointed to by the pointer p.

【0006】よく知られているように、一般に for文等
で構成されるループによる配列の計算部分は、ベクトル
処理装置で処理するようにベクトル化した目的プログラ
ムを生成するための主要な対象である。
As is well known, the calculation part of an array by a loop, which is generally composed of for statements, etc., is a main target for generating a vectorized object program for processing by a vector processing device. .

【0007】従って、ベクトル化機能を持つコンパイラ
は最適化処理として、先ずループ内のデータ引用のう
ち、少なくとも一方が値を定義するデータ引用であり、
同じ配列データに関する2個のデータ引用のすべての組
合せについて、データ依存関係を調べて、それらの各デ
ータ引用対ごとについてのデータ依存関係を表す値を設
定したデータ依存関係表を作成する。
Therefore, the compiler having the 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.
The data dependence is examined for all combinations of two data citations for the same sequence data, and a data dependence relationship table is created in which values indicating the data dependence for each of those data citation pairs are set.

【0008】次に、そのデータ依存関係表を参照して、
データ依存関係が無いか、又はその影響を避けるようプ
ログラムを変更できる場合には変更して、ベクトル化目
的プログラムを生成する。
Next, referring to the data dependency table,
If there is no data dependency or the program can be changed so as to avoid the influence, change the program and generate the vectorized object program.

【0009】しかし、従来ポインタ間接引用が含まれる
場合には、次のような状況が発生する可能性を持つこと
から、無条件に最適化をしないようにしている。即ち、
そのループのデータ引用対について、前記のデータ依存
関係表に設定する値をすべて無条件に「?」としてデー
タ依存関係の解析不能を示すようにし、従ってそのデー
タ依存関係表を参照する最適化処理では、ベクトル化不
能と判断せざるを得ないようにする。
However, conventionally, when the pointer indirect reference is included, the following situation may occur, so that the optimization is unconditionally not 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 cannot be analyzed. Therefore, the optimization processing that refers to the data dependency table is performed. Then, we have no choice but to judge that it cannot be vectorized.

【0010】このように処置する理由は次のとおりであ
る。例えば図2(a)の例で、for文の実行直前の変数jと
aの値が次の通りであったとする。 j=2 a=( 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,1
4,.....) ベクトル化しないで、順次実行すれば、 for文実行後の
aは、 a=( 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2,13,1
4,.....) となることは、プログラムを追えば明らかである。
The reason for such treatment is as follows. For example, in the example of FIG. 2A, assume that the values of the variables j and a immediately before the execution of the for statement are as follows. j = 2 a = (1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,1
4, .....) If it is 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,1
4, .....) is obvious when following the program.

【0011】しかしベクトル化すると、実行前のaの値
の列を一斉にベクトル処理装置のベクトルレジスタに読
み込んでおき、それをパイプライン式の演算器に送り込
んで演算し、パイプラインから順次出てくる結果を、例
えばベクトルレジスタの別の領域に順次格納しておい
て、一斉にaの領域へ書き込むようにするので、実行後
のaの値は、 a=( 1, 2, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,13,1
4,.....) となり、前記のaの結果と異なる。
However, when vectorized, the sequence of values of a before execution is read into the vector register of the vector processing device all at once, and it is sent to the pipeline type arithmetic unit for arithmetic operation, and then sequentially output from the pipeline. For example, the results obtained are sequentially stored in different areas of the vector register and are written to the area of a at the same time. Therefore, the value of a after execution is a = (1, 2, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,13,1
4, .....), which is different from the result of a above.

【0012】以上のとおり、ベクトル化すると、プログ
ラムの記述上意図したのと異なる動きをし、その結果演
算結果が異なってしまうので、このような結果になる場
合にはベクトル化してはならない。
[0012] As described above, vectorization causes a movement different from that intended in the description of the program, resulting in a different calculation result. Therefore, if such a result is obtained, vectorization should not be performed.

【0013】次に、図2(b)はポインタ間接引用を使用
した別の例で、(a)と類似した文であるので個々の説明
を省略するが、この例の場合には行でポインタ間接引
用が参照に使用され、間接引用先の変数bも行で参照
のみに使用されているために、ベクトル化してもポイン
タ間接引用に起因する前記(b)の例のような結果は発生
しない。
Next, FIG. 2 (b) is another example using the pointer indirect reference. Since the sentence is similar to that of (a), the individual description will be omitted. Since the indirect reference is used for the reference and the variable b of the indirect reference is also used only for the reference in the line, vectorization does not result in the result like the example of (b) due to the pointer indirect reference. .

【0014】即ち、図2(b)の例のような場合には、ポ
インタ間接引用があっても、ベクトル化して効率のよい
目的プログラムを生成できることが望まれる。本発明
は、ポインタ間接引用があってもベクトル化してよいこ
とを比較的容易に判定できる場合を効率よく選別して、
ベクトル化範囲を拡大したコンパイラ装置を目的とす
る。
That is, in the case of the example of FIG. 2B, it is desired that even if there is pointer indirect reference, it is possible to generate an efficient target program by vectorizing. The present invention efficiently selects a case where it is relatively easy to determine that vectorization is possible even if there is pointer indirect citation,
A compiler device having an expanded vectorization range is intended.

【0015】[0015]

【課題を解決するための手段】図1は、本発明の構成を
示すブロック図である。図はコンパイラ装置の構成であ
って、ポインタ機能を有するプログラミング言語で記述
された原始プログラムを、解析部1が解析し、データ依
存関係設定部3が、該解析結果に従い、ループをなすプ
ログラム部分のデータ引用から取り出す2個のデータ引
用の組合せのうち少なくとも一方のデータ引用が値を定
義するデータ引用であるすべての各組合せについてデー
タ依存関係を解析し、データ依存関係が有る各組合せ、
及びデータ依存関係の解析不能の各組合せについて、各
組合せの表示と所定のデータ依存関係値とをデータ依存
関係表に設定するデータ依存関係設定処理を行い、最適
化実施部4が、該データ依存関係表を参照して、ベクト
ル化の可否を識別し、ベクトル化可能な場合に必要な最
適化を行い、コード生成部5が該最適化結果に従い、ベ
クトル化可能部分をベクトル化した目的プログラムを生
成するコンパイラ装置であって、データ引用分類部2を
設ける。
FIG. 1 is a block diagram showing the configuration of the present invention. The figure shows the configuration of the compiler device. The analysis unit 1 analyzes a source program written in a programming language having a pointer function, and the data dependency relationship setting unit 3 analyzes the program portion forming a loop according to the analysis result. Of the combinations of the two data citations extracted from the data citations, the data dependency relationship is analyzed for at least one of the data citations for which at least one data citation is a data citation defining a value, and each combination having a data dependency relationship,
For each combination in which the data dependency relationship cannot be analyzed, a data dependency relationship setting process for setting the display of each combination and a predetermined data dependency relationship value in the data dependency relationship table is performed, and the optimization execution unit 4 causes the data dependency relationship By referring to the relation table, it is possible to identify whether or not vectorization is possible, perform the necessary optimization when vectorization is possible, and the code generation unit 5 follows the optimization result to create a target program that vectorizes the vectorizable part. It is a compiler device for generating and includes a data citation classifying unit 2.

【0016】データ引用分類部2は、該原始プログラム
の解析結果について、各データ引用を判別し、各該デー
タ引用がポインタ間接引用、外部変数についての引用、
及びアドレスを取られている変数の引用の何れかである
ことを条件として、当該データ引用をA分類とし、A分
類に属さない場合に当該データ引用をB分類とする。
The data citation classification unit 2 determines each data citation in the analysis result of the source program, and each data citation is a pointer indirect citation, an external variable citation,
And the data citation is classified as A on the condition that it is one of the citations of the variable whose address is taken, and the data citation is classified as B when it does not belong to the A classification.

【0017】データ依存関係設定部3は、データ引用分
類部2の分類したB分類の全データ引用のみについて、
該データ依存関係設定処理を行い、A分類の全データ引
用から取り出す、2個のデータ引用の組合せのうち少な
くとも一方のデータ引用が値を定義するデータ引用であ
るすべての各組合せについて、無条件に解析不能を示す
該データ依存関係値をデータ依存関係表に設定する。
The data dependency relationship setting unit 3 determines only all data citations of the B class classified by the data citation classifying unit 2.
The data dependency setting processing is performed, and all the data citations of the A classification are extracted from all the data citations of at least one of the combinations of the two data citations, and at least one of the data citations is a data citation that defines a value. The data dependency value indicating that analysis is impossible is set in the data dependency table.

【0018】[0018]

【作用】本発明のコンパイラ装置により、ポインタ間接
引用についても、データ依存関係の無いことが明確な場
合には、ベクトル化の可否が解析されて、可能な場合は
ベクトル化が実施される。
With the compiler apparatus according to the present invention, it is analyzed whether or not vector indirect pointer indirect reference can be vectorized if it is clear that there is no data dependency, and vectorization is performed if possible.

【0019】[0019]

【実施例】図3は、図1のデータ引用分類部2の処理の
流れの一例を示す図であり、解析部1の解析結果による
forループ等のベクトル化候補部分について、データ引
用を順次調べるものとし、処理ステップ10で一つのデー
タ引用を取り出す。
EXAMPLE FIG. 3 is a diagram showing an example of the processing flow of the data citation classifying section 2 of FIG.
It is assumed that data citations are sequentially checked for vectorization candidate portions such as for loops, and one data citation is taken out in processing step 10.

【0020】処理ステップ11で、そのデータ引用がポイ
ンタ間接引用(即ち、ポインタをpとして、前記説明の
ようにp[i]の形で行われている引用)か識別し、ポイン
タ間接引用であれば処理ステップ14で分類Aのデータ引
用とする。
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 the pointer is p), and it is a pointer indirect citation. For example, in processing step 14, the data of category A is cited.

【0021】ポインタ間接引用でなければ、処理ステッ
プ12で、そのデータ引用が外部変数(即ち、関数定義等
の外で定義されている変数) か識別し、外部変数であれ
ば処理ステップ14で分類Aのデータ引用とする。これ
は、以上のような外部変数であれば、外部でアドレスを
取られている (後述) ことがあり得るからである。
If it is not a pointer indirect reference, it is identified in processing step 12 whether the data reference is an external variable (that is, a variable defined outside the function definition, etc.), and if it is an external variable, it is classified in processing step 14. Data from A is used. This is because it is possible that the address is taken externally (described later) with the above external variables.

【0022】以上の何れでもなければ、処理ステップ13
で、そのデータ引用がアドレスを取られているか識別す
る。ここで、アドレスを取られているとは、データ引用
の配列変数が、そのアドレスを求められて、そのアドレ
ス値をポインタに代入することが記述されれていること
を言うものとし、従って前記説明のプログラムの例にお
いて&演算子の対象になっている変数が典型的な例であ
るが、その他にもプログラミング言語の仕様上暗にアド
レスを取られることになる場合についても考慮するもの
とする。
If none of the above, processing step 13
Identifies whether the data citation is addressed. Here, taking an address means that it is described that an array variable for data reference is asked for the address and the address value is substituted into a pointer, and therefore the above description is given. The variable that is the target of the & operator is a typical example in the above program example, but other cases where addresses are implicitly taken due to the specifications of the programming language shall also be considered.

【0023】以上の識別の結果、アドレスを取られてい
れば処理ステップ14で分類Aのデータ引用とし、以上3
条件の何れでもない場合は処理ステップ15で、そのデー
タ引用を分類Bとし、以上の分類処理を、すべてのデー
タ引用について行ったか処理ステップ16で識別して繰り
返す。
As a result of the above identification, if the address is obtained, it is classified as the data reference of the classification A in the processing step 14, and the above 3
If none of the conditions is satisfied, the processing step 15 sets the data citation as the classification B, and the above classification processing is repeated in the processing step 16 by discriminating whether or not all the data citations have been performed.

【0024】前記図2(b) のプログラム例のデータ引用
について、以上の処理による分類結果を説明すると、こ
の例では forループ内のデータ引用としてp[i]、a[i]、
b[i]及びa[i+100]があるので、それらを順次取り出して
調べる。
Regarding the data citation of the program example of FIG. 2 (b), the classification result by the above processing will be described. In this example, p [i], a [i],
Since there are b [i] and a [i + 100], they are sequentially taken out and examined.

【0025】その結果、p[i]はポインタ間接引用の条件
に該当し、a[i]は3条件の何れにも該当せず、b[i]はポ
インタ間接引用でも、外部変数でもないが、アドレスを
取られている (図2(b) の行) 条件に該当し、a[i+10
0]は何れの条件にも該当しないので、p[i]とb[i]が分類
A、a[i]とa[i+100]が分類Bとなる。
As a result, p [i] corresponds to the condition of pointer indirect reference, a [i] does not correspond to any of the three conditions, and b [i] is neither pointer indirect reference nor external variable. , The address is taken (line in Figure 2 (b)), which corresponds to the condition, a [i + 10
Since 0] does not correspond to any condition, p [i] and b [i] are classified as A, and a [i] and a [i + 100] are classified as B.

【0026】図4は、図1のデータ依存関係設定部3の
処理の流れの一例を示す図であり、データ引用分類部2
の分類結果により、各分類ごとに2個のデータ引用の対
ごとに、データ依存関係を順次調べるものとし、先ず分
類Aについて処理ステップ20で一対のデータ引用を取り
出す。
FIG. 4 is a diagram showing an example of the processing flow of the data dependency relationship setting section 3 of FIG.
According to the result of classification, the data dependence is sequentially examined for each pair of two data citations in each classification. First, in processing step 20 for the class A, a pair of data citations are extracted.

【0027】処理ステップ21で取り出した対の両データ
引用が共に参照であれば(何れも、値を定義するデータ
引用でなければ)、このデータ引用対についてデータ依
存関係は無いので処理の必要が無いものとする。
If both data citations of the pair retrieved in processing step 21 are both references (neither is a data citation that defines a value), there is no data dependency relationship for this data citation pair, so processing is required. There is no one.

【0028】対の少なくとも一方が値を定義するデータ
引用であれば、処理ステップ22で、その対のデータ引用
と、データ依存関係の値として「?」(解析不能)とを
データ依存関係表に設定する。
If at least one of the pairs is a data reference that defines a value, in step 22, the data reference of the pair and "?" (Not analyzable) as the value of the data dependency are set in the data dependency table. Set.

【0029】以上の処理を、分類Aに分類されたデータ
引用のすべての2個の組合せについて行うように、処理
ステップ23で識別しながら、以上の処理を繰り返し、分
類Aの処理を終わると次に分類Bを処理する。
The above-mentioned processing is repeated while performing the above-described processing while performing the identification in the processing step 23 so that all the two combinations of the data citations classified into the classification A are identified. Class B is processed.

【0030】なお、前記例のプログラムの場合に、分類
Aのデータ引用はp[i]とb[i]であったので、この対を処
理すると、両者ともにデータ参照であるので、データ依
存関係は無いと判断される。
In the case of the program of the above example, since the data citations of classification A were p [i] and b [i], when this pair is processed, both are data references. It is judged that there is no.

【0031】分類Bについては、2個のデータ引用の対
ごとのデータ依存関係を、従来のデータ依存関係の解析
処理と同様にして処理し、必要な各対についてデータ依
存関係をデータ依存関係表に設定する。
For category B, the data dependency relationship for each pair of two data citations is processed in the same manner as the conventional data dependency analysis processing, and the data dependency relationship for each required pair is calculated. Set to.

【0032】即ち、処理ステップ24で分類Bのデータ引
用の1対を取り出し、処理ステップ25、26で取り出した
対の少なくとも一方が値を定義し、且つ同じ配列データ
のデータ引用であればデータ依存関係の解析を要するも
のとし、それ以外の対についてはデータ依存関係は無い
ので処理の必要が無いものとする。
That is, if a pair of data citations of classification B is taken out in processing step 24, at least one of the pairs retrieved in processing steps 25 and 26 defines a value, and if they are data citations of the same sequence data, data dependence It is assumed that the analysis of the relationship is required, and that the other pairs do not need to be processed because there is no data dependency relationship.

【0033】データ依存関係の解析は処理ステップ27
で、両データ引用の添字間の必要な計算等を行って識別
し、データ依存関係有りと判断した場合には、処理ステ
ップ28でデータ依存関係表にその対のデータ引用と、デ
ータ依存関係の計算結果の値とを設定する。
The analysis of the data dependency is performed in the processing step 27.
Then, if it is determined that there is a data dependency by performing necessary calculation between the subscripts of both data citations and determining that there is a data dependency, the data dependency table of the pair and the data dependency of the data dependency are displayed in processing step 28. Set the value of the calculation result.

【0034】例えば、前記例で分類Bになったa[i]とa
[i+100]の対については、両データ引用の添字iとi+100
とについて、両者の差をとって-100を得、それを forル
ープの増分1及びループ変数の係数1で割った結果の-1
00を計算値として求め、これをデータ依存関係の設定値
とする。
For example, a [i] and a which are classified into class B in the above example
For the pair [i + 100], the subscripts i and i + 100 in both data citations
For and, the difference between the two is taken to obtain -100, and the result is divided by 1 in the for loop and 1 in the loop variable, resulting in -1
00 is calculated as the calculated value, and this is set as the set value of the data dependency.

【0035】この値は、これは後に図1の最適化実施部
4が、通常の従来通りの処理により、ベクトル化の可否
判断をし、又必要な場合に適当な最適化を行ってベクト
ル化可能にするための判断データとして使用する。
This value is to be vectorized by the optimizing unit 4 of FIG. 1 which makes a decision as to whether or not vectorization is possible by a usual conventional process, and performs an appropriate optimization if necessary. It is used as judgment data to enable it.

【0036】処理ステップ24から処理ステップ28までの
以上の処理を、分類Bに分類されたデータ引用のすべて
の2個の組合せについて行うように、処理ステップ29で
識別しながら処理を繰り返し、分類Bの処理を終わる。
The above-described processing from processing step 24 to processing step 28 is repeated while identifying in processing step 29 so that all the two combinations of data citations classified into classification B are performed. Ends the process.

【0037】最適化実施部4は、以上で作成されたデー
タ依存関係表を参照して最適化処理を行う。その処理は
従来と同様であるので詳細を省略するが、データ依存関
係表に従来のように無条件にデータ依存関係「?」が設
定されるのではなく、本発明により前記プログラム例の
forループであれば、a[i]とa[i+100]の対のみについ
て、計算されたデータ依存関係値「-100」が設定されて
いるので、それに基づいて実効的な最適化処理が実施さ
れる。
The optimization execution section 4 refers to the data dependency table created above to perform the optimization process. The details are omitted because the processing is the same as the conventional one. However, the data dependency “?” Is not unconditionally set in the data dependency table unlike the conventional one.
If it is a for loop, the calculated data dependency value "-100" is set only for the pair of a [i] and a [i + 100], so effective optimization processing is performed based on it. Be implemented.

【0038】[0038]

【発明の効果】以上の説明から明らかなように本発明に
よれば、計算機プログラムのコンパイルにおけるベクト
ル化による最適化処理に際し、ポインタ間接引用につい
ても、データ依存関係の無いことが明確な場合には、ベ
クトル化の可否が解析されて、可能な場合はベクトル化
が実施されるようになるので、ベクトル化率を向上して
効率の良い目的プログラムを生成できるという著しい工
業的効果がある。
As is apparent from the above description, according to the present invention, in the optimization processing by vectorization in compiling a computer program, it is clear that pointer indirect reference also has no data dependency relationship. Since vectorization is analyzed and vectorization is performed if possible, there is a remarkable industrial effect that the vectorization rate can be improved and an efficient target program can be generated.

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

【図1】 本発明の構成を示すブロック図FIG. 1 is a block diagram showing the configuration of the present invention.

【図2】 プログラム例を説明する図FIG. 2 is a diagram illustrating a program example.

【図3】 本発明の処理の流れ図(その1)FIG. 3 is a flowchart of the process of the present invention (No. 1)

【図4】 本発明の処理の流れ図(その2)FIG. 4 is a flowchart of the process of the present invention (No. 2)

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

1 解析部 2 データ引用分類部 3 データ依存関係設定部 4 最適化実施部 5 コード生成部 10〜16、20〜29 処理ステップ 1 analysis unit 2 data citation classification unit 3 data dependency setting unit 4 optimization execution unit 5 code generation unit 10-16, 20-29 processing steps

Claims (1)

【特許請求の範囲】[Claims] 【請求項1】 ポインタ機能を有するプログラミング言
語で記述された原始プログラムを、解析部(1)が解析
し、 データ依存関係設定部(3)が、該解析結果に従い、ルー
プをなすプログラム部分のデータ引用から取り出す2個
のデータ引用の組合せのうち少なくとも一方のデータ引
用が値を定義するデータ引用であるすべての各組合せに
ついてデータ依存関係を解析し、データ依存関係が有る
各組合せ、及びデータ依存関係の解析不能の各組合せに
ついて、各組合せの表示と所定のデータ依存関係値とを
データ依存関係表に設定するデータ依存関係設定処理を
行い、 最適化実施部(4)が、該データ依存関係表を参照して、
ベクトル化の可否を識別し、ベクトル化可能な場合に必
要な最適化を行い、 コード生成部(5)が該最適化結果に従い、ベクトル化可
能部分をベクトル化した目的プログラムを生成するコン
パイラ装置であって、 データ引用分類部(2)を設け、 該データ引用分類部(2)は、該原始プログラムの解析結
果について、各データ引用を判別し、各該データ引用が
ポインタ間接引用、外部変数についての引用、及びアド
レスを取られている変数の引用の何れかであることを条
件として、当該データ引用をA分類とし、A分類に属さ
ない場合をB分類とし、 該データ依存関係設定部(3)は、該データ引用分類部(2)
の分類したB分類の全データ引用のみについて、該デー
タ依存関係設定処理を行い、 A分類の全データ引用から取り出す、2個のデータ引用
の組合せのうち少なくとも一方のデータ引用が値を定義
するデータ引用であるすべての各組合せについて、無条
件に解析不能を示す該データ依存関係値をデータ依存関
係表に設定するように構成されていることを特徴とする
コンパイラ装置。
1. An analysis unit (1) analyzes a source program written in a programming language having a pointer function, and a data dependency setting unit (3) stores data of a program portion forming a loop according to the analysis result. Of the combinations of the two data citations extracted from the citation, the data dependency is analyzed for all the combinations in which at least one of the data citations is a data citation that defines a value, and each combination having the data dependency and the data dependency For each combination that cannot be analyzed, the data dependence setting process that sets the display of each combination and the predetermined data dependence value in the data dependence table is performed, and the optimization execution unit (4) See
A compiler device that identifies whether vectorization is possible, performs the necessary optimization when vectorization is possible, and the code generation unit (5) generates an object program that vectorizes the vectorizable part according to the optimization result. Therefore, a data citation classification unit (2) is provided, and the data citation classification unit (2) discriminates each data citation in the analysis result of the source program, and each data citation regards pointer indirect citation and external variable. Data citation and the citation of the variable whose address is taken, the data citation is classified as A, and the data citation not belonging to A is classified as B, and the data dependence setting unit (3 ) Is the data citation classification unit (2)
The data for which the data dependency setting process is performed only for all the data citations of the B category that have been classified, and data is extracted from all the data citations of the A category, and at least one of the data citation combinations defines a value. A compiler apparatus, which is configured to set the data dependency relationship value indicating unanalyzable unconditionally for each of the quoted combinations in the data dependency relationship table.
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 true JPH07225753A (en) 1995-08-22
JP3658771B2 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
JP3658771B2 (en) 2005-06-08

Similar Documents

Publication Publication Date Title
US8839210B2 (en) Program performance analysis apparatus
US7917899B2 (en) Program development apparatus, method for developing a program, and a computer program product for executing an application for a program development apparatus
JPH0721033A (en) Device and method for processing language
JPH06324881A (en) Compiler device with superposition deciding function of memory data
CN112631925B (en) Method for detecting single-variable atom violation defect
JPH07225753A (en) Compiler system
JP3196625B2 (en) Parallel compilation method
JPH0713809A (en) Program evaluation system
JPH09288580A (en) Device and method for optimizing source program
JPH02236638A (en) Register allocation managing system
JPH0588912A (en) Multiprocessor simulator
JPH0793144A (en) Program analyzer
JP2842057B2 (en) Objective program generator
JP3412323B2 (en) Vectorization processing device
JPH05120322A (en) Automatic accelerating system for do loop calculation
JPH05324346A (en) Vectorization system
JPH06208470A (en) Objective code optimizing device
JPH07141328A (en) Compiling device
JPH03260865A (en) Vectorization processing system
JPS6367676A (en) Processing system for vector formation from general loop
JPS6297031A (en) Matching system for bit number of mantissa part
JPH05324402A (en) Test state measuring system for program
JPH03116241A (en) Compiler
JPS61285544A (en) Program executing method
JPH0193826A (en) System for counting dynamic step of high grade language

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

Effective date: 20040528

Free format text: JAPANESE INTERMEDIATE CODE: A523

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

Effective date: 20050222

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Effective date: 20050307

Free format text: JAPANESE INTERMEDIATE CODE: A61

R150 Certificate of patent (=grant) or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

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

Free format text: PAYMENT UNTIL: 20080325

Year of fee payment: 3

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

Free format text: PAYMENT UNTIL: 20090325

Year of fee payment: 4

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

Year of fee payment: 5

Free format text: PAYMENT UNTIL: 20100325

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

Year of fee payment: 5

Free format text: PAYMENT UNTIL: 20100325

FPAY Renewal fee payment (prs 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