JP4985461B2 - Compiler, compiling method, and program - Google Patents

Compiler, compiling method, and program Download PDF

Info

Publication number
JP4985461B2
JP4985461B2 JP2008042864A JP2008042864A JP4985461B2 JP 4985461 B2 JP4985461 B2 JP 4985461B2 JP 2008042864 A JP2008042864 A JP 2008042864A JP 2008042864 A JP2008042864 A JP 2008042864A JP 4985461 B2 JP4985461 B2 JP 4985461B2
Authority
JP
Japan
Prior art keywords
specialization
subprogram
satisfied
generic
condition
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
JP2008042864A
Other languages
Japanese (ja)
Other versions
JP2009199520A (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 JP2008042864A priority Critical patent/JP4985461B2/en
Publication of JP2009199520A publication Critical patent/JP2009199520A/en
Application granted granted Critical
Publication of JP4985461B2 publication Critical patent/JP4985461B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Devices For Executing Special Programs (AREA)

Description

本発明は、コンパイラ、コンパイル方法、及び、プログラムに関し、更に詳しくは、ソースプログラムに対応したプログラムを生成するコンパイラ、コンパイル方法、及び、プログラムに関する。   The present invention relates to a compiler, a compiling method, and a program. More specifically, the present invention relates to a compiler that generates a program corresponding to a source program, a compiling method, and a program.

プログラム中のサブプログラム(手続き、関数、サブルーチンなど)は、型や構造が異なる複数の種類のデータに対して動作する「総称サブプログラム」として記述される場合がある。特に、言語処理系が提供する組込みサブプログラムや実行時ライブラリルーチン等がこれに該当する。このような総称サブプログラムは、対象データの種類のあり得る全てのパターンに対して動作するように記述されているため、個々のパターンにたいしては、必ずしも最適な方法で動作するとは限らない。更に、High Performance Fortran(HPF)に代表される並列言語では、総称サブプログラムは、対象データの種類に加えて、並列化方法(e.g.データ分散の種別)や並列実行の環境(e.g.プロセッサ数や相互結合網のトポロジ)に関しても総称的である必要がある。このため、性能上のオーバヘッドは更に大きくなる可能性が高い。   A subprogram (procedure, function, subroutine, etc.) in a program may be described as a “generic subprogram” that operates on a plurality of types of data having different types and structures. In particular, this includes embedded subprograms and runtime library routines provided by the language processor. Since such a generic subprogram is described so as to operate on all possible patterns of the type of target data, it does not necessarily operate in an optimum manner for each pattern. Furthermore, in a parallel language represented by High Performance Fortran (HPF), generic subprograms include a parallelization method (eg, data distribution type) and a parallel execution environment (eg, the number of processors and mutual information) in addition to the type of target data. The topology of the coupled network also needs to be generic. For this reason, the performance overhead is likely to be further increased.

ここで、コンパイルにおけるプログラム最適化に関する技術としては、特許文献1、特許文献2に記載された技術がある。特許文献1では、まず、最適化対象プログラムに、プログラム中の変数が取る値と、その値を取る頻度とを対応付けて記録する手続コード(プロファイルコード)を付加し、プログラム実行時に変数が取る値とその頻度とを、プロファイル情報として記憶する。次に、変数を用いるプログラム部分を、高頻度の変数の値(特定値)で特殊化して新たに付加し、実行時に、変数の値が特定値に一致するときに、新たに付加したプログラム部分(特殊化部分)が実行されるようなコードを生成する。このようなコードからオブジェクトプログラムを生成することで、高速実行が可能なプログラムを得ることができる。   Here, as a technique related to program optimization in compilation, there are techniques described in Patent Document 1 and Patent Document 2. In Patent Document 1, first, a procedure code (profile code) that records a value taken by a variable in the program in association with a frequency at which the value is taken is added to the optimization target program, and the variable is taken when the program is executed. The value and its frequency are stored as profile information. Next, a program part using a variable is specially added with a value (specific value) of a high-frequency variable and newly added, and when the variable value matches the specific value at the time of execution, the newly added program part Generate code that executes (specialized part). By generating an object program from such code, a program that can be executed at high speed can be obtained.

また、特許文献2では、まず、高級言語で記述されたソースプログラムをコンパイルし、当該プログラムに対する目的コードである第1目的コードを生成する。次に、第1目的コードを実行する際に動的なデータを計測するための計測コードを、第1目的コードに挿入する。続いて、第1目的コードを実行することで得られる計測データから得られる情報を用いて、第1目的コードに対して最適化処理を行う。その後、第1目的コードを、最適化された第2目的コードに翻訳する処理を行うための翻訳コードを生成し、第1目的コードに付加する。このようにすることで、アプリケーションを実行する環境が、ソースプログラムのコンパイル時の環境とは異なる環境であっても、実行環境に応じた最適化が可能である。
特開平11−149380号公報 特開2002−351674号公報
In Patent Document 2, first, a source program described in a high-level language is compiled to generate a first object code that is an object code for the program. Next, a measurement code for measuring dynamic data when executing the first object code is inserted into the first object code. Subsequently, an optimization process is performed on the first object code using information obtained from the measurement data obtained by executing the first object code. Thereafter, a translation code for performing processing for translating the first object code into the optimized second object code is generated and added to the first object code. In this way, even if the environment for executing the application is different from the environment at the time of compiling the source program, optimization according to the execution environment is possible.
JP-A-11-149380 JP 2002-351474 A

サブプログラムが「総称的」であることに起因して、性能上のオーバヘッドが発生する問題を解決する手法として、特定のデータや並列実行環境に対して「特殊化」したサブプログラムを用意しておき、実際のデータや並列実行環境が条件に合致していれば、その特殊化したプログラムを使用するという手法が考えられる。特殊化したプログラムは、特定の条件下で動作が最適化されているため、性能上のオーバヘッドは小さく、最適な方法で動作することが期待できる。   As a technique to solve the problem of performance overhead caused by the subprogram being “generic”, a “specialized” subprogram is prepared for specific data and parallel execution environments. In addition, if the actual data or parallel execution environment meets the conditions, a method of using the specialized program can be considered. Since the operation of a specialized program is optimized under specific conditions, the performance overhead is small and it can be expected to operate in an optimal manner.

サブプログラムの特殊化に関連する手法としては、下記に示す(a)〜(e)の5つが挙げられる。
(a)ユーザプログラム上のIF構文によるサブプログラムの選択:
特殊化の適用条件(「特殊化条件」)を実行時に判定し、IF構文により適切なサブプログラム呼び出しを選択する:
(b)組込みサブプログラムや実行時ライブラリルーチンの中のIF構文による処理の分岐:
組込みサブプログラムや実行時ライブラリルーチンの中で、対象データの個々のパターンに応じて最適な処理を選択する。
(c)サブプログラムのオーバーロードとオーバーライド:
サブプログラムのオーバーロードやオーバーライドなどの機能により、同一の名前を持つ総称サブプログラムと特殊化サブプログラムとを定義しておき、実際にどのサブプログラムを呼び出すかは、処理系がコンパイル時又は実行時に決定する。
(d)テンプレート特殊化:
C++などの言語が持つテンプレートを用いると、特定の条件に合致する場合のみに適用される特殊化されたサブプログラムを定義できる。
(e)言語処理系による自動特殊化:
言語処理系が、手続き間解析や実行時プロファイリングにより得られた情報から、特殊化されたサブプログラムを自動的に生成する。
特許文献1や特許文献2のアプローチは、上記(d)の手法に近い。
There are five methods (a) to (e) shown below as methods related to specialization of subprograms.
(A) Selection of subprogram by IF syntax on user program:
Determine the specialization application conditions ("specialization conditions") at runtime and select the appropriate subprogram call with IF syntax:
(B) Branch of processing by IF syntax in embedded subprogram or runtime library routine:
In an embedded subprogram or runtime library routine, the optimum process is selected according to the individual pattern of the target data.
(C) Subprogram overload and override:
Generic subprograms and specialized subprograms with the same name are defined by functions such as overloading and overriding of subprograms. Which subprogram is actually called depends on whether the processing system is compiled or executed. decide.
(D) Template specialization:
If a template of a language such as C ++ is used, a specialized subprogram that is applied only when a specific condition is met can be defined.
(E) Automatic specialization by language processing system:
The language processor automatically generates specialized subprograms from information obtained by interprocedural analysis and runtime profiling.
The approaches of Patent Document 1 and Patent Document 2 are close to the above method (d).

しかし、上記した(a)の手法には、次のような問題点がある。すなわち、(a)の手法では、特殊化の種類ごとにサブプログラム呼び出しのコードを付け加えなければならないため、コードの書き換えが必要になる。また、ソースプログラム上で明示的に呼び出すサブプログラムに対する特殊化しか記述できないので、種々の実行時処理のために処理系が暗黙的に呼び出す実行時ライブラリルーチンの特殊化に適用することはできない。また、(b)の手法では、対応済みパターン以外では効果がないという問題がある。すなわち、通常、組み込みサブプログラムや実行時ライブラリルーチンのコードにユーザが手を出すことはできないため、ユーザが対応パターンを拡張することができない。   However, the above method (a) has the following problems. That is, in the method (a), since a code for calling a subprogram must be added for each type of specialization, it is necessary to rewrite the code. Further, since only the specialization for the subprogram that is explicitly called on the source program can be described, it cannot be applied to the specialization of the runtime library routine that is implicitly called by the processing system for various runtime processing. In addition, the method (b) has a problem that there is no effect except for a corresponding pattern. In other words, since the user cannot usually deal with the code of the embedded subprogram or the runtime library routine, the user cannot expand the corresponding pattern.

(c)の手法では、実際にどのサブプログラムを呼び出すかは、言語仕様が定める情報(通常、引数の型や個数)のみに基づいて決定されるため、指定できる特殊化条件に関する制約が大きいという問題がある。すなわち、あらゆる特殊化条件を、型そのものとして表現しなければならない(e.g.配列の寸法が2のべき乗であることを表す型)。このような方法は煩雑である上、コンパイル時に不定の動的な情報(e.g.並列実行環境)に基づく特殊化を実現するのに必要な「動的な型生成」の機能を持つ言語は多くない。つまり、データ分散の種別や並列実行環境などの情報に基づく、柔軟な特殊化条件を指定することができないか、或いは、困難である。   In the method (c), which subprogram is actually called is determined based only on information (generally, the type and number of arguments) defined by the language specification, so that there are large restrictions on specialization conditions that can be specified. There's a problem. In other words, all specialization conditions must be expressed as the type itself (a type indicating that the size of the e.g. array is a power of 2). Such a method is cumbersome, and not many languages have the "dynamic type generation" function necessary for realizing specialization based on indefinite dynamic information (eg parallel execution environment) at the time of compilation. . That is, it is difficult or difficult to specify flexible specialization conditions based on information such as the type of data distribution and the parallel execution environment.

(d)の手法では、テンプレートのパラメータとして指定できるのは、型名や整数値などの情報のみであり、更にテンプレートのインスタンス化はコンパイル時に行われる。従って、(c)の手法と同様に、指定できる特殊化条件に関する制約が大きい。(e)の手法では、引数の値や型に基づく定型的な特殊化(e.g.定数の畳み込み)しか実現できず、より効果が大きい高度な特殊化(e.g.アルゴリズムの特殊化)は実現できないという問題がある。   In the method (d), only information such as type names and integer values can be specified as template parameters, and template instantiation is performed at compile time. Therefore, as with the method (c), there are large restrictions on the specialization conditions that can be specified. The method (e) can only realize a standard specialization (eg constant convolution) based on the value or type of an argument, and cannot achieve a highly effective advanced specialization (eg algorithm specialization). There is.

本発明は、任意の総称サブプログラムについて、任意の特殊化が可能なコンパイル方法、コンパイラ、及び、プログラムを提供することを目的とする。   An object of the present invention is to provide a compiling method, a compiler, and a program capable of arbitrary specialization for an arbitrary generic subprogram.

上記目的を達成するために、本発明のコンパイル方法は、コンピュータを用い、総称サブプログラムに対する特殊化サブプログラムを指定する記述と、コンパイル時に不定の情報を含み、前記特殊化サブプログラムが適用される特殊化条件を設定する記述とを含むソースプログラムをコンパイルする方法であって、前記コンピュータが、前記ソースプログラムに含まれる前記特殊化サブプログラム及び特殊化条件を特殊化情報テーブルに記録するステップと、前記コンピュータが、前記ソースプログラムに基づいて、特殊化サブプログラムが指定された総称サブプログラムの呼び出しを検出するステップと、前記コンピュータが、前記特殊化情報テーブルを参照して、前記検出した総称サブプログラムに対応する特殊化サブプログラムの特殊化条件がコンパイル時に成立するか否かを判定するステップと、前記判定ステップで前記特殊化条件がコンパイル時に成立するか否かが不定であると判定されると、前記コンピュータが、前記総称サブプログラムを呼び出すコードを、前記特殊化条件の成立時に前記特殊化サブプログラムを呼び出すコードに変換するステップとを有することを特徴とする。   In order to achieve the above object, the compiling method of the present invention uses a computer and includes a description specifying a specialized subprogram for a generic subprogram and indefinite information at the time of compilation, and the specialized subprogram is applied. Compiling a source program including a description for setting specialization conditions, wherein the computer records the specialization subprogram and specialization conditions included in the source program in a specialization information table; The computer detecting a call of a generic subprogram in which a specialized subprogram is designated based on the source program; and the computer refers to the specialized information table to detect the detected generic subprogram. Specialized subprogram special corresponding to Determining whether or not the condition is satisfied at the time of compiling; and determining whether or not the specialization condition is satisfied at the time of compiling in the determining step; Converting a code to be called into a code to call the specialization subprogram when the specialization condition is satisfied.

本発明のコンパイラは、コンピュータに、総称サブプログラムに対する特殊化サブプログラムを指定する記述と、コンパイル時に不定の情報を含み、前記特殊化サブプログラムが適用される特殊化条件を設定する記述とを含むソースプログラムを入力させ、前記特殊化サブプログラム及び特殊化条件を特殊化情報テーブルに記録させための構文解析部と、前記コンピュータに、前記ソースプログラムに基づいて、前記特殊化サブプログラムが指定された総称サブプログラムの呼び出しを検出させための特殊化検出部と、前記コンピュータに、前記特殊化情報テーブルを参照させて、前記検出された総称サブプログラムに対応する特殊化サブプログラムの特殊化条件がコンパイル時に成立するか否かを判定させための特殊化条件判定部と、記特殊化条件がコンパイル時に成立すると判定されると、前記コンピュータに、前記総称サブプログラムを呼び出すコードを、前記特殊化条件が成立する特殊化サブプログラムを呼び出すコードに変換させ、前記特殊化条件がコンパイル時に成立するか否かが不定であると判定されると、前記総称サブプログラムを呼び出すコードを、前記特殊化条件の成立時に前記特殊化サブプログラムを呼び出すコードに変換させためのコード変換・生成部とを備えることを特徴とする。 The compiler of the present invention includes a description for specifying a specialized subprogram for a generic subprogram and a description for setting specialization conditions to which the specialized subprogram is applied, including indefinite information at the time of compilation. to enter the source program, the syntax analysis unit for a specialized sub-program and specialized conditions Ru is recorded in specialized information table, to the computer, on the basis of the source program, the special subprogram is specified and specialization detector for Ru is detected the call generic subprogram, the computer, the by referring to specialized information table, special conditions of specialized sub-programs corresponding to the detected generic subprogram and special conditions determination unit for but that Ru is determined whether or not satisfied at compile When the front Symbol specialized conditions Ru is determined that established at compile time, the computer, the code that calls the generic subprogram, the specialized conditions is converted to the code that calls the specialized subprogram satisfied, the special conditions When but Ru is determined whether established at compile time is indefinite, the code that calls the generic subprogram, code conversion for Ru is converted to code that calls the special subprogram during establishment of the special conditions A generation unit is provided.

本発明のプログラムは、コンピュータに、総称サブプログラムに対する特殊化サブプログラムを指定する記述と、コンパイル時に不定の情報を含み、前記特殊化サブプログラムが適用される特殊化条件を設定する記述とを含むソースプログラムをコンパイルする処理を実行させるプログラムであって、前記コンピュータに、前記ソースプログラムに含まれる前記特殊化サブプログラム及び特殊化条件を特殊化情報テーブルに記録する処理と、前記ソースプログラムに基づいて、特殊化サブプログラムが指定された総称サブプログラムの呼び出しを検出する処理と、前記特殊化情報テーブルを参照して、前記検出した総称サブプログラムに対応する特殊化サブプログラムの特殊化条件がコンパイル時に成立するか否かを判定する処理と、前記判定処理で前記特殊化条件がコンパイル時に成立するか否かが不定であると判定すると、前記コンピュータが、前記総称サブプログラムを呼び出すコードを、前記特殊化条件の成立時に前記特殊化サブプログラムを呼び出すコードに変換する処理とを実行させることを特徴とする。   The program of the present invention includes a description for specifying a specialized subprogram for the generic subprogram in the computer and a description for setting specialization conditions to which the specialized subprogram is applied, including indefinite information at the time of compilation. A program for executing a process of compiling a source program, wherein the computer records the specialization subprogram and specialization conditions included in the source program in a specialization information table, and based on the source program , Processing for detecting a call of a generic subprogram with a specified special subprogram, and referring to the specialization information table, the specialization condition of the specialization subprogram corresponding to the detected generic subprogram is determined at compile time. A process for determining whether or not it is established; If it is determined in the processing that the specialization condition is satisfied at the time of compilation, the computer calls the generic subprogram code that calls the specialization subprogram when the specialization condition is satisfied And a process of converting the data into the data.

本発明のコンパイル方法、コンパイラ、及び、プログラムは、任意の総称サブプログラムについて、任意の特殊化を行うことができる。   The compiling method, compiler, and program of the present invention can perform any specialization for any generic subprogram.

以下、図面を参照し、本発明の実施の形態を詳細に説明する。図1は、本発明の一実施形態のコンパイラを示している。コンパイラ101は、構文解析部102、特殊化部103、並列化部107、最適化部108、及び、コード生成部109を有する。コンパイラ101は、ソースプログラム100を入力し、オブジェクトプログラム110を出力する。コンパイラ101内の各部の機能は、コンピュータ上で所定のプログラムを実行することで実現される。コンパイラ101は、定数伝播や定数の畳み込みなどの、ソースプログラム100の中の式を静的に評価する機能を持つ。   Hereinafter, embodiments of the present invention will be described in detail with reference to the drawings. FIG. 1 shows a compiler according to an embodiment of the present invention. The compiler 101 includes a syntax analysis unit 102, a specialization unit 103, a parallelization unit 107, an optimization unit 108, and a code generation unit 109. The compiler 101 inputs the source program 100 and outputs an object program 110. The function of each part in the compiler 101 is realized by executing a predetermined program on a computer. The compiler 101 has a function of statically evaluating an expression in the source program 100, such as constant propagation and constant folding.

ソースプログラム100は、所定言語で記述されたプログラムである。ソースプログラム100は、総称サブプログラムに対して特殊化サブプログラムを指定する記述と、その特殊化条件を設定する記述とを含む。構文解析部102は、ソースプログラム100の構文解析を行い、特殊化情報テーブル111とサブプログラム情報テーブル112とを含む各種の情報テーブルを生成する。構文解析部102は、特殊化情報テーブル111に、ソースプログラム100に記述されている特殊化サブプログラムと、その特殊化サブプログラムに設定された特殊化条件とを記録する。構文解析部102は、サブプログラム情報テーブル112に、ソースプログラム100に現れる全てのサブプログラムの情報を記録する。その際、特殊化を宣言されているサブプログラムに対しては、特殊化が宣言されている旨を示すフラグ(「特殊化フラグ」)をオンに設定すると共に、対応する特殊化情報テーブル111へのリンクを設定する。   The source program 100 is a program written in a predetermined language. The source program 100 includes a description for specifying a specialized subprogram for the generic subprogram and a description for setting the specialization condition. The syntax analysis unit 102 performs syntax analysis of the source program 100 and generates various information tables including a specialization information table 111 and a subprogram information table 112. The syntax analysis unit 102 records in the specialization information table 111 the specialization subprogram described in the source program 100 and the specialization conditions set in the specialization subprogram. The syntax analysis unit 102 records information on all subprograms appearing in the source program 100 in the subprogram information table 112. At this time, for a subprogram that has been declared specialization, a flag indicating that specialization is declared (“specialization flag”) is set to ON, and the corresponding specialization information table 111 is displayed. Set the link.

特殊化部103は、サブプログラムの特殊化を行う。サブプログラムの特殊化では、サブプログラム情報テーブル112を参照して、ソースプログラム実行時に呼び出される総称サブプログラムに対して、特殊化が宣言されているか否かを判定する。特殊化が宣言されているときは、特殊化情報テーブル111を参照して、特殊化条件がコンパイル時に成立するか否かを判定する。成立すると判定したときは、総称サブプログラムの呼び出しを、特殊化サブプログラムの呼び出しに置き換える。成立するか否かがコンパイル時に確定できない(不定である)ときは、総称サブプログラムの呼び出し部分を、実行時に特殊化条件が成立するときに特殊化サブプログラムを呼び出すコードに変換する。成立しないと判定したときは、総称サブプログラムの呼び出しのままとする。並列化部107は、必要に応じてプログラムの並列化を行う。最適化部108は、種々の最適化を適用する。コード生成部109は、オブジェクトコードを生成する。   The specialization unit 103 specializes the subprogram. In subprogram specialization, the subprogram information table 112 is referred to and it is determined whether or not specialization is declared for the generic subprogram called when the source program is executed. When specialization is declared, it is determined by referring to the specialization information table 111 whether the specialization condition is satisfied at the time of compilation. If it is determined that it is established, the generic subprogram call is replaced with a specialized subprogram call. When it is not possible to determine whether or not it is established at the time of compilation (indefinite), the calling portion of the generic subprogram is converted into a code that calls the specialized subprogram when the specialization condition is satisfied at the time of execution. If it is determined that it does not hold, the generic subprogram is still called. The parallelization unit 107 parallelizes the program as necessary. The optimization unit 108 applies various optimizations. The code generation unit 109 generates an object code.

本実施形態では、
(1)ソースプログラム100において総称サブプログラムの特殊化を記述するための言語の機能
(2)特殊化部103
(3)特殊化情報テーブル111
が重要である。以下に、それぞれについて、更に詳しく説明する。
In this embodiment,
(1) Language function for describing specialization of generic subprogram in source program 100 (2) Specialization unit 103
(3) Specialization information table 111
is important. Each will be described in more detail below.

まず、総称サブプログラムの特殊を記述するための言語機能について説明する。言語を拡張し、以下に説明する、総称サブプログラムに対する特殊化を宣言する機能と特殊化条件を設定する機能を追加する。図2に、HPFにて、総称サブプログラムの特殊化を行うプログラムの例を示す。なお、図2に用いられている言語拡張の文法は、一例であり、これに限定されるものではない。すなわち、図2に例示した文法により実現できる言語の機能を規定するのであって、文法自体を規定するものではない。   First, language functions for describing the specialities of generic subprograms will be described. Extends the language and adds the following functions to declare specializations for generic subprograms and to set specialization conditions. FIG. 2 shows an example of a program that specializes generic subprograms in HPF. Note that the language extension grammar used in FIG. 2 is an example, and the grammar is not limited to this. That is, the language functions that can be realized by the grammar illustrated in FIG. 2 are defined, and the grammar itself is not defined.

・総称サブプログラムに対する特殊化を宣言する機能
総称サブプログラム(組込みサブプログラム及び実行時ライブラリルーチンを含む)に対して、特殊化されたサブプログラムを指定する。図2では、Fortranの引用仕様宣言を拡張した構文により、HPFの実行時ライブラリ手続redist_copyに対する特殊化サブプログラムを指定している。また、redist_copyに対する特殊化サブプログラムとして、2つの特殊化サブプログラムredist_copy_squareとredist_copy_blockを指定している。
-Function for declaring specialization for generic subprograms Specify specialized subprograms for generic subprograms (including built-in subprograms and runtime library routines). In FIG. 2, a specialized subprogram for the runtime library procedure redist_copy of the HPF is specified by a syntax obtained by extending the Fortran citation specification declaration. Two specialized subprograms redist_copy_square and redist_copy_block are designated as specialized subprograms for redist_copy.

interface文で総称名として指定されているhpf(redist_copy)は、当該引用仕様宣言が、HPFの実行時ライブラリ手続redist_copyに対する総称引用仕様を指定することを示す。引用仕様本体は、対となるend interfaceまでの間に記述する。引用仕様本体のsubroutine文のプレフィックスとして指定されているspecial指定子は、そのsubroutine文で宣言されている手続が、当該引用仕様宣言が指定する総称手続の「特殊化引用仕様」であることを宣言する。redist_copy_square(a1,a2)のa1,a2は、当該特殊化サブプログラムの引数を表す。subroutineからend subroutineまでの間には、引数を含む変数の宣言や特殊化条件を記述する。   hpf (redist_copy) specified as a generic name in the interface statement indicates that the citation specification declaration specifies a generic citation specification for the HPF runtime library procedure redist_copy. The cited specification body is described between the paired end interface. The special specifier specified as the prefix of the subroutine statement in the citation specification body declares that the procedure declared in the subroutine statement is a "specialized citation specification" of the generic procedure specified by the citation specification declaration. To do. a1 and a2 of redist_copy_square (a1, a2) represent arguments of the specialized subprogram. Between the subroutine and the end subroutine, variable declarations including arguments and specialization conditions are described.

・特殊化条件を設定する機能
引用仕様本体にて、特殊化サブプログラムを適用する条件を明示する。引用仕様本体の宣言部に現れるspecialize_if(...)は、当該特殊化手続きに対する「特殊化条件」を指定する。特殊化条件としてspecialize_if文の括弧内に指定できるのは、その中の全ての演算が組込みであり、かつ、全ての一次子が制限式か特殊化条件一時変数であるような、論理型のスカラである式である。ここで、特殊化条件一時変数とは、その中の全ての演算が組込みであり、かつ、全ての一次子が制限式か特殊化条件一時変数であるような初期値式を持つ変数とする(e.g.図2の変数np)。
-Function to set specialization conditions Clarify the conditions for applying specialization subprograms in the cited specification body. Specialize_if (...) that appears in the declaration part of the cited specification body specifies the "specialization condition" for the specialization procedure. A special condition can be specified in parentheses in the specialize_if statement as a logical scalar whose all operations are built-in and whose primary is a restricted expression or special condition temporary variable. Is an expression. Here, the special condition temporary variable is a variable having an initial value expression in which all the operations therein are built-in and all the primary elements are restriction expressions or special condition temporary variables ( eg Variable np in Figure 2).

上記の特殊化条件の定義により、並列実行におけるプロセッサ台数、ある変数の値といったコンパイル時には不定で、実行時に確定する可能性がある動的な条件を、特殊化条件として設定できる。更に、特殊化引用仕様で指定されている、仮引数に対する記述的な分散指示文(e.g.図2の引用仕様本体におけるdistribute指示文)は、暗黙的な特殊化条件とみなされる。   By defining the specialization conditions described above, dynamic conditions that are undefined at the time of compilation and may be determined at the time of execution, such as the number of processors in parallel execution and values of certain variables, can be set as the specialization conditions. Further, the descriptive distribution directive (e.g. distribute directive in the citation specification body of FIG. 2) for the dummy argument specified in the specialization citation specification is regarded as an implicit specialization condition.

次に、特殊化部103について詳細に説明する。特殊化部103は、特殊化検出部104、特殊化条件判定部105、及び、コード変換・生成部106を有する。特殊化検出部104は、プログラム実行で呼び出される総称サブプログラムの呼び出しを処理する際に、サブプログラム情報テーブル112を参照して、当該サブプログラムに対して特殊化サブプログラムが指定されているか否かを検出する。特殊化条件判定部105は、処理中の総称サブプログラムに対する特殊化サブプログラムが指定されているときは、特殊化情報テーブル111を参照して、対応する特殊化条件の成否を判定する。一つの総称サブプログラムに対して複数の特殊化サブプログラムが指定されているときは、特殊化情報テーブル111からエントリを1つずつ取り出し、各特殊化条件の判定を行う。   Next, the specialization unit 103 will be described in detail. The specialization unit 103 includes a specialization detection unit 104, a specialization condition determination unit 105, and a code conversion / generation unit 106. The specialization detection unit 104 refers to the subprogram information table 112 when processing the call of the generic subprogram called by program execution, and whether or not a specialization subprogram is specified for the subprogram. Is detected. The specialization condition determination unit 105 refers to the specialization information table 111 when the specialization subprogram for the generic subprogram being processed is designated, and determines whether the corresponding specialization condition is successful. When a plurality of specialized subprograms are designated for one generic subprogram, one entry is taken out from the specialization information table 111, and each specialization condition is determined.

コード変換・生成部106は、特殊化条件判定部105が特殊化条件が成立していると判定すると、当該総称サブプログラム呼び出しを、特殊化サブプログラムの呼び出しで置換する。特殊化条件が成立するか否かがコンパイル時に不定である場合は、特殊化条件の成否を実行時に判定し、その結果に基づいて、対応する特殊化サブプログラム又は元の総称サブプログラムを呼び分けるコードを生成する。複数の特殊化条件が成立する場合は、特殊化情報テーブル111の最も上位に現れる特殊化サブプログラムを優先して呼び出すようにコードを生成する。   When the specialization condition determination unit 105 determines that the specialization condition is satisfied, the code conversion / generation unit 106 replaces the generic subprogram call with the specialization subprogram call. If it is uncertain at the time of compilation whether or not the specialization condition is satisfied, the success or failure of the specialization condition is determined at execution time, and the corresponding specialized subprogram or the original generic subprogram is called based on the result Generate code. When a plurality of specialization conditions are satisfied, a code is generated so that the specialization subprogram that appears at the top of the specialization information table 111 is called preferentially.

続いて、特殊化情報テーブル111について説明する。特殊化情報テーブル111は、特殊化を宣言されている総称サブプログラムのそれぞれに対応する複数のテーブルを有する。各テーブルには、対応する総称サブプログラムに対して指定されている各特殊化サブプログラムの名前、引数、及び、特殊化条件が、総称サブプログラムの引用仕様宣言に現れた順序で記録される。   Next, the specialization information table 111 will be described. The specialization information table 111 has a plurality of tables corresponding to the generic subprograms that have been declared specialization. In each table, the names, arguments, and specialization conditions of each specialized subprogram specified for the corresponding generic subprogram are recorded in the order in which they appear in the quoted specification declaration of the generic subprogram.

図3に、特殊化部103の動作手順を示す。特殊化検出部104は、サブプログラムの呼び出しを検出すると、サブプログラム情報テーブル112を参照し、当該サブプログラムの特殊化フラグがオンであるか否かを判定する(ステップS1)。特殊化フラグがオンでないと判定された場合、当該サブプログラムに対する特殊化サブプログラムは存在しないので、コード変換・生成部106は、元の総称サブプログラムの呼び出しを生成する(ステップS13)。つまり、総称サブプログラムの特殊化サブプログラムへの置き換えは行わない。   FIG. 3 shows an operation procedure of the specialization unit 103. When the specialization detection unit 104 detects a subprogram call, the specialization detection unit 104 refers to the subprogram information table 112 and determines whether or not the specialization flag of the subprogram is on (step S1). If it is determined that the specialization flag is not on, there is no specialized subprogram for the subprogram, and the code conversion / generation unit 106 generates a call to the original generic subprogram (step S13). That is, the generic subprogram is not replaced with the specialized subprogram.

特殊化検出部104は、ステップS1で特殊化フラグがオンであると判定すると、対応する特殊化情報テーブル111に、未処理のエントリがあるか否かを判定する(ステップS2)。未処理のエントリがある場合は、未処理のエントリの中の先頭のエントリを、カレントエントリとして選ぶ。特殊化条件判定部105は、カレントエントリの特殊化条件がコンパイル時に成立するか否か、又は、コンパイル時には確定できず不定であるかを判定する(ステップS3)。条件が成立しない場合は、カレントエントリを処理済みとして、ステップS2に戻り、次の未処理エントリを選択する。特殊化条件が1つも成立又は不定と判定されることなく、全てのエントリの特殊化条件の判定を終了したときは、ステップS2からステップS13へと進んで、元の総称サブプログラムの呼び出しを生成する。ステップS3で、何れかのエントリの特殊化条件が成立すると判定されたときは、コード変換・生成部106は、当該サブプログラムの呼び出しを、当該エントリの特殊化サブプログラムの呼び出しに変換したコードを生成する(ステップS10)。   If the specialization detection unit 104 determines that the specialization flag is on in step S1, the specialization detection unit 104 determines whether there is an unprocessed entry in the corresponding specialization information table 111 (step S2). If there is an unprocessed entry, the first entry among the unprocessed entries is selected as the current entry. The specialization condition determination unit 105 determines whether or not the specialization condition of the current entry is satisfied at the time of compilation, or whether it cannot be determined at the time of compilation and is indefinite (step S3). If the condition is not satisfied, the current entry has been processed, the process returns to step S2, and the next unprocessed entry is selected. When it is not determined that any specialization condition is satisfied or indefinite, and the determination of the specialization condition for all entries is completed, the process proceeds from step S2 to step S13 to generate the original generic subprogram call. To do. When it is determined in step S3 that the specialization condition of any entry is satisfied, the code conversion / generation unit 106 converts the code obtained by converting the subprogram call into the specialization subprogram call of the entry. Generate (step S10).

ステップS3で不定であると判定された場合、コード変換・生成部106は、カレントエントリの特殊化条件を条件式とするIF構文を生成する(ステップS4)。特殊化条件に特殊化一時変数が現れる場合、宣言部にその宣言を生成し、IF構文の直前にその定義を生成する。特殊化条件又は特殊化一時変数の定義に表れる仮引数は、対応する実引数で置換する。その後、コード変換・生成部106は、ステップS4で生成したIF構文内に、カレントエントリの特殊化サブプログラムの呼び出しを生成し、カレントエントリを処理済みとする(ステップS5)。ステップS5で、特殊化サブプログラムを、ステップS4で生成したIF構文において条件式が成立した場合に実行されるサブプログラムとして記述することで、総称サブプログラムを呼び出す部分が、特殊化条件成立時に特殊化サブプログラムを呼び出すコードに変換される。   If it is determined in step S3 that the code conversion / generation unit 106 is indefinite, the code conversion / generation unit 106 generates an IF syntax using the specialization condition of the current entry as a conditional expression (step S4). When a specialization temporary variable appears in the specialization condition, the declaration is generated in the declaration part, and the definition is generated immediately before the IF syntax. Formal arguments appearing in the definition of specialization conditions or specialization temporary variables are replaced with the corresponding actual arguments. Thereafter, the code conversion / generation unit 106 generates a call for the specialized subprogram of the current entry in the IF syntax generated in step S4, and sets the current entry as processed (step S5). In step S5, the specialized subprogram is described as a subprogram that is executed when the conditional expression is satisfied in the IF syntax generated in step S4, so that the part that calls the generic subprogram is special when the specialization condition is satisfied. Is converted into code that calls the generalized subprogram.

続いて、特殊化検出部104は、特殊化情報テーブル111の中に、未処理のエントリがあるか否かを判定する(ステップS6)。未処理のエントリがあるときは、その中の先頭のエントリを、カレントエントリとして選ぶ。特殊化条件判定部105は、カレントエントリの特殊化条件がコンパイル時に成立するか否か、又は、不定であるかを判定する(ステップS8)。不定と判定した場合、コード変換・生成部106は、カレントエントリの特殊化条件を条件式とするELSE IF文を生成する(ステップS11)。このとき、特殊化条件に特殊化一時変数が現れる場合は、宣言部にその宣言を生成し、IF構文の直前にその定義を生成する。特殊化条件又は特殊化一時変数の定義に現れる仮引数は、対応する実引数で置換する。コード変換・生成部106は、カレントエントリの特殊化サブプログラムの呼び出しを生成し、カレントエントリを処理済とする(ステップS12)。ステップS12で生成される特殊化サブプログラムは、ステップS11で生成したELSE IFの条件式が成立するときに実行されるサブプログラムである。その後、ステップS6に戻り、次のエントリを選択する。   Subsequently, the specialization detection unit 104 determines whether or not there is an unprocessed entry in the specialization information table 111 (step S6). If there is an unprocessed entry, the first entry is selected as the current entry. The specialization condition determination unit 105 determines whether or not the specialization condition of the current entry is satisfied at the time of compilation or is indefinite (step S8). If determined to be indeterminate, the code conversion / generation unit 106 generates an ELSE IF statement that uses the specialization condition of the current entry as a conditional expression (step S11). At this time, if a specialization temporary variable appears in the specialization condition, the declaration is generated in the declaration part, and the definition is generated immediately before the IF syntax. A dummy argument that appears in the definition of a specialization condition or specialization temporary variable is replaced with the corresponding actual argument. The code conversion / generation unit 106 generates a call to the specialization subprogram of the current entry and sets the current entry as processed (step S12). The specialized subprogram generated in step S12 is a subprogram executed when the ELSE IF conditional expression generated in step S11 is satisfied. Thereafter, the process returns to step S6, and the next entry is selected.

ステップS8で、特殊化検出部104が特殊化条件が成立すると判定した場合、コード変換・生成部106は、ELSE文を生成し(ステップS9)、ステップS10に進んで特殊化サブプログラムの呼び出しを生成する。つまり、直前のIF構文の条件式が成立しない場合に実行される特殊化サブプログラムの呼び出しを生成する。特殊化条件が成立しないときは、ステップS6に戻る。ステップS6で、未処理のエントリがないと判定されると、つまり、全ての特殊化条件の判定が終了すると、コード変換・生成部106は、ELSE文を生成し(ステップS7)、ステップS13に進んで、総称サブプログラムの呼び出しを生成する。つまり、直前のIF構文の条件式が成立しないときに実行される総称サブプログラムの呼び出しを生成する。   If the specialization detection unit 104 determines in step S8 that the specialization condition is satisfied, the code conversion / generation unit 106 generates an ELSE statement (step S9), and proceeds to step S10 to call the specialization subprogram. Generate. That is, a call to a specialized subprogram that is executed when a conditional expression of the immediately preceding IF syntax is not satisfied is generated. When the specialization condition is not satisfied, the process returns to step S6. If it is determined in step S6 that there is no unprocessed entry, that is, if all the specialization conditions have been determined, the code conversion / generation unit 106 generates an ELSE statement (step S7), and the process proceeds to step S13. Go ahead and generate generic subprogram calls. That is, a generic subprogram call that is executed when the conditional expression of the immediately preceding IF syntax is not satisfied is generated.

以下、図2に示すプログラムを用いて、特殊化部103の動作の具体例を説明する。なお、説明容易となるように、図2のプログラムにはredist_copyの呼び出しを明示してあるが、本来、HPFの実行時ライブラリ手続は処理系によって暗黙的に呼び出されるものであり、ユーザプログラム上から直接に呼び出されることは通常ないことに注意されたい。図3に示す処理に先立って、構文解析部102は、図2に示すプログラムから、特殊化情報テーブル111と、サブプログラム情報テーブル112とを生成する。   A specific example of the operation of the specialization unit 103 will be described below using the program shown in FIG. For ease of explanation, the program shown in FIG. 2 clearly shows the call to redist_copy, but the HPF runtime library procedure is originally called implicitly by the processing system, and from the user program. Note that it is not usually called directly. Prior to the processing shown in FIG. 3, the syntax analysis unit 102 generates a specialized information table 111 and a subprogram information table 112 from the program shown in FIG.

図4に、特殊化情報テーブル111及びサブプログラム情報テーブル112のデータ例を示す。図2では、interface文で総称名として指定されているredist_copyに対して、interfaceからend interfaceまでの間にspecial指定子が存在するので、総称サブプログラムredist_copyに対して特殊化フラグをオンに設定する。また、作成する/作成したredist_copyに対する特殊化サブプログラムの情報を記録する特殊化情報テーブルへのリンクを設定する。   FIG. 4 shows data examples of the specialization information table 111 and the subprogram information table 112. In FIG. 2, a special specifier exists between interface and end interface for redist_copy specified as a generic name in the interface statement, so the specialization flag is set to ON for the generic subprogram redist_copy. . In addition, a link to a specialization information table that records information of the specialization subprogram for the created / created redist_copy is set.

図2では、HPFの実行時ライブラリ手続redist_copyに対して、2つの特殊化サブプログラムredist_copy_squareとredist_copy_blockが宣言されている。構文解析部102は、これら特殊化サブプログラムを、redist_copyについての特殊化情報テーブル111の各エントリに登録する。各エントリは、特殊化手続の手続名、引数、特殊化条件を有する。例えば、手続名「redist_copy_square」について、引数「real a1(:,:) , a2(:,:)、distribute a1(*,block)、distribute a2(block,*)」、特殊化条件「mod(size(a1,1), np) == 0 .and. mod(np,2) == 0」を登録する。   In FIG. 2, two specialized subprograms redist_copy_square and redist_copy_block are declared for the HPF runtime library procedure redist_copy. The syntax analysis unit 102 registers these specialized subprograms in each entry of the specialized information table 111 for redist_copy. Each entry has a procedure name, arguments, and specialization conditions for the specialization procedure. For example, for the procedure name `` redist_copy_square '', arguments `` real a1 (:, :), a2 (:, :), distribute a1 (*, block), distribute a2 (block, *) '', specialization condition `` mod (size (a1,1), np) == 0 .and. mod (np, 2) == 0 ”is registered.

特殊化部103は、プログラム内で、サブプログラムを呼び出す部分を検出する。このとき、特殊化部103は、ソースプログラム上での明示的に呼び出されるサブプログラムだけでなく、ソースプログラムの実行時に黙示的に呼び出されるサブプログラムも検出する。特殊化部103がredist_copy(x1, x2)の呼び出しを検出すると、特殊化検出部104は、ステップS1でサブプログラム情報テーブル112を検索し、redist_copyの特殊化フラグがオンであるか否かを調べる。特殊化フラグはオンであるので、ステップS2に進む。特殊化条件判定部105は、特殊化情報テーブル111の最初のエントリ(redist_copy_square)をカレントエントリとする。その後、ステップS3で、カレントエントリの特殊化条件が成立しているか否かを判定する。   The specialization unit 103 detects a part that calls a subprogram in the program. At this time, the specialization unit 103 detects not only a subprogram that is explicitly called on the source program but also a subprogram that is implicitly called when the source program is executed. When the specialization unit 103 detects the call to redist_copy (x1, x2), the specialization detection unit 104 searches the subprogram information table 112 in step S1 to check whether the specialization flag of redist_copy is on. . Since the specialization flag is on, the process proceeds to step S2. The specialization condition determination unit 105 sets the first entry (redist_copy_square) in the specialization information table 111 as the current entry. Thereafter, in step S3, it is determined whether or not a special condition for the current entry is satisfied.

特殊化条件の判定では、特殊化条件に含まれる引数(a1,a2)を、サブプログラム呼び出し時の引数(x1,x2)に変換した上で、条件判定を行う。図2を参照すると、第1引数であるx1の1次元目のサイズは1024で、np(=number_of_processors())の値は8であるので(2行目及び3行目)、特殊化条件の前段部分であるmod(size(x1,1),np)==0は成立する。また、後段部分mod(np,2)==0も成立する。従って、ステップS3からステップS10へと進む。コード変換・生成部106は、当該特殊化サブプログラム(redist_copy_square)の呼び出しを生成して、redist_copy(x1, x2)についての処理を終了する。   In determining the specialization condition, the argument (a1, a2) included in the specialization condition is converted into the argument (x1, x2) at the time of calling the subprogram, and then the condition determination is performed. Referring to FIG. 2, the size of the first dimension of the first argument x1 is 1024, and the value of np (= number_of_processors ()) is 8 (2nd and 3rd lines). The former part mod (size (x1,1), np) == 0 holds. Further, the latter part mod (np, 2) == 0 also holds. Accordingly, the process proceeds from step S3 to step S10. The code conversion / generation unit 106 generates a call to the specialization subprogram (redist_copy_square), and ends the process for redist_copy (x1, x2).

次に、特殊化部103がredist_copy(y1, y2)の呼び出しを検出すると、特殊化検出部104は、ステップS1で、サブプログラム情報テーブル112を検索し、redist_copyの特殊化フラグがオンであると判定する。特殊化条件判定部105は、ステップS2で特殊化情報テーブル111の最初のエントリ(redist_copy_square)をカレントエントリとし、ステップS3でカレントエントリの特殊化条件が成立しているか否かを判定する。   Next, when the specialization unit 103 detects a call to redist_copy (y1, y2), the specialization detection unit 104 searches the subprogram information table 112 in step S1 and determines that the specialization flag of redist_copy is on. judge. The specialization condition determination unit 105 sets the first entry (redist_copy_square) in the specialization information table 111 as the current entry in step S2, and determines whether the specialization condition for the current entry is satisfied in step S3.

redist_cpoy_squareの特殊化条件の成否を判定すると、特殊化条件の前段部分であるmod(size(y1,1),np)==0が成立するかどうかが不定である。従って、ステップS3からステップS4、S5へと進み、コード変換・生成部106が、特殊化条件を条件式とするIF構文と、条件式が成立したときに実行される特殊化サブプログラムの呼び出し(redist_copy_square)を生成する。このとき、distribute指示文は、暗黙的な特殊化条件とみなされるので、特殊化条件に、distribute指示文に対応する条件を追加する。また、IF構文に先行して、特殊化一時変数npの宣言(integer np)及び定義(np=number_of_processors())を併せて生成する。   When the success / failure of the specialization condition of redist_cpoy_square is determined, it is uncertain whether mod (size (y1,1), np) == 0, which is the preceding part of the specialization condition, is satisfied. Accordingly, the process proceeds from step S3 to steps S4 and S5, and the code conversion / generation unit 106 calls the IF syntax that uses the specialization condition as a conditional expression and the calling of the specialization subprogram executed when the conditional expression is satisfied ( redist_copy_square). At this time, since the distribute directive is regarded as an implicit specialization condition, a condition corresponding to the distribute directive is added to the specialization condition. Prior to the IF syntax, a declaration (integer np) and a definition (np = number_of_processors ()) of the specialization temporary variable np are also generated.

ステップS5で、特殊化サブプログラムの呼び出しを生成した後、ステップS6へ進む。特殊化条件判定部105は、ステップS6で2つ目のエントリ(redist_copy_block)をカレントエントリとして選択し、ステップS8でカレントエントリの特殊化条件が成立するか否かを判定する。この特殊化条件の成否も不定であるので、ステップS8からステップS11へと進む。コード変換・生成部106は、ステップS11、S12で、else if文と、else if文の条件式が成立したときに実行される特殊化サブプログラム(redist_copy_square)の呼び出しを生成する。その後、ステップS6へ戻る。   In step S5, after calling a specialized subprogram, the process proceeds to step S6. The specialization condition determination unit 105 selects the second entry (redist_copy_block) as the current entry in step S6, and determines whether the specialization condition for the current entry is satisfied in step S8. Since the success or failure of the specialization condition is also undefined, the process proceeds from step S8 to step S11. In steps S11 and S12, the code conversion / generation unit 106 generates an else if statement and a call to a specialized subprogram (redist_copy_square) that is executed when the conditional expression of the else if statement is satisfied. Then, it returns to step S6.

ステップS6で、次のエントリを選択しようとすると、特殊化情報テーブル111には未処理のエントリが残っていないので、ステップS6からステップS7へと進む。コード変換・生成部106は、ステップS7で、ステップS11で生成したelse ifに対応するelse文を生成し、ステップS13で、元の総称サブプログラム(redist_copy)の呼び出しを生成し、redist_copy(y1, y2)についての処理を終了する。   If an attempt is made to select the next entry in step S6, since no unprocessed entries remain in the specialization information table 111, the process proceeds from step S6 to step S7. In step S7, the code conversion / generation unit 106 generates an else statement corresponding to the else if generated in step S11. In step S13, the code conversion / generation unit 106 generates a call to the original generic subprogram (redist_copy), and redist_copy (y1, The process for y2) is terminated.

続いて、特殊化部103がredist_copy(z1, z2)の呼び出しを検出すると、特殊化検出部104は、ステップS1で、サブプログラム情報テーブル112を検索し、redist_copyの特殊化フラグがオンであると判定する。特殊化条件判定部105は、ステップS2で特殊化情報テーブル111の最初のエントリ(redist_copy_square)をカレントエントリとし、ステップS3でカレントエントリの特殊化条件が成立しているか否かを判定する。この特殊化条件は成立しないので、ステップ2に戻り、次のエントリ(redist_cpoy_block)を選択する。   Subsequently, when the specialization unit 103 detects a call to redist_copy (z1, z2), the specialization detection unit 104 searches the subprogram information table 112 in step S1, and determines that the specialization flag of redist_copy is on. judge. The specialization condition determination unit 105 sets the first entry (redist_copy_square) in the specialization information table 111 as the current entry in step S2, and determines whether the specialization condition for the current entry is satisfied in step S3. Since this specialization condition is not satisfied, the process returns to step 2 to select the next entry (redist_cpoy_block).

ステップS3で、redist_cpoy_blockの特殊化条件の成否を判定すると、この条件も成立しないので、ステップ2に戻る。ステップS2で、次のエントリを選択しようとすると、特殊化情報テーブル111には未処理のエントリが残っていないので、ステップS2からステップS13へと進む。コード変換・生成部106は、ステップS13で、元の総称サブプログラム(redist_copy)の呼び出しを生成し、redist_copy(z1, z2)についての処理を終了する。この場合は、全ての特殊化サブプログラムについて特殊化条件が成立しないので特殊化サブプログラムへの変換は行われない。   If it is determined in step S3 whether or not the specialization condition for redist_cpoy_block is satisfied, the condition is not satisfied, and the process returns to step 2. If an attempt is made to select the next entry in step S2, since there are no unprocessed entries remaining in the specialization information table 111, the process proceeds from step S2 to step S13. In step S13, the code conversion / generation unit 106 generates a call to the original generic subprogram (redist_copy), and ends the process for redist_copy (z1, z2). In this case, since specialization conditions are not satisfied for all specialized subprograms, conversion into specialized subprograms is not performed.

図5に、特殊化部103による処理結果を示す。図2に示すプログラムに含まれる3つのredist_copyの呼び出しを、図3に示す処理にて処理すると、図5に示す結果が得られる。1つ目のredist_copyは、コンパイル時にredist_copy_squareの特殊化条件が成立するケースであり、redist_copy(x1, x2)は、redist_copy_square(x1. x2)に置き換えられる。2つ目のredist_copyは、実行時にredist_copy_squareの特殊化条件が成立するときは、redist_copy_squareを呼び出し、不成立時にredist_copy_blockの特殊化条件が成立するときはredist_copy_blockを呼び出し、双方とも不成立のときは、元のredist_copyを呼び出すコードに変換される。3つ目のredist_copyは、何れのコンパイル時に特殊化条件も成立しないので、元のredist_copyの呼び出しのままである。   FIG. 5 shows a processing result by the specialization unit 103. If the three redist_copy calls included in the program shown in FIG. 2 are processed by the process shown in FIG. 3, the result shown in FIG. 5 is obtained. The first redist_copy is a case where the specialization condition of redist_copy_square is satisfied at the time of compilation, and redist_copy (x1, x2) is replaced with redist_copy_square (x1. X2). The second redist_copy calls redist_copy_square when the redist_copy_square specialization condition is met at execution time, calls redist_copy_block when the redist_copy_block specialization condition is met, and when both are not met, the original redist_copy_block Is converted into code that calls. Since the third redist_copy does not satisfy any specialization condition at the time of compilation, the original redist_copy is still called.

本実施形態では、プログラミング言語に、総称的に定義されているサブプログラムに対して、特定の条件下でより性能が高い特殊化サブプログラムを指定する機能と、その適用条件を設定する機能とを持たせる。特殊化条件の設定では、動的な情報を、特殊化条件に設定できる。コンパイラは、特殊化を伴うサブプログラムの呼び出しを検出し、特殊化条件の成否をコンパイル時に判定する。条件成立時は、元の総称サブプログラム呼び出しを特殊化サブプログラム呼び出しで置き換える。コンパイル時に特殊化条件の成否が不明なときは、実行時に特殊化条件の成否を判定して、特殊化サブプログラム又は元の総称サブプログラムを呼び分けるコードを生成する。   In the present embodiment, for the subprograms defined generically in the programming language, a function for specifying a specialized subprogram having higher performance under a specific condition and a function for setting the application condition are provided. Give it. In setting specialization conditions, dynamic information can be set as specialization conditions. The compiler detects a call to a subprogram with specialization, and determines whether the specialization condition is successful at the time of compilation. When the condition is met, the original generic subprogram call is replaced with a specialized subprogram call. When the success or failure of the specialization condition is unknown at the time of compilation, the success or failure of the specialization condition is determined at the time of execution, and a code for calling the specialization subprogram or the original generic subprogram is generated.

本実施形態では、必要に応じて実行時に条件判定を行うことで、より柔軟な特殊化条件をユーザが設定できる。また、特殊化条件の判定と特殊化サブプログラムの呼び出しとを、処理系が自動的に行うことで、実行環境や問題設定の変更に伴うソースプログラムの修正が不要である。ソースプログラムに、特殊化サブプログラムを指定する機能と特殊化条件を設定する機能とを持たせることで、組込みサブプログラムや実行時ライブラリルーチンを特殊化の対象にできる。また、ユーザがソースプログラムにて特殊化サブプログラムを定義することにより、任意の特殊化を実現できる。   In this embodiment, the user can set more flexible specialization conditions by performing condition determination at the time of execution as necessary. In addition, since the processing system automatically performs the determination of the specialization condition and the call of the specialization subprogram, it is not necessary to modify the source program in accordance with the change of the execution environment and the problem setting. By providing the source program with a function for specifying a specialized subprogram and a function for setting a specialization condition, it is possible to target an embedded subprogram or a runtime library routine. Also, any specialization can be realized by the user defining the specialization subprogram in the source program.

なお、上記実施形態では、ソースプログラムにFortranを用いる例について説明したが、ソースプログラムの言語は、Fortran又はその拡張言語には限られない。例えば、C言語の拡張である並列言語Unified Parallel C(UPC)を用いることもできる。図6に、UPCの例を示す。1行目では、総称的な、すなわち、任意の型・任意のブロックサイズの共有配列を処理対象とする関数ArrayCopyのプロトタイプが宣言されている。2行目のspecialize(ArrayCopy)にて、総称的な関数ArrayCopyに対して、特殊化サブプログラムを指定する。3行目以降において、ArrayCopyに対する特殊化条件と特殊化関数(ArrayCopy_Congruent)とが宣言されている。このようなソースプログラムに対するコンパイラの動作は、FortranとCの文法の違いを除き、上記実施形態のそれと同じである。   In the above embodiment, an example in which Fortran is used as a source program has been described. However, the language of the source program is not limited to Fortran or an extended language thereof. For example, a parallel language Unified Parallel C (UPC), which is an extension of the C language, can be used. FIG. 6 shows an example of UPC. In the first line, a prototype of a function ArrayCopy that declares a generic array, that is, a shared array of an arbitrary type and an arbitrary block size is declared. In the second line, specialize (ArrayCopy), a specialized subprogram is specified for the generic function ArrayCopy. In the third and subsequent lines, specialization conditions and specialization functions (ArrayCopy_Congruent) for ArrayCopy are declared. The operation of the compiler for such a source program is the same as that of the above embodiment, except for the difference in syntax between Fortran and C.

以上、本発明をその好適な実施形態に基づいて説明したが、本発明のコンパイラ、コンパイル方法、及び、プログラムは、上記実施形態にのみ限定されるものではなく、上記実施形態の構成から種々の修正及び変更を施したものも、本発明の範囲に含まれる。   Although the present invention has been described based on the preferred embodiment, the compiler, the compilation method, and the program of the present invention are not limited to the above embodiment, and various configurations are possible from the configuration of the above embodiment. Modifications and changes are also included in the scope of the present invention.

本発明の一実施形態のコンパイラを示すブロック図。The block diagram which shows the compiler of one Embodiment of this invention. ソースプログラム例を示す図。The figure which shows the example of a source program. 特殊化部の動作手順を示すフローチャート。The flowchart which shows the operation | movement procedure of a specialization part. サブプログラム情報テーブル及び特殊化情報テーブルのデータ例を示す図。The figure which shows the example of data of a subprogram information table and a specialization information table. 特殊化部による処理後のプログラムを示す図。The figure which shows the program after the process by the specialization part. UPC言語で記述したプログラムを示す図。The figure which shows the program described in the UPC language.

符号の説明Explanation of symbols

100:ソースプログラム
101:コンパイラ
102:構文解析部
103:特殊化部
104:特殊化検出部
105:特殊化条件判定部
106:コード変換・生成部
107:並列化部
108:最適化部
109:コード生成部
110:オブジェクトプログラム
111:特殊化情報テーブル
112:サブプログラム情報テーブル
100: source program 101: compiler 102: syntax analysis unit 103: specialization unit 104: specialization detection unit 105: specialization condition determination unit 106: code conversion / generation unit 107: parallelization unit 108: optimization unit 109: code Generation unit 110: Object program 111: Specialization information table 112: Subprogram information table

Claims (16)

コンピュータを用い、総称サブプログラムに対する特殊化サブプログラムを指定する記述と、コンパイル時に不定の情報を含み、前記特殊化サブプログラムが適用される特殊化条件を設定する記述とを含むソースプログラムをコンパイルする方法であって、
前記コンピュータが、前記ソースプログラムに含まれる前記特殊化サブプログラム及び特殊化条件を特殊化情報テーブルに記録するステップと、
前記コンピュータが、前記ソースプログラムに基づいて、特殊化サブプログラムが指定された総称サブプログラムの呼び出しを検出するステップと、
前記コンピュータが、前記特殊化情報テーブルを参照して、前記検出した総称サブプログラムに対応する特殊化サブプログラムの特殊化条件がコンパイル時に成立するか否かを判定するステップと、
前記判定ステップで前記特殊化条件がコンパイル時に成立するか否かが不定であると判定されると、前記コンピュータが、前記総称サブプログラムを呼び出すコードを、前記特殊化条件の成立時に前記特殊化サブプログラムを呼び出すコードに変換するステップとを有するコンパイル方法。
Using a computer, compile a source program that includes a description that specifies a specialized subprogram for the generic subprogram and a description that includes indefinite information at the time of compilation and sets a specialization condition to which the specialized subprogram is applied. A method,
The computer recording the specialization subprogram and specialization conditions included in the source program in a specialization information table;
The computer detecting a call of a generic subprogram to which a specialized subprogram is designated based on the source program;
The computer refers to the specialization information table to determine whether a specialization condition of the specialization subprogram corresponding to the detected generic subprogram is satisfied at the time of compilation;
If it is determined in the determination step that the specialization condition is satisfied at the time of compilation, it is determined that the computer calls code for calling the generic subprogram when the specialization condition is satisfied. A compiling method comprising the step of converting the code into a code that calls the program.
前記特殊化サブプログラムを指定する記述が、1つの総称サブプログラムに対して複数の特殊化サブプログラムを指定する記述を含み、かつ、前記特殊化条件を設定する記述が、前記複数の特殊化サブプログラムのそれぞれが適用される特殊化条件を設定する記述を含んでおり、前記コンピュータは、前記複数の特殊化サブプログラム及び特殊化条件を、前記特殊化情報テーブルにエントリを分けて登録する、請求項1に記載のコンパイル方法。   The description that specifies the specialization subprogram includes a description that specifies a plurality of specialization subprograms for one generic subprogram, and the description that sets the specialization condition includes the plurality of specialization subprograms. The computer program includes a description for setting specialization conditions to which each of the programs is applied, and the computer registers the plurality of specialization subprograms and specialization conditions by dividing the entries into the specialization information table. The compiling method according to Item 1. 前記コンピュータは、前記特殊化条件がコンパイル時に成立すると判定されるまで、又は、全ての特殊化条件の判定が終了するまで、前記特殊化情報テーブルのエントリを1つずつ選択し、該選択したエントリの特殊化条件がコンパイル時に成立するか否かを判定する、請求項2に記載のコンパイル方法。   The computer selects one entry of the specialization information table one by one until it is determined that the specialization condition is satisfied at the time of compilation, or until the determination of all specialization conditions is completed, and the selected entry The compiling method according to claim 2, wherein it is determined whether or not the specialization condition is satisfied at the time of compiling. 前記判定ステップで前記特殊化条件がコンパイル時に成立するか否かが不定であると判定された後に、他の特殊化条件が成立するか否かがコンパイル時に不定であると判定されると、前記コンピュータが、前記不定と判定された特殊化条件が成立せず、かつ、前記不定と判定された他の特殊化条件が成立するときに、当該他の特殊化条件に対応する特殊化サブプログラムを呼び出すコードを生成し追加するステップを更に有する、請求項3に記載のコンパイル方法。   If it is determined in the determination step that the specialization condition is satisfied at compile time, and then it is determined that another specialization condition is satisfied at the time of compilation, When the specialization condition determined to be indefinite is not satisfied and the other specialization condition determined to be indefinite is satisfied, the computer executes a specialization subprogram corresponding to the other specialization condition. The compiling method according to claim 3, further comprising generating and adding code to be called. 前記判定ステップで前記特殊化条件がコンパイル時に成立するか否かが不定であると判定された後に、他の特殊化条件が成立すると判定されると、前記コンピュータが、前記不定と判定された特殊化条件が成立しないときに、前記成立すると判定された特殊化条件に対応する特殊化サブプログラムを呼び出すコードを生成し追加するステップを更に有する、請求項3に記載のコンパイル方法。   If it is determined in the determination step that the specialization condition is satisfied at the time of compilation, and if it is determined that another specialization condition is satisfied, the computer determines that the special is determined to be indefinite. 4. The compiling method according to claim 3, further comprising a step of generating and adding a code for calling a specialization subprogram corresponding to the specialization condition determined to be satisfied when the optimization condition is not satisfied. 前記判定ステップで前記特殊化条件がコンパイル時に成立するか否かが不定であると判定された後に、全ての特殊化条件の判定が終了すると、前記コンピュータが、前記不定と判定された特殊化条件が成立しないときに、前記総称サブプログラムを呼び出すコードを生成し追加するステップを更に有する、請求項3に記載のコンパイル方法。   After determining that the specialization condition is satisfied at the time of compiling in the determination step, and after determining all the specialization conditions, the computer determines the specialization condition determined to be indefinite. The compiling method according to claim 3, further comprising a step of generating and adding a code that calls the generic subprogram when the above is not established. 前記特殊化条件がコンパイル時に成立すると判定されると、前記コンピュータが、前記総称サブプログラムの呼び出すコードを、前記特殊化条件が成立する特殊化サブプログラムの呼び出すコードに変換するステップを更に有する、請求項1乃至3の何れか一に記載のコンパイル方法。   When it is determined that the specialization condition is satisfied at the time of compilation, the computer further includes a step of converting a code called by the generic subprogram into a code called by the specialization subprogram that satisfies the specialization condition. Item 4. The compiling method according to any one of Items 1 to 3. 前記コンピュータが、前記総称サブプログラムの呼び出しを検出するステップに先行して、前記ソースプログラムの実行時に呼び出される総称サブプログラムを検索し、前記特殊化サブプログラムが指定された総称サブプログラムを、特殊化サブプログラムが指定されている旨を示すフラグと共にサブプログラム情報テーブルに登録するステップを更に有する、請求項1乃至7の何れか一に記載のコンパイル方法。   Prior to the step of detecting the call of the generic subprogram, the computer searches for the generic subprogram that is called when the source program is executed, and specializes the generic subprogram in which the specialized subprogram is specified. 8. The compiling method according to claim 1, further comprising a step of registering in a subprogram information table together with a flag indicating that a subprogram is designated. 前記特殊化サブプログラムが指定された総称サブプログラムの呼び出しを検出するステップが、
前記コンピュータが、前記ソースプログラムに基づいて、総称サブプログラムの呼び出しを検出するステップと、
前記コンピュータが、前記フラグを参照して、前記検出した総称サブプログラムに対して特殊化サブプログラムが指定されているか否かを判定するステップとを含む、請求項8に記載のコンパイル方法。
Detecting a call to a generic subprogram with the specialized subprogram specified;
The computer detecting a call to a generic subprogram based on the source program;
The compiling method according to claim 8, further comprising: determining whether a specialized subprogram is designated for the detected generic subprogram with reference to the flag.
コンピュータに、総称サブプログラムに対する特殊化サブプログラムを指定する記述と、コンパイル時に不定の情報を含み、前記特殊化サブプログラムが適用される特殊化条件を設定する記述とを含むソースプログラムを入力させ、前記特殊化サブプログラム及び特殊化条件を特殊化情報テーブルに記録させための構文解析部と、
前記コンピュータに、前記ソースプログラムに基づいて、前記特殊化サブプログラムが指定された総称サブプログラムの呼び出しを検出させための特殊化検出部と、
前記コンピュータに、前記特殊化情報テーブルを参照させて、前記検出された総称サブプログラムに対応する特殊化サブプログラムの特殊化条件がコンパイル時に成立するか否かを判定させための特殊化条件判定部と、
記特殊化条件がコンパイル時に成立すると判定されると、前記コンピュータに、前記総称サブプログラムを呼び出すコードを、前記特殊化条件が成立する特殊化サブプログラムを呼び出すコードに変換させ、前記特殊化条件がコンパイル時に成立するか否かが不定であると判定されると、前記総称サブプログラムを呼び出すコードを、前記特殊化条件の成立時に前記特殊化サブプログラムを呼び出すコードに変換させためのコード変換・生成部とを備えるコンパイラ。
The computer, the description that specifies the special subprogram for generic subprogram includes indeterminate information at compile time, to input a source program including a description and to the specialized sub program sets the special conditions that apply, a parser for Ru is recorded in specialized information table the specialized subprograms and special conditions,
The computer, and on the basis of the source program, specialization detector for Ru is detected the call to the generic subprogram special subprogram is specified,
The computer, said by referring to specialized information table, special conditions determined for the special conditions of specialized sub-programs corresponding to the detected generic subprogram Ru is determined whether or not satisfied at compile And
When the front Symbol specialized conditions Ru is determined that established at compile time, the computer, the code that calls the generic subprogram, the specialized conditions is converted to the code that calls the specialized subprogram satisfied, the special conditions When but Ru is determined whether established at compile time is indefinite, the code that calls the generic subprogram, code conversion for Ru is converted to code that calls the special subprogram during establishment of the special conditions A compiler having a generation unit.
前記特殊化サブプログラムを指定する記述が、1つの総称サブプログラムに対して複数の特殊化サブプログラムを指定する記述を含み、かつ、前記特殊化条件を設定する記述が、前記複数の特殊化サブプログラムのそれぞれの特殊化条件を設定する記述を含み、前記構文解析部は、前記複数の特殊化サブプログラム及び特殊化条件を、前記特殊化情報テーブルにエントリを分けて登録する、請求項10に記載のコンパイラ。   The description that specifies the specialization subprogram includes a description that specifies a plurality of specialization subprograms for one generic subprogram, and the description that sets the specialization condition includes the plurality of specialization subprograms. 11. The description includes setting a specialization condition for each program, and the syntax analysis unit registers the plurality of specialization subprograms and specialization conditions separately in the specialization information table. The listed compiler. 前記特殊化条件判定部は、前記特殊化条件がコンパイル時に成立すると判定されるまで、又は、全ての特殊化条件の判定が終了されるまで、前記コンピュータに、前記特殊化情報テーブルのエントリを1つずつ選択させ、該選択したエントリの特殊化条件がコンパイル時に成立するか否かを判定させためのものである、請求項11に記載のコンパイラ。 The specialization condition judging unit, the special conditions are determined to be satisfied at compile time until, or until the determination of all the specialized conditions is ended, the computer, the entry of the specialized information table 1 one each is selected is for special conditions of the entry the selected Ru is determined whether or not satisfied at compile time, the compiler according to claim 11. 前記コンピュータが、前記特殊化条件がコンパイル時に成立するか否かが不定であると判定した後に、他の特殊化条件が成立するか否かがコンパイル時に不定であると判定したときに、前記コード変換・生成部は、前記コンピュータに、前記不定と判定された特殊化条件が成立せず、かつ、前記不定と判定された他の特殊化条件が成立するときに、当該他の特殊化条件に対応する特殊化サブプログラムを呼び出すコードを生成させ追加させことを特徴とする、請求項12に記載のコンパイラ。 When the computer determines that whether or not the specialization condition is satisfied at compile time and then determines that another specialization condition is satisfied or not is determined at compile time, the code When the specialization condition determined to be indefinite is not satisfied and the other specialization condition determined to be indefinite is satisfied in the computer , the conversion / generation unit sets the other specialization condition to characterized in that to produce a code that calls the corresponding special subprogram Ru is added, the compiler according to claim 12. 前記コンピュータが、前記特殊化条件がコンパイル時に成立するか否かが不定であると判定した後に、他の特殊化条件が成立すると判定したときに、前記コード変換・生成部は、前記コンピュータに、前記不定と判定された特殊化条件が成立しないときに、前記成立すると判定された特殊化条件に対応する特殊化サブプログラムを呼び出すコードを生成させ追加させことを特徴とする、請求項12に記載のコンパイラ。 The computer, after the specialized conditions is determined to whether established at compile time is indefinite, when other special conditions is judged to be satisfied, the code conversion-generating unit, the computer, when the undefined determined as special conditions is not satisfied, characterized in that to generate the code that calls the special subprogram corresponding to the determined specialized conditions as established Ru is added, in claim 12 The listed compiler. 前記コンピュータが、前記特殊化条件がコンパイル時に成立するか否かが不定であると判定した後に、全ての特殊化条件の判定が終了したと判定したときに、前記コード変換・生成部前記コンピュータに、前記不定と判定された特殊化条件が成立しないときに、前記総称サブプログラムを呼び出すコードを生成させ追加させことを特徴とする、請求項12に記載のコンパイラ。 The computer, after the specialized conditions is determined to whether established at compile time is indefinite, when the determination of all the specialized conditions determined to have ended, the code conversion-generating unit, the the computer, when the undefined determined as special conditions is not satisfied, wherein the Ru was added to produce a code that calls the generic subprogram, according to claim 12 compiler. コンピュータに、総称サブプログラムに対する特殊化サブプログラムを指定する記述と、コンパイル時に不定の情報を含み、前記特殊化サブプログラムが適用される特殊化条件を設定する記述とを含むソースプログラムをコンパイルする処理を実行させるプログラムであって、前記コンピュータに、
前記ソースプログラムに含まれる前記特殊化サブプログラム及び特殊化条件を特殊化情報テーブルに記録する処理と、
前記ソースプログラムに基づいて、特殊化サブプログラムが指定された総称サブプログラムの呼び出しを検出する処理と、
前記特殊化情報テーブルを参照して、前記検出した総称サブプログラムに対応する特殊化サブプログラムの特殊化条件がコンパイル時に成立するか否かを判定する処理と、
前記判定処理で前記特殊化条件がコンパイル時に成立するか否かが不定であると判定すると、前記コンピュータが、前記総称サブプログラムを呼び出すコードを、前記特殊化条件の成立時に前記特殊化サブプログラムを呼び出すコードに変換する処理とを実行させるプログラム。
Processing for compiling a source program including a description for specifying a specialized subprogram for a generic subprogram and a description for setting specialization conditions to which the specialized subprogram is applied, including indefinite information at the time of compilation. A program for causing the computer to execute
A process of recording the specialization subprogram and specialization conditions included in the source program in a specialization information table;
A process for detecting a call to a generic subprogram in which a specialized subprogram is specified based on the source program;
A process of referring to the specialization information table to determine whether a specialization condition of the specialization subprogram corresponding to the detected generic subprogram is satisfied at the time of compilation;
If it is determined in the determination processing that the specialization condition is satisfied at compile time, the computer calls the generic subprogram code for calling the generic subprogram, and the specialization subprogram is executed when the specialization condition is satisfied. A program that executes processing to convert into code to be called.
JP2008042864A 2008-02-25 2008-02-25 Compiler, compiling method, and program Expired - Fee Related JP4985461B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2008042864A JP4985461B2 (en) 2008-02-25 2008-02-25 Compiler, compiling method, and program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2008042864A JP4985461B2 (en) 2008-02-25 2008-02-25 Compiler, compiling method, and program

Publications (2)

Publication Number Publication Date
JP2009199520A JP2009199520A (en) 2009-09-03
JP4985461B2 true JP4985461B2 (en) 2012-07-25

Family

ID=41142920

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2008042864A Expired - Fee Related JP4985461B2 (en) 2008-02-25 2008-02-25 Compiler, compiling method, and program

Country Status (1)

Country Link
JP (1) JP4985461B2 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2018041373A (en) * 2016-09-09 2018-03-15 オムロン株式会社 Executable program creation device, executable program creation method, and executable program creation program
JP2018081592A (en) 2016-11-17 2018-05-24 富士通株式会社 Compile program, compile method, and compiler

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002259135A (en) * 2001-02-28 2002-09-13 Internatl Business Mach Corp <Ibm> Method for optimizing program and compiler using thereof

Also Published As

Publication number Publication date
JP2009199520A (en) 2009-09-03

Similar Documents

Publication Publication Date Title
US9645803B2 (en) Methods and systems for forming an adjusted perform range
JP4662657B2 (en) Unified data type system and method
CN110149800B (en) Apparatus for processing abstract syntax tree associated with source code of source program
JPH05257709A (en) Parallelism discriminating method and parallelism supporting method using the same
Leißa et al. A graph-based higher-order intermediate representation
US20160246622A1 (en) Method and system for implementing invocation stubs for the application programming interfaces embedding with function overload resolution for dynamic computer programming languages
JP2011065220A (en) Compiler program, compilation method and computer system
EP0528008A1 (en) Symbol table for intermediate compiler language
US10013244B2 (en) Apparatus and method to compile a variadic template function
US8762974B1 (en) Context-sensitive compiler directives
JP4985461B2 (en) Compiler, compiling method, and program
US20060107258A1 (en) Program, program code optimization method, program code compile method, program code, and information processing system
Gotti et al. UML executable: A comparative study of UML compilers and interpreters
Zhao et al. Automated test program generation for an industrial optimizing compiler
US20170206068A1 (en) Program optimization based on directives for intermediate code
JP2007226589A (en) Program conversion system
Masten et al. Function/kernel vectorization via loop vectorizer
KR101705996B1 (en) Apparatus and method for statically analyzing javascript source code in order to optimize javascript source code
Ramsey Beyond relooper: recursive translation of unstructured control flow to structured control flow (functional pearl)
Moyen et al. Loop quasi-invariant chunk motion by peeling with statement composition
CN114072762A (en) Compiling and executing source code into a service
Racordon From ASTs to Machine Code with LLVM
Djukic et al. Embedded Processor Oriented Compiler Infrastructure
Reis et al. SSA-based MATLAB-to-C Compilation and Optimization
US20170249131A1 (en) Compilation apparatus and compiling method

Legal Events

Date Code Title Description
RD01 Notification of change of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7421

Effective date: 20100224

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20111212

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20120117

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20120316

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

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

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

Ref document number: 4985461

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

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

Free format text: PAYMENT UNTIL: 20150511

Year of fee payment: 3

LAPS Cancellation because of no payment of annual fees