JPH0363728A - Optimumizing system for exclusive control - Google Patents
Optimumizing system for exclusive controlInfo
- Publication number
- JPH0363728A JPH0363728A JP19902789A JP19902789A JPH0363728A JP H0363728 A JPH0363728 A JP H0363728A JP 19902789 A JP19902789 A JP 19902789A JP 19902789 A JP19902789 A JP 19902789A JP H0363728 A JPH0363728 A JP H0363728A
- Authority
- JP
- Japan
- Prior art keywords
- exclusive control
- sentences
- movement
- section
- target section
- 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
Links
Landscapes
- Devices For Executing Special Programs (AREA)
Abstract
Description
【発明の詳細な説明】
(産業上の利用分野)
本発明は、高級プログラミング言語のコンパイラにかけ
る排他制御の最適化方式に関する。DETAILED DESCRIPTION OF THE INVENTION (Field of Industrial Application) The present invention relates to an optimization method for exclusive control applied to a compiler of a high-level programming language.
(従来の技術) 従来、プログラム中の排他制御の開始処理。(Conventional technology) Conventionally, exclusive control start processing in a program.
および終了処理の実行によるオーバヘッド時間を減らす
ためには、排他制御する文が連続するように利用者がプ
ログラムを記述して、排他制御の開始および終了の処理
回数を減らす必要があった。In order to reduce the overhead time due to the execution of the termination process, it is necessary for the user to write the program so that the exclusive control statements are consecutive, thereby reducing the number of times the exclusive control is started and terminated.
(発明が解決しようとする課題)
上述した従来の方式では、利用者が又聞の依存関係など
を意識して、プログラムを作成しなければならないとい
う煩わしさがあった。また。(Problems to be Solved by the Invention) The conventional system described above has the trouble of requiring the user to create a program while being aware of the dependencies between programs. Also.
排他制御する文が連続的に現れるように利用者が意識し
てプログラムを作成すると1文の出現順序がプログラム
の流れとは異なり、そのドキュメント性が低下するとい
う欠点があった。If a user consciously creates a program so that exclusive control statements appear consecutively, the order in which the sentences appear will be different from the flow of the program, resulting in a deterioration in documentation quality.
本発明の目的は、コンパイラでプログラム中の文を並び
かえることによジ上記欠点を除去し。An object of the present invention is to eliminate the above drawbacks by rearranging the statements in a program using a compiler.
ドキュメント性の低下することがないように構成した排
他制御の最適化方式を提供することにある。An object of the present invention is to provide an optimization method for exclusive control configured so as not to reduce document quality.
(課題を解決するための手段)
本発明による排他制御の最適化方式は移動対象区間検出
手段と、移動可能性判定手段と、移動処理手段と金具備
して構成したものである。(Means for Solving the Problems) The exclusive control optimization method according to the present invention includes a movement target section detection means, a movement possibility determination means, a movement processing means, and a metal fitting.
移動対象区間検出手段は、マルチプロセサでの実行を記
述可能な高級プログラミング言語を翻訳するコンパイラ
に入力された原始プログラムから、排他制御する文の集
まりとしての排他制御区間に挾1れた排他制御しない文
の集1りとしての移動対象区間全検出するためのもので
ある。The movement target section detecting means detects non-exclusively controlled statements, which are a collection of exclusive-controlled statements, that are inserted into an exclusive-controlled section from a source program input to a compiler that translates a high-level programming language that can describe execution on multiple processors. This is for detecting the entire movement target section as a collection.
移動可能性判定手段は、移動対象区間の文を一文づつ取
出し、その文が直前、あるいは直後の排他制御区間内の
すべての文と依存関係がなく移動可能か否かを判定し、
移動対象区間のすべての文について移動可能か否かの判
定が終了した後で、移動対象区間のすべての文が直前の
排他制御区間の前、あるいは直後の排他制御区間の後ろ
のいずれかに移動可能か否かを判定するためのものであ
る。The movement possibility determining means extracts the sentences in the movement target section one by one, and determines whether the sentence can be moved without having a dependency relationship with all the sentences in the exclusive control section immediately before or after,
After it has been determined whether or not all sentences in the movement target section can be moved, all sentences in the movement target section are moved either before the immediately preceding exclusive control section or after the immediately following exclusive control section. This is to determine whether or not it is possible.
移動処理手段は、移動可能性判定手段で移動可能と判定
した移動対象区間のすべての文t−直前の排他制御区間
の前、あるいは直後の排他制御区間の後ろに移動すると
ともに、移動対象区間の文の移動で連続になった2つの
排他制御区間をひとつの排他制御区間に変更するための
ものである。The movement processing means moves all the sentences in the movement target section determined to be movable by the movement possibility determining means to the front of the immediately preceding exclusive control section or after the immediately following exclusive control section, and also This is for changing two consecutive exclusive control sections due to statement movement into one exclusive control section.
(実施例)
次に1本発明の実施例について図面を参照して説明をす
る。(Example) Next, an example of the present invention will be described with reference to the drawings.
第1図は1本発明による排他制御の最適化方式の一実施
例を示すブロック構成図である。FIG. 1 is a block diagram showing an embodiment of an exclusive control optimization method according to the present invention.
第1図にかいて、lは原始プログラム、2はコンパイラ
、lOは移動対象区間検出手段、20は移動可能性判定
手段、30は移動処理手段である。In FIG. 1, 1 is a source program, 2 is a compiler, 10 is a movement target section detection means, 20 is a movement possibility determination means, and 30 is a movement processing means.
コンパイラ2は移動対象区間検索手段lOと。The compiler 2 is a movement target section search means lO.
移動可能性判定手段20と、移動処理手段30とを備え
ている。It includes a movement possibility determining means 20 and a movement processing means 30.
コンパイラ2の移動対象区間検索手段10では。In the movement target section search means 10 of the compiler 2.
入力された原始プログラム1から移動対象区間を検索し
て取出す。移動可能性判定手段20は。Search and extract the movement target section from the input source program 1. The movement possibility determining means 20 is.
検索された移動対象区間の文と直前、あるいは直後の排
他制御区間のすべての文との依存関係を調べて、直前の
排他制御区間の前、あるいは直後の排他制御に移動cI
T能か否か七判定する。Checks the dependencies between the searched statement in the movement target section and all statements in the immediately preceding or following exclusive control section, and moves to the exclusive control section before or after the immediately preceding exclusive control section cI
Seven judgments are made as to whether it is T-noh or not.
移動処理手段30は、移動可能と判定された移動対象区
間のすべての文を、直前の排他制御区間の前、あるいは
直後の排他制御区間の後ろに移動する。それらの移動の
結果、連続的になった排他制御区間がひとつの排他制御
区間になるように変更する。The movement processing means 30 moves all sentences in the movement target section determined to be movable to the front of the immediately preceding exclusive control section or after the immediately following exclusive control section. As a result of these movements, the continuous exclusive control sections are changed into one exclusive control section.
第2図は、FORTRAN言語で記述した原始プログラ
ム1の一例と、原始プログラム1を最適化した後の原始
プログラムの一例を示す説明図である。FIG. 2 is an explanatory diagram showing an example of the source program 1 written in the FORTRAN language and an example of the source program after the source program 1 has been optimized.
原始プログラム1は排他制御区間文110゜210、お
よび排他制御区間文190,290を備えている。筐た
。排他制御区間110a内には文120,130.排他
制御区間210a内には文21O1移動対象区間310
a内には文310,320を含んでいる。The source program 1 includes exclusive control interval statements 110, 210, and exclusive control interval statements 190 and 290. It was a cabinet. In the exclusive control section 110a, statements 120, 130 . In the exclusive control section 210a, there is a statement 21O1 moving target section 310.
Sentences 310 and 320 are included in a.
コンパイラ2の移動対象区間検索手段10は、入力され
た原始プログラムlの移動対象区間310at−検索す
る。The migration target section search means 10 of the compiler 2 searches for the migration target section 310at of the input source program l.
移動可能性判定手段20は、移動対象区間310aの文
310を取出し、直前の排他制御区間110aのすべて
の文120,130との依存関係を調べる。その結果1
文310は文120,130の両方と依存関係があるの
で、排他制御区間110aの前に移動できないと判定す
る。The movement possibility determining means 20 extracts the sentence 310 of the movement target section 310a, and examines the dependency relationship with all the sentences 120 and 130 of the immediately preceding exclusive control section 110a. Result 1
Since statement 310 has a dependency relationship with both statements 120 and 130, it is determined that it cannot be moved before exclusive control section 110a.
また1文310は直後の排他制御区間210aの文22
0と依存関係がないので、排他制御区間210aの後方
に移動できると判定する。Also, the first sentence 310 is the sentence 22 in the exclusive control section 210a immediately after.
Since there is no dependency relationship with 0, it is determined that it is possible to move to the rear of the exclusive control section 210a.
同様に1文320についても文の移動判定を行うと、排
他制御区間110aの前には移動可能、排他制御区間2
10aの後方には移動不可能となる。Similarly, when the sentence movement judgment is performed for the first sentence 320, it is found that it is possible to move before the exclusive control section 110a,
It becomes impossible to move behind 10a.
移動対象区間310aのすべての文について。Regarding all the sentences in the movement target section 310a.
文の移動可能性の判定が終了した後に、移動対象区間3
10aの移動可能性を判定する。判定の結果、移動対象
区間310aの文310を直後の排他制御区間220a
の後方に移動し、さらに文320を直前の排他制御区間
110aの前に移動しても、その依存関係を保てるので
、移動対象区間310ai移動可能と判定する。After the determination of the possibility of moving the sentence is completed, move target section 3
The possibility of movement of 10a is determined. As a result of the determination, the statement 310 in the movement target section 310a is moved to the immediately following exclusive control section 220a.
Even if the statement 320 is moved backwards and further before the immediately preceding exclusive control section 110a, the dependency relationship can be maintained, so it is determined that the movement target section 310ai can be moved.
移動処理手段30は、移動可能性判定手段20で移動可
能と判定された移動対象区間310aの文310,32
0t−その判定に従って移動させる。文の移動の結果、
連続になった制御区間110a 、210aから排他制
御区間文190と排他制御区間文210とを削除して、
ひとつの排他制御区間410aに変更する。The movement processing means 30 processes the sentences 310 and 32 of the movement target section 310a determined to be movable by the movement possibility determination means 20.
0t - Move according to the determination. As a result of sentence movement,
By deleting the exclusive control interval statement 190 and the exclusive control interval statement 210 from the continuous control intervals 110a and 210a,
The exclusive control section 410a is changed to one exclusive control section 410a.
原始プログラム1aは、排他制御の最適化が終了した後
の原始プログラム1である。The source program 1a is the source program 1 after exclusive control optimization has been completed.
(発明の効果)
以上説明したように本発明は、コンパイラでプログラム
中の文を並びかえることにょ9.複数の非連続な排他制
御区間をひとつの連続した排他制御区間に変換できると
云う効果がある。(Effects of the Invention) As explained above, the present invention allows the compiler to rearrange statements in a program.9. This has the effect of converting a plurality of discontinuous exclusive control sections into one continuous exclusive control section.
そのため、利用者が排他制御の最適化を意識することな
しに、排他制御の開始処理および終了処jiK伴うオー
バヘッド時間を削減して実行時間の短縮を図ることがで
きると云う効果がある。Therefore, there is an effect that the execution time can be shortened by reducing the overhead time accompanying the exclusive control start processing and termination processing jiK without the user being aware of exclusive control optimization.
第1図は1本発明による排他制御の最適化方式の一実施
例を示すブロック構成図である。第2図は、入力する原
始プログラムの一例と、その原始プログラムに対して排
他制御の最適化が終了した後の一例金示す説明図である
。
1・・・原始プログラム
1a・・・最適化した原始プログラム
2・・・コンパイラ
10・・・移動対象区間検索手段
20・・・移動可能性判定手段
30・・・移動処理手段
110.210・・・排他制御区間文
190.290・・・排他制御区間文
120.130,310,320・・・文110a 、
210a 、410a・・・排他制御区間
310a・・・移動対象区間FIG. 1 is a block diagram showing an embodiment of an exclusive control optimization method according to the present invention. FIG. 2 is an explanatory diagram showing an example of an input source program and an example of the result after exclusive control optimization has been completed for the source program. 1... Source program 1a... Optimized source program 2... Compiler 10... Movement target section search means 20... Movement possibility determination means 30... Movement processing means 110.210... - Exclusive control section statement 190.290...Exclusive control section statement 120.130, 310, 320...Statement 110a,
210a, 410a...Exclusive control section 310a...Movement target section
Claims (1)
グ言語を翻訳するコンパイラに入力された原始プログラ
ムから、排他制御する文の集まりとしての排他制御区間
に挾まれた排他制御しない文の集まりとしての移動対象
区間を検出するための移動対象区間検出手段と、前記移
動対象区間の文を一文づつ取出し、前記取出された文が
直前、あるいは直後に置かれた前記排他制御区間内のす
べての文と依存関係がなく移動可能か否かを判定し、前
記移動対象区間のすべての文について移動可能か否かの
判定が終了した後で、前記移動対象区間のすべての文が
、前記直前の排他制御区間の前、あるいは直後の排他制
御区間の後ろのいずれかに移動可能か否かを判定するた
めの移動可能性判定手段と、前記移動可能性判定手段で
移動可能と判定された前記移動対象区間のすべての文を
前記直前の排他制御区間の前、あるいは直後の排他制御
区間の後ろに移動するとともに、前記移動対象区間の文
の移動で連続になつた2つの排他制御区間をひとつの排
他制御区間に変更するための移動処理手段とを具備して
構成したことを特徴とするコンパイラの排他制御の最適
化方式。From a source program input to a compiler that translates a high-level programming language that can describe execution on multiple processors, the movement target section is a collection of statements that are not under exclusive control and is sandwiched in an exclusive control section that is a collection of statements that are under exclusive control. A moving target section detecting means for detecting the moving target section, and extracting the sentences of the moving target section one by one, so that the extracted sentences have no dependency relationship with all the sentences in the exclusive control section placed immediately before or after the moving target section. After determining whether or not it is possible to move, and after determining whether or not all sentences in the movement target section can be moved, all sentences in the movement target section are moved before the immediately preceding exclusive control section. or a movement possibility determining means for determining whether or not it is possible to move to any of the following exclusive control sections, and all sentences in the movement target section that are determined to be movable by the movement possibility determining means. is moved to the front of the immediately preceding exclusive control section or after the immediately following exclusive control section, and the two exclusive control sections that became continuous by moving the statement in the movement target section are changed into one exclusive control section. 1. An optimization method for exclusive control of a compiler, characterized in that it is configured to include a movement processing means for.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP19902789A JP2958985B2 (en) | 1989-07-31 | 1989-07-31 | Exclusive control optimization method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP19902789A JP2958985B2 (en) | 1989-07-31 | 1989-07-31 | Exclusive control optimization method |
Publications (2)
Publication Number | Publication Date |
---|---|
JPH0363728A true JPH0363728A (en) | 1991-03-19 |
JP2958985B2 JP2958985B2 (en) | 1999-10-06 |
Family
ID=16400900
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP19902789A Expired - Fee Related JP2958985B2 (en) | 1989-07-31 | 1989-07-31 | Exclusive control optimization method |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP2958985B2 (en) |
-
1989
- 1989-07-31 JP JP19902789A patent/JP2958985B2/en not_active Expired - Fee Related
Also Published As
Publication number | Publication date |
---|---|
JP2958985B2 (en) | 1999-10-06 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
TW356540B (en) | Method for operating a computer program on a computer readable media for execution by a vector processor and by a dual multiprocessor including a vector processor and a RISC processor | |
BR9914549A (en) | Apparatus and method for the construction of modeling tools | |
EP0742512A3 (en) | Method and apparatus for reordering memory operations in a superscalar or very long instruction word processor | |
EP0735468A3 (en) | Method and apparatus for an optimizing compiler | |
ATE423351T1 (en) | METHOD FOR RESTORING A CALCULATION STATE | |
ATE181161T1 (en) | DATA PROCESSING SYSTEM AND OPERATING PROCEDURES | |
DE60143757D1 (en) | METHOD AND DEVICE FOR USING AN AUXILIARY COMPUTER FOR COMMAND PREVENTING A MAIN PROCESSOR | |
US5522074A (en) | Vectorization system for vectorizing loop containing condition induction variables | |
JPH0363728A (en) | Optimumizing system for exclusive control | |
JP2871693B2 (en) | Critical section optimization method | |
JPH0659905A (en) | Parallel processing system for compiler | |
JPS6297031A (en) | Matching system for bit number of mantissa part | |
JP2564904B2 (en) | Program optimization processing method | |
JPH04116756A (en) | Dynamic link system for user definition command in application | |
JPH08263298A (en) | Compiler device | |
JP2590288B2 (en) | Program conversion device | |
JPS63271636A (en) | Macroprocessor for language | |
JPH0668128A (en) | Morpheme analysis processing method | |
JPH0377141A (en) | compilation processing unit | |
JPS62187940A (en) | Loop control processing method | |
JPH0319041A (en) | Automatic control system for control item | |
JPH0210433A (en) | Reserved work deciding system | |
JPH04323731A (en) | Optimized text editing system | |
JPH05313910A (en) | Machine word instruction generating system | |
JPH04101228A (en) | Language processor |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
LAPS | Cancellation because of no payment of annual fees |