JP2003216440A - Program analyzing method, program therefor and program analyzing system - Google Patents

Program analyzing method, program therefor and program analyzing system

Info

Publication number
JP2003216440A
JP2003216440A JP2002011383A JP2002011383A JP2003216440A JP 2003216440 A JP2003216440 A JP 2003216440A JP 2002011383 A JP2002011383 A JP 2002011383A JP 2002011383 A JP2002011383 A JP 2002011383A JP 2003216440 A JP2003216440 A JP 2003216440A
Authority
JP
Japan
Prior art keywords
program
control flow
analysis
loop
point
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
JP2002011383A
Other languages
Japanese (ja)
Other versions
JP3648710B2 (en
Inventor
Makoto Sato
真琴 佐藤
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hitachi Ltd
Original Assignee
Hitachi Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hitachi Ltd filed Critical Hitachi Ltd
Priority to JP2002011383A priority Critical patent/JP3648710B2/en
Publication of JP2003216440A publication Critical patent/JP2003216440A/en
Application granted granted Critical
Publication of JP3648710B2 publication Critical patent/JP3648710B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Landscapes

  • Devices For Executing Special Programs (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To solve a problem in a conventional method that in a case when a user checks whether an object variable can be made private or not, the user must check the information that 'a definition point of the variable is executed before the execution of a use point of the object variable in the same loop iteration, when the use point of the object variable is executed', because the information is not displayed. <P>SOLUTION: The loop-independent control flow from a loop inlet point to the definition point of a certain variable or a loop-independent control flow from the loop inlet point to a use point of the variable not through the definition point of the certain variable is detected and extracted with respect to the loop given by an analyzed object designating part 191, by a hierarchical control flow graph creating part 120, an analyzed object input part 130, an innermost branch analyzing part 140, an inclusive relation analyzing part 150, and a control flow analyzing part 160, and the program execution order or reverse order is displayed by using a sentence on a sentence information display part 192 or the program slice along the control flow by the sentence information display part 192. <P>COPYRIGHT: (C)2003,JPO

Description

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

【0001】[0001]

【発明の属する技術分野】本発明は、プログラム中の、
指定された文や参照点などに対する解析情報を出力する
技術に係わり、特に、並列コンピュータ用プログラムの
チューニングの高効率化等に好適な技術に関するもので
ある。
BACKGROUND OF THE INVENTION 1. Field of the Invention
The present invention relates to a technique for outputting analysis information for a designated sentence or reference point, and particularly to a technique suitable for improving the efficiency of tuning a parallel computer program.

【0002】[0002]

【従来の技術】並列コンピュータの性能を引き出すため
には、プログラムのチューニングが必要であるが、この
チューニングには手作業が必要であり時間がかかる。例
えば、ループ並列化のチューニングにおいては、変数・
配列のプライベート化が重要となっているが、このため
のプログラム解析は特に難しい。
2. Description of the Related Art Tuning of a program is required to bring out the performance of a parallel computer, but this tuning requires manual work and takes time. For example, in tuning loop parallelization,
The privatization of arrays is important, but program analysis for this is especially difficult.

【0003】このような並列化コンピュータ用のプログ
ラムのチューニングに係わる従来技術としては、例え
ば、シー ウェイ リィアオ、アマー ダイワン、 ロ
バートピー ボッシュ ジュニア、アンワォー ギュロ
ウム、 モニカ エス ラム著の「スイフ エクスプロ
ーラー:アン インターラクティブ アンド インター
プロシージュアル パラレライザー」(ピーピーオーピ
ーピー99、第37頁から第48頁、1999)(Shih
-Wei Liao, Amer Diwan, Robert P. Bosch Jr., Anwar
Ghuloum, Monica S. Lam, SUIF Explorer: An Interact
ive and Interprocedural Parallelizer, PPoPP '99, p
p. 37-48, 1999)で論じられているものがある。
Examples of conventional techniques related to tuning a program for such a parallel computer include, for example, "Swift Explorer: Uninteractive and" written by Shiwei Riao, Ammer Daiwan, Robert Pea Bosch Jr. Interprocedural Parallelizer "(PpOpPp99, pages 37 to 48, 1999) (Shih
-Wei Liao, Amer Diwan, Robert P. Bosch Jr., Anwar
Ghuloum, Monica S. Lam, SUIF Explorer: An Interact
ive and Interprocedural Parallelizer, PPoPP '99, p
p. 37-48, 1999).

【0004】この技術では、コンパイラが、プログラム
上のループ中の2つの配列参照間にデータ依存関係があ
るか否か決定できず、そのためループ並列化ができない
場合、システムにおいて対象プログラムを解析し、それ
らの配列添字の値に影響を与える文(「プログラムスラ
イス」)を表示し、ユーザはこれをもとに上記ループの
並列性調査をしていた
In this technique, the compiler cannot determine whether or not there is a data dependency between two array references in a loop on the program, and if loop parallelization cannot be performed, the system analyzes the target program, The statement that influences the value of those array subscripts ("program slice") is displayed, and the user is conducting the parallelism investigation of the above loop based on this.

【0005】しかし、この場合、ユーザは、表示された
プログラムスライスを目で追いながら、ループ並列化対
象変数のプライベート化の必要性と可能性等を調査しな
ければならず、調査対象のプログラムが複雑な制御フロ
ーを持つものであれば、ユーザの負荷か大きく、調査に
時間もかかり、また、間違いを引き起こしやすいとの問
題があった。
In this case, however, the user has to check the necessity and possibility of privatization of the loop parallelization target variable while following the displayed program slice, and If there is a complicated control flow, there is a problem that the user's load is heavy, it takes time to investigate, and it is easy to make an error.

【0006】[0006]

【発明が解決しようとする課題】解決しようとする問題
点は、従来の技術では、ループ並列化の調査用の情報と
して、システムは、プログラムスライスのみしか表示す
ることができない点である。
The problem to be solved is that in the prior art, the system can display only program slices as information for investigating loop parallelization.

【0007】本発明の目的は、これら従来技術の課題を
解決し、ユーザの、対象変数のプライベート化判定等に
要する時間を削減することを可能とすることである。
An object of the present invention is to solve these problems of the prior art and to reduce the time required for the user to make a privatization determination of a target variable.

【0008】[0008]

【課題を解決するための手段】上記目的を達成するた
め、本発明では、記憶装置に記憶されたプログラムを読
み出して当該プログラムの解析と解析結果の出力を行う
際、解析対象として指定されたループのループ入口とこ
のループ内で定義される変数の定義点および使用点のい
ずれか一つから、ループのループ出口および変数の定義
点と使用点のいずれか一つへ到達する制御フローを検出
し、検出した制御フローからループの繰り返しをまたが
らない制御フローを抽出し、抽出した制御フロー上の文
情報を、プログラム実行順もしくは逆順で、ファイル
に、もしくは、表示装置画面上でソースプログラム上に
強調表示等して出力する。このように出力した情報は、
「対象変数の定義点が実行される」および「対象変数の
使用点が実行されるとき、同じループイタレーション内
でその実行より前にその変数の定義点が実行される」と
いったプライベート化の可否判定の条件を示しており、
ユーザの当該情報の調査負荷が軽減される。
In order to achieve the above object, according to the present invention, when a program stored in a storage device is read and the program is analyzed and an analysis result is output, a loop designated as an analysis target is executed. The control flow that reaches the loop exit of the loop and any one of the variable definition point and the usage point is detected from the loop entrance of the loop and one of the definition point and the usage point of the variable defined in this loop. , The control flow that does not cross the loop repetition is extracted from the detected control flow, and the statement information on the extracted control flow is stored in a file in the program execution order or in the reverse order or in the source program on the display device screen. Output by highlighting. The information output in this way is
Whether or not privatization such as "the definition point of the target variable is executed" and "when the use point of the target variable is executed, the definition point of the variable is executed before the execution in the same loop iteration" It shows the judgment conditions,
The research load on the information of the user is reduced.

【0009】[0009]

【発明の実施の形態】以下、本発明の実施の形態を、図
面により詳細に説明する。
BEST MODE FOR CARRYING OUT THE INVENTION Embodiments of the present invention will be described in detail below with reference to the drawings.

【0010】図1は、本発明に係わるプログラム解析シ
ステムの構成例を示すブロック図であり、図14は、図
1におけるプログラム解析システムの解析対象となるプ
ログラムの指定操作例を示す説明図、図20は、図1に
おけるプログラム解析システムの図14のプログラムに
対応する解析結果例を示す説明図である。
FIG. 1 is a block diagram showing a configuration example of a program analysis system according to the present invention, and FIG. 14 is an explanatory diagram showing an example of a designation operation of a program to be analyzed by the program analysis system in FIG. 20 is an explanatory diagram showing an example of an analysis result corresponding to the program of FIG. 14 of the program analysis system in FIG.

【0011】図1におけるプログラム解析システムは、
CPU(Central Processing Unit)や主メモリ、表示
装置、入力装置、外部記憶装置からなるコンピュータシ
ステムであり、光ディスク駆動装置等を介してCD−R
OM等の記憶媒体に記録されたプログラムやデータを外
部記憶装置内にインストールした後、この外部記憶装置
から主メモリに読み込みCPUで処理する内容が、各処
理部の機能として実現される。
The program analysis system shown in FIG.
A computer system including a CPU (Central Processing Unit), a main memory, a display device, an input device, and an external storage device, and a CD-R via an optical disk drive device or the like.
After the programs and data recorded in the storage medium such as the OM are installed in the external storage device, the contents read from the external storage device into the main memory and processed by the CPU are realized as the functions of the respective processing units.

【0012】すなわち、本例のプログラム解析システム
は、解析処理部100と解析対象指定部191、情報表
示部192の各処理部からなり、解析処理部100は、
さらに、構文解析部110と階層的制御フローグラフ作
成部120、解析対象入力部130、最内分岐解析部1
40、および、包含フラグ設定部151と通過フラグ設
定部152からなる包含関係解析部150、そして、制
御フロー解析部160により構成されている。
That is, the program analysis system of this example comprises an analysis processing unit 100, an analysis target designating unit 191, and an information display unit 192.
Furthermore, the syntax analysis unit 110, the hierarchical control flow graph creation unit 120, the analysis target input unit 130, the innermost branch analysis unit 1
40, an inclusion relation analysis unit 150 including an inclusion flag setting unit 151 and a passage flag setting unit 152, and a control flow analysis unit 160.

【0013】このような構成により、本例のプログラム
解析システムでは、図14の入力プログラム表示画面1
401に示すループプログラムの解析指示に対応して、
当該プログラムを解析し、その解析結果として、図20
に示すようにして、所定の文情報を表示装置の画面上に
強調表示する。
With such a configuration, in the program analysis system of this example, the input program display screen 1 shown in FIG.
In response to the loop program analysis instruction 401,
The program is analyzed, and the analysis result is shown in FIG.
As shown in, the predetermined sentence information is highlighted on the screen of the display device.

【0014】すなわち、プログラム解析システムでは、
プライベート化に関しての解析指定がなされたプログラ
ムの解析および解析結果の出力を行う際、解析対象のル
ープ、および、ループ内の変数の定義点と使用点に対す
る識別情報を入力し、解析対象ループのループ入口と変
数の定義点および使用点のいずれか1つから、ループ出
口と変数の定義点および使用点のいずれか1つへ到達
し、かつ、解析対象ループの繰り返しをまたがらない制
御フローを検出・抽出し、検出・抽出した制御フロー上
の文情報を、ファイルに出力、または、ソースプログラ
ム上で強調表示する。
That is, in the program analysis system,
When performing analysis of a program for which analysis is specified regarding privatization and output of analysis results, enter the identification information for the loop to be analyzed and the definition points and points of use of variables in the loop, and then loop the loop to be analyzed. Detects a control flow that reaches either one of the definition point and the use point of the loop exit and the variable from any one of the definition point and the use point of the entry and the variable and does not cross the loop of the analysis target loop. -The extracted and detected / extracted sentence information on the control flow is output to a file or highlighted on the source program.

【0015】例えば、解析対象ループのループ入口から
変数の定義点および使用点の内の一方を通らずに他方へ
到達する制御フロー、または、変数の定義点および使用
点の内の一方から他方を通らずに解析対象ループのルー
プ出口に到達する制御フローを検出・抽出し、その文情
報をプログラム実行順またはその逆順に表示・出力す
る。
For example, the control flow from the loop entrance of the loop to be analyzed to the other without passing through one of the variable definition point and the use point, or from one of the variable definition point and the use point to the other The control flow that reaches the loop exit of the analysis target loop without passing is detected and extracted, and the statement information is displayed and output in the program execution order or the reverse order.

【0016】尚、変数の定義点あるいは使用点における
配列添字またはスカラ変数に対する、検出・抽出した制
御フローに沿うプログラムスライスを文情報とする。も
しくは、変数の定義点あるいは使用点における配列添字
またはスカラ変数に対するプログラムスライスと、検出
・抽出した制御フローとの交わりを文情報とする。
Program slices along the detected / extracted control flow for array subscripts or scalar variables at variable definition points or use points are used as statement information. Alternatively, the intersection of the program slice for the array subscript or the scalar variable at the definition point or the use point of the variable and the detected / extracted control flow is used as the sentence information.

【0017】このようにして、プログラム解析システム
では、ループ入口点からある変数の定義点へ至るループ
独立な制御フロー上の文、または、その制御フローに沿
ったプログラムスライスを、あるいは、ループ入口点か
らある変数の定義点を通らずにその変数の使用点へ至る
ループ独立な制御フロー上の文、または、その制御フロ
ーに沿ったプログラムスライスを、プログラム実行順ま
たは逆順に表示する。
In this way, in the program analysis system, the statement on the loop independent control flow from the loop entry point to the definition point of a certain variable, or the program slice along the control flow, or the loop entry point A statement on a loop-independent control flow from a variable to a point of use of the variable without passing through the definition point of the variable, or a program slice along the control flow is displayed in the program execution order or the reverse order.

【0018】この表示では、「対象変数の定義点が実行
される」という条件、および、「対象変数の使用点が実
行される時、同じループイタレーション内で、その実行
より前にその変数の定義点が実行される」という条件を
表しており、これらの条件は、ユーザが、対象変数のプ
ライベート化の必要性およびプライベート化可能性を調
査する場合に用いるものであり、本例のプログラム解析
システムによる表示により、ユーザはその条件を自分で
調査する必要がなくなるので、負荷が軽減される。
In this display, the condition "the definition point of the target variable is executed" and "when the use point of the target variable is executed, in the same loop iteration, before the execution of the variable The definition point is executed ", and these conditions are used when the user investigates the necessity and privatization possibility of the privatization of the target variable. The system display eliminates the need for the user to investigate the condition by himself, thus reducing the load.

【0019】以下、図1におけるプログラム解析システ
ムの構成および動作の詳細を説明する。
The details of the configuration and operation of the program analysis system in FIG. 1 will be described below.

【0020】図1において、解析対象指定部191は、
外部記憶装置等に記憶された入力プログラム181を読
み出して入力し、図14に示す操作画面において、プロ
グラム中の解析対象ループと解析対象参照点をユーザに
指定させて解析対象ファイル182を出力する。
In FIG. 1, the analysis target designating section 191 is
The input program 181 stored in the external storage device or the like is read and input, and the analysis target file 182 is output by allowing the user to specify the analysis target loop and the analysis target reference point in the program on the operation screen shown in FIG.

【0021】この解析対象ファイル182を含め、後述
の中間語171、階層的制御グラフ172、解析対象リ
スト173、制御フローリスト174、文情報ファイル
183のそれぞれは外部記憶装置に格納される。
An intermediate word 171, a hierarchical control graph 172, an analysis target list 173, a control flow list 174, and a sentence information file 183, which will be described later, including the analysis target file 182, are stored in an external storage device.

【0022】解析処理部100において、構文解析11
0は、入力プログラム181を入力して中間語171を
生成して出力し、階層的制御フローグラフ作成部120
は、中間語171を入力して階層的制御フローグラフ1
72を作成する。
In the analysis processing unit 100, the syntax analysis 11
0 inputs the input program 181, generates the intermediate word 171 and outputs it, and the hierarchical control flow graph creation unit 120
Inputs an intermediate word 171 to generate a hierarchical control flow graph 1
Create 72.

【0023】また、解析対象入力部130は、解析対象
ファイル182を入力し、解析対象を階層的制御フロー
グラフ172に書き込み、解析対象ループから解析対象
参照点に至る呼び出し手続き列を表わす解析対象リスト
173を生成して出力する。
The analysis target input unit 130 inputs the analysis target file 182, writes the analysis target in the hierarchical control flow graph 172, and displays the analysis target list representing the calling procedure sequence from the analysis target loop to the analysis target reference point. 173 is generated and output.

【0024】また、最内分岐解析部140は、階層的制
御フローグラフ172を入力して、解析対象参照点を含
む文へ分岐するノードおよび解析対象参照点を含む文か
ら分岐するノードで、最も内側にあるループ入口以外の
ノードと分岐に対応するエッジを検出し、それらのエッ
ジに制御フローが通過しないようにフラグを立てる。
The innermost branch analysis unit 140 receives the hierarchical control flow graph 172 and branches to a sentence including the analysis target reference point and a node branching from the sentence including the analysis target reference point. Edges corresponding to nodes and branches other than the inner loop entrance are detected, and flags are set so that the control flow does not pass through these edges.

【0025】また、包含関係解析部150は、階層的制
御フローグラフ172を入力して、各ノードが解析対象
参照点を含むか否かを解析し、解析対象参照点のうち、
通過しないことを指定した解析対象参照点を含まないノ
ードにフラグを立てる。
Further, the inclusion relation analysis unit 150 inputs the hierarchical control flow graph 172, analyzes whether or not each node includes an analysis target reference point, and selects one of the analysis target reference points.
Flag a node that does not include the analysis target reference point that is specified not to pass.

【0026】また、制御フロー解析部160は、解析対
象リスト173と階層的制御フローグラフ172を入力
して、ユーザ指定の解析対象参照点を接続する制御フロ
ーを解析し、その制御フローを制御フローリスト174
として出力し、さらに、その制御フローリスト174を
入力して、当該制御フロー上のプログラム中の文または
プログラムスライスを解析し、その解析結果を文情報フ
ァイル183に出力する。
Further, the control flow analysis unit 160 inputs the analysis target list 173 and the hierarchical control flow graph 172, analyzes the control flow connecting the analysis target reference points designated by the user, and controls the control flow. Listing 174
Further, the control flow list 174 is input to analyze the statement or program slice in the program on the control flow, and the analysis result is output to the statement information file 183.

【0027】そして、文情報表示部192は、このよう
にして解析処理部100が格納した文情報ファイル18
3と入力プログラム181とを記憶装置から読み出して
入力し、表示装置の画面において、解析処理部100で
得られた文情報を入力プログラム181上で強調表示す
る。
Then, the sentence information display unit 192 displays the sentence information file 18 stored in the analysis processing unit 100 in this way.
3 and the input program 181 are read from the storage device and input, and the sentence information obtained by the analysis processing unit 100 is highlighted on the input program 181 on the screen of the display device.

【0028】解析処理部100における包含関係解析部
150は、包含フラグ設定部151において、階層的制
御フローグラフ172を入力して各ノードが解析対象参
照点を含むか否かを表わすフラグを立て、通過フラグ設
定部152において、解析対象参照点のうち、通過しな
いことを指定した解析対象参照点を含まないノードにフ
ラグを立てる。
In the inclusion relation analysis unit 150 in the analysis processing unit 100, the inclusion flag setting unit 151 inputs the hierarchical control flow graph 172 and sets a flag indicating whether or not each node includes the analysis target reference point, The passage flag setting unit 152 sets a flag in the analysis target reference points that do not include the analysis target reference points that are designated not to pass.

【0029】次に、このような構成のプログラム解析シ
ステムの動作および表示を、図2から図20を用いて、
具体的に説明する。
Next, the operation and display of the program analysis system having such a configuration will be described with reference to FIGS.
This will be specifically described.

【0030】図14においては、解析対象指定部191
の具体的な操作例を示しており、この解析対象指定部1
91は、入力プログラム表示画面1401、解析対象行
番号表示部1402、解析対象行表示部1403、文番
号表示部1404からなる操作画面を表示する。入力プ
ログラム表示画面1401に表示してあるのは入力プロ
グラム181の具体例である。
In FIG. 14, the analysis target designating section 191 is provided.
Shows a specific operation example of the analysis target designating unit 1
91 displays an operation screen including an input program display screen 1401, an analysis target line number display unit 1402, an analysis target line display unit 1403, and a sentence number display unit 1404. A specific example of the input program 181 is displayed on the input program display screen 1401.

【0031】ユーザが入力プログラム表示画面1401
上で行番号「11」、「13」、「17」に対応する3
つの行を選択すると、その行番号と行(の文内容)が解
析対象行番号表示部1402および解析対象行表示部1
403に表示される。
User input program display screen 1401
3 corresponding to the line numbers "11", "13", and "17" above
When one line is selected, the line number and the line (text content thereof) are displayed in the analysis target line number display unit 1402 and the analysis target line display unit 1.
403 is displayed.

【0032】ユーザが解析対象行表示部1403上で解
析対象参照点1405を選択することによりそれ(「x
(j)」)は強調表示される。また、ユーザは、項目欄
1406における「start」、「skip」、「end」のそれ
ぞれに各々文を指定することにより、「start」で示さ
れた文から「skip」で示された文を通過せずに「end」
で示された文に至る制御フローを指定することができ
る。
When the user selects the analysis target reference point 1405 on the analysis target line display portion 1403, it is displayed ("x
(J) ”) is highlighted. In addition, the user passes the sentence indicated by "skip" from the sentence indicated by "start" by designating each sentence in "start", "skip", and "end" in the item column 1406. Without "end"
It is possible to specify the control flow leading to the sentence indicated by.

【0033】尚、「skip」に対応する文は省略すること
ができる。また、解析対象参照点(1405)の指定は
制御フロー上のプログラムスライスを計算するためのも
のであり、単に制御フロー上の文のみを表示したい場合
は、解析対象参照点(1405)の指定を省略すること
ができる。
The sentence corresponding to "skip" can be omitted. The designation of the analysis target reference point (1405) is for calculating the program slice on the control flow. To display only the statement on the control flow, the designation of the analysis target reference point (1405) is required. It can be omitted.

【0034】図15は、図1における解析対象ファイル
の内容例を示す説明図である。
FIG. 15 is an explanatory diagram showing an example of the contents of the analysis target file in FIG.

【0035】本例は、図14で示された内容に基づき図
1の解析対象指定部191が出力した解析対象ファイル
182の内容である。この図15の内容を説明する前に
解析対象ファイルのタグ構造とタグフォーマットを図9
に基づき説明する。
This example is the contents of the analysis target file 182 output by the analysis target designating unit 191 of FIG. 1 based on the contents shown in FIG. Before explaining the contents of FIG. 15, the tag structure and tag format of the file to be analyzed are shown in FIG.
It will be explained based on.

【0036】図9は、解析対象ファイルのタグ構造例を
示す説明図である。
FIG. 9 is an explanatory diagram showing an example of the tag structure of the file to be analyzed.

【0037】図9に示す例では、全部で14個のタグが
ある。各タグは記号「#」で始まり改行で終わる。対に
なって使用されるタグ同士は、図中、それらの間を左側
の曲線で結んで表示している。
In the example shown in FIG. 9, there are a total of 14 tags. Each tag begins with the symbol "#" and ends with a line break. Tags used in pairs are shown by connecting them with a curve on the left side in the figure.

【0038】例えば、タグ901とタグ914は対にな
って使用される。対になって使用されるタグの一方は記
号「#」で始まり、他方は記号「#/」で始まる。尚、図
9では表示してないが、引数を伴うタグもある。また、
記号「#/」で始まるタグは引数を持たない。
For example, the tag 901 and the tag 914 are used as a pair. One of the tags used in pairs begins with the symbol "#" and the other begins with the symbol "# /". Although not shown in FIG. 9, there are also tags with arguments. Also,
Tags that start with the symbol "# /" have no arguments.

【0039】図10は、図9における解析対象ファイル
のタグフォーマット例を示す説明図である。
FIG. 10 is an explanatory diagram showing an example of the tag format of the analysis target file in FIG.

【0040】図10(a)では、タグ毎のタグフォーマ
ット1001を示しており、「#LINE」の引数の[カラ
ム]は参照点が指定された場合の、そのカラムを表わ
す。参照点が指定されない場合は省略される。
FIG. 10A shows a tag format 1001 for each tag, and the [column] of the argument of "#LINE" represents the column when the reference point is designated. Omitted if no reference point is specified.

【0041】図10(b)では、図9におけるタグ「#K
IND」903の引数である解析方法の種別1002を示
し、図10(c)および図10(d)では、図9におけ
るタグ「#LINE」905.908.911の引数である
文種別1003と対象種別1004を示している。
In FIG. 10B, the tag "#K" in FIG.
IND ”903 shows an analysis method type 1002 that is an argument, and in FIG. 10C and FIG. 10D, a sentence type 1003 that is an argument of the tag“ #LINE ”905.9908.911 in FIG. The type 1004 is shown.

【0042】次に図15の説明に戻り、図15におい
て、行1501は解析対象ループを含む手続き名が「te
st」であることを示し、行1502は解析対象ループの
DO文の文番号が10であることを示している。
Returning to the explanation of FIG. 15, in FIG. 15, the line 1501 indicates that the procedure name including the loop to be analyzed is "te".
st ”, and the line 1502 indicates that
It indicates that the sentence number of the DO sentence is 10.

【0043】また、行1503は、解析方法の種別がタ
グ「ST」で示された文からタグ「SK」で示された文を通
らずにタグ「EN」で示された文に至るものであることを
示し、行1504〜1506は、開始の文が、手続き名
「test」の行番号「11」で文種別が手続き呼出し文や
ループ以外の文であり、解析対象であることを示す。
Line 1503 shows that the type of analysis method is from the sentence indicated by tag "ST" to the sentence indicated by tag "EN" without passing through the sentence indicated by tag "SK". Lines 1504 to 1506 indicate that the start sentence is a sentence other than the procedure call sentence or the loop with the line number “11” of the procedure name “test” and the sentence type is the analysis target.

【0044】また、行1507〜1510は、ユーザが
通らないことを指定した文の情報を示し、そのうちの行
1508,1509は、その文を手続きやループを階層
とみなした時の、上位の階層から下位の階層へ解析対象
となる文に至るまでの文の列を示している。
Further, lines 1507 to 1510 show information on a sentence that the user has specified not to pass, and lines 1508 and 1509 among them indicate the upper layer when the sentence or procedure is regarded as a layer. It shows a sequence of sentences from to the lower layer to the sentence to be analyzed.

【0045】ここで、行1508は、「DOループ」の
「DO文」を示し、これは解析対象ではなく、解析対象の
文の上位の階層にあるだけなので、タグの引数である対
象種別は「NO」となる。また、行1509は解析対象で
あり、タグの引数である対象種別は「YES」となる。
Here, the line 1508 shows the “DO statement” of the “DO loop”, which is not the analysis target but only in the higher hierarchy of the analysis target sentence, and therefore the target type as the argument of the tag is It becomes "NO". Further, the line 1509 is the analysis target, and the target type that is the argument of the tag is “YES”.

【0046】また、行1511〜1514は、終了の文
を示しており、これらも文の列となっている。
Further, lines 1511 to 1514 show ending sentences, and these are also columns of sentences.

【0047】以上の、タグ「ST」(行1504〜150
6)、タグ「SK」(行1507〜1510)、タグ「E
N」(行1511〜1514)で示された文は、各々、
図14における欄1406の「start」、「skip」、「e
nd」で示された文(1403)に対応している。
The above tag "ST" (lines 1504 to 150)
6), tag "SK" (lines 1507-1510), tag "E
The sentences indicated by "N" (lines 1511-1514) are
In column 1406 of FIG. 14, "start", "skip", and "e"
It corresponds to the sentence (1403) indicated by "nd".

【0048】次に、この解析対象ファイル182を入力
した図1の解析処理部100における各処理部の動作を
説明する。
Next, the operation of each processing unit in the analysis processing unit 100 of FIG. 1 which inputs the analysis target file 182 will be described.

【0049】構文解析部110は、図14の入力プログ
ラム表示画面1401に表示された入力プログラム18
1を入力し、中間語171を生成して出力する。ここ
で、中間語171は入力プログラムをツリー状に表現し
たものであるが、内容は入力プログラム181とほぼ同
じであるので、以降の説明では入力プログラム表示画面
1401に表示された入力プログラムを中間語171と
見なす。
The syntax analysis unit 110 uses the input program 18 displayed on the input program display screen 1401 of FIG.
1 is input, an intermediate word 171 is generated and output. Here, the intermediate language 171 is a tree-like representation of the input program, but since the content is almost the same as the input program 181, the input program displayed on the input program display screen 1401 will be referred to as an intermediate language in the following description. 171.

【0050】階層的制御フローグラフ作成部120は、
中間語171を入力して、図16に例示する階層的制御
フローグラフ172を作成する。
The hierarchical control flow graph generator 120
The intermediate word 171 is input to create the hierarchical control flow graph 172 illustrated in FIG.

【0051】図16は、図1における階層的制御フロー
グラフの構造例を示す説明図である。
FIG. 16 is an explanatory diagram showing a structural example of the hierarchical control flow graph in FIG.

【0052】本図16に示す階層的制御フローグラフ1
72は、図14の入力プログラム表示画面1401に表
示された入力プログラムを中間語171と見なし、この
中間語を入力して作成されたものである。
Hierarchical control flow graph 1 shown in FIG.
Reference numeral 72 is created by regarding the input program displayed on the input program display screen 1401 of FIG. 14 as the intermediate language 171 and inputting this intermediate language.

【0053】階層的制御フローグラフ172のノード
は、入口ノード(図16では「S」と表示)、出口ノー
ド(同「E」)、ループノード(同「LOOP」)、基
本ブロックノード(同「BB」)、分岐ノード(同「B
R」)、合流ノード(同「JOIN」)、手続き呼び出
しノードからなる。また、各ノードは制御フローに従っ
たエッジで接続される。
The nodes of the hierarchical control flow graph 172 include an ingress node (indicated as "S" in FIG. 16), an exit node (at "E"), a loop node (at "LOOP"), and a basic block node (at "S"). BB ”), branch node (the same“ B
R ”), a confluence node (same as“ JOIN ”), and a procedure call node. Further, each node is connected by an edge according to the control flow.

【0054】このように、階層的制御フローグラフで
は、ループおよび手続きを1つの階層とする。各階層は
入口ノードから始まり、出口ノードで終わるバックエッ
ジのない有向グラフである。ここで、バックエッジとは
入口ノードのある方を向いたエッジのことである。図中
の1610、1620、1630が各々、階層となる。
As described above, in the hierarchical control flow graph, the loop and the procedure are one hierarchy. Each hierarchy is a directed graph with no back edges, starting at the ingress node and ending at the egress node. Here, the back edge is an edge that faces the entrance node. 1610, 1620, and 1630 in the figure are each a hierarchy.

【0055】本図16において、ループノード1601
は、そのループボディに対応する階層1610と接続さ
れる。さらに、階層1610の中のループノード161
4,1616には、各々のループボディに対応する階層
1620,1630が接続される。
In FIG. 16, a loop node 1601
Is connected to the hierarchy 1610 corresponding to the loop body. Furthermore, the loop node 161 in the hierarchy 1610
Layers 1620 and 1630 corresponding to the respective loop bodies are connected to 4, 1616.

【0056】以降では、階層的制御フローグラフを略し
て「LCFグラフ」と呼び、その一つの階層を「部分L
CFグラフ」と呼ぶ。また、ループノード1601を部
分LCFグラフの中に含まれる任意のノードの上位ノー
ド、逆に、部分LCFグラフの中に含まれる任意のノー
ドをループノード1601の下位ノードと呼ぶ。
In the following, the hierarchical control flow graph is abbreviated as "LCF graph", and one hierarchy thereof is referred to as "part L
CF graph ". Further, the loop node 1601 is called an upper node of an arbitrary node included in the partial LCF graph, and conversely, an arbitrary node included in the partial LCF graph is called a lower node of the loop node 1601.

【0057】解析対象入力部130は、解析対象ファイ
ル182を入力して解析対象を階層的制御フローグラフ
172に書き込み、解析対象ループから解析対象参照点
に至る呼び出し手続き列を表わす解析対象リスト173
を作成して出力する。c
The analysis target input unit 130 inputs the analysis target file 182 and writes the analysis target in the hierarchical control flow graph 172, and the analysis target list 173 representing the calling procedure sequence from the analysis target loop to the analysis target reference point.
Create and output. c

【0058】図2は、図1における解析対象入力部の処
理動作例を示すフローチャートである。
FIG. 2 is a flow chart showing an example of the processing operation of the analysis target input section in FIG.

【0059】図1における解析対象入力部130では、
まず、ステップ201において、図15に示された解析
対象ファイル182を入力し、次に、ステップ202に
おいて、図15の解析対象ファイル182中で、タグ
「ST」,「SK」,「EN」で示された参照点または
文を「st」,「sk」,「en」で指し示す。そして、ステッ
プ203において、図17に示す内容の解析対象リスト
173を作成する。
In the analysis target input section 130 shown in FIG.
First, in step 201, the analysis target file 182 shown in FIG. 15 is input, and then in step 202, in the analysis target file 182 of FIG. 15, the tags “ST”, “SK”, and “EN” are used. Point to the indicated reference point or sentence with "st", "sk", "en". Then, in step 203, an analysis target list 173 having the contents shown in FIG. 17 is created.

【0060】図17は、図1における解析対象リストの
構成例を示す説明図である。
FIG. 17 is an explanatory diagram showing a configuration example of the analysis target list in FIG.

【0061】本図の解析対象リスト173は、図1にお
ける解析対象入力部130の処理結果で得られたもので
ある。上から順に、「st」,「sk」,「en」に対応する。
ここで、リストを構成する各テーブルの各フィールドを
図13に基づき説明する。
The analysis target list 173 in this figure is obtained as a result of processing by the analysis target input unit 130 in FIG. These correspond to "st", "sk", and "en" in order from the top.
Here, each field of each table constituting the list will be described with reference to FIG.

【0062】図13は、図1における解析対象リストの
テーブル構成例を示す説明図である。
FIG. 13 is an explanatory diagram showing a table configuration example of the analysis target list in FIG.

【0063】本図13では、図17に示した構成の解析
対象リスト173のテーブルの各フィールドの内容を示
しており、1301は次のテーブルへのポインタ、13
02は直前のテーブルへのポインタを表わす。
FIG. 13 shows the contents of each field of the table of the analysis target list 173 having the configuration shown in FIG. 17, and 1301 is a pointer to the next table, 13
02 represents a pointer to the immediately preceding table.

【0064】また、1303はテーブルが表わす文の文
番号、1304は文に対応するノードのノード種別を表
わす。ノード種別は1310に示した4つである。そし
て、1305はLCFグラフの対応するノードへのポイ
ンタである。
Reference numeral 1303 represents the statement number of the statement represented by the table, and 1304 represents the node type of the node corresponding to the statement. There are four node types shown in 1310. And 1305 is a pointer to the corresponding node of the LCF graph.

【0065】図17において、各リストの開始テーブル
1701,1703,1706は解析対象ループに対応
する。よって、文番号は「10」であり、ノード種別は
「LOOP」となる。「st」,「sk」,「en」の開始テー
ブル以降のテーブルついても、リスト中の各テーブルの
文番号は図15の対応するタグの文番号に対応する。
In FIG. 17, the start tables 1701, 1703, 1706 of each list correspond to the analysis target loop. Therefore, the sentence number is "10" and the node type is "LOOP". For the tables after the start table of “st”, “sk”, and “en”, the statement numbers of each table in the list correspond to the statement numbers of the corresponding tags in FIG.

【0066】次に、図2において、解析対象入力部13
0は、ステップ204で、解析対象リストからLCFグ
ラフlcfのノードへのポインタを張る。図17におけ
る、解析対象ループに対応する各リストの開始テーブル
1701,1703,1706では、LCFグラフのノ
ード1601に対応する。
Next, referring to FIG. 2, the analysis target input unit 13
In step 204, 0 sets a pointer from the analysis target list to the node of the LCF graph lcf. In the start tables 1701, 1703, and 1706 of each list corresponding to the analysis target loop in FIG. 17, it corresponds to the node 1601 of the LCF graph.

【0067】また、「st」,「sk」,「en」の開始テーブ
ル以降のテーブルでは、LCFグラフへのポインタは、
各々、図17における1612、1614と1622、
1616と1632に対応する。
In the tables after the start table of "st", "sk", and "en", the pointer to the LCF graph is
1612, 1614 and 1622 in FIG. 17, respectively.
Corresponding to 1616 and 1632.

【0068】そして、図2において、解析対象入力部1
30は、ステップ205で、LCFグラフlcfのノード
にフラグを立てる。これらのフラグは、図16では16
12、1622、1632の横に「st」,「sk」,「en」
と示している。
Then, in FIG. 2, the analysis target input unit 1
30 flags the nodes of the LCF graph lcf in step 205. These flags are 16 in FIG.
"St", "sk", "en" beside 12, 1622, 1632.
Is shown.

【0069】図1の最内分岐解析部140では、このよ
うな階層的制御フローグラフ172を入力し、解析対象
参照点を含む文へ分岐するノード、および、解析対象参
照点を含む文から分岐するノードで、最も内側にあるル
ープ入口以外のノードと、分岐に対応するエッジを検出
し、それらのエッジに制御フローが通過しないようにフ
ラグを立てる。このような最内分岐解析部140の処理
動作を図3に基づき説明する。
The innermost branch analysis unit 140 in FIG. 1 inputs such a hierarchical control flow graph 172, branches to a sentence including the analysis target reference point, and branches from the sentence including the analysis target reference point. The nodes other than the innermost loop entrance and the edges corresponding to the branch are detected, and a flag is set so that the control flow does not pass through these edges. The processing operation of the innermost branch analysis unit 140 will be described with reference to FIG.

【0070】図3は、図1における最内分岐解析部の処
理動作例を示すフローチャートである。
FIG. 3 is a flow chart showing an example of the processing operation of the innermost branch analysis unit in FIG.

【0071】本例は図1の最内分岐解析部140の図1
6に示す階層的制御フローグラフに基づく処理動作(ア
ルゴリズム)例を示したものであり、まず、ステップ3
01は、図16に示す階層的制御フローグラフにおいて
は「sk」が指定されているので、「Y」となり、次のス
テップ302以降の処理に移る。
In this example, the innermost branch analysis unit 140 of FIG.
6 shows an example of processing operation (algorithm) based on the hierarchical control flow graph shown in FIG.
Since “sk” is designated in the hierarchical control flow graph shown in FIG. 16, 01 becomes “Y”, and the processing proceeds to the next step 302 and subsequent steps.

【0072】このステップ302では、「sk」を含むノ
ード1622を「node」とし、ステップ303におい
て、「node」1622を含むLCFグラフ1620をlc
fとする。そして、「node」1622は、lcf(LCFグ
ラフ)1620内で、lcf1620の出口1623を支
配しているので、ステップ304では「Y」となる。
In this step 302, the node 1622 including “sk” is set to “node”, and in step 303, the LCF graph 1620 including “node” 1622 is lc.
Let f. Then, since the “node” 1622 controls the exit 1623 of the lcf 1620 in the lcf (LCF graph) 1620, it becomes “Y” in step 304.

【0073】lcf(LCFグラフ)1620は、「st」
も「en」も含まないので、ステップ305では「N」と
なり、ステップ308において、lcf(LCFグラフ)
1620の上位ノードであるノード1614を「node」
とする。
Lcf (LCF graph) 1620 is "st"
Since neither "en" is included, "N" is obtained in step 305, and lcf (LCF graph) is obtained in step 308.
The node 1614, which is the upper node of 1620, is "node".
And

【0074】ステップ309において、lcf(LCFグ
ラフ)1620は解析対象ループに対応してないので、
「N」となり、ステップ303での処理に戻り、node1
614を含む部分LCFグラフ1610をlcfとする。
At step 309, since lcf (LCF graph) 1620 does not correspond to the loop to be analyzed,
It becomes “N”, the process returns to step 303, and node1
A partial LCF graph 1610 including 614 is designated as lcf.

【0075】次のステップ304においては、node16
14は、lcf1610内でlcf1610の出口ノード16
17を支配しないので、「N」となり、ステップ310
およびステップ311での処理へ進む。
In the next step 304, node16
14 is the exit node 16 of the lcf 1610 within the lcf 1610
Since it does not control 17, it becomes “N”, and step 310
Then, the process proceeds to step 311.

【0076】ステップ310では、node1614からlc
f1610の入り口方向へたどって、node1614が後
支配しない最初のノードを見つけ、そのノードとその直
後のノードとの間のエッジに非通過フラグを立てる。図
16に示す例では、このステップ310での処理で得ら
れるノードとエッジは1613と1640である。
At step 310, lc is output from node 1614.
Following the entrance direction of f1610, the node 1614 finds the first node that does not dominate, and sets the non-passage flag at the edge between that node and the node immediately after it. In the example shown in FIG. 16, the nodes and edges obtained by the processing in step 310 are 1613 and 1640.

【0077】また、ステップ311では、node1614
からlcf1610の出口方向へたどって、node1614
が支配しない最初のノードを見つけ、そのノードとその
直前のノードとの間のエッジに非通過フラグを立てる。
図16に示す例では、このステップ311での処理で得
られるノードとエッジは1615と1650である。以
上のようにして、2つのエッジ1640,1650に非
通過フラグを立てる。
In step 311, node1614
From the exit of lcf1610 to node1614
Finds the first node that does not dominate and flags the edge between that node and the node immediately preceding it as a non-passing flag.
In the example shown in FIG. 16, the nodes and edges obtained by the processing in step 311 are 1615 and 1650. As described above, the non-passage flag is set on the two edges 1640 and 1650.

【0078】尚、ステップ305において、lcf(LC
Fグラフ)が、「st」もしくは「en」を含む場合には、
ステップ306の処理に進み、「sk」(もしくは「e
n」)が「st」(もしくは「sk」)より出口方向に有る
か否かを判別し、無ければステップ307において、lc
f(LCFグラフ)と解析対象ループの間にループが有
るか否かを判別する。
In step 305, lcf (LC
F graph) contains "st" or "en",
Proceed to the process of step 306, and execute "sk" (or "e
n ”) is in the exit direction from“ st ”(or“ sk ”), and if there is not, in step 307, lc
It is determined whether or not there is a loop between f (LCF graph) and the loop to be analyzed.

【0079】ステップ306において「Y」(「sk」も
しくは「en」が「st」もしくは「sk」より出口方向に有
る)、および、ステップ307において、「N」(lcf
と解析対象ループの間にループが無い)であれば、ある
いは、ステップ309において「Y」(lcfは解析対象
ループに対応した部分LCFフラグ)であれば、ステッ
プ312での処理に進み、「条件を満たすパスは存在し
ない」と出力して本ツールでの処理を終了する。
In step 306, "Y"("sk" or "en" is in the exit direction from "st" or "sk"), and in step 307, "N" (lcf
If there is no loop between the analysis target loop and the analysis target loop) or if “Y” (lcf is a partial LCF flag corresponding to the analysis target loop) in step 309, the process proceeds to step 312 and the “condition There is no path that satisfies the above condition ", and the processing of this tool ends.

【0080】このようにして作成された階層的制御フロ
ーグラフ172は、図1における包含関係解析部150
に入力され、図4に示す処理が施される。
The hierarchical control flow graph 172 thus created is included in the inclusion relation analysis unit 150 in FIG.
Is input to and the processing shown in FIG. 4 is performed.

【0081】図1における包含関係解析部150は、包
含フラグ設定部151と通過フラグ設定部152よりな
る。包含フラグ設定部151は、図1および図16にお
ける階層的制御フローグラフ172を入力して、各ノー
ドが解析対象参照点を含むか否かを表わすフラグを立て
る。この包含フラグ設定部151のアルゴリズムを図4
に基づき説明する。
The inclusion relation analysis unit 150 in FIG. 1 comprises an inclusion flag setting unit 151 and a passage flag setting unit 152. The inclusion flag setting unit 151 inputs the hierarchical control flow graph 172 in FIGS. 1 and 16, and sets a flag indicating whether or not each node includes the analysis target reference point. The algorithm of the inclusion flag setting unit 151 is shown in FIG.
It will be explained based on.

【0082】図4は、図1における包含フラグ設定部の
処理動作例を示すフローチャートである。
FIG. 4 is a flow chart showing an example of the processing operation of the inclusion flag setting section in FIG.

【0083】本例では、プログラムスライスを求める最
大範囲を解析対象ループとし、ステップ400では、L
CFの開始ノードとして解析対象ループのループボディ
に対応する部分LCFグラフの入口ノード1611を取
る。以下、ノード1611に対して、処理A(ステップ
401〜411)を呼ぶ。
In this example, the maximum range for obtaining the program slice is the loop to be analyzed, and in step 400, L
The entry node 1611 of the partial LCF graph corresponding to the loop body of the analysis target loop is taken as the CF start node. Hereinafter, the process A (steps 401 to 411) is called for the node 1611.

【0084】処理Aでは、ノード1611は、ステップ
403において「Y」となり、ステップ408に進み、
現階層(図16における階層1610)内の全ノードに
対して処理Aを順に呼ぶ。
In the process A, the node 1611 becomes “Y” in step 403, and the process proceeds to step 408.
The process A is sequentially called for all the nodes in the current layer (layer 1610 in FIG. 16).

【0085】この処理において、次のノード1612は
「st」を含むので、ステップ404において「Y」とな
り、ステップ409の処理で、上位ノード1601の
「st」フラグを「ON」にする。
In this process, the next node 1612 contains "st", so it becomes "Y" in step 404, and in the process of step 409, the "st" flag of the upper node 1601 is turned "ON".

【0086】次の分岐ノード1613はステップ401
〜404のいずれにも該当せず、処理は行なわれない。
次のループノード1614は、ステップ401において
「Y」となり、そのループ入口ノード1621に対して
処理Aを呼ぶ。
The next branch node 1613 is step 401.
Nothing corresponds to any of ~ to 404, and no processing is performed.
The next loop node 1614 becomes “Y” in step 401, and the process A is called for the loop entry node 1621.

【0087】この入口ノード1621に対しては、ステ
ップ403からステップ408に進み、その階層162
0内の全ノードに対して処理Aを呼ぶ。まず、ノード1
622は「sk」を含むので、ステップ404からステッ
プ409の処理に進み、その上位ノード1614に「s
k」フラグを設定する。
For this ingress node 1621, the process proceeds from step 403 to step 408, and the hierarchy 162
The process A is called for all the nodes in 0. First, node 1
Since 622 includes “sk”, the process proceeds from step 404 to step 409, and “s” is assigned to its upper node 1614.
Set the "k" flag.

【0088】次の出口ノード1623はステップ401
〜404のいずれにも該当せず、処理は行なわれず、以
上で、ステップ406でのループノード1614に対す
る処理が終了し、次のステップ411において、上位ノ
ード1601の「sk」フラグを、現ノード1614の
「sk」フラグによりONに設定する。
The next egress node 1623 is step 401.
To 404, the process is not performed, and the process for the loop node 1614 in step 406 is completed. In the next step 411, the “sk” flag of the upper node 1601 is set to the current node 1614. It is set to ON by the "sk" flag of.

【0089】ノード1614の次の合流ノード1615
はステップ401〜404のいずれにも該当せず処理は
行なわれない。
A junction node 1615 next to the node 1614
Does not correspond to any of steps 401 to 404 and is not processed.

【0090】次のループノード1616に対しては、ル
ープノード1614と同様の処理を行い、このループノ
ード1616と上位のループノード1601に「en」フ
ラグを設定する。
The next loop node 1616 is processed in the same manner as the loop node 1614, and the "en" flag is set in this loop node 1616 and the upper loop node 1601.

【0091】以上の処理により設定された「st」,「s
k」,「en」フラグは、図16において、ノード160
1,1614,1616の横に下線をつけて表示してい
る。
[St], [s] set by the above processing
The “k” and “en” flags correspond to the node 160 in FIG.
1, 1614 and 1616 are displayed with underlines beside them.

【0092】このような包含フラグ設定部151に対し
て通過フラグ設定部152は、解析対象参照点のうち、
通過しないことを指定した解析対象参照点を含まないノ
ードにフラグを立てる。以下、通過フラグ設定部152
の処理動作を図5を用いて説明する。
With respect to such an inclusion flag setting unit 151, the passage flag setting unit 152 determines, among the analysis target reference points,
Flag a node that does not include the analysis target reference point that is specified not to pass. Hereinafter, the passage flag setting unit 152
The processing operation of will be described with reference to FIG.

【0093】図5は、図1における通過フラグ設定部の
処理動作例を示すフローチャートである。
FIG. 5 is a flow chart showing an example of the processing operation of the passage flag setting section in FIG.

【0094】本図5では、図1の通過フラグ設定部15
2のアルゴリズムを説明するものであり、通過フラグ設
定部152は、まず、ステップ500において、LCF
の開始ノードとして、解析対象ループのループボディに
対応する部分LCFグラフの入口ノード(図16におけ
るノード1611)を取り、このノード1611に対し
て処理Bを施す。
In FIG. 5, the passage flag setting unit 15 of FIG.
The algorithm of No. 2 is described below. The passage flag setting unit 152 first sets the LCF in step 500.
The entry node (node 1611 in FIG. 16) of the partial LCF graph corresponding to the loop body of the loop to be analyzed is taken as the start node of, and the process B is applied to this node 1611.

【0095】処理Bでは、ノード1611は、ステップ
501において「N」、ステップ505において「Y」
となり、現階層1610内の全ノードに対して処理Bを
呼ぶ(ステップ506)。
In the process B, the node 1611 is "N" in step 501 and "Y" in step 505.
Then, the process B is called for all the nodes in the current hierarchy 1610 (step 506).

【0096】現階層1610内のノード1612,16
13は共に、ステップ501,505のいずれでも
「N」となり処理されない。次のノード1614は、ス
テップ501において「Y」となる。そして、前述の包
含フラグ設定部151の処理により、ノード1614に
は「sk」フラグが設定されているので、ステップ502
において「N」となり、下位の階層の入口ノード162
1に対して処理Bを呼ぶ(ステップ504)。
Nodes 1612 and 16 in the current hierarchy 1610
Both 13 are "N" in both steps 501 and 505 and are not processed. The next node 1614 becomes "Y" in step 501. Then, since the "sk" flag is set in the node 1614 by the processing of the inclusion flag setting unit 151 described above, step 502
Becomes “N” in the lower hierarchy, and the entry node 162 of the lower hierarchy
The process B is called for 1 (step 504).

【0097】このノード1621は、ステップ501に
おいて「N」、ステップ505において「Y」となり、
現階層1620内の全ノードに対して処理Bを呼ぶ。し
かし、現階層1620内のノード1622,1623は
共に、ステップ501,505のいずれでも「N」とな
り処理されない。
This node 1621 becomes "N" in step 501 and "Y" in step 505,
The process B is called for all the nodes in the current hierarchy 1620. However, the nodes 1622 and 1623 in the current hierarchy 1620 are both “N” and not processed in any of steps 501 and 505.

【0098】階層1620の処理を終了し、上位階層1
610の処理に戻り、まず、ノード1615は、ステッ
プ501,505のいずれでも「N」となり処理されな
いが、次のノード1616はループノードであり、ステ
ップ501において「Y」となり、ステップ502にお
いては、「sk」フラグは「OFF」であり「Y」とな
り、ステップ503において、ノード1616に通過フ
ラグを設定する。
The processing of the layer 1620 is completed, and the upper layer 1
Returning to the processing of 610, first, the node 1615 becomes “N” in both steps 501 and 505 and is not processed, but the next node 1616 is a loop node, becomes “Y” in step 501, and in step 502, The “sk” flag is “OFF” and becomes “Y”, and in step 503, the passage flag is set in the node 1616.

【0099】その後、ステップ504において、下位階
層の入口ノード1631に対して処理Bを呼ぶが、ノー
ド1614の場合と同様にして、下位階層に対する処理
は行われない。
After that, in step 504, the process B is called for the entry node 1631 of the lower layer, but the process for the lower layer is not performed as in the case of the node 1614.

【0100】以上の処理により設定された通過フラグ
は、図16において、ノード1616の横に下線をつけ
て「pass」と表示した。
The pass flag set by the above processing is indicated by "pass" with an underline beside the node 1616 in FIG.

【0101】このようにして、包含フラグ設定部151
および通過フラグ設定部152におりフラグが設定され
た階層的制御フローグラフは、図1の制御フロー解析部
160に入力される。
In this way, the inclusion flag setting unit 151
The hierarchical control flow graph with the flag set in the passage flag setting unit 152 is input to the control flow analysis unit 160 in FIG.

【0102】制御フロー解析部160は、階層的制御フ
ローグラフ172と解析対象リスト173とを入力し
て、ユーザ指定の解析対象参照点を接続する制御フロー
を解析し、その制御フローを制御フローリスト174と
して出力し、再度、制御フローリスト174を入力して
その制御フロー上のプログラム中の文またはプログラム
スライスを解析し、その解析結果を文情報ファイル18
3に出力する。このような制御フロー解析部160を図
6,7を用いて説明する。
The control flow analysis unit 160 inputs the hierarchical control flow graph 172 and the analysis target list 173, analyzes the control flow connecting the analysis target reference points designated by the user, and analyzes the control flow. 174 is output again, and the control flow list 174 is input again to analyze the statement or program slice in the program on the control flow, and the analysis result is the statement information file 18
Output to 3. Such a control flow analysis unit 160 will be described with reference to FIGS.

【0103】図6は、図1における制御フロー解析部の
第1の処理動作例を示すフローチャートであり、図7
は、図1における制御フロー解析部の第2の処理動作例
を示すフローチャートである。
FIG. 6 is a flow chart showing a first processing operation example of the control flow analysis unit in FIG.
3 is a flowchart showing a second processing operation example of the control flow analysis unit in FIG. 1.

【0104】これらの図6および図7は、図1における
制御フロー解析部160のアルゴリズムを説明したもの
であり、ここでは、図16に示す階層的制御フローグラ
フ172に関連する処理のみを説明する。
6 and 7 explain the algorithm of the control flow analysis unit 160 in FIG. 1, and here, only the processing related to the hierarchical control flow graph 172 shown in FIG. 16 will be described. .

【0105】制御フロー解析部160は、まず、図6の
ステップ600において、「st」を含むノード(図16
におけるノード1612)に対して図7に示す処理Cを
呼ぶ。このノード1612に関しては、図7のステップ
700において「Y」となり、ステップ721におい
て、図16に示す次のノード1613に対して処理Cを
呼ぶ。
First, the control flow analysis unit 160 determines in step 600 of FIG. 6 that the node including “st” (see FIG. 16).
7 is called for the node 1612) in FIG. Regarding this node 1612, it becomes “Y” in step 700 of FIG. 7, and in step 721, the process C is called to the next node 1613 shown in FIG.

【0106】ノード1613は分岐ノードであり、ステ
ップ705において「Y」となり、ステップ716での
処理に進む。このステップ716の処理においては、エ
ッジ1640は非通過フラグが「ON」であり、合流ノ
ード1615に向かうエッジが選択され、合流ノード1
615に対して処理Cを呼ぶ。
The node 1613 is a branch node, which becomes “Y” in step 705, and the process proceeds to step 716. In the processing of step 716, the non-passage flag of the edge 1640 is “ON”, the edge toward the merging node 1615 is selected, and the merging node 1
The process C is called for 615.

【0107】この合流ノード1615に関しては、ステ
ップ706において「Y」となり、ステップ717にお
いて、合流直前のノード1613中の最後の文である図
14の入力プログラム表示画面1401に表示されたプ
ログラムにおける文番号「11」の文の文番号を文番号
として持ち、ノード種別が「JOIN」のテーブルを作
成して、制御フローリスト(174)の最初のノードと
し、次のノード1616に対して処理Cを呼ぶ。
Regarding this merge node 1615, it becomes "Y" at step 706, and at step 717, the sentence number in the program displayed on the input program display screen 1401 of FIG. 14 which is the last sentence in the node 1613 immediately before the merge. A table having the sentence number of the sentence “11” as the sentence number and the node type “JOIN” is created as the first node of the control flow list (174), and the process C is called to the next node 1616. .

【0108】このノード1616はループノードであ
り、ステップ704において「Y」となり、「sk」を含
まないので、ステップ712では「N」となり、「en」
を含むのでステップ713において「Y」となり、制御
フローリスト(174)に、現ループノード1616か
ら「en」までの解析対象リスト(173)を追加する
(ステップ714)。図18に、この結果、得られた制
御フローリストを示す。
Since this node 1616 is a loop node and becomes “Y” in step 704 and does not include “sk”, it becomes “N” in step 712 and “en”.
Therefore, the analysis target list (173) from the current loop node 1616 to “en” is added to the control flow list (174) (step 714). FIG. 18 shows the control flow list obtained as a result of this.

【0109】図18は、図1における制御フローリスト
の構成例を示す説明図である。
FIG. 18 is an explanatory diagram showing a configuration example of the control flow list in FIG.

【0110】図18において、1801は図7における
ステップ717での制御フロー解析部160による処理
で作成されたテーブルであり、1802,1803は図
7におけるステップ714での処理で作成されたテーブ
ルである。これらの2つのテーブル1802,1803
は、図17におけるテーブル1707,1708と同じ
である。
In FIG. 18, 1801 is a table created by the processing by the control flow analysis unit 160 in step 717 in FIG. 7, and 1802 and 1803 are tables created by the processing in step 714 in FIG. . These two tables 1802, 1803
Is the same as the tables 1707 and 1708 in FIG.

【0111】次に、こうして得られた制御フローリスト
(174)に対して、ステップ715aにおけるスライ
ス解析を行う。このスライス解析について図8を用いて
説明する。
Then, the control flow list (174) thus obtained is subjected to slice analysis in step 715a. This slice analysis will be described with reference to FIG.

【0112】図8は、図7におけるスライス解析の詳細
例を示すフローチャートである。
FIG. 8 is a flowchart showing a detailed example of slice analysis in FIG.

【0113】本図8は、スライス解析のアルゴリズムを
示したものであり、ステップ801において、図18に
示した制御フローリスト174のテーブル1801〜1
803で表現された制御フローに沿ってプログラムスラ
イスを解析する。
FIG. 8 shows an algorithm of slice analysis. In step 801, the tables 1801 to 1801 of the control flow list 174 shown in FIG. 18 are shown.
The program slice is analyzed according to the control flow represented by 803.

【0114】このプログラムスライス解析の詳細は、シ
ー ウェイ リィアオ、アマー ダイワン、 ロバート
ピー ボッシュ ジュニア、アンワォー ギュロウ
ム、モニカ エス ラム著「スイフ エクスプローラ
ー:アン インターラクティブアンド インタープロシ
ージュアル パラレライザー」(ピーピーオーピーピー
99、第37頁から第48頁、1999)(Shih-Wei L
iao, Amer Diwan, Robert P. Bosch Jr., Anwar Ghulou
m, Monica S. Lam, SUIF Explorer: An Interactive an
d Interprocedural Parallelizer, PPoPP '99, pp. 37-
48, 1999)で論じられているので説明は省略する。
The details of this program slice analysis are described in "Swift Explorer: An Interactive and Interprocedural Parallelizer" by P.W.Liao, Amar Daiwan, Robert Peabosch Jr., Anwer Guroum, and Monica Eslam. 37 to 48, 1999) (Shih-Wei L
iao, Amer Diwan, Robert P. Bosch Jr., Anwar Ghulou
m, Monica S. Lam, SUIF Explorer: An Interactive an
d Interprocedural Parallelizer, PPoPP '99, pp. 37-
48, 1999) and will not be described here.

【0115】プログラムスライスは、図1および図15
における解析対象ファイル182として指定された参照
点を基点に解析する。図15に示す解析対象ファイル1
82では、1513で「17」行目で指定された図14
における参照点1405に対して解析される。
The program slice is shown in FIG. 1 and FIG.
The analysis is performed using the reference point designated as the analysis target file 182 in FIG. Analysis target file 1 shown in FIG.
In FIG. 14, in FIG.
Is analyzed for reference point 1405 at.

【0116】次のステップ802においては、一連番号
numを0から1だけ増加させ、「1」とする。そして、
ステップ803において、numを一連番号とし、出力フ
ァイルフォーマットに従って、プログラムスライス上の
文の文番号を図1の文情報ファイル183に出力する。
この文情報ファイル183について、図11と図12お
よび図19を用いて説明する。
At the next step 802, the serial number
num is incremented by 1 from 0 to “1”. And
In step 803, num is used as a serial number, and the statement number of the statement on the program slice is output to the statement information file 183 of FIG. 1 according to the output file format.
The sentence information file 183 will be described with reference to FIGS. 11, 12 and 19.

【0117】図11は、図1における文情報ファイルの
タグ構造例を示す説明図であり、図12は、図11の文
情報ファイルにおけるタグフォーマット例を示す説明
図、図19は、図7におけるスライス解析で出力された
文情報ファイルの構成例を示す説明図である。
FIG. 11 is an explanatory view showing an example of the tag structure of the sentence information file in FIG. 1, FIG. 12 is an explanatory view showing an example of the tag format in the sentence information file of FIG. 11, and FIG. 19 is shown in FIG. It is explanatory drawing which shows the structural example of the sentence information file output by slice analysis.

【0118】図11に示すように、本例では、文情報フ
ァイル183には、全部で4個のタグがある。各タグは
記号「#」で始まり改行で終わる。対になって使用され
るタグ同士は、図中、それらの間を左側の曲線で結んで
表示している。例えば、タグ1101とタグ1103は
対になって使用される。
As shown in FIG. 11, in this example, the sentence information file 183 has a total of four tags. Each tag begins with the symbol "#" and ends with a line break. Tags used in pairs are shown by connecting them with a curve on the left side in the figure. For example, the tag 1101 and the tag 1103 are used as a pair.

【0119】対になって使用されるタグの一方は記号
「#」で始まり、他方は記号「#/」で始まる。尚、本図
11では表示してないが引数を伴うタグもある。記号
「#/」で始まるタグは引数を持たない。
One of the tags used in pairs begins with the symbol "#" and the other begins with the symbol "# /". Although not shown in FIG. 11, there are tags with arguments. Tags that start with the symbol "# /" have no arguments.

【0120】図11において、1102はタグからなる
集合であり、それは1104〜1109で定義される。
1102は、その定義において自分自身である1107
を含んでいる。これにより、ある手続き中から別の手続
きが呼び出されることを表現する。
In FIG. 11, 1102 is a set of tags, which are defined by 1104-1109.
1102 is self in its definition 1107
Is included. This represents that another procedure is called from one procedure.

【0121】図12において、1201はタグフォーマ
ットをタグ毎に表示したものである。ここで、「#LIN
E」と「#CALL」は、1つの「#PROC」内では、行番号順
にソートされる。「#CALL」直後には呼び出し先手続き
の手続き情報「#PROC」が続く。また、「#LINE」が示す
文の並びには「CALL」文は含まない。
In FIG. 12, reference numeral 1201 indicates the tag format for each tag. Here, "#LIN
"E" and "#CALL" are sorted in line number order within one "#PROC". Immediately after "#CALL", the procedure information "#PROC" of the called procedure follows. In addition, the "CALL" statement is not included in the sequence of statements indicated by "#LINE".

【0122】図19に示す文情報ファイル183は、図
1における制御フロー解析部160により、図7におけ
るステップ715a,718でのスライス解析処理で出
力されるものである。
The sentence information file 183 shown in FIG. 19 is output by the control flow analysis unit 160 in FIG. 1 by the slice analysis processing in steps 715a and 718 in FIG.

【0123】図19において、行1901〜1906の
内、行1903は文番号「11」からなる1つの文を、
行1904は文番号「15」から「18」までの4つの
連続した文の集まりを表わす。
In FIG. 19, among lines 1901-1906, line 1903 represents one sentence consisting of sentence number “11”.
Line 1904 represents a group of four consecutive sentences from sentence numbers “15” to “18”.

【0124】図1における文情報表示部192は、この
ような文情報ファイル183と入力プログラム181を
入力し、図20に示すようにして、解析処理部100で
得られた文情報を入力プログラム181上に表示する。
The sentence information display unit 192 in FIG. 1 inputs the sentence information file 183 and the input program 181, and as shown in FIG. 20, the sentence information obtained by the analysis processing unit 100 is input into the input program 181. Display on top.

【0125】図20は、図1における文情報表示部によ
る表示結果例を示す説明図である。
FIG. 20 is an explanatory view showing an example of a display result by the sentence information display section in FIG.

【0126】本図20に示す表示画面2000の例で
は、図19における内容で文情報ファイル192に出力
された文が網掛け表示されている。これにより、ループ
入口である文番号「11」の文から、文番号「13」の
文を通過せずに、分番号「17」に至る制御フローは唯
一であり、その制御フロー上の文のプログラムスライス
が網掛けで表示されることにより容易に判読することが
できる。
In the example of the display screen 2000 shown in FIG. 20, the sentences output to the sentence information file 192 with the contents shown in FIG. 19 are displayed in a shaded manner. As a result, there is only one control flow from the sentence with the sentence number “11” that is the loop entry to the minute number “17” without passing through the sentence with the sentence number “13”. The program slices can be easily read by being shaded.

【0127】尚、図20の例では、全文を一度に表示し
ているが、文情報ファイル183には文が実行順に並べ
られているので、その順またはその逆順に表示すること
でも良い。
In the example of FIG. 20, all the sentences are displayed at once, but since the sentences are arranged in the sentence information file 183 in the order of execution, they may be displayed in that order or in the reverse order.

【0128】以上のようにして、配列「x」に対して、
ループの1イタレーションで、ループ入口から配列
「x」の定義点を通らず、配列「x」の使用点に至る制御
フローが示される。この制御フローは「i」の値が
「1」でも「5」でもない時に実行されるので、文番号
「10」において「m」の値が「2」以上なら、実行さ
れる。従って、この時、変数「x」に対してプライベー
ト化は適用できないことがわかる。
As described above, with respect to the array "x",
One iteration of the loop shows the control flow from the loop entry to the use point of the array "x" without passing through the definition point of the array "x". Since this control flow is executed when the value of "i" is neither "1" nor "5", it is executed when the value of "m" is "2" or more in the sentence number "10". Therefore, at this time, it can be seen that privatization cannot be applied to the variable “x”.

【0129】以上、図1〜図20を用いて説明したよう
に、本例のプログラム解析技術では、プログラム中の解
析対象を指定する解析対象指定情報を入力してそれに対
する解析情報を出力するコンピュータシステムにおい
て、解析対象ループ、ある変数の定義点および使用点に
対する識別情報を入力し、解析対象ループのループ入
口、変数の定義点、および使用点のいずれか1つから、
ループ出口、変数の定義点、および使用点のいずれか1
つへ到達し、かつ、解析対象ループの繰り返しをまたが
らない制御フローを検出・抽出し、この制御フロー上の
文情報をファイルに出力、または、文情報をソースプロ
グラム上で強調表示する。
As described above with reference to FIGS. 1 to 20, in the program analysis technique of this example, a computer for inputting analysis target designating information designating an analysis target in a program and outputting analysis information corresponding to the analysis target designating information. In the system, the identification information for the analysis target loop, the definition point and the use point of a certain variable is input, and one of the loop entrance of the analysis target loop, the variable definition point, and the use point
One of loop exit, variable definition point, and usage point 1
A control flow that has reached a certain point and does not cross the loop of the analysis target is detected and extracted, and the statement information on this control flow is output to a file or the statement information is highlighted on the source program.

【0130】あるいは、解析対象ループのループ入口か
ら変数の定義点および使用点の内の一方を通らずに他方
へ到達する、または、変数の定義点および使用点の内の
一方から他方を通らずに解析対象ループのループ出口に
到達する制御フローを検出・抽出し、この制御フロー上
の文情報をファイルに出力、または、文情報をソースプ
ログラム上で強調表示する。
Alternatively, from the loop entrance of the loop to be analyzed, one of the variable definition point and the use point is not reached but the other is reached, or one of the variable definition point and the use point is not passed through the other. The control flow that reaches the loop exit of the analysis target loop is detected and extracted, and the statement information on this control flow is output to a file or the statement information is highlighted on the source program.

【0131】尚、変数の定義点あるいは使用点における
配列添字またはスカラ変数に対する、検出・抽出した制
御フローに沿うプログラムスライスを文情報とする。も
しくは、変数の定義点あるいは使用点における配列添字
またはスカラ変数に対するプログラムスライスと、検出
・抽出した制御フローとの交わりを文情報とし、このよ
うな文情報を、プログラム実行順またはその逆順に表示
する。
The program slice along the detected / extracted control flow for the array subscript or the scalar variable at the definition point or use point of the variable is used as the sentence information. Alternatively, the statement slice is the intersection of the program slice for the array subscript or scalar variable at the definition point or use point of the variable and the detected / extracted control flow, and such statement information is displayed in the program execution order or the reverse order. .

【0132】このことにより、ユーザは、プライベート
化の第1条件「対象変数の定義点が実行される」を、プ
ログラム中の少ない文を見ることで容易に検証すること
ができるので、対象変数のプライベート化の必要性を知
る時間を削減することができる。
As a result, the user can easily verify the first condition of privatization, "the definition point of the target variable is executed", by looking at the few sentences in the program. You can reduce the time to know the need for privatization.

【0133】また、プライベート化の第2条件「対象変
数の使用点が実行される時、同じループイタレーション
内で、その実行より前にその変数の定義点が実行され
る」をプログラム中の少ない文を見ることで容易に検証
することができるので、ユーザが、対象変数がプライベ
ート化可能であることを知る時間を削減することができ
る。
In the program, the second condition of privatization, "when the use point of the target variable is executed, the definition point of the variable is executed before the execution within the same loop iteration", is less in the program. Since it can be easily verified by looking at the sentence, it is possible to reduce the time for the user to know that the target variable can be privatized.

【0134】また、プライベート化の第1条件またはプ
ライベート化の第2条件をプログラム実行順またはその
逆順に文を表示しながら検証することができるので、ユ
ーザは、複雑な制御フローを持つプログラムでも短時間
で、確実に調査を行なうことができる。
Further, since the first condition for privatization or the second condition for privatization can be verified by displaying the statements in the program execution order or the reverse order thereof, the user can easily check a program having a complicated control flow. In time, you can be sure to carry out an investigation.

【0135】尚、本発明は、図1〜図20を用いて説明
した例に限定されるものではなく、その要旨を逸脱しな
い範囲において種々変更可能である。例えば、本発明
は、本実施例で説明した変数のプライベート化可能性を
ユーザに検証させる目的以外にも使うことができる。
The present invention is not limited to the examples described with reference to FIGS. 1 to 20, and various modifications can be made without departing from the spirit of the invention. For example, the present invention can be used for purposes other than allowing a user to verify the privatization possibility of a variable described in this embodiment.

【0136】例えば、ある変数に対する2つの参照点の
間にループ運搬フロー依存があるとそのループは並列化
できないことが知られている。このデータ依存を引き起
こす可能性のある制御フローをユーザに表示すること
で、コンパイラによる静的解析では確定的に判定できな
かったループ運搬フロー依存をユーザが検証することが
可能となる。
For example, it is known that a loop cannot be parallelized if there is a loop-carrying flow dependency between two reference points for a certain variable. By displaying the control flow that may cause this data dependence to the user, the user can verify the loop-carrying flow dependence that could not be definitely determined by the static analysis by the compiler.

【0137】このため、コンパイラがデータ依存の可能
性があると見なした2つの参照点に対して、変数に対す
る一方の定義点からループ出口に至る制御フローをその
上の文またはプログラムスライスを使って表示する。さ
らに、ループ入口からその変数に対するの使用点に至る
制御フローを同様に表示する。これら2つを逐一、また
は、同時に2つの画面を使って表示することにより、ユ
ーザによるデータ依存の存在の検証、すなわち、ループ
並列化の検証が可能となる。
For this reason, the control flow from one definition point for a variable to the loop exit is used for the two reference points that the compiler considers to be possibly data-dependent by using the statement or program slice above it. To display. In addition, the control flow from the loop entry to the point of use for that variable is also displayed. By displaying these two one by one or simultaneously using two screens, the user can verify the existence of data dependence, that is, verify the loop parallelization.

【0138】また、本例では、記録媒体としてCD−R
OMを用いることを記載しているが、FD(Flexible D
isk)等を記録媒体として用いることでも良い。また、
プログラムのインストールに関しても、通信装置を介し
てネットワーク経由でプログラムをダウンロードしてイ
ンストールすることでも良い。
Further, in this example, the recording medium is a CD-R.
Although it is described that OM is used, FD (Flexible D
isk) or the like may be used as the recording medium. Also,
Regarding the installation of the program, the program may be downloaded and installed via the network via the communication device.

【0139】[0139]

【発明の効果】本発明によれば、与えられたループに対
して、ループ入口点からある変数の定義点へ至るループ
独立な制御フロー、または、ループ入口点からある変数
の定義点を通らずにその変数の使用点へ至るループ独立
な制御フローを、その上の文、または、その制御フロー
に沿ったプログラムスライスを使って、プログラム実行
順または逆順に表示するので、従来は、対象変数がプラ
イベート化可能か否かをユーザが調査する場合、システ
ムは「対象変数の使用点が実行される時、同じループイ
タレーション内で、その実行より前にその変数の定義点
が実行される」という情報を表示しないのでユーザは自
分でそれを調べなければならず、ユーザの負荷が大きか
ったとの問題を解決できる。すなわち、本発明により、
ユーザは自分でそれを調べる必要がなくなり、ユーザ
の、対象変数のプライベート化判定等に要する時間を削
減すること、および、ユーザの負荷を軽減することが可
能となる。
According to the present invention, for a given loop, a loop-independent control flow from a loop entry point to a variable definition point or a variable entry point from a loop entry point is not passed. Since the loop-independent control flow to the point of use of the variable is displayed in the program execution order or the reverse order using the statement above it or the program slice along the control flow, conventionally, the target variable is When the user investigates whether or not it can be privatized, the system says, "When the usage point of the target variable is executed, the definition point of that variable is executed before the execution within the same loop iteration." Since the information is not displayed, the user has to check it by himself, which can solve the problem that the user's load is heavy. That is, according to the present invention,
The user does not need to check it by himself, and it is possible to reduce the time required for the user to make a privatization determination of the target variable and to reduce the load on the user.

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

【図1】本発明に係わるプログラム解析システムの構成
例を示すブロック図である。
FIG. 1 is a block diagram showing a configuration example of a program analysis system according to the present invention.

【図2】図1における解析対象入力部の処理動作例を示
すフローチャートである。
FIG. 2 is a flowchart showing an example of processing operation of an analysis target input unit in FIG.

【図3】図1における最内分岐解析部の処理動作例を示
すフローチャートである。
FIG. 3 is a flowchart showing an example of processing operation of an innermost branch analysis unit in FIG.

【図4】図1における包含フラグ設定部の処理動作例を
示すフローチャートである。
FIG. 4 is a flowchart showing an example of processing operation of an inclusion flag setting unit in FIG.

【図5】図1における通過フラグ設定部の処理動作例を
示すフローチャートである。
5 is a flowchart showing an example of processing operation of a passage flag setting unit in FIG.

【図6】図1における制御フロー解析部の第1の処理動
作例を示すフローチャートである。
FIG. 6 is a flowchart showing a first processing operation example of a control flow analysis unit in FIG.

【図7】図1における制御フロー解析部の第2の処理動
作例を示すフローチャートである。
FIG. 7 is a flowchart showing a second processing operation example of the control flow analysis unit in FIG.

【図8】図7におけるスライス解析の詳細例を示すフロ
ーチャートである。
8 is a flowchart showing a detailed example of slice analysis in FIG.

【図9】解析対象ファイルのタグ構造例を示す説明図で
ある。
FIG. 9 is an explanatory diagram showing a tag structure example of an analysis target file.

【図10】図9における解析対象ファイルのタグフォー
マット例を示す説明図である。
10 is an explanatory diagram showing an example of a tag format of a file to be analyzed in FIG.

【図11】図1における文情報ファイルのタグ構造例を
示す説明図である。
11 is an explanatory diagram showing an example of a tag structure of the sentence information file in FIG.

【図12】図11の文情報ファイルにおけるタグフォー
マット例を示す説明図である。
12 is an explanatory diagram showing an example of a tag format in the sentence information file of FIG.

【図13】図1における解析対象リストのテーブル構成
例を示す説明図である。
13 is an explanatory diagram showing a table configuration example of an analysis target list in FIG. 1. FIG.

【図14】図1におけるプログラム解析システムの解析
対象となるプログラムの指定操作例を示す説明図であ
る。
14 is an explanatory diagram illustrating an example of a designation operation of a program to be analyzed by the program analysis system in FIG.

【図15】図1における解析対象ファイルの内容例を示
す説明図である。
FIG. 15 is an explanatory diagram showing an example of contents of an analysis target file in FIG.

【図16】図1における階層的制御フローグラフの構造
例を示す説明図である。
16 is an explanatory diagram showing a structural example of a hierarchical control flow graph in FIG.

【図17】図1における解析対象リストの構成例を示す
説明図である。
17 is an explanatory diagram showing a configuration example of an analysis target list in FIG.

【図18】図1における制御フローリストの構成例を示
す説明図である。
18 is an explanatory diagram showing a configuration example of a control flow list in FIG.

【図19】図7におけるスライス解析で出力された文情
報ファイルの構成例を示す説明図である。
19 is an explanatory diagram showing a configuration example of a sentence information file output by the slice analysis in FIG.

【図20】図1におけるプログラム解析システムの図1
4のプログラムに対応する解析結果例を示す説明図であ
る。
FIG. 20 is a diagram of the program analysis system in FIG.
It is explanatory drawing which shows the example of an analysis result corresponding to the program of FIG.

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

100:解析処理部、110:構文解析、120:階層
的制御フローグラフ作成部、130:解析対象入力部、
140:最内分岐解析部、150:包含関係解析部、1
51:包含フラグ設定部、152:通過フラグ設定部、
160:制御フロー解析部、171:中間語、172:
階層的制御フローグラフ、173:解析対象リスト、1
74:制御フローリスト、181:入力プログラム、1
82:解析対象ファイル、183:文情報ファイル、1
91:解析対象指定部、192:文情報表示部、901
〜914:タグ、1001:タグフォーマット、100
2:解析方法の種別、1003:文種別、1004:対
象種別、1101〜1109:タグ、1201:タグフ
ォーマット、1301,1302:ポインタ、130
3:文番号、1304:ノード種別、1305:ポイン
タ、1310:ノード種別、1401:入力プログラム
表示画面、1402:解析対象行番号表示部、140
3:解析対象行表示部、1404:文番号表示部、14
05:解析対象参照点、1406:項目欄、1501〜
1516:行、1601,1611〜1617,162
1〜1623,1631〜1633:ループノード、1
610,1620,1630:階層、1701,170
3,1706:開始テーブル、1702,1704,1
705,1707.1708,1801〜1803:テ
ーブル、1901〜1906:行、2000:表示画
面。
100: analysis processing unit, 110: syntax analysis, 120: hierarchical control flow graph creation unit, 130: analysis target input unit,
140: innermost branch analysis unit, 150: inclusion relation analysis unit, 1
51: inclusion flag setting unit, 152: passage flag setting unit,
160: control flow analysis unit, 171: intermediate language, 172:
Hierarchical control flow graph, 173: analysis target list, 1
74: control flow list, 181: input program, 1
82: analysis target file, 183: sentence information file, 1
91: analysis target designation unit, 192: sentence information display unit, 901
~ 914: tag, 1001: tag format, 100
2: analysis method type, 1003: sentence type, 1004: target type, 1101 to 1109: tag, 1201: tag format, 1301, 1302: pointer, 130
3: sentence number, 1304: node type, 1305: pointer, 1310: node type, 1401: input program display screen, 1402: analysis target line number display unit, 140
3: Analysis target line display unit, 1404: Sentence number display unit, 14
05: analysis target reference point, 1406: item column, 1501
1516: line, 1601, 1611 to 1617, 162
1-1623, 1631-1633: Loop node, 1
610, 1620, 1630: Hierarchy, 1701, 170
3, 1706: start table, 1702, 1704, 1
705, 1707.1708, 1801 to 1803: table, 1901 to 1906: row, 2000: display screen.

Claims (7)

【特許請求の範囲】[Claims] 【請求項1】 記憶装置に記憶されたプログラムを読み
出して当該プログラムの解析と解析結果の出力を行うコ
ンピュータシステムによるプログラム解析方法であっ
て、解析対象として指定されたプログラム上のループの
入口と該ループ内で定義される変数の定義点および使用
点を記憶装置に記憶し、記憶した上記ループの入口と上
記変数の定義点および使用点のいずれか一つから、上記
ループの出口および上記変数の定義点と使用点のいずれ
か一つへ到達する制御フローの内、上記ループの繰り返
しをまたがらない制御フローを抽出し、抽出した上記制
御フロー上の文情報を出力することを特徴とするプログ
ラム解析方法。
1. A program analysis method by a computer system for reading a program stored in a storage device and analyzing the program and outputting an analysis result, comprising: a loop entrance on a program designated as an analysis target; The definition point and the usage point of the variable defined in the loop are stored in a storage device, and from either one of the stored entry point and the definition point and the usage point of the variable, the exit point of the loop and the Among the control flows that reach either one of the definition point and the usage point, a control flow that does not cross the repetition of the loop is extracted, and sentence information on the extracted control flow is output. analysis method.
【請求項2】 記憶装置に記憶されたプログラムを読み
出して当該プログラムの解析と解析結果の出力を行うコ
ンピュータシステムによるプログラム解析方法であっ
て、解析対象として指定されたプログラム上のループの
入口と該ループ内で定義される変数の定義点および使用
点を記憶装置に記憶し、記憶した上記ループの入口から
上記変数の定義点と使用点のいずれか一方を通らずに他
方へ到達する制御フロー、および、上記変数の定義点と
使用点のいずれか一方から他方を通らずに上記ループの
出口へ到達する制御フローを抽出し、抽出した上記制御
フロー上の文情報を出力することを特徴とするプログラ
ム解析方法。
2. A program analysis method by a computer system for reading out a program stored in a storage device and analyzing the program and outputting an analysis result, comprising: a loop entrance on a program designated as an analysis target; A control flow in which the definition point and the use point of the variable defined in the loop are stored in a storage device, and the other is reached from the stored entry point of the loop without passing through either the definition point or the use point of the variable, And, the control flow reaching the exit of the loop from one of the definition point and the use point of the variable without passing through the other is extracted, and the sentence information on the extracted control flow is output. Program analysis method.
【請求項3】 請求項1、もしくは、請求項2のいずれ
かに記載のプログラム解析方法であって、上記文情報と
して、上記変数の定義点あるいは使用点における配列添
字またはスカラ変数に対する、上記抽出した制御フロー
に沿うプログラムスライスを出力することを特徴とする
プログラム解析方法。
3. The program analysis method according to claim 1 or 2, wherein the sentence information is extracted from an array subscript or a scalar variable at a definition point or a use point of the variable. A program analysis method characterized by outputting a program slice according to the control flow described above.
【請求項4】 請求項1、もしくは、請求項2のいずれ
かに記載のプログラム解析方法であって、上記文情報と
して、上記変数の定義点あるいは使用点における配列添
字またはスカラ変数に対するプログラムスライスと、上
記抽出した制御フローとの交わりを出力することを特徴
とするプログラム解析方法。
4. The program analysis method according to claim 1 or 2, wherein the sentence information includes a program slice for an array subscript or a scalar variable at a definition point or a use point of the variable. A program analysis method characterized by outputting the intersection with the extracted control flow.
【請求項5】 請求項1から請求項4のいずれかに記載
のプログラム解析方法であって、上記文情報を、プログ
ラム実行順もしくは逆順に表示することを特徴とするプ
ログラム解析方法。
5. The program analysis method according to claim 1, wherein the sentence information is displayed in a program execution order or a reverse order.
【請求項6】 コンピュータに、請求項1から請求項5
のいずれかに記載のプログラム解析方法における各手順
を実行させるためのプログラム。
6. The computer according to any one of claims 1 to 5.
A program for executing each step in the program analysis method according to any one of 1.
【請求項7】 記憶装置に記憶されたプログラムを読み
出して当該プログラムの解析と解析結果の出力を行うコ
ンピュータシステムであって、解析対象プログラムから
中間語を生成し記憶装置に出力する構文解析手段と、記
憶装置から上記中間語を読み出し該中間語に基づき階層
的制御フローグラフを生成して記憶装置に出力する階層
的制御フローグラフ作成手段と、ユーザによる上記解析
対象プログラム上の解析対象ループと解析対象参照点の
指定を受け付け、受け付けた指定内容に対応して解析対
象ファイルを生成して記憶装置に出力する解析対象指定
手段と、記憶装置から上記解析対象ファイルおよび上記
階層的制御フローグラフを読み出し、上記解析対象ファ
イルで示される解析対象を上記階層的制御フローグラフ
に書き込み、解析対象ループから解析対象参照点に至る
呼び出し手続列を表す解析対象リストを生成して記憶装
置に出力する解析対象入力手段と、記憶装置から上記階
層的制御フローグラフを読み出し、解析対象参照点を含
む文へ分岐するノードおよび解析対象参照点を含む文か
ら分岐するノードで、最も内側にあるループ入口以外の
ノードと分岐に対応するエッジを検出し、該エッジに制
御フローが通過しないように第1のフラグを立てて記憶
装置に出力する最内分岐解析手段と、記憶装置から上記
階層的制御フローグラフを読み出し、各ノードが解析対
象参照点を含むか否かを解析し、解析対象参照点の内、
上記第1のフラグで通過しないことを指定した解析対象
参照点を含まないノードに第2のフラグを立てて記憶装
置に出力する包含関係解析手段と、記憶装置から上記解
析対象リストと上記第1,第2のフラグを立てた階層的
制御フローグラフを読み出し、ユーザ指定の解析対象参
照点を接続する制御フローを解析し、該制御フローを制
御フローリストとして記憶装置に出力すると共に、該制
御フローリストを入力して、当該制御フロー上のプログ
ラム中の文もしくはプログラムスライスを解析し、解析
結果を文情報ファイルとして記憶装置に出力する制御フ
ロー解析手段と、記憶装置から上記文情報ファイルと上
記解析対象プログラムとを読み出して入力し、表示装置
の画面において、上記文情報ファイルにおける文情報を
上記解析対象プログラム上で強調表示する文情報表示手
段とを有することを特徴とするプログラム解析システ
ム。
7. A computer system for reading a program stored in a storage device to analyze the program and output an analysis result, and a syntax analysis means for generating an intermediate word from a program to be analyzed and outputting the intermediate word to the storage device. A hierarchical control flow graph creating means for reading the intermediate word from the storage device and generating a hierarchical control flow graph based on the intermediate word and outputting the hierarchical control flow graph to the storage device; and an analysis target loop and analysis by the user on the analysis target program. An analysis target designating unit that receives the designation of the target reference point, generates an analysis target file corresponding to the received designated content, and outputs the file to the storage device, and reads the analysis target file and the hierarchical control flow graph from the storage device. , Write the analysis target indicated by the analysis target file in the hierarchical control flow graph, and Analysis target input means for generating an analysis target list representing a calling procedure sequence from the phantom loop to the analysis target reference point and outputting it to the storage device; and reading the hierarchical control flow graph from the storage device, and including the analysis target reference point. A node that branches to a sentence and a node that branches from a sentence that includes a reference point to be analyzed detects an edge other than the innermost loop entrance and an edge that corresponds to the branch, and prevents the control flow from passing through the edge. The innermost branch analysis means for setting a flag of and outputting to the storage device, and reading out the hierarchical control flow graph from the storage device, analyzes whether or not each node includes the analysis target reference point, and analyzes the analysis target reference point. Of which
An inclusion relation analysis unit that sets a second flag to a node that does not include an analysis target reference point that is designated not to pass by the first flag and outputs the node to the storage device; the analysis target list from the storage device; , Reading the hierarchical control flow graph with the second flag set, analyzing the control flow connecting the user-specified reference points for analysis, outputting the control flow as a control flow list to the storage device, and Control flow analysis means for inputting a list, analyzing statements or program slices in a program on the control flow, and outputting the analysis result to a storage device as a statement information file, and the statement information file and the analysis from the storage device Read and input the target program, and on the screen of the display device, display the sentence information in the sentence information file Program analysis system; and a statement information display means for highlighting on the ram.
JP2002011383A 2002-01-21 2002-01-21 Program analysis system Expired - Fee Related JP3648710B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2002011383A JP3648710B2 (en) 2002-01-21 2002-01-21 Program analysis system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2002011383A JP3648710B2 (en) 2002-01-21 2002-01-21 Program analysis system

Publications (2)

Publication Number Publication Date
JP2003216440A true JP2003216440A (en) 2003-07-31
JP3648710B2 JP3648710B2 (en) 2005-05-18

Family

ID=27648872

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2002011383A Expired - Fee Related JP3648710B2 (en) 2002-01-21 2002-01-21 Program analysis system

Country Status (1)

Country Link
JP (1) JP3648710B2 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007094753A (en) * 2005-09-29 2007-04-12 Hitachi Ltd Logic extraction support device
US8806464B2 (en) 2012-04-26 2014-08-12 Hewlett-Packard Development Company, L.P. Process flow optimized directed graph traversal

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007094753A (en) * 2005-09-29 2007-04-12 Hitachi Ltd Logic extraction support device
US8806464B2 (en) 2012-04-26 2014-08-12 Hewlett-Packard Development Company, L.P. Process flow optimized directed graph traversal

Also Published As

Publication number Publication date
JP3648710B2 (en) 2005-05-18

Similar Documents

Publication Publication Date Title
US7996819B2 (en) Generating functional test scripts
US8701084B1 (en) Preview of auto-fix changes to software code
US8296748B2 (en) Method and system for intermediate representation of source code
US8127261B2 (en) System for quickly specifying formal verification environments
JP4001286B2 (en) Program maintenance support apparatus, program maintenance support method, and program
US20100199269A1 (en) Program optimization device and program optimization method
US9703683B2 (en) Software testing coverage
US20020052856A1 (en) Method of data-dependence analysis and display for procedure call
JP2003208307A (en) Source program generation system
JP2003216440A (en) Program analyzing method, program therefor and program analyzing system
JP6790921B2 (en) Program analyzer, program analysis method and program analysis program
JP2002527816A (en) Program optimization apparatus and method
Liang et al. A Novel Optimized Path-Based Algorithm for Model Clone Detection.
Barbon et al. Visual debugging of behavioural models
JP2003330710A (en) Program generating device, program generating method, and program for generating program
JP5910410B2 (en) Schematic program test data generation apparatus and method, and program
JP3373641B2 (en) Test sequence generator
JP4387324B2 (en) Property conversion device
Saddler et al. EventFlowSlicer: Goal based test generation for graphical user interfaces
US11086829B2 (en) Comparing schema definitions using sampling
JP2012059202A (en) Test case generation device, test case generation method and test case generation program
JPH0793144A (en) Program analyzer
Nembhard et al. Conversational code analysis: The future of secure coding
JP2957025B2 (en) Functional level simulation device
JP2002041595A (en) Device and method for back annotation

Legal Events

Date Code Title Description
A977 Report on retrieval

Effective date: 20040909

Free format text: JAPANESE INTERMEDIATE CODE: A971007

A131 Notification of reasons for refusal

Effective date: 20041015

Free format text: JAPANESE INTERMEDIATE CODE: A131

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20041213

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: 20050121

A61 First payment of annual fees (during grant procedure)

Effective date: 20050203

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)

Year of fee payment: 3

Free format text: PAYMENT UNTIL: 20080225

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

Free format text: PAYMENT UNTIL: 20090225

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20090225

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20100225

Year of fee payment: 5

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

Free format text: PAYMENT UNTIL: 20100225

Year of fee payment: 5

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

Free format text: PAYMENT UNTIL: 20110225

Year of fee payment: 6

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

Year of fee payment: 7

Free format text: PAYMENT UNTIL: 20120225

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

Free format text: PAYMENT UNTIL: 20120225

Year of fee payment: 7

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

Year of fee payment: 8

Free format text: PAYMENT UNTIL: 20130225

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

Year of fee payment: 8

Free format text: PAYMENT UNTIL: 20130225

LAPS Cancellation because of no payment of annual fees