JP4778286B2 - コンパイラ装置 - Google Patents
コンパイラ装置 Download PDFInfo
- Publication number
- JP4778286B2 JP4778286B2 JP2005282852A JP2005282852A JP4778286B2 JP 4778286 B2 JP4778286 B2 JP 4778286B2 JP 2005282852 A JP2005282852 A JP 2005282852A JP 2005282852 A JP2005282852 A JP 2005282852A JP 4778286 B2 JP4778286 B2 JP 4778286B2
- Authority
- JP
- Japan
- Prior art keywords
- instruction
- program
- loop
- movement
- loop process
- 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
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/40—Transformation of program code
- G06F8/41—Compilation
- G06F8/44—Encoding
- G06F8/445—Exploiting fine grain parallelism, i.e. parallelism at instruction level
Landscapes
- Engineering & Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Software Systems (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Devices For Executing Special Programs (AREA)
Description
中田育男著,「コンパイラの構成と最適化」,株式会社朝倉書店,1999年9月15日,p.242−243およびp.284−287
以下、図面を参照しながら本発明の実施の形態1に係るコンパイラについて説明する。
− その定義は唯一の定義である
− その命令は無条件実行命令である
次に、本発明の実施の形態2に係るコンパイラについて説明する。
次に、本発明の実施の形態3に係るコンパイラについて説明する。
次に、本発明の実施の形態4に係るコンパイラについて説明する。
次に、本発明の実施の形態5に係るコンパイラについて説明する。
次に、本発明の実施の形態6に係るコンパイラについて説明する。
図28(a)は、コンパイラに対して、命令移動によるループ処理の最適化処理を実行するように指示するプラグマ「#pragma invariant_reverse」を含むソースプログラムの一例を示す図である。コンパイラは、ソースプログラム200において、プラグマ「#pragma invariant_reverse」で指定されるforループを対象として、上述した命令移動によるループ処理の最適化処理を実行する。
ループ不変式移動部212は、入力された中間プログラムに対して命令スケジューリングを行ない、このスケジューリング結果を結果Aとする(S2)。次に、ループ不変式移動部212はループ処理中に含まれるすべての命令に対して以下の処理を繰り返す。すなわち、ループ不変式移動部212は、着目している命令がループ処理外への移動可能条件を満たしているか否かについて判断する(S102)。この移動可能条件は、周知の技術であるため、ここでは、その詳細な説明は繰り返さない。移動可能条件を満たす場合には(S102でYES)、ループ不変式移動部212は、当該命令をループ処理の外に移動させる(S104)。次に、ループ不変式移動部212は、命令を移動させた後の中間プログラムに対して命令スケジューリングを行ない、この命令スケジューリング結果を結果Bとする(S8)。その後、ループ不変式移動部212は、結果Bで必要とされるレジスタ数が結果Aで必要とされるレジスタ数以上の場合には(S106でNO)、命令をループ処理外へ移動させたとしても、必要レジスタ数が減少しない。このため、ループ不変式移動部212は、命令移動処理(S104)において、ループ外に移動させた命令を元の位置に戻す(S14)。
22 Cプログラム
24 構文解析部
26 一般最適化部
28,152 移動判定部
30,154,164 移動実行部
32 命令スケジューリング部
34 レジスタ割付部
36 出力部
38 機械語プログラム
Claims (10)
- ループ処理を含む第1のプログラムを第2のプログラムに変換するコンパイラ装置であって、
前記第1のプログラムに含まれる前記ループ処理外に位置する命令で使用される変数の生存区間を解析し、命令により生存区間が開始する変数の数である生存開始数が前記命令により生存区間が終了する変数の数である生存終了数よりも大きい場合に当該命令を前記ループ処理内に移動可能であると判定する移動判定手段と、
前記移動判定手段で移動可能と判断された命令を前記ループ処理内に移動させ、中間プログラムを生成する移動実行手段と、
前記中間プログラムを前記第2のプログラムに変換する変換手段と
を備えることを特徴とするコンパイラ装置。 - 前記移動実行手段は、さらに、前記移動判定手段で移動可能と判断された第1の命令を前記ループ処理内に移動させるに際し、当該第1の命令とデータ依存関係にある第2の命令を前記データ依存関係を壊さない位置に移動させる
ことを特徴とする請求項1に記載のコンパイラ装置。 - 前記移動実行手段は、さらに、前記移動判定手段で移動可能と判断された命令を前記ループ処理内に移動させた後に、当該命令で使用されている第1のレジスタとの生存区間の重なりが解消された第2のレジスタが存在する場合には、当該第2のレジスタを他のレジスタに再割付する
ことを特徴とする請求項1に記載のコンパイラ装置。 - さらに、命令の移動を行なうか否かに関する指示を取得する指示取得手段を備え、
前記移動判定手段は、さらに、前記指示取得手段が前記命令の移動を行なわないとする指示を取得した場合には、命令をループ処理内に移動可能か否かの判定を行なわない
ことを特徴とする請求項1〜3のいずれか1項に記載のコンパイラ装置。 - さらに、命令の移動を行なうか否かに関する指示を取得する指示取得手段を備え、
前記移動判定手段は、さらに、前記指示取得手段が前記命令の移動を行なうとする指示を取得した場合には、命令をループ処理内に移動可能か否かの判定を行なう
ことを特徴とする請求項1〜3のいずれか1項に記載のコンパイラ装置。 - さらに、低消費電力向けの第2のプログラムに変換するか否かに関する指示を取得する指示取得手段を備え、
前記移動判定手段は、さらに、前記指示取得手段が低消費電力向けの第2のプログラムに変換するとする指示を取得した場合には、命令をループ処理内に移動可能か否かの判定を行なわない
ことを特徴とする請求項1〜3のいずれか1項に記載のコンパイラ装置。 - 前記指示は、自身の起動時に与えられるコンパイルオプションである
ことを特徴とする請求項4〜6のいずれか1項に記載のコンパイラ装置。 - 前記指示は、前記第1のプログラム中に記述されているプラグマ記述である
ことを特徴とする請求項4〜6のいずれか1項に記載のコンパイラ装置。 - ループ処理を含む第1のプログラムを第2のプログラムに変換するコンパイル方法であって、
前記第1のプログラムに含まれる前記ループ処理外に位置する命令で使用される変数の生存区間を解析し、命令により生存区間が開始する変数の数である生存開始数が前記命令により生存区間が終了する変数の数である生存終了数よりも大きい場合に当該命令を前記ループ処理内に移動可能であると判定する移動判定ステップと、
前記移動判定ステップで移動可能と判断された命令を前記ループ処理内に移動させ、中間プログラムを生成する移動実行ステップと、
前記中間プログラムを前記第2のプログラムに変換する変換ステップと
を含むことを特徴とするコンパイル方法。 - ループ処理を含む第1のプログラムを第2のプログラムに変換するコンパイラであって、
前記第1のプログラムに含まれる前記ループ処理外に位置する命令で使用される変数の生存区間を解析し、命令により生存区間が開始する変数の数である生存開始数が前記命令により生存区間が終了する変数の数である生存終了数よりも大きい場合に当該命令を前記ループ処理内に移動可能であると判定する移動判定ステップと、
前記移動判定ステップで移動可能と判断された命令を前記ループ処理内に移動させ、中間プログラムを生成する移動実行ステップと、
前記中間プログラムを前記第2のプログラムに変換する変換ステップとをコンピュータに実行させる
ことを特徴とするコンパイラ。
Priority Applications (3)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2005282852A JP4778286B2 (ja) | 2005-09-28 | 2005-09-28 | コンパイラ装置 |
| US11/534,719 US7827542B2 (en) | 2005-09-28 | 2006-09-25 | Compiler apparatus |
| CNA2006101689106A CN101000556A (zh) | 2005-09-28 | 2006-09-28 | 编译装置 |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2005282852A JP4778286B2 (ja) | 2005-09-28 | 2005-09-28 | コンパイラ装置 |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JP2007094731A JP2007094731A (ja) | 2007-04-12 |
| JP4778286B2 true JP4778286B2 (ja) | 2011-09-21 |
Family
ID=37895708
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP2005282852A Expired - Fee Related JP4778286B2 (ja) | 2005-09-28 | 2005-09-28 | コンパイラ装置 |
Country Status (3)
| Country | Link |
|---|---|
| US (1) | US7827542B2 (ja) |
| JP (1) | JP4778286B2 (ja) |
| CN (1) | CN101000556A (ja) |
Families Citing this family (11)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2006107339A (ja) * | 2004-10-08 | 2006-04-20 | Matsushita Electric Ind Co Ltd | プログラム処理装置 |
| JP2009048252A (ja) * | 2007-08-14 | 2009-03-05 | Oki Electric Ind Co Ltd | プログラム変換装置及びコンパイラプログラム |
| US8236711B1 (en) | 2008-06-12 | 2012-08-07 | Milliken & Company | Flexible spike and knife resistant composite |
| US20140143761A1 (en) * | 2012-04-18 | 2014-05-22 | Natalio Fridman | Method and system for database conversion |
| US9229717B2 (en) * | 2012-12-11 | 2016-01-05 | Nvidia Corporation | Register allocation for clustered multi-level register files |
| GB2514618B (en) * | 2013-05-31 | 2020-11-11 | Advanced Risc Mach Ltd | Data processing systems |
| CN108804222B (zh) * | 2018-04-13 | 2021-07-27 | 南京南瑞继保电气有限公司 | 一种临时变量的数据区分配方法 |
| US10698689B2 (en) | 2018-09-01 | 2020-06-30 | Intel Corporation | Recompiling GPU code based on spill/fill instructions and number of stall cycles |
| US10983794B2 (en) | 2019-06-17 | 2021-04-20 | Intel Corporation | Register sharing mechanism |
| CN113535231B (zh) * | 2020-04-17 | 2024-09-20 | 中科寒武纪科技股份有限公司 | 减少指令跳转的方法及装置 |
| WO2024225430A1 (ja) * | 2023-04-28 | 2024-10-31 | 株式会社 Preferred Networks | 情報処理装置、情報処理方法、プログラム、中間言語生成方法、機械語生成方法及びデータ構造生成方法 |
Family Cites Families (18)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JPS63285668A (ja) * | 1987-05-19 | 1988-11-22 | Fujitsu Ltd | ベクトルロ−ド処理方法 |
| US4991088A (en) * | 1988-11-30 | 1991-02-05 | Vlsi Technology, Inc. | Method for optimizing utilization of a cache memory |
| US5202995A (en) * | 1989-10-12 | 1993-04-13 | International Business Machines Corporation | Method for removing invariant branches from instruction loops of a computer program |
| JP3004340B2 (ja) * | 1990-10-15 | 2000-01-31 | 沖電気工業株式会社 | プログラム最適化装置 |
| US5386562A (en) * | 1992-05-13 | 1995-01-31 | Mips Computer Systems, Inc. | Circular scheduling method and apparatus for executing computer programs by moving independent instructions out of a loop |
| US5457799A (en) * | 1994-03-01 | 1995-10-10 | Digital Equipment Corporation | Optimizer for program loops |
| US5966539A (en) * | 1994-03-01 | 1999-10-12 | Digital Equipment Corporation | Link time optimization with translation to intermediate program and following optimization techniques including program analysis code motion live variable set generation order analysis, dead code elimination and load invariant analysis |
| JP3606387B2 (ja) * | 1994-09-13 | 2005-01-05 | 松下電器産業株式会社 | コンパイル装置 |
| US5815721A (en) * | 1996-04-25 | 1998-09-29 | Hewlett-Packard Company | Method and apparatus for optimizing complex control structures using abstract web patterns |
| US6059839A (en) * | 1997-01-09 | 2000-05-09 | Silicon Graphics, Inc. | Apparatus and method for compiler identification of address data |
| US6253373B1 (en) * | 1997-10-07 | 2001-06-26 | Hewlett-Packard Company | Tracking loop entry and exit points in a compiler |
| US6463582B1 (en) * | 1998-10-21 | 2002-10-08 | Fujitsu Limited | Dynamic optimizing object code translator for architecture emulation and dynamic optimizing object code translation method |
| US6954927B2 (en) * | 1999-02-17 | 2005-10-11 | Elbrus International | Hardware supported software pipelined loop prologue optimization |
| JP3405696B2 (ja) * | 1999-08-19 | 2003-05-12 | インターナショナル・ビジネス・マシーンズ・コーポレーション | コンパイル装置およびその方法 |
| US20030237080A1 (en) | 2002-06-19 | 2003-12-25 | Carol Thompson | System and method for improved register allocation in an optimizing compiler |
| US7316012B2 (en) * | 2003-09-29 | 2008-01-01 | Intel Corporation | System, method, and apparatus for spilling and filling rotating registers in software-pipelined loops |
| US7444628B2 (en) | 2004-08-30 | 2008-10-28 | International Business Machines Corporation | Extension of swing modulo scheduling to evenly distribute uniform strongly connected components |
| JP2006139553A (ja) | 2004-11-12 | 2006-06-01 | Matsushita Electric Ind Co Ltd | 命令スケジューリング方法、および装置 |
-
2005
- 2005-09-28 JP JP2005282852A patent/JP4778286B2/ja not_active Expired - Fee Related
-
2006
- 2006-09-25 US US11/534,719 patent/US7827542B2/en not_active Expired - Fee Related
- 2006-09-28 CN CNA2006101689106A patent/CN101000556A/zh active Pending
Also Published As
| Publication number | Publication date |
|---|---|
| JP2007094731A (ja) | 2007-04-12 |
| CN101000556A (zh) | 2007-07-18 |
| US7827542B2 (en) | 2010-11-02 |
| US20070074196A1 (en) | 2007-03-29 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| EP2677424B1 (en) | OpenCL compilation | |
| US8893080B2 (en) | Parallelization of dataflow actors with local state | |
| JP4822817B2 (ja) | コンパイルシステム | |
| JP4778286B2 (ja) | コンパイラ装置 | |
| US20100070958A1 (en) | Program parallelizing method and program parallelizing apparatus | |
| JP2004234126A (ja) | コンパイラ装置およびコンパイル方法 | |
| JP5966509B2 (ja) | プログラム、コード生成方法および情報処理装置 | |
| US20060277529A1 (en) | Compiler apparatus | |
| JP2015194881A (ja) | コンパイル装置、コンパイラプログラム、コンパイル方法 | |
| US20060064682A1 (en) | Compiler, compilation method, and compilation program | |
| CN106462432A (zh) | 数据相关控制流简化 | |
| JPH0934725A (ja) | 言語処理装置及び言語処理方法 | |
| US8650525B2 (en) | Integrated circuit compilation | |
| JP5576605B2 (ja) | プログラム変換装置およびプログラム変換方法 | |
| CN111930359A (zh) | 一种异构嵌入式系统上进行算法开发的系统及方法 | |
| JP2008305337A (ja) | プログラム変換装置、プログラム変換方法、プログラム、記憶媒体、デバッグ装置、デバッグ方法及びプログラム開発システム | |
| US20050144605A1 (en) | Information processing system and code generation method | |
| CN112579091A (zh) | 指令编译方法、装置、编译器及计算设备 | |
| CN112540750B (zh) | 自适应内建函数与指令操作选择翻译方法 | |
| JP2004326760A (ja) | コンパイラ、記録媒体、コンパイル装置、通信端末装置及びコンパイル方法 | |
| JP2006301989A (ja) | 計算機言語によるプログラムをブロック図から自動生成する方法と装置とプログラム | |
| JP5208589B2 (ja) | コンパイル装置、コンパイラ、コンパイル方法 | |
| JP2009064207A (ja) | コンパイル装置 | |
| JP2008071128A (ja) | プリフェッチ制御方法及びコンパイル装置 | |
| CN120122956A (zh) | 一种多粒度数据流编译系统与数据流图编译方法 |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20080827 |
|
| A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20100615 |
|
| A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20110405 |
|
| A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20110527 |
|
| 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: 20110621 |
|
| A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 |
|
| A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20110701 |
|
| R150 | Certificate of patent or registration of utility model |
Ref document number: 4778286 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 Free format text: JAPANESE INTERMEDIATE CODE: R150 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20140708 Year of fee payment: 3 |
|
| S111 | Request for change of ownership or part of ownership |
Free format text: JAPANESE INTERMEDIATE CODE: R313111 |
|
| R350 | Written notification of registration of transfer |
Free format text: JAPANESE INTERMEDIATE CODE: R350 |
|
| R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
| R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
| LAPS | Cancellation because of no payment of annual fees |