JP3239830B2 - Transfer instruction optimization apparatus and method - Google Patents

Transfer instruction optimization apparatus and method

Info

Publication number
JP3239830B2
JP3239830B2 JP01555098A JP1555098A JP3239830B2 JP 3239830 B2 JP3239830 B2 JP 3239830B2 JP 01555098 A JP01555098 A JP 01555098A JP 1555098 A JP1555098 A JP 1555098A JP 3239830 B2 JP3239830 B2 JP 3239830B2
Authority
JP
Japan
Prior art keywords
instruction
transfer instruction
operand
transfer
text
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
JP01555098A
Other languages
Japanese (ja)
Other versions
JPH11212800A (en
Inventor
良彰 廣谷
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
NEC Corp
Original Assignee
NEC Corp
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 NEC Corp filed Critical NEC Corp
Priority to JP01555098A priority Critical patent/JP3239830B2/en
Publication of JPH11212800A publication Critical patent/JPH11212800A/en
Application granted granted Critical
Publication of JP3239830B2 publication Critical patent/JP3239830B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Landscapes

  • Devices For Executing Special Programs (AREA)

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【発明の属する技術分野】この発明は、コンパイラによ
ってソースプログラムから生成する命令列あるいは中間
テキスト列の最適化に関し、特に移送命令を削除する移
送命令最適化装置および方法に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to optimization of an instruction sequence or an intermediate text sequence generated from a source program by a compiler, and more particularly to a transfer instruction optimizing apparatus and method for deleting a transfer instruction.

【0002】[0002]

【従来の技術】コンパイラの最適化に関する参照文献の
土居範久著「コンパイラ」培同館、ページ440〜ペー
ジ442によれば、移送命令(A=Bの形の単純な代入
処理であり、左辺のレジスタやメモリなどの記憶領域
「A」に右辺のレジスタやメモリなどの記憶領域の値や
定数値「B」を複写する処理)削減のためのコンパイラ
における最適化技法に複写伝播手段がある。この最適化
技法は、移送命令(A=B)以降の移送命令の左辺オペ
ランドAの参照の全てを右辺オペランドBの値によって
置き換えることにより移送命令を不要になるようにし、
移送命令を削減する方法であった。たとえば、以下に複
写伝播処理前と複写伝播処理後の命令列を例示するよう
に、オペランドAの値をオペランドBに置換することで
移送命令(A=B)が削除されて、移送命令の最適化が
実施される。
2. Description of the Related Art According to Norihisa Doi, "Compiler", Bundokan, pages 440 to 442, which is a reference on compiler optimization, a transfer instruction (a simple assignment process in the form of A = B, A process of copying the value of a storage area such as a register or a memory on the right side or a constant value “B” into a storage area “A” such as a register or a memory) includes a copy propagation means as an optimization technique in a compiler for reduction. This optimization technique eliminates the need for a transfer instruction by replacing all references to the left operand A of the transfer instruction following the transfer instruction (A = B) with the value of the right operand B,
It was a method to reduce the transfer orders. For example, the transfer instruction (A = B) is deleted by replacing the value of the operand A with the operand B, as shown below as an example of the instruction sequence before the copy propagation processing and after the copy propagation processing. Is implemented.

【0003】 複写伝播処理前の命令列 複写伝播処理後の命令列 A=B (削除された) X=A+C X=B+C Y=A/2.0 Y=B/2.0 更に、複写伝播方式の例が、特開平4−17031号公
報に記載されている。この公報に記載された複写伝播方
式は、移送命令の右辺が定数の場合の例であり、移送命
令以降の左辺の値の参照を右辺の定数値によって置き換
えることにより不要移送命令を削減する方式である。こ
のように、従来の複写伝播方式は、移送命令の左辺のオ
ペランドの参照を右辺のオペランドで置き換えることに
よって行われていた。
Instruction sequence before copy propagation process Instruction sequence after copy propagation process A = B (deleted) X = A + C X = B + CY Y = A / 2.0 Y = B / 2.0 Is described in JP-A-4-17031. The copy propagation system described in this publication is an example in which the right side of a transfer instruction is a constant, and the unnecessary transfer instruction is reduced by replacing the reference of the value on the left side after the transfer instruction with the constant value on the right side. is there. As described above, the conventional copy propagation method is performed by replacing the reference of the operand on the left side of the transfer instruction with the operand on the right side.

【0004】[0004]

【発明が解決しようとする課題】第1の問題点は、移送
命令を削除できる命令列のパターンが限られるという点
である。その理由は、移送命令の左辺のオペランドの全
ての参照が右辺のオペランドによって置き換えられる前
に、右辺オペランドの新たな定義命令が出現すると、右
辺オペランドの値が変更され、移送命令の時点での値と
異なるため、その定義命令以降の左辺オペランドの置換
はできないためであり、結果として移送命令の削除がで
きなくなる。以下は、従来の複写伝播方式では移送命令
が削除できない命令列の例である。
A first problem is that the pattern of an instruction sequence from which a transfer instruction can be deleted is limited. The reason is that if a new definition instruction for the right-hand operand appears before all references to the left-hand operand of the transfer instruction are replaced by the right-hand operand, the value of the right-hand operand is changed, and the value at the time of the transfer instruction is changed. Therefore, the left operand cannot be replaced after the definition instruction, and as a result, the transfer instruction cannot be deleted. The following is an example of an instruction sequence in which a transfer instruction cannot be deleted by the conventional copy propagation method.

【0005】A=B B=X/2.0 Y=A+C 第三の命令(Y=A+C)のオペランドAの値は、オペ
ランドBで置換できない(第二の命令B=X/2.0で
オペランドBの値が変更されているため)ので、移送命
令A=Bは削除できない。
A = B B = X / 2.0 Y = A + C The value of the operand A of the third instruction (Y = A + C) cannot be replaced by the operand B (the second instruction B = X / 2.0 Since the value of the operand B has been changed), the transfer instruction A = B cannot be deleted.

【0006】この発明の目的は、移送命令を含む命令列
において移送命令の右辺の定義命令が現れる場合に対し
て、その移送命令を削除できる条件を判定して削除する
装置および方法を提供することである。
SUMMARY OF THE INVENTION An object of the present invention is to provide an apparatus and a method for determining, when a definition instruction on the right-hand side of a transfer instruction appears in an instruction sequence including the transfer instruction, a condition under which the transfer instruction can be deleted and deleting the same. It is.

【0007】[0007]

【課題を解決するための手段】この発明の移送命令削除
のための移送命令最適化装置および方法は、移送命令の
左辺オペランドの参照を右辺オペランドで置換するので
はなく、逆に、右辺オペランドの参照を左辺オペランド
によって置換する。そのために、従来の移送命令削除を
行う複写伝播処理手段に、新たな削除対象である移送命
令の右辺オペランドの定義命令を見つけ、移送命令以降
の命令列における移送命令の左辺オペランドによる置換
ができるか否かを判定し、全ての命令列を走査しながら
左辺オペランドによる右辺オペランドの置換判定処理お
よび置換処理を行い、全ての置換処理を終了した時点で
移送命令の削除処理を行う拡張複写伝播処理手段を付加
する。この拡張複写伝播処理手段は、移送命令の削除と
ともに、この移送命令の右辺オペランドの定義テキスト
における左辺オペランドを移送命令の左辺オペランドで
置換する。移送命令は、全ての右辺オペランドの参照を
左辺オペランドに置換することで削除される。また、移
送命令の左辺オペランドの値は右辺オペランドの定義命
令で計算されるように変更する。このため、右辺オペラ
ンドの新たな定義命令が出現し右辺オペランドの値が変
更されても、これ以降参照される移送命令の左辺オペラ
ンドの値は、右辺オペランドの定義命令の結果として得
られているためオペランド置換を行うことなく移送命令
を削除できる。
SUMMARY OF THE INVENTION A transfer instruction optimizing apparatus and method for deleting a transfer instruction according to the present invention does not replace the reference of the left-hand operand of the transfer instruction with the right-hand operand. Replace the reference with the left operand. For this reason, the copy propagation processing means for deleting the transfer instruction finds the definition instruction of the right-hand operand of the transfer instruction to be newly deleted, and can replace the transfer instruction with the left-hand operand of the transfer instruction in the instruction sequence after the transfer instruction? Extended copy propagation processing means for determining whether or not the instruction has been scanned, performing a replacement determination process and a replacement process for the right-hand operand by the left-hand operand while scanning all the instruction strings, and deleting the transfer instruction when all the replacement processes are completed. Is added. The extended copy propagation processing means replaces the left side operand in the definition text of the right side operand of the transfer instruction with the left side operand of the transfer instruction while deleting the transfer instruction. The transfer instruction is deleted by replacing all references to the right-hand operand with the left-hand operand. Further, the value of the left operand of the transfer instruction is changed so as to be calculated by the definition instruction of the right operand. For this reason, even if a new definition instruction of the right-hand operand appears and the value of the right-hand operand is changed, the value of the left-hand operand of the transfer instruction referred to thereafter is obtained as a result of the definition instruction of the right-hand operand. The transfer instruction can be deleted without performing operand replacement.

【0008】[0008]

【発明の実施の形態】次に、この発明の実施の形態につ
いて図面を参照して説明する。移送命令最適化装置の実
施の形態の構成を示す図1を参照すると、ソースプログ
ラムファイルを保持する原始プログラム1と、ソースプ
ログラムを入力し字句解析や構文解析などを行って中間
テキストを生成する中間プログラム生成手段2と、生成
された中間テキストを保持する中間プログラム3と、中
間テキストを入力し最適化を施した中間テキストに変換
する中間テキスト最適化手段4と、最適化後の中間テキ
ストを入力し目的プログラムに変換する目的プログラム
生成手段5と、目的プログラムを保持する目的プログラ
ム6と、を含む。
Next, an embodiment of the present invention will be described with reference to the drawings. Referring to FIG. 1 showing the configuration of an embodiment of a transfer instruction optimizing apparatus, a source program 1 for holding a source program file and an intermediate program for inputting a source program and performing lexical analysis and syntax analysis to generate an intermediate text A program generating means 2, an intermediate program 3 for holding the generated intermediate text, an intermediate text optimizing means 4 for inputting the intermediate text and converting it to an optimized intermediate text, and inputting the optimized intermediate text And a target program generating means 5 for converting the target program into a target program, and a target program 6 for holding the target program.

【0009】中間テキスト最適化手段4は、中間プログ
ラム3中の中間テキスト列に対して、共通式削除処理や
不変式のループ外への移動などの一般的なテキスト列の
最適化を行うほか、従来の複写伝播処理を行う複写伝播
処理手段41と、この発明による移送命令の削除対象を
拡張した拡張複写伝播処理手段42と、を備える。従来
の複写伝播処理手段41で最適化されなかった移送命令
を行う中間テキストが、拡張複写伝播処理手段42で削
除条件が判定されて削除対象のテキストとなる。
The intermediate text optimizing means 4 performs general text sequence optimization such as common expression deletion processing and invariant expression moving out of the loop with respect to the intermediate text sequence in the intermediate program 3. It comprises a copy propagation processing means 41 for performing conventional copy propagation processing, and an extended copy propagation processing means 42 for extending the transfer instruction deletion target according to the present invention. The intermediate text that performs a transfer instruction that has not been optimized by the conventional copy propagation processing means 41 becomes the text to be deleted after the extended copy propagation processing means 42 determines the deletion condition.

【0010】次に、この発明の実施の形態の動作につい
て図1を援用し、図2を参照して説明する。図1におい
て、原始プログラム1はコンパイラの中間プログラム生
成手段2により中間テキスト列に変換され、中間プログ
ラム3に蓄積される。中間プログラム3中の中間テキス
ト列は、中間テキスト最適化手段4により最適化され
る。中間テキスト列内の移送命令は、複写伝播処理手段
41の対象テキストとなり、削除条件が判定されて、可
能なら削除される。削除できなかった移送命令は拡張複
写伝播処理手段42の対象テキストとなる。
Next, the operation of the embodiment of the present invention will be described with reference to FIG. In FIG. 1, a source program 1 is converted into an intermediate text string by an intermediate program generating means 2 of a compiler, and is stored in an intermediate program 3. The intermediate text string in the intermediate program 3 is optimized by the intermediate text optimizing means 4. The transfer instruction in the intermediate text string becomes the target text of the copy propagation processing means 41, and the deletion condition is determined and deleted if possible. The transfer instruction that could not be deleted becomes the target text of the extended copy propagation processing means 42.

【0011】図2は、この発明の移送命令削除の適用条
件を拡張した拡張複写伝播処理手段42の処理の流れで
ある。図中に示すは移送テキスト(命令)を、は移
送テキストの右辺オペランドの値を決定する定義テキス
ト(命令)を、は移送テキスト以後に現れる移送テキ
ストの右辺オペランドの定義テキスト(命令)をそれぞ
れ指している。図2を用いてこの発明の処理を説明す
る。複写伝播処理手段41により削除されなかった移送
テキストある場合(ステップ21)、移送テキスト
の右辺オペランドの値を決定している定義テキスト
をの前方の中間テキスト列から見つける(ステップ2
2)。定義テキストが見つからない場合は、以後の処
理を中断して終了する。定義テキストが見つかった場
合は、との間の中間テキストでの左辺のオペラン
ドが使用されているか否かを調べる(ステップ23)。
左辺および右辺のオペランドが使用されている場合は、
最適化不可であるため以後の処理を中断して終了する。
左辺および右辺のオペランドが使用されていなければ、
の次のテキストを取り出しフラグDEF_FLAGを
「0」にしておく(ステップ24)。以後のステップ2
5からステップ31までの処理を、中間テキストがなく
なるか、または、の右辺オペランドの新たな定義テキ
ストが現れるまで繰り返す。取り出された中間テキス
トにおいて、であるか否かを判定する(ステップ2
5)。定義テキストでない場合(ステップ25のYE
S)、の左辺オペランドの定義テキストであるか否か
を判定する(ステップ26)。定義テキストでない場合
(ステップ26のNO)、ステップ28へ移行する。定
義テキストである場合(ステップ26のYES)、フラ
グDEF_FLAGに「1」を設定してステップ28へ
移行する。ステップ28では、現在の中間テキストが
の右辺オペランドの参照テキストであるか判定する。参
照テキストでない場合(ステップ28のNO)、ステッ
プ31へ移行する。参照テキストであり(ステップ28
のYES)、既にフラグDEF_FLAGが「1」であ
れば(ステップ29のYES)、処理を中断し最適化を
終了する。DEF_FLAGが「1」でない場合(ステ
ップ29のNO)、現在の中間テキストにおけるの右
辺オペランドの参照をの左辺オペランドの参照で置換
する(ステップ30)。ステップ31では、現在の中間
テキストの次のテキストを取り出し、ステップ25から
の処理を繰り返す。ステップ25で、中間テキストがな
くなるか、または、のテキストが現れた場合は、ステ
ップ32に移行する。ステップ32では、の左辺オペ
ランドをの左辺オペランドで置換し移行テキストを
削除する。
FIG. 2 shows the flow of processing of the extended copy propagation processing means 42 in which the conditions for applying the transfer instruction deletion according to the present invention are extended. In the figure, the transfer text (instruction) indicates the definition text (instruction) for determining the value of the right operand of the transfer text, and the definition text (instruction) of the right operand of the transfer text appearing after the transfer text. ing. To explain the inventions of the processing of this with reference to FIG. 2. If a transfer text that were not removed by the copy propagation process unit 41 (step 21), found from the front of the middle text column definition text that determines the value of the right-hand operand transfer text (Step 2
2). If the definition text is not found, the subsequent processing is interrupted and the processing ends. If the definition text is found, it is checked whether or not the left operand is used in the intermediate text between (step 23).
If the left and right operands are used,
Since the optimization cannot be performed, the subsequent processing is interrupted and terminated.
If the left and right operands are not used,
The next text is taken out and the flag DEF_FLAG is set to "0" (step 24). Subsequent step 2
The processes from 5 to 31 are repeated until there is no intermediate text or a new definition text of the right-hand operand appears. In the extracted intermediate text, it is determined whether or not (step 2
5). If not a definition text (YE in step 25)
S), it is determined whether or not the text is a definition text of the left operand (step 26). If it is not a definition text (NO in step 26), the process proceeds to step 28. If the text is a definition text (YES in step 26), “1” is set in the flag DEF_FLAG, and the flow advances to step 28. In step 28, it is determined whether or not the current intermediate text is the reference text of the right-hand side operand. If it is not a reference text (NO in step 28), the process proceeds to step 31. Reference text (step 28
If the flag DEF_FLAG is already "1" (YES in step 29), the process is interrupted and the optimization is terminated. If DEF_FLAG is not "1" (NO in step 29), the reference of the right-hand operand in the current intermediate text is replaced with the reference of the left-hand operand (step 30). In step 31, the text following the current intermediate text is extracted, and the processing from step 25 is repeated. In step 25, if the intermediate text disappears or the text of appears, the process proceeds to step 32. In step 32, the left operand is replaced with the left operand, and the transition text is deleted.

【0012】次に、この実施の形態の動作を図3
(a),図3(b),図3(c)の具体例で説明する。
図3(a)は、複写伝播処理手段41で削除できない移
行テキストを含み、拡張複写伝播処理手段42の対象
となる中間テキスト列51である。移送テキストとそ
の左辺オペランドの参照テキストの間にの右辺オペ
ランドの定義テキストがあるため、従来の複写伝播処
理ではが削除できない。まず、ステップ22において
の移送テキストの右辺オペランドBの定義テキストを
見つける。見つかった定義テキストが(B=C*2.
0)である。との間では、オペランドAおよびオペ
ランドBは使用されていないのでステップ23はYES
となり、ステップ24に移行する。ステップ25での
次のテキスト、すなわち、(Z=B/2.0)を取り
出し以後の処理を行う。は、の右辺オペランドBの
定義テキストでないので、ステップ25はYESとな
り、ステップ26に移行する。さらに、は、の左辺
オペランドAの定義テキストでもないのでNOとなりス
テップ28に移行する。は、の右辺オペランドBを
参照しているが、フラッグDEF_FLAGが「0」の
ままなのでステップ30に移行する。ここで、のオペ
ランドBの参照をオペランドAの参照に変更する。この
時点での中間テキスト列が図3(b)の置換テキスト列
52である。
Next, the operation of this embodiment will be described with reference to FIG.
This will be described with reference to specific examples of FIGS. 3 (a), 3 (b) and 3 (c).
FIG. 3A shows an intermediate text string 51 that includes a transition text that cannot be deleted by the copy propagation processing unit 41 and is a target of the extended copy propagation processing unit 42. Since there is a definition text of the right operand between the transfer text and the reference text of the left operand, it cannot be deleted by the conventional copy propagation processing. First, in step 22, the definition text of the right-hand operand B of the transfer text is found. The found definition text is (B = C * 2.
0). Is not used, the operand A and the operand B are not used.
And the process proceeds to step 24. The next text in step 25, that is, (Z = B / 2.0) is extracted and the subsequent processing is performed. Is not the definition text of the right-hand operand B of step 25, so that the result of step 25 is YES, and the routine goes to step 26. Further, since is not the definition text of the operand A on the left-hand side, the result is NO, and the flow shifts to step 28. Refers to the operand B on the right side of, but since the flag DEF_FLAG remains “0”, the flow proceeds to step 30. Here, the reference of the operand B is changed to the reference of the operand A. The intermediate text string at this point is the replacement text string 52 in FIG.

【0013】つぎに、ステップ31でのつぎのテキス
トを取り出し、ステップ25からステップ31までを同
じように施す。中間テキストが取り出されると、の
右辺オペランドBの定義テキストであるため、ステップ
25はNOとなりステップ32に移行する。ここで、
の左辺オペランドBをの左辺オペランドAで置き換え
て、の移送テキストを削除する。この時点の中間テキ
スト列が図3(c)の削除テキスト列53である。
Next, the next text in step 31 is taken out, and steps 25 to 31 are performed in the same manner. When the intermediate text is extracted, since the text is the definition text of the right-hand operand B, step 25 is NO and the process proceeds to step 32. here,
Replace the left-hand operand B with the left-hand operand A and delete the transport text. The intermediate text string at this point is the deleted text string 53 in FIG.

【0014】[0014]

【発明の効果】第1の効果は、移送(命令)テキストを
含む(命令)テキスト列において、移送命令の右辺オペ
ランドの定義テキストが現れても、移送命令の削除が行
えるということである。これにより、コンパイラの最適
化において不要な移送命令を削除した効率の良い目的プ
ログラムを生成できる。
The first effect is that the transfer instruction can be deleted even if the definition text of the right-hand operand of the transfer instruction appears in the (instruction) text string including the transfer (instruction) text. This makes it possible to generate an efficient target program from which unnecessary transfer instructions have been deleted in the optimization of the compiler.

【0015】その理由は、移送命令以後の命令列におけ
る移送命令の右辺のオペランドの参照を移送命令の左辺
のオペランドによって置換し、また、右辺オペランドの
定義命令において左辺オペランドを移送命令の左辺オペ
ランドで置換するようにしたからである。
The reason is that the reference to the operand on the right side of the transfer instruction in the instruction sequence after the transfer instruction is replaced by the operand on the left side of the transfer instruction, and the left operand in the definition instruction of the right side operand is replaced by the left operand of the transfer instruction. This is because replacement is performed.

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

【図1】この発明の実施の形態の構成を示す図である。FIG. 1 is a diagram showing a configuration of an embodiment of the present invention.

【図2】図1の拡張複写伝播処理手段の動作を示す図で
ある。
FIG. 2 is a diagram showing the operation of an extended copy propagation processing means of FIG. 1;

【図3】移送命令を含む中間テキスト列の最適化を例示
する図である。
FIG. 3 is a diagram illustrating optimization of an intermediate text string including a transfer instruction.

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

1 原始プログラム 2 中間プログラム生成手段 3 中間プログラム 4 中間テキスト最適化手段 5 目的プログラム生成手段 6 目的プログラム 41 複写伝播処理手段 42 拡張複写伝播処理手段 DESCRIPTION OF SYMBOLS 1 Primitive program 2 Intermediate program generating means 3 Intermediate program 4 Intermediate text optimizing means 5 Object program generating means 6 Object program 41 Copy propagation processing means 42 Extended copy propagation processing means

Claims (3)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】 原始プログラムをコンパイルし、中間テ
キスト列を生成して蓄積する中間プログラムファイル
生成する中間プログラム生成手段と、 前記中間テキスト列から移送命令の削除条件を判定し、
削除可能な移送命令を削除する複写伝播処理手段を有す
中間テキスト最適化手段と、 前記削除可能な移送命令を削除した中間テキスト列から
目的プログラムを生成する目的プログラム生成手段と、 を備える移送命令最適化装置において、前記複写伝播処理手段が、 削除されない 移送命令に対して、前記移送命令より後方
の中間テキスト列で、前記移送命令の右辺のオペランド
の参照を前記移送命令の左辺のオペランドで置換し、前
記移送命令より前方の中間テキスト列で、前記移送命令
の右辺オペランドの定義命令に対して、前記定義命令の
左辺オペランドを前記移送命令の左辺オペランドで置換
し、前記移送命令を削除する拡張複写伝播処理手段を有
することを特徴とする移送命令最適化装置。
1. Compiling a source program,
Intermediate program file that generates and accumulates quist stringsTo
Intermediate program generation means to generateAnd determining the delete condition of the transfer instruction from the intermediate text string,
Delete transport instructions that can be deletedHas copy propagation processing means
ToIntermediate text optimizing means;
And a target program generating means for generating a target program.Transfer instruction optimizationIn the device,The copy propagation processing means, Not deleted For the transfer instruction, the transfer instructionMore backward
In the middle text string of the right-hand side operand of the transfer instruction
Is replaced with the operand on the left side of the transfer instruction,
Transfer instructionMore forwardIn the intermediate text string, the transport instruction
The definition instruction of the right-hand operand of
Replace the left operand with the left operand of the transfer instruction
Extended copy propagation processing means for deleting the transfer instruction.
A transfer instruction optimizing device, comprising:
【請求項2】 原始プログラムをコンパイルし、中間テ
キスト列を生成して中間プログラムファイルに蓄積し
前記中間テキスト列から移送命令の削除条件を判定し、
削除可能な移送命令を削除する複写伝播処理による移送
命令最適化の方法において、前記複写伝播処理によって削除されない移送命令に対し
て、 前記移送命令より前方の中間テキスト列に、前記移送命
令の右辺オペランドの定義命令があり、かつ前記移送命
令の右辺及び左辺のオペランドが前記定義命令と前記移
送命令の間で使用されないとき、あるいは前記移送命令
より後方の中間テキスト列に、前記移送命令の左辺オペ
ランドの定義命令がなく、かつ前記移送命令の右辺オペ
ランドの参照命令であるとき、前記定義命令の左辺オペ
ランド及び前記参照命令の右辺オペランドを前記移送命
令の左辺オペランドで置換し、前記移送命令を削除する
拡張複写伝播処理を実行する ことを特徴とする移送命令
最適化方法。
2. Compiling a source program, generating an intermediate text string and storing it in an intermediate program file ,
To determine the deletion condition of the transfer instructions from the intermediate text string,
A method of optimizing a transfer instruction by a copy propagation process for deleting a transfer instruction that can be deleted, the method comprising:
In the intermediate text string ahead of the transfer instruction,
There is a definition instruction for the operand on the right side of the
The operands on the right and left sides of the instruction
When not used during a transfer order, or when said transfer order
In the intermediate text string further behind, the left-hand operation
There is no land definition command, and the right side operation of the transfer command
When the instruction is a land reference instruction, the left
The transfer instruction for the land and the right-hand operand of the reference instruction.
Replace with the left operand of the instruction and delete the transfer instruction
A transfer instruction optimizing method characterized by executing an extended copy propagation process .
【請求項3】 請求項2の拡張複写伝播処理を実行する
プログラムを記憶するコンピュータ読みとり可能な記憶
媒体。
3. A computer-readable storage medium for storing a program for executing the extended copy propagation process according to claim 2 .
JP01555098A 1998-01-28 1998-01-28 Transfer instruction optimization apparatus and method Expired - Fee Related JP3239830B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP01555098A JP3239830B2 (en) 1998-01-28 1998-01-28 Transfer instruction optimization apparatus and method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP01555098A JP3239830B2 (en) 1998-01-28 1998-01-28 Transfer instruction optimization apparatus and method

Publications (2)

Publication Number Publication Date
JPH11212800A JPH11212800A (en) 1999-08-06
JP3239830B2 true JP3239830B2 (en) 2001-12-17

Family

ID=11891893

Family Applications (1)

Application Number Title Priority Date Filing Date
JP01555098A Expired - Fee Related JP3239830B2 (en) 1998-01-28 1998-01-28 Transfer instruction optimization apparatus and method

Country Status (1)

Country Link
JP (1) JP3239830B2 (en)

Also Published As

Publication number Publication date
JPH11212800A (en) 1999-08-06

Similar Documents

Publication Publication Date Title
JP4118456B2 (en) Program language processing system, code optimization method, and machine-readable storage medium
JP6651977B2 (en) Information processing apparatus, compiling method, and compiling program
JP3239830B2 (en) Transfer instruction optimization apparatus and method
EP1164477A2 (en) A loop optimization method and a compiler
KR100305097B1 (en) Compiler capable of reducing interrupt handling in optimization and its optimization method
JP2018120389A (en) Compiling method, compiling program and information processing device
US6944852B2 (en) Compiler
JP2002297399A (en) METHOD FOR GIVING ϕ FUNCTION FOR PERFORMING STATIC SINGLE SUBSTITUTION
Barnard et al. Hierarchic syntax error repair for LR grammars
JP3610563B2 (en) PDL data processing device
JP3887097B2 (en) COMPILING METHOD, COMPILING DEVICE, AND COMPUTER-READABLE STORAGE MEDIUM CONTAINING COMPILING PROGRAM
JPH0546404A (en) Branch instruction deletion optimizing system
JP2002082811A (en) Compiling method and recording medium
JPH05197561A (en) Compilation system
JP2001125793A (en) Compiler system, compile method and recording medium
JPH0689187A (en) Inline expansion optimizing method
JPH03127127A (en) Method of optimizing computer program
JP3324486B2 (en) Loop optimization method and its program recording medium
JPH04369745A (en) Backup file generation/management system and number of edition management system
JP2832330B2 (en) Software remodeling support apparatus and method
JPH06314194A (en) Patch system
JP2655608B2 (en) Program source copy processing method
JPS63291126A (en) System for shortening compile time
JPH05204699A (en) Identifier searching system at debugging
JP2003015884A (en) Device and program for checking duplicate definition

Legal Events

Date Code Title Description
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20010911

LAPS Cancellation because of no payment of annual fees
A711 Notification of change in applicant

Free format text: JAPANESE INTERMEDIATE CODE: A711

Effective date: 20051118