JPH02163833A - Block dividing method and synchronizing process position deciding method for program repeating structure and program converting device - Google Patents

Block dividing method and synchronizing process position deciding method for program repeating structure and program converting device

Info

Publication number
JPH02163833A
JPH02163833A JP31907688A JP31907688A JPH02163833A JP H02163833 A JPH02163833 A JP H02163833A JP 31907688 A JP31907688 A JP 31907688A JP 31907688 A JP31907688 A JP 31907688A JP H02163833 A JPH02163833 A JP H02163833A
Authority
JP
Japan
Prior art keywords
program
process position
synchronizing process
repeating structure
data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP31907688A
Other languages
Japanese (ja)
Inventor
Kimiharu Okabe
岡部 公治
Shigeo Asahara
重夫 浅原
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.)
Panasonic Holdings Corp
Original Assignee
Matsushita Electric Industrial Co 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 Matsushita Electric Industrial Co Ltd filed Critical Matsushita Electric Industrial Co Ltd
Priority to JP31907688A priority Critical patent/JPH02163833A/en
Publication of JPH02163833A publication Critical patent/JPH02163833A/en
Pending legal-status Critical Current

Links

Landscapes

  • Devices For Executing Special Programs (AREA)

Abstract

PURPOSE:To obtain a synchronizing process position in a simple procedure by dividing a program repeating structure into blocks where the only input/ output flow exists respectively in the case the repeating structure includes a complicated control structure and this structure has the data dependeint relation. CONSTITUTION:A program analyzing part 11 analyzes the branching destination of each sentence, the data using way, the additional characters, etc., for a sequential program to be converted. Based on this analyzed data, a synchronizing process position deciding part 12 decides a synchronizing process position between loops. Then a code generating part 13 sets a synchronizing instruction into the synchronizing process position decided at the part 12 to produce a parallel processing code. Thus the synchronizing process position is obtained in a simple procedure.

Description

【発明の詳細な説明】 産業上の利用分野 本発明はプログラムの繰り返し構造を、入出力フローが
共に唯一つであるようなブロックに分割するブロック分
割方法並びにデータ依存関係を持つループの並列処理時
の同期命令の実行位置を決定する同期処理位置決定方法
及び逐次型プログラムをデータ依存関係を持つ箇所で同
期を取りながら実行されるプログラムに変換するプログ
ラム変換装置に関するものである。
[Detailed Description of the Invention] Industrial Application Field The present invention relates to a block division method for dividing a repetitive structure of a program into blocks having only one input/output flow, and a method for parallel processing of loops having data dependencies. The present invention relates to a synchronous processing position determination method for determining the execution position of a synchronous instruction, and a program conversion device for converting a sequential program into a program that is executed while maintaining synchronization at locations having data dependencies.

従来の技術 従来のプログラム変換装置では、並列に実行されるプロ
セス間でデータ依存関係が存在する時には並列化を抑止
するか、プロセス間の同期命令の実行位置決定方法は、
同期処理位置へ至るあるいはそこから到達出来る全ての
分岐位置を選択する。
BACKGROUND OF THE INVENTION Conventional program conversion devices have a method of inhibiting parallelization when there is a data dependency between processes executed in parallel, or determining the execution position of a synchronized instruction between processes.
Select all branch positions that lead to or can be reached from the synchronization processing position.

発明が解決しようとする課題 従来のプログラム変換装置は、たとえ同期命令の実行位
置を決定できたとしても、分岐のたびに同期命令を実行
するためその数が多くなる。またその決定を簡単なステ
ップで行う方法が存在しない。さらに複数の同期処理を
最適化する手順が複雑であるという問題がある。
Problems to be Solved by the Invention In conventional program conversion devices, even if the execution position of a synchronous instruction can be determined, the number of synchronous instructions is large because the synchronous instruction is executed every time there is a branch. Furthermore, there is no way to make this decision in simple steps. Another problem is that the procedure for optimizing multiple synchronization processes is complicated.

本発明は上記問題点に鑑み、逐次型プログラムを並列処
理用のプログラムに変換する際、簡単な手順で同期処理
位置を得ることを目的としており、さらに−i詰’)、
=装置に用いられる同期処理位置決定方法及びそのため
のブロック分割方法を提供することを目的としている。
In view of the above problems, the present invention aims to obtain a synchronous processing position by a simple procedure when converting a sequential program into a parallel processing program, and furthermore,
It is an object of the present invention to provide a synchronous processing position determination method used in a device and a block division method therefor.

課題を解決するための手段 上記課題を解決するために本発明のブロック分割方法は
、フローグラフの生成、深さ優先探索、人出ツノフロー
が唯一なブロックへの分割するステップを持つ。同期処
理位置決定方法は、上記プログラム分割、同期処理位置
初期決定、冗長な同期処理の除去なるステップを持つ。
Means for Solving the Problems In order to solve the above problems, the block division method of the present invention includes the steps of generating a flow graph, depth-first search, and division into blocks with a unique flow of people. The synchronous processing position determining method includes the steps of dividing the program, initializing the synchronous processing position, and removing redundant synchronous processing.

プログラム変換装置は、プログラム解析、上記同期処理
位置決定、並列処理用コードの生成するステップから構
成される。
The program conversion device is comprised of the steps of program analysis, determining the synchronous processing position, and generating code for parallel processing.

作用 上記のように構成されたプログラム変換装置で逐次型プ
ログラムを並列型プログラムに変換すると、ループ間で
データ依存関係による同期処理が必要な場合、同期命令
は入出力フローが唯一つになるように分割されたブロッ
クのmI後で実行されるため、命令数が少なく理解しや
すい。
Effect When converting a sequential program into a parallel program using the program conversion device configured as described above, if synchronization processing is required due to data dependencies between loops, the synchronization instruction is used to ensure that there is only one input/output flow. Since it is executed after mI of the divided block, the number of instructions is small and easy to understand.

そして、同期命令の実行位置決定では、ブロック分割方
法を利用するので、簡単な手順で実行できる。
Furthermore, since the block division method is used to determine the execution position of the synchronization command, the execution can be performed in a simple procedure.

また、ブロック分割は、深さ優先探索にもとすき簡単な
手順で実行できる。
Furthermore, block division can be performed in a simple procedure, making it suitable for depth-first search.

実施例 以下本発明について、図面を参照しながら説明する。第
1図は本発明のプログラム変換装置の一実施例の全体構
成を示すブロック図で、プログラム解析部11、同期処
理位置決定部12、及び並列コード生成部13から構成
される。
EXAMPLES The present invention will be described below with reference to the drawings. FIG. 1 is a block diagram showing the overall configuration of an embodiment of the program converting device of the present invention, which is composed of a program analysis section 11, a synchronous processing position determination section 12, and a parallel code generation section 13.

第1図において、逐次型の被変換プログラムは、まずプ
ログラム解析部11において、各文の分岐先、データの
使用のされかた、その添え字などが解析される。ここで
解析されたデータをもとに、同期処理位置決定部12に
おいて、ループ間の同期処理位置を決定する。コード生
成部13は、同期処理位置決定部12において決定され
た同期処理位置に同期命令を組み込んだ並列処理用コー
ドを生成する。
In FIG. 1, a program to be converted of a sequential type is first analyzed by a program analysis section 11 to determine the branch destination of each statement, how data is used, and its subscripts. Based on the data analyzed here, the synchronization processing position determination unit 12 determines the synchronization processing position between loops. The code generation unit 13 generates a code for parallel processing that incorporates a synchronization command at the synchronization processing position determined by the synchronization processing position determination unit 12.

第2図は、本発明の同期処理位置決定方法の一実施例の
詳細を示す流れ図で、プ07り分割21、同期処理位置
初期決定22、及び冗長な同期の除去23などから構成
される。第2図において、第1図のプログラム解析部1
1で解析されたループは、ループ間でデータ依存関係が
ある場合、ブロック分割21なるステップで、入出力フ
ローを唯一つだけ持つようなブロックに分割される。次
に、同期処理位置初期決定22なるステップで同期処理
位置を初期決定する。これは、ブロックを同期処理の単
位とし、同期処理を必要とする文を含むブロックの前後
に同期処理位置を設定する方法である。最後に冗長な同
期の除去23なるステップでは、複数に同期により不必
要な同期がある場合、これを取り除くステ、ブであり、
例えば第3図で示されるような手順で実現できる。
FIG. 2 is a flowchart showing details of an embodiment of the synchronization processing position determination method of the present invention, which is comprised of a process 21, a synchronization processing position initial determination 22, redundant synchronization removal 23, and the like. In FIG. 2, the program analysis section 1 in FIG.
If there is a data dependency relationship between the loops, the loop analyzed in step 1 is divided into blocks having only one input/output flow in a block division step 21. Next, in a step 22 for initial determination of synchronous processing position, the synchronous processing position is initially determined. In this method, a block is used as a unit of synchronization processing, and the synchronization processing positions are set before and after a block that includes a statement that requires synchronization processing. Finally, in the step 23 of removing redundant synchronization, if there is unnecessary synchronization due to multiple synchronizations, this is removed.
For example, this can be realized by the procedure shown in FIG.

第4図は本発明のブロック分割方法の一実施例の詳細を
示す流れ図で、フローグラフの作成41、深さ優先探索
42、ブロック分割43などから構成される。第4図に
おいて、第5図で示されるループをブロック分割する場
合、フローグラフの作成41なるステップで、第6図に
示されるようなフローグラフが作成される。次に、深さ
優先探索42なるステップで、第6図のフローグラフに
対して深さ優先探索が行われ、各文のLot。
FIG. 4 is a flowchart showing details of an embodiment of the block division method of the present invention, which includes flow graph creation 41, depth-first search 42, block division 43, and the like. In FIG. 4, when the loop shown in FIG. 5 is divided into blocks, a flow graph as shown in FIG. 6 is created in a flow graph creation step 41. Next, in step depth-first search 42, a depth-first search is performed on the flow graph of FIG. 6 to find the Lot of each sentence.

DFNUMBKR,及び探索木のbackedgeが第
7図のように求められる。ここで、DFNUMBlle
R(:n)は文nの訪問順序を示し、Lot(n)は、
文nからbackadge (深さ優先探索で、最終文
まで到達した時に通過しなかった枝)を辿って戻れる文
のDFNUMBERのうち最小のものである。さらに、
フロック分割43なるステップで、第7図の探索木に対
して第8図で示されるようにブロック分割がなされる。
DFNUMBKR and the backedge of the search tree are determined as shown in FIG. Here, DFNUMBlle
R(:n) indicates the visiting order of sentence n, and Lot(n) is
This is the smallest DFNUMBER of sentences that can be returned by tracing backward from sentence n (branches that were not passed when reaching the final sentence in depth-first search). moreover,
In a step called block division 43, the search tree of FIG. 7 is divided into blocks as shown in FIG.

これは、DFNUMBKR(n)=LOWCn)なる文
nを各ブロックの先頭とみなすことで実現できる。
This can be achieved by regarding the sentence n, DFNUMBKR(n)=LOWCn), as the beginning of each block.

発明の効果 本発明は、以上説明したように構成されているので、以
下に記載されるような効果を奏する。
Effects of the Invention Since the present invention is configured as described above, it produces the effects described below.

プログラムのブロック分割に深さ優先探索を利用するこ
とで、プログラムを入出力フローを唯一つだけ持つよう
なブロックに簡単に分割することが可能となる。
By using depth-first search to divide a program into blocks, it becomes possible to easily divide the program into blocks that have only one input/output flow.

そして、データ依存関係を有するループ間の同期処理位
置決定にブロック分割を利用することで、冗長な同期の
除去を含めて、位置決定を簡単に行うことが可能となる
By using block division to determine the position of synchronization processing between loops having data dependence, it becomes possible to easily determine the position, including the removal of redundant synchronization.

さらに、逐次型プログラムの並列型プログラムへの変換
に、上記同期処理位置決定方法を利用することで、比較
的簡単に同期処理位置の少ない並列型プログラムが得ら
れるプログラム変換装置が実現できる。
Furthermore, by using the above-mentioned synchronous processing position determining method for converting a sequential program into a parallel program, a program conversion device that can relatively easily obtain a parallel program with fewer synchronous processing positions can be realized.

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

第1図は本発明のプログラム変換装置の一実施例の全体
構成を示すブロック図、第2図は本発明の同期処理位置
決定方法の一実施例の詳細を示す流れ図、第3図は冗長
な同期を取シ除くステップを示す図、第4図は本発明の
ブロック分割方法の一実施例の詳細を示す流れ図、第5
図は被対象プログラムの一例を示す図、第6図は第6図
のループに対して作成されたフローグラフ、第7図は第
6図のフローグラフに対して深さ優先探索を行ったとき
の探索木図、第8図は第7図の探索木に対してブロック
分割を行った時のブロック分割図である。 11・・・・・・プログラム解析部、12・・・・・・
同期処理位置決定部、13・・・・・・並列コード生成
部、21・・・・・・ブロック分割、22・・・・・・
同期処理位置の初期決定、23・・・・・・冗長な同期
の除去、41・・・・・・フローグラフの作成、42・
・・・・・深さ優先探索、43・・・・・・フロック分
割。 代理人の氏名 弁理士 粟 野 重 孝 ほか1名第1
図 第 3 図 beI+n チc1.−  jam、m−1,・・ 、1f□r D
I、 2. ・・、m 1+@1lln rf 5vII(+、コ)a+  ℃Pler+d。 +or M、 −、J 子v町・・・、m 5YN(1,k)−0 一 nd wi2図 第 42 ■   Do 101〜1.N ■    K婁2+L ■    Do 20 J−1,N C(f)−J εLSE C(1◆2)#司 10 cONTINuE LOW[+]”l■0FNL114BεI?[+]、1
10■8−−1 13■f1 : bac神dge 第6図 壷 ■−■ +    ◆ ■  ■ 第8図
FIG. 1 is a block diagram showing the overall configuration of an embodiment of the program conversion device of the present invention, FIG. 2 is a flowchart showing details of an embodiment of the synchronous processing position determination method of the present invention, and FIG. FIG. 4 is a flowchart showing details of an embodiment of the block division method of the present invention; FIG.
The figure shows an example of the target program, Figure 6 is a flow graph created for the loop in Figure 6, and Figure 7 is when depth-first search is performed on the flow graph in Figure 6. FIG. 8 is a block division diagram when the search tree of FIG. 7 is divided into blocks. 11...Program analysis department, 12...
Synchronous processing position determination unit, 13... Parallel code generation unit, 21... Block division, 22...
Initial determination of synchronization processing position, 23... Removal of redundant synchronization, 41... Creation of flow graph, 42.
...Depth-first search, 43...Flock division. Name of agent: Patent attorney Shigetaka Awano and 1 other person 1st
Figure 3 Figure beI+n Chi c1. - jam, m-1,..., 1f□r D
I, 2. ..., m 1+@1lln rf 5vII (+, ko) a+ ℃Pler+d. +or M, -, J Child v town..., m 5YN(1,k)-0 1st wi2 Figure 42 ■ Do 101~1. N ■ K婁2+L ■ Do 20 J-1, N C(f)-J εLSE C(1◆2)#TSUKASA10 cONTINuE LOW[+]”l■0FNL114BεI?[+], 1
10■8--1 13■f1: bac god dge Fig. 6 jar ■-■ + ◆ ■ ■ Fig. 8

Claims (3)

【特許請求の範囲】[Claims] (1)プログラムの繰り返し構造が複雑な制御構造を含
み、その中にデータ依存関係を有する場合、前記繰り返
し構造を、入出力フローが共に唯一つであるブロックに
分割するブロック分割方法。
(1) A block division method that divides the repetitive structure of a program into blocks having only one input/output flow when the repetitive structure of the program includes a complicated control structure and has data dependencies therein.
(2)繰り返し構造を、分割して並列に処理する場合、
データ依存関係による並列処理プロセス間の同期命令の
実行位置を、請求項1記載のブロック分割方法により決
定する同期処理位置決定方法。
(2) When dividing a repeating structure and processing it in parallel,
2. A synchronous processing position determining method for determining the execution position of a synchronous instruction between parallel processing processes based on data dependence using the block division method according to claim 1.
(3)逐次型言語で記述されたプログラムを並列処理用
に変換するとき、請求項2記載の同期命令位置決定方法
を用いるプログラム変換装置。
(3) A program conversion device that uses the synchronous instruction position determination method according to claim 2 when converting a program written in a sequential language to one for parallel processing.
JP31907688A 1988-12-16 1988-12-16 Block dividing method and synchronizing process position deciding method for program repeating structure and program converting device Pending JPH02163833A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP31907688A JPH02163833A (en) 1988-12-16 1988-12-16 Block dividing method and synchronizing process position deciding method for program repeating structure and program converting device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP31907688A JPH02163833A (en) 1988-12-16 1988-12-16 Block dividing method and synchronizing process position deciding method for program repeating structure and program converting device

Publications (1)

Publication Number Publication Date
JPH02163833A true JPH02163833A (en) 1990-06-25

Family

ID=18106233

Family Applications (1)

Application Number Title Priority Date Filing Date
JP31907688A Pending JPH02163833A (en) 1988-12-16 1988-12-16 Block dividing method and synchronizing process position deciding method for program repeating structure and program converting device

Country Status (1)

Country Link
JP (1) JPH02163833A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2015001807A (en) * 2013-06-14 2015-01-05 株式会社デンソー Parallelization compilation method, parallelization compiler, parallelization compilation device, and on-vehicle device

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2015001807A (en) * 2013-06-14 2015-01-05 株式会社デンソー Parallelization compilation method, parallelization compiler, parallelization compilation device, and on-vehicle device

Similar Documents

Publication Publication Date Title
JPH04307625A (en) Loop optimization system
JP2580592B2 (en) Data structure driven processor and control method thereof
JPS6267634A (en) Generation of object code for making input data coincide with output data structure
JPH03116281A (en) Logic synthesizing device
JPH02163833A (en) Block dividing method and synchronizing process position deciding method for program repeating structure and program converting device
JPH10187461A (en) Language processing system
JPS62217325A (en) Optimization system for assembler code
JPH09288580A (en) Device and method for optimizing source program
JP2748582B2 (en) Compile processing unit
JP2001154998A (en) Parallel analysis instructing method and device for parallel general associated analysis
JPH01199233A (en) Conditional branch control system for pipeline processing
JPS6297031A (en) Matching system for bit number of mantissa part
JPH10105387A (en) Sdl/program code mutual conversion system
JPH0241572A (en) Logic circuit synthesizing system
JPS62259142A (en) Processing system for instruction scheduling
JP2682206B2 (en) Optimization method of target program
JPH04248675A (en) Lsi design supporting device
JPH0573607A (en) Vector instruction generation processing method
JPH08115220A (en) Loop optimization method
JP3373861B2 (en) Compile processing unit
JPH04340628A (en) Fuzzy inference process compile system
JPH052487A (en) Language processing system
JPH03282826A (en) Parallel conversion translating system
JPS63314675A (en) Loop unrolling processing method
JPH02110669A (en) Vectorization processing method