JP2011028523A - Program conversion device and program conversion system - Google Patents

Program conversion device and program conversion system Download PDF

Info

Publication number
JP2011028523A
JP2011028523A JP2009173735A JP2009173735A JP2011028523A JP 2011028523 A JP2011028523 A JP 2011028523A JP 2009173735 A JP2009173735 A JP 2009173735A JP 2009173735 A JP2009173735 A JP 2009173735A JP 2011028523 A JP2011028523 A JP 2011028523A
Authority
JP
Japan
Prior art keywords
intermediate code
unit
optimality
program
optimization
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP2009173735A
Other languages
Japanese (ja)
Inventor
Teruo Kawabata
輝雄 川端
Takehito Heiji
岳人 瓶子
Hiroshi Shimada
広志 島田
Ryo Sato
僚 佐藤
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Panasonic Corp
Original Assignee
Panasonic 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 Panasonic Corp filed Critical Panasonic Corp
Priority to JP2009173735A priority Critical patent/JP2011028523A/en
Priority to PCT/JP2010/004473 priority patent/WO2011010435A1/en
Publication of JP2011028523A publication Critical patent/JP2011028523A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation

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)

Abstract

<P>PROBLEM TO BE SOLVED: To support efficient tuning of a source program. <P>SOLUTION: A parser 182 generates first intermediate code from a source program 141. A logical guarantee optimizer 184 generates second intermediate code by way of performing optimization processing corresponding to a target processor for the first intermediate code. An optimality attainment level analyzer 186 analyzes performance of the second intermediate code and outputs optimality attainment level information 142 indicating results of the performance analysis. <P>COPYRIGHT: (C)2011,JPO&INPIT

Description

本発明は、ソースプログラムを、ターゲットプロセッサ向けのコードに変換するプログラム変換装置およびプログラム変換システムに関する。   The present invention relates to a program conversion apparatus and a program conversion system for converting a source program into a code for a target processor.

近年、メディア処理における高性能化が求められている。メディア処理は、例えば、画像および音声の符号化処理、画像および音声の復号処理である。これまで、単一での変換処理のみ行っていれば商品要求を満たしていたが、商品の高性能化により、符号化処理、復号処理の輻輳処理が求められてきた事により、より高性能なメディア処理が求められている。そのために、コンパイラでの最適化処理が実装され、かつ、これまで最適化処理の改善も行われてきた。   In recent years, high performance in media processing has been demanded. The media processing is, for example, image and audio encoding processing and image and audio decoding processing. Until now, if only a single conversion process was performed, the product requirement was satisfied, but due to the high performance of the product, the congestion processing of the encoding process and the decoding process has been required, so the higher performance Media processing is required. For this reason, optimization processing by a compiler has been implemented, and the optimization processing has been improved so far.

しかし、メディア処理の性能向上の要求が高まるにつれ、コンパイラでの最適化処理の効率が向上するようなコードの記述が必要となってきた。プログラム開発者(以下、プログラマという)は、コンパイラに対して#pragma指令による最適化のアシスト情報の記述や、プログラムのチューニングを施すことでコンパイラの最適化処理の活用を行ってきた。   However, as the demand for improving the performance of media processing increases, it has become necessary to write code that improves the efficiency of optimization processing in the compiler. A program developer (hereinafter referred to as a programmer) has used optimization processing of the compiler by describing optimization assistance information by the #pragma instruction to the compiler and tuning the program.

しかし、プログラマは、ソースプログラムのどの箇所にどの様なチューニングを施せばどれだけの性能向上が図れるか分からないため、ソースプログラムの修正に対してどれだけ性能が向上したかを確認するチューニングを繰り返し行い、多大な工数を費やす必要がある。   However, the programmer does not know how much performance improvement can be achieved by applying what kind of tuning to which part of the source program. Therefore, the tuning is repeated to confirm how much the performance has improved by correcting the source program. It is necessary to carry out and spend a great deal of man-hours.

特許文献1には、上記問題を解決するために、プログラマにチューニングを施す箇所を知らせる技術(以下、従来技術Aという)が開示されている。具体的には、特許文献1には、ソースプログラムに対して最適化を施した内容をコンパイルリストファイルとして出力する最適化コンパイラが開示されている。   Patent Document 1 discloses a technique (hereinafter referred to as Conventional Technology A) that informs a programmer where to perform tuning in order to solve the above problem. Specifically, Patent Document 1 discloses an optimizing compiler that outputs contents obtained by optimizing a source program as a compile list file.

また、非特許文献1には、入力プログラムをより最適化させるための補助情報の入力を促す対話型の最適化コンパイラが開示されている。   Non-Patent Document 1 discloses an interactive optimization compiler that prompts input of auxiliary information for further optimizing an input program.

特開平5−108372号公報Japanese Patent Laid-Open No. 5-108372

Hans Zima,Barbara Chapman著、村岡 洋一訳「スーパーコンパイラ(Supercompilers for Parallel and Vector Computers)」、第1版、オーム社、平成7年4月25日Hans Zima, Barbara Chapman, Yoichi Muraoka, “Supercompilers for Parallel and Vector Computers”, 1st edition, Ohmsha, April 25, 1995

従来技術Aでは、ソースプログラムに対し行った最適化処理の内容を出力する。プログラムは、この最適化処理の内容に基づいて、ソースプログラムのチューニングを繰り返す。   In the prior art A, the contents of the optimization process performed on the source program are output. The program repeats tuning of the source program based on the contents of the optimization process.

しかし、プログラマは、既に最良となっているかもしれないソースプログラムに対しても、チューニング効果が収束するまで、チューニングを繰り返し実施することで、ソースプログラムの最適性を確認しなければならない。つまり、プログラマは、チューニングに対し多大な工数を費やす必要があり、ソースプログラムのチューニングの効率が悪い。   However, the programmer must confirm the optimality of the source program by repeatedly performing tuning on the source program that may already be the best until the tuning effect converges. That is, the programmer needs to spend a great amount of man-hours for tuning, and the efficiency of tuning the source program is poor.

本発明は、上述の問題点を解決するためになされたものであって、その目的は、ソースプログラムの効率的なチューニングを支援することである。   The present invention has been made to solve the above-described problems, and an object thereof is to support efficient tuning of a source program.

上述の課題を解決するために、この発明のある局面に従うプログラム変換装置は、高級言語で記述されたソースプログラムを、ターゲットプロセッサ向けのコードに変換する。プログラム変換装置は、ソースプログラムから第1の中間コードを生成する中間コード生成部と、第1の中間コードに対しターゲットプロセッサに応じた最適化処理を行うことにより、第2の中間コードを生成する最適化部と、第2の中間コードの性能の分析を行い、性能分析の結果を示す最適性到達度情報を出力する解析部とを備える。   In order to solve the above-described problem, a program conversion device according to an aspect of the present invention converts a source program described in a high-level language into a code for a target processor. The program conversion device generates a second intermediate code by performing an intermediate code generation unit that generates a first intermediate code from a source program and an optimization process corresponding to the target processor for the first intermediate code. An optimization unit, and an analysis unit that analyzes the performance of the second intermediate code and outputs optimality achievement information indicating the result of the performance analysis.

すなわち、中間コード生成部は、ソースプログラムから第1の中間コードを生成する。最適化部は、第1の中間コードに対しターゲットプロセッサに応じた最適化処理を行うことにより、第2の中間コードを生成する。解析部は、第2の中間コードの性能の分析を行い、性能分析の結果を示す最適性到達度情報を出力する。   That is, the intermediate code generation unit generates the first intermediate code from the source program. The optimization unit generates a second intermediate code by performing an optimization process corresponding to the target processor on the first intermediate code. The analysis unit analyzes the performance of the second intermediate code and outputs optimality achievement information indicating the result of the performance analysis.

したがって、プログラマは、最適性到達度情報を参照することにより、ソースプログラムに対応する第2の中間コードの性能分析の結果を把握することができる。その結果、プログラマは、第2の中間コードに対応するソースプログラムに対するチューニングの効果を把握することができる。つまり、最適性到達度情報を出力することにより、プログラマに対し、ソースプログラムの効率的なチューニングを支援することができる。   Therefore, the programmer can grasp the result of the performance analysis of the second intermediate code corresponding to the source program by referring to the optimality achievement degree information. As a result, the programmer can grasp the effect of tuning on the source program corresponding to the second intermediate code. That is, by outputting the optimality reachability information, it is possible to assist the programmer in efficiently tuning the source program.

また、プログラム変換装置は、さらに、第1の中間コードに対し、特定の条件を.緩和させた最適化処理である特定条件緩和最適化処理を行うことにより、第3の中間コードを生成する特定条件緩和最適化部を備え、解析部は、さらに、第3の中間コードの性能を分析し、第2の中間コードおよび第3の中間コードの性能の分析結果を示す最適性到達度情報を出力することが好ましい。   Further, the program conversion apparatus further performs a specific condition relaxation optimization process, which is an optimization process in which a specific condition is relaxed, for the first intermediate code, thereby generating a third intermediate code. A condition relaxation optimization unit is provided, and the analysis unit further analyzes the performance of the third intermediate code and outputs optimality reachability information indicating the analysis results of the performance of the second intermediate code and the third intermediate code. It is preferable to do.

これにより、第2および第3の中間コードの性能の分析結果を把握することができる。
また、特定条件緩和最適化部は、さらに、特定の条件を緩和させた条件の情報を出力することが好ましい。
Thereby, the analysis result of the performance of the second and third intermediate codes can be grasped.
Further, it is preferable that the specific condition relaxation optimizing unit further outputs information on a condition in which the specific condition is relaxed.

また、プログラム変換装置は、さらに、指示を受付ける受付部を備え、特定条件緩和最適化部は、受付部が受付けた指示が示す条件に基づいた特定条件緩和最適化処理を行うことが好ましい。   Moreover, it is preferable that the program conversion apparatus further includes a reception unit that receives an instruction, and the specific condition relaxation optimization unit performs a specific condition relaxation optimization process based on a condition indicated by the instruction received by the reception unit.

また、受付部が受付けた指示は、コマンドラインによる指示であることが好ましい。
また、受付部が受付けた指示は、ソースプログラムに含まれる指示であることが好ましい。
Moreover, it is preferable that the instruction received by the reception unit is an instruction by a command line.
Moreover, it is preferable that the instruction received by the receiving unit is an instruction included in the source program.

また、プログラム変換装置は、さらに、第1の中間コードに対し、論理の正当性を保証しない最適化処理である論理未保証最適化処理を行うことにより、第4の中間コードを生成する論理未保証最適化部を備え、解析部は、さらに、第4の中間コードの性能を分析し、第2の中間コードおよび第4の中間コードの性能の分析結果を示す最適性到達度情報を出力することが好ましい。   In addition, the program conversion apparatus further performs a logic unguaranteed optimization process, which is an optimization process that does not guarantee the validity of the logic, on the first intermediate code, thereby generating a fourth logic code that does not generate a fourth intermediate code. A guarantee optimization unit is provided, and the analysis unit further analyzes the performance of the fourth intermediate code, and outputs optimum reachability information indicating the analysis results of the performance of the second intermediate code and the fourth intermediate code. It is preferable.

これにより、第2および第4の中間コードの性能の分析結果を把握することができる。
また、論理未保証最適化部は、さらに、論理の正当性を保証していない条件の情報を出力することが好ましい。
Thereby, the analysis result of the performance of the second and fourth intermediate codes can be grasped.
Further, it is preferable that the logic non-guaranteed optimization unit further outputs information on conditions for which the logical validity is not guaranteed.

また、プログラム変換装置は、さらに、指示を受付ける受付部を備え、論理未保証最適化部は、受付部が受付けた指示が示す、論理の保証が不要な条件に基づいた論理未保証最適化処理を行うことが好ましい。   The program conversion apparatus further includes a receiving unit that receives an instruction, and the logical unguaranteed optimization unit performs a logical unguaranteed optimization process based on a condition that does not require a logical guarantee indicated by the instruction received by the receiving unit. It is preferable to carry out.

また、受付部が受付けた指示は、コマンドラインによる指示であることが好ましい。
また、受付部が受付けた指示は、ソースプログラムに含まれる指示であることが好ましい。
Moreover, it is preferable that the instruction received by the reception unit is an instruction by a command line.
Moreover, it is preferable that the instruction received by the receiving unit is an instruction included in the source program.

また、最適性到達度情報は、ターゲットプロセッサに対する第2の中間コードの最適度合いを少なくとも示すことが好ましい。   Further, it is preferable that the optimality reachability information indicates at least the optimal degree of the second intermediate code for the target processor.

この発明の他の局面に従うプログラム変換システムは、高級言語で記述されたソースプログラムを、ターゲットプロセッサ向けの機械語コードに変換するシステムである。プログラム変換システムは、プログラムから第1の中間コードを生成する中間コード生成部と、第1の中間コードに対しターゲットプロセッサに応じた最適化処理を行うことにより、第2の中間コードを生成する最適化部と、第2の中間コードの性能の分析を行うことにより、性能分析の結果を示す最適性到達度情報を出力する解析部と、第2の中間コードに基づくファイルを使用してターゲットプロセッサで動作する機械語コードを生成する機械語コード生成部とを備える。   A program conversion system according to another aspect of the present invention is a system for converting a source program described in a high-level language into a machine language code for a target processor. The program conversion system includes an intermediate code generation unit that generates a first intermediate code from a program and an optimization process that generates a second intermediate code by performing an optimization process on the first intermediate code according to a target processor. An analysis unit that outputs performance reachability information indicating the result of the performance analysis by analyzing the performance of the second intermediate code, and a target processor using a file based on the second intermediate code A machine language code generation unit that generates machine language code that operates on the machine.

なお、本発明は、このような特徴的な手段を備えるプログラム変換装置として実現するだけでなく、プログラム変換装置に含まれる特徴的な処理を行う各部をステップとするプログラム変換方法として実現したり、プログラム変換装置に含まれる特徴的な手段としてコンピュータを機能させるためのプログラムとして実現したりすることもできる。そして、そのようなプログラムは、CD−ROM(Compact Disc-Read Only Memory)等の記録媒体やインターネット等の通信ネットワークを介して流通させることができるのは言うまでもない。   Note that the present invention is not only realized as a program conversion apparatus including such characteristic means, but also realized as a program conversion method in which each unit performing characteristic processing included in the program conversion apparatus is a step, It can also be realized as a program for causing a computer to function as characteristic means included in the program conversion apparatus. Needless to say, such a program can be distributed via a recording medium such as a CD-ROM (Compact Disc-Read Only Memory) or a communication network such as the Internet.

本発明により、ソースプログラムの効率的なチューニングを支援することができる。   According to the present invention, efficient tuning of a source program can be supported.

コンピュータの概観を示す図である。It is a figure which shows the external appearance of a computer. コンピュータ内のハードウエア構成を示したブロック図である。It is the block diagram which showed the hardware constitutions in a computer. 第1の実施の形態におけるコンパイラシステムの構成を示す図である。It is a figure which shows the structure of the compiler system in 1st Embodiment. 第1の実施の形態におけるコンパイラの構成を示す図である。It is a figure which shows the structure of the compiler in 1st Embodiment. コンパイラが実行する処理のフローチャートである。It is a flowchart of the process which a compiler performs. 最適性到達度解析処理のフローチャートである。It is a flowchart of optimality achievement analysis processing. ソースプログラムの一例を示す図である。It is a figure which shows an example of a source program. 第1の実施の形態における一例としての最適性到達度情報を示す図である。It is a figure which shows the optimality achievement level information as an example in 1st Embodiment. 第2の実施の形態におけるコンパイラシステムの構成を示す図である。It is a figure which shows the structure of the compiler system in 2nd Embodiment. 第2の実施の形態におけるコンパイラの構成を示す図である。It is a figure which shows the structure of the compiler in 2nd Embodiment. コンパイラが実行する処理のフローチャートである。It is a flowchart of the process which a compiler performs. 最適性到達度解析処理Aのフローチャートである。It is a flowchart of the optimality achievement analysis process A. 第2の実施の形態における一例としての最適性到達度情報を示す図である。It is a figure which shows the optimality achievement level information as an example in 2nd Embodiment. 第2の実施の形態の変形例1におけるコンパイラの構成を示す図である。It is a figure which shows the structure of the compiler in the modification 1 of 2nd Embodiment. 第2の実施の形態の変形例2におけるコンパイラシステムの構成を示す図である。It is a figure which shows the structure of the compiler system in the modification 2 of 2nd Embodiment. 第2の実施の形態の変形例2におけるコンパイラの構成を示す図である。It is a figure which shows the structure of the compiler in the modification 2 of 2nd Embodiment. 第3の実施の形態におけるコンパイラシステムの構成を示す図である。It is a figure which shows the structure of the compiler system in 3rd Embodiment. 第3の実施の形態におけるコンパイラの構成を示す図である。It is a figure which shows the structure of the compiler in 3rd Embodiment. コンパイラが実行する処理のフローチャートである。It is a flowchart of the process which a compiler performs. 最適性到達度解析処理Cのフローチャートである。It is a flowchart of optimality achievement analysis processing C. 第3の実施の形態における一例としての最適性到達度情報を示す図である。It is a figure which shows the optimality achievement level information as an example in 3rd Embodiment. 第3の実施の形態の変形例1におけるコンパイラの構成を示す図である。It is a figure which shows the structure of the compiler in the modification 1 of 3rd Embodiment. 第3の実施の形態の変形例2におけるコンパイラシステムの構成を示す図である。It is a figure which shows the structure of the compiler system in the modification 2 of 3rd Embodiment. 第3の実施の形態の変形例2におけるコンパイラの構成を示す図である。It is a figure which shows the structure of the compiler in the modification 2 of 3rd Embodiment.

以下、図面を参照しつつ、本発明の実施の形態について説明する。以下の説明では、同一の部品には同一の符号を付してある。それらの名称および機能も同じである。したがって、それらについての詳細な説明は繰り返さない。   Hereinafter, embodiments of the present invention will be described with reference to the drawings. In the following description, the same parts are denoted by the same reference numerals. Their names and functions are also the same. Therefore, detailed description thereof will not be repeated.

<第1の実施の形態>
以下、第1の実施の形態におけるコンパイラシステムについて説明する。
<First Embodiment>
Hereinafter, the compiler system in the first embodiment will be described.

第1の実施の形態におけるコンパイラシステムは、図1に示されるコンピュータ500において、プログラムが実行されることにより実現される。   The compiler system in the first embodiment is realized by executing a program in the computer 500 shown in FIG.

次に、コンピュータ500について詳細に説明する。
図2は、コンピュータ500内のハードウエア構成を示したブロック図である。なお、図2には、説明のために、記録媒体50も示している。記録媒体50には、後述するプログラム51が記録されている。すなわち、プログラム51は、媒体等に記録されてプログラム製品として流通される。また、記録媒体50もプログラム製品として流通される。
Next, the computer 500 will be described in detail.
FIG. 2 is a block diagram showing a hardware configuration in the computer 500. Note that FIG. 2 also shows a recording medium 50 for explanation. On the recording medium 50, a program 51 to be described later is recorded. That is, the program 51 is recorded on a medium or the like and distributed as a program product. The recording medium 50 is also distributed as a program product.

図2に示されるように、コンピュータ500は、制御部510と、RAM(Random Access Memory)520と、記憶部522と、記憶媒体アクセス部530と、表示部540と、キーボード551と、マウス552と、通信部560とを備える。   As shown in FIG. 2, the computer 500 includes a control unit 510, a RAM (Random Access Memory) 520, a storage unit 522, a storage medium access unit 530, a display unit 540, a keyboard 551, a mouse 552, and the like. And a communication unit 560.

制御部510、RAM520、記憶部522、記憶媒体アクセス部530、表示部540、キーボード551、マウス552および通信部560は、データバス502に接続されている。   Control unit 510, RAM 520, storage unit 522, storage medium access unit 530, display unit 540, keyboard 551, mouse 552 and communication unit 560 are connected to data bus 502.

制御部510は、CPU(Central Processing Unit)である。なお、制御部510は、CPUに限定されることなく、演算機能を有するその他の回路であってもよい。   Control unit 510 is a CPU (Central Processing Unit). Control unit 510 is not limited to a CPU, and may be another circuit having an arithmetic function.

RAM520は、揮発性のメモリである。RAM520は、制御部510によってデータアクセスされる。RAM520は、一時的にデータを記憶するワークメモリとしての機能を有する。   The RAM 520 is a volatile memory. The RAM 520 is accessed by the control unit 510. The RAM 520 functions as a work memory that temporarily stores data.

記憶部522は、不揮発性のメモリである。記憶部522は、たとえば、ハードディスクドライブである。なお、記憶部522は、ハードディスクドライブに限定されることなく、不揮発的のメモリであれば、その他のメモリ(たとえば、フラッシュメモリ)であってもよい。記憶部522は、制御部510によって、データアクセスされる。記憶部522には、プログラム51、その他の各種データ等が記憶されている。   The storage unit 522 is a nonvolatile memory. Storage unit 522 is, for example, a hard disk drive. The storage unit 522 is not limited to a hard disk drive, and may be another memory (for example, a flash memory) as long as it is a nonvolatile memory. The storage unit 522 is accessed by the control unit 510. The storage unit 522 stores a program 51 and other various data.

制御部510は、記憶部522に記憶されているプログラム51を実行し、プログラム51に基づいて、コンピュータ500内の各部に対する各種処理や、演算処理等を行なう。   Control unit 510 executes program 51 stored in storage unit 522, and performs various types of processing, arithmetic processing, and the like for each unit in computer 500 based on program 51.

記憶媒体アクセス部530は、制御部510からの指示により、プログラム51が記憶された記録媒体50から、プログラム51を読み出す機能を有する。記録媒体50に記憶されているプログラム51は、制御部510が行なうインストール処理により、記憶媒体アクセス部530により読み出され、記憶部522に記憶される。このインストール処理用プログラムは、予め、記憶部522に格納されている。インストール処理は、制御部510が、インストール処理用プログラムに基づいて行なう。   The storage medium access unit 530 has a function of reading the program 51 from the recording medium 50 in which the program 51 is stored according to an instruction from the control unit 510. The program 51 stored in the recording medium 50 is read out by the storage medium access unit 530 and stored in the storage unit 522 by an installation process performed by the control unit 510. This installation processing program is stored in the storage unit 522 in advance. Installation processing is performed by control unit 510 based on an installation processing program.

記録媒体50は、CD−ROM(Compact Disc-Read Only Memory)である。なお、記録媒体50は、CD−ROMに限定されることなく、データを不揮発的に記録可能なその他の媒体(例えば、SD(Secure Digital)メモリーカード)であってもよい。   The recording medium 50 is a CD-ROM (Compact Disc-Read Only Memory). The recording medium 50 is not limited to a CD-ROM, and may be another medium capable of recording data in a nonvolatile manner (for example, an SD (Secure Digital) memory card).

表示部540は、文字や画像等を表示する機能を有する。表示部540には、文字や画像等を表示する表示面が設けられる。表示部540は、LCDパネル(Liquid Crystal Display Panel)を使用した装置である。なお、表示部540は、上記以外の表示方式のパネルを使用した装置であってもよい。   The display unit 540 has a function of displaying characters, images, and the like. The display unit 540 is provided with a display surface for displaying characters, images, and the like. The display unit 540 is a device that uses an LCD panel (Liquid Crystal Display Panel). Note that the display unit 540 may be a device using a panel of a display method other than the above.

ユーザは、キーボード551またはマウス552を操作することにより、コンピュータ500に指示を与える。キーボード551またはマウス552からの入力指示は、制御部510へ送信される。制御部510は、キーボード551またはマウス552からの入力指示に基づいて所定の処理を行なう。すなわち、キーボード551およびマウス552は、ユーザがコンピュータ500を操作するためのインターフェースである。   The user gives an instruction to the computer 500 by operating the keyboard 551 or the mouse 552. An input instruction from the keyboard 551 or the mouse 552 is transmitted to the control unit 510. Control unit 510 performs predetermined processing based on an input instruction from keyboard 551 or mouse 552. That is, the keyboard 551 and the mouse 552 are interfaces for the user to operate the computer 500.

通信部560は、有線技術または無線技術を利用して、ネットワークに接続される装置とデータ通信を行なう機能を有する。有線技術は、たとえば、イーサネット(登録商標)に基づく技術である。なお、有線技術は、イーサネット(登録商標)に基づく技術に限定されることなく、その他の有線技術であってもよい。   The communication unit 560 has a function of performing data communication with a device connected to a network using a wired technology or a wireless technology. The wired technology is, for example, technology based on Ethernet (registered trademark). The wired technology is not limited to a technology based on Ethernet (registered trademark), and may be another wired technology.

(システム構成(基本))
図3は、第1の実施の形態におけるコンパイラシステム148の構成を示す図である。コンパイラシステム148は、プログラム51が制御部510により実行されることにより実現される。すなわち、プログラム51は、コンパイラシステム148を含む。
(System configuration (basic))
FIG. 3 is a diagram illustrating a configuration of the compiler system 148 according to the first embodiment. The compiler system 148 is realized by the program 51 being executed by the control unit 510. That is, the program 51 includes a compiler system 148.

コンパイラシステム148は、C言語等の高級言語で記述されたソースプログラム141を、機械語コードで記述される実行プログラム145に変換するソフトウエアシステムである。具体的には、コンパイラシステム148は、ソースプログラム141を、ターゲットプロセッサが実行可能な実行プログラム145に変換するソフトウエアシステムである。ここで、ターゲットプロセッサとは、実行プログラム145を実行させる対象となるCPUである。当該CPUは、コンピュータで使用されるCPUである。   The compiler system 148 is a software system that converts a source program 141 described in a high-level language such as C language into an execution program 145 described in machine language code. Specifically, the compiler system 148 is a software system that converts the source program 141 into an execution program 145 that can be executed by the target processor. Here, the target processor is a CPU that is a target for executing the execution program 145. The CPU is a CPU used in a computer.

ターゲットプロセッサは、複数種類のハードウエア資源を有する。複数種類のハードウエア資源は、例えば、実行ユニット、キャッシュメモリ、命令デコードユニット等である。実行ユニットには、演算器(ALU)、レジスタ等が含まれる。   The target processor has multiple types of hardware resources. The plural types of hardware resources are, for example, an execution unit, a cache memory, an instruction decode unit, and the like. The execution unit includes an arithmetic unit (ALU), a register, and the like.

コンパイラシステム148は、コンパイラ149と、アセンブラ150と、リンカ151とを含む。   The compiler system 148 includes a compiler 149, an assembler 150, and a linker 151.

コンパイラ149は、ソースプログラム141を、ターゲットプロセッサ向けのアセンブラファイル143に変換するプログラムである。アセンブラファイル143は、アセンブラ言語で記述されたファイルである。   The compiler 149 is a program that converts the source program 141 into an assembler file 143 for the target processor. The assembler file 143 is a file described in an assembler language.

コンパイラ149は、ソースプログラム141をアセンブラファイル143に変換する際に、最適化処理を行い、アセンブラファイル143および最適性到達度情報142を出力する。最適性到達度情報142は、ソースプログラム141に対する最適性を解析した結果を示す情報である。   The compiler 149 performs optimization processing when the source program 141 is converted into the assembler file 143, and outputs the assembler file 143 and the optimality achievement degree information 142. The optimality achievement degree information 142 is information indicating the result of analyzing the optimality for the source program 141.

アセンブラ150は、アセンブラ言語で記述されたアセンブラファイル143を機械語コードで記述されたオブジェクトファイル144に変換するプログラムである。   The assembler 150 is a program that converts an assembler file 143 described in an assembler language into an object file 144 described in a machine language code.

リンカ151は、複数のオブジェクトファイル144を結合し、実行プログラム145を生成するプログラムである。実行プログラム145は、ターゲットプロセッサで動作するプログラムである。つまり、アセンブラ150およびリンカ151は、アセンブラファイル143を使用して、機械語コードで記述された実行プログラム145を生成する機械語コード生成部を構成する。   The linker 151 is a program that combines a plurality of object files 144 to generate an execution program 145. The execution program 145 is a program that operates on the target processor. That is, the assembler 150 and the linker 151 constitute a machine language code generation unit that uses the assembler file 143 to generate an execution program 145 described in machine language code.

(コンパイラの構成(基本))
図4は、第1の実施の形態におけるコンパイラ149の構成を示す図である。
(Compiler configuration (basic))
FIG. 4 is a diagram illustrating a configuration of the compiler 149 according to the first embodiment.

コンパイラ149は、構文解析部182と、論理保証最適化部184と、最適性到達度解析部186と、コード出力部188とを含む。コンパイラ149内の各部は、プログラムモジュールとして実現される。   The compiler 149 includes a syntax analysis unit 182, a logic guarantee optimization unit 184, an optimality achievement level analysis unit 186, and a code output unit 188. Each part in the compiler 149 is realized as a program module.

構文解析部182は、ソースプログラム141に対し構文解析処理を行うことにより、中間コード(以下、第1の中間コードという)を生成し、第1の中間コードを出力する。すなわち、構文解析部182は、ソースプログラム141から第1の中間コードを生成する中間コード生成部である。   The syntax analysis unit 182 generates an intermediate code (hereinafter referred to as a first intermediate code) by performing a syntax analysis process on the source program 141, and outputs the first intermediate code. That is, the syntax analysis unit 182 is an intermediate code generation unit that generates a first intermediate code from the source program 141.

ここで、以下に記載する最適化処理は、一般的な最適化コンパイラが行う最適化処理であるとする。当該最適化処理は、例えば、ループ回数を少なくするための処理、命令の実行回数を減らすための処理、コードサイズを小さくするための処理、分岐の数を少なくするための処理等を含む。当該最適化処理は、一般的なコンパイラで行われる処理と同様なので詳細な説明は繰り返さない。   Here, it is assumed that the optimization process described below is an optimization process performed by a general optimization compiler. The optimization process includes, for example, a process for reducing the number of loops, a process for reducing the number of instruction executions, a process for reducing the code size, and a process for reducing the number of branches. Since the optimization process is the same as the process performed by a general compiler, detailed description will not be repeated.

論理保証最適化部184は、第1の中間コードに対して、論理の正当性を保証した最適化処理を行う。論理の正当性を保証した最適化処理とは、例えば、当該最適化処理が行われることにより得られる中間コードの論理(アルゴリズム)に矛盾がない処理である。すなわち、論理保証最適化部184は、第1の中間コードに対して、論理の正当性を保証可能な範囲内で最適化処理を行う。   The logic guarantee optimization unit 184 performs an optimization process that guarantees the validity of the logic for the first intermediate code. The optimization process that guarantees the correctness of logic is, for example, a process in which the logic (algorithm) of the intermediate code obtained by performing the optimization process is consistent. That is, the logic guarantee optimization unit 184 performs an optimization process on the first intermediate code within a range in which the logic validity can be guaranteed.

以下においては、論理保証最適化部184が行う最適化処理を、論理保証最適化処理という。   Hereinafter, the optimization process performed by the logic assurance optimization unit 184 is referred to as a logic assurance optimization process.

具体的には、論理保証最適化部184は、第1の中間コードに対して、ターゲットプロセッサの仕様に応じた最適化処理(論理保証最適化処理)を行うことにより、最適化処理が施された中間コード(以下、第2の中間コードという)を出力する。第2の中間コードは、第1の中間コードに対して最適化処理が行われることにより得られる中間コードである。すなわち、論理保証最適化部184は、第1の中間コードに対してターゲットプロセッサに応じた最適化処理を行うことにより、第2の中間コードを生成する。   Specifically, the logic assurance optimization unit 184 performs optimization processing on the first intermediate code by performing optimization processing (logic assurance optimization processing) according to the specifications of the target processor. Output an intermediate code (hereinafter referred to as a second intermediate code). The second intermediate code is an intermediate code obtained by performing optimization processing on the first intermediate code. That is, the logic assurance optimization unit 184 generates the second intermediate code by performing optimization processing corresponding to the target processor on the first intermediate code.

この場合、第2の中間コードは、論理(アルゴリズム)に矛盾がないコードである。
プログラマが一般的に行うチューニング手法の一つに、一般的な、C99言語にて定義されているrestrict修飾子を用いた、見かけのメモリ依存の緩和手法がある。C99言語とは「ISO/IEC 9899:1999-Programming Language C」の規格に基づくC言語である。restrict修飾子および見かけのメモリ依存は、一般的で周知なものであるため、その詳細な説明はここでは行わない。
In this case, the second intermediate code is a code having no contradiction in logic (algorithm).
One of the tuning methods generally performed by programmers is a general memory dependence mitigation method using a restrict modifier defined in the C99 language. The C99 language is a C language based on the standard of “ISO / IEC 9899: 1999-Programming Language C”. Since the restrict qualifier and apparent memory dependence are common and well known, a detailed description thereof will not be given here.

本実施の形態では、例えば、見かけのメモリ依存に着目し、論理保証最適化部184は、第1の中間コードに対して、見かけのメモリ依存を考慮した論理保証最適化処理を行うことにより、第2の中間コードを得る。   In the present embodiment, for example, paying attention to the apparent memory dependence, the logic assurance optimization unit 184 performs a logic assurance optimization process in consideration of the apparent memory dependence on the first intermediate code. A second intermediate code is obtained.

最適性到達度解析部186は、論理保証最適化部184から出力された第2の中間コードに基づいて、第2の中間コードの最適性の到達度としての最適度情報を算出する。当該最適度情報は、第2の中間コードが、ターゲットプロセッサのハードウエア資源をどれだけ効率的に使用できているかの割合である。最適度情報は、例えば、レジスタ資源使用率、演算器資源使用率、パイプライン占有率、バス幅占有率、IPC(Instruction par Cycle)、ストール率等である。   Based on the second intermediate code output from the logic assurance optimization unit 184, the optimality reachability analysis unit 186 calculates optimality information as the reachability of the optimality of the second intermediate code. The optimality information is a ratio of how efficiently the second intermediate code can use the hardware resources of the target processor. The optimality information includes, for example, a register resource usage rate, an arithmetic unit resource usage rate, a pipeline occupancy rate, a bus width occupancy rate, an IPC (Instruction par Cycle), and a stall rate.

最適性到達度解析部186は、例えば、第2の中間コードと、ターゲットプロセッサのアーキテクチャ仕様とを照らし合わせて、算出した最適度情報を示す最適性到達度情報142を出力する。   The optimality achievement level analysis unit 186, for example, compares the second intermediate code with the architecture specification of the target processor, and outputs the optimality achievement level information 142 indicating the calculated optimality information.

すなわち、最適性到達度解析部186は、第2の中間コードの最適性の到達度(最適度合い)を解析(分析)し、解析(分析)の結果(最適度合い)を示す最適性到達度情報142を出力する。つまり、最適性到達度解析部186は、第2の中間コードの性能の分析を行い、性能分析の結果を示す最適性到達度情報142を出力する。この場合、最適性到達度情報142は、第2の中間コードの最適度合いを示す。   That is, the optimality reachability analysis unit 186 analyzes (analyzes) the optimality reachability (optimum degree) of the second intermediate code, and the optimality reachability information indicating the result (optimum degree) of the analysis (analysis) 142 is output. That is, the optimality achievement level analysis unit 186 analyzes the performance of the second intermediate code and outputs the optimality achievement level information 142 indicating the result of the performance analysis. In this case, the optimality achievement information 142 indicates the optimum degree of the second intermediate code.

コード出力部188は、論理保証最適化部184にて、論理を保証して最適化された第2の中間コードをアセンブラ言語に変換して、アセンブラファイル143を出力する。すなわち、アセンブラファイル143は、第2の中間コードに基づくファイルである。   The code output unit 188 converts the second intermediate code optimized by guaranteeing the logic by the logic guarantee optimization unit 184 into an assembler language, and outputs an assembler file 143. That is, the assembler file 143 is a file based on the second intermediate code.

(コンパイラ処理の流れ(基本))
次に、コンパイラ149が実行する処理の流れについて説明する。
(Flow of compiler processing (basic))
Next, the flow of processing executed by the compiler 149 will be described.

図5は、コンパイラ149が実行する処理のフローチャートである。
構文解析部182は、ソースプログラム141の構文解析を行い、第1の中間コードを生成する(S1)。論理保証最適化部184は、第1の中間コードに対し前述した論理保証最適化処理を行うことにより、第2の中間コードを生成する(S2)。
FIG. 5 is a flowchart of processing executed by the compiler 149.
The syntax analysis unit 182 performs syntax analysis of the source program 141 and generates a first intermediate code (S1). The logic guarantee optimization unit 184 generates the second intermediate code by performing the above-described logic guarantee optimization process on the first intermediate code (S2).

最適性到達度解析部186は、第2の中間コードの最適性の到達度を解析(分析)し、解析(分析)の結果を示す最適性到達度情報142を出力する(S3)。   The optimality reachability analysis unit 186 analyzes (analyzes) the reachability of the optimality of the second intermediate code, and outputs optimality reachability information 142 indicating the result of the analysis (analysis) (S3).

コード出力部188は、第2の中間コードをアセンブラ言語に変換し、アセンブラファイル143として出力する(S4)。   The code output unit 188 converts the second intermediate code into an assembler language and outputs it as an assembler file 143 (S4).

(最適性到達度解析処理の詳細な流れ(基本))
次に、図5のステップS3の最適性到達度解析処理について詳細に説明する。
(Detailed flow of optimality achievement analysis processing (basic))
Next, the optimality achievement analysis process in step S3 of FIG. 5 will be described in detail.

図6は、最適性到達度解析処理のフローチャートである。
最適性到達度解析部186は、第2の中間コードを、関数(手続き)毎に分割して第2の中間コードを解析する(S31)。
FIG. 6 is a flowchart of optimality reachability analysis processing.
The optimality reach analysis unit 186 divides the second intermediate code for each function (procedure) and analyzes the second intermediate code (S31).

次に、最適性到達度解析部186は、ステップS31にて関数毎に分割された第2の中間コードを、基本ブロック毎に分割して、分割された各第2の中間コードを解析する(S32)。ここで、基本ブロックとは、分岐命令のないブロックである。   Next, the optimality achievement level analysis unit 186 divides the second intermediate code divided for each function in step S31 for each basic block, and analyzes each divided second intermediate code ( S32). Here, the basic block is a block without a branch instruction.

次に、最適性到達度解析部186は、ステップS32にて基本ブロック毎に分割された各第2の中間コードに対応するDAG(Directed acyclic graph)情報を生成する(S33)。DAG情報とは、閉路を持たない有効グラフを示す情報である。   Next, the optimality achievement level analysis unit 186 generates DAG (Directed acyclic graph) information corresponding to each second intermediate code divided for each basic block in step S32 (S33). The DAG information is information indicating an effective graph having no cycle.

次に、最適性到達度解析部186は、生成されたDAG情報と、ターゲットプロセッサのアーキテクチャ仕様と比較した結果を、性能解析情報データベース201Dに登録する。具体的には、最適性到達度解析部186は、関数シンボル名を主キーとして、基本ブロックを特定する番号と比較結果とを対応づけて性能解析情報データベース201Dに登録する(S34)。   Next, the optimality achievement level analysis unit 186 registers the generated DAG information and the result of comparison with the architecture specification of the target processor in the performance analysis information database 201D. Specifically, the optimality attainment analysis unit 186 registers the number identifying the basic block and the comparison result in the performance analysis information database 201D with the function symbol name as the main key (S34).

例えば、ターゲットプロセッサのアーキテクチャ仕様が、3命令同時発行可能であることを示しているとする。この場合、DAG情報から、分割された第2の中間コードのIPC(Instruction par Cycle)が、2.5であることが解析されたとする。IPCとは、1サイクルにおいて、ターゲットプロセッサが実行可能な命令の数である。   For example, assume that the architecture specification of the target processor indicates that three instructions can be issued simultaneously. In this case, it is assumed that the IPC (Instruction Par Cycle) of the divided second intermediate code is analyzed from the DAG information as 2.5. The IPC is the number of instructions that can be executed by the target processor in one cycle.

この場合、最適性到達度は、2.5/3=83%となる。すなわち、ステップS34の処理により、最適性到達度83%が、性能解析情報データベース201Dに登録される。   In this case, the optimality achievement is 2.5 / 3 = 83%. That is, the optimality achievement level of 83% is registered in the performance analysis information database 201D by the process of step S34.

次に、ステップS35にて、最適性到達度解析部186は、性能解析情報データベース201Dから、主キーの関数名毎に基本ブロック番号と比較結果を整形し、整形された後の情報を示す最適性到達度情報142を出力する。この場合、制御部510は、最適性到達度情報142を、例えば、表示部540に表示させるための処理を行う。そして、この最適性到達度解析処理は終了する。   Next, in step S35, the optimality achievement degree analysis unit 186 shapes the basic block number and the comparison result for each function name of the primary key from the performance analysis information database 201D, and shows the information after the shaping. Sexual reach information 142 is output. In this case, the control unit 510 performs a process for causing the display unit 540 to display the optimality achievement degree information 142, for example. Then, the optimality reachability analysis process ends.

ここで、ソースプログラム141が、一例として、図7に示されるプログラムであるとする。この場合、図5の処理および図6の最適性到達度解析処理が行われることにより出力される最適性到達度情報142は、一例として、図8に示される情報である。   Here, it is assumed that the source program 141 is a program shown in FIG. 7 as an example. In this case, the optimality achievement information 142 output by performing the processing of FIG. 5 and the optimality achievement analysis processing of FIG. 6 is information shown in FIG. 8 as an example.

図8は、第1の実施の形態における一例としての最適性到達度情報142を示す図である。   FIG. 8 is a diagram showing the optimality achievement degree information 142 as an example in the first embodiment.

図8において、「BasicBlockNum」とは、基本ブロック番号である。「IPC(解析結果)」とは、最適性到達度解析処理により得られた、基本ブロック番号に対応する、分割された第2の中間コードのIPCを示す。「IPC(仕様)」とは、ターゲットプロセッサのアーキテクチャ仕様として示されるIPCである。   In FIG. 8, “BasicBlockNum” is a basic block number. “IPC (analysis result)” indicates the IPC of the divided second intermediate code corresponding to the basic block number, obtained by the optimality reachability analysis process. “IPC (specification)” is an IPC indicated as an architecture specification of the target processor.

図8の「最適性到達度」は、(IPC(解析結果)/IPC(仕様))の式により算出される値である。「最適性到達度」は、ステップS34の処理において、最適性到達度解析部186が算出する。この場合、「最適性到達度」は、ステップS34の処理における比較結果である。   The “optimum achievement level” in FIG. 8 is a value calculated by the equation (IPC (analysis result) / IPC (specification)). The “optimum achievement level” is calculated by the optimality level analysis unit 186 in the process of step S34. In this case, the “optimum achievement level” is a comparison result in the process of step S34.

基本ブロックに対応する最適性到達度が100(%)に近い値であるほど、ソースプログラム141に記述されている、当該基本ブロックに対応する部分のソースコードが、ターゲットプロセッサのハードウエア資源を、より効率的に使用できていることになる。すなわち、最適性到達度は、ソースプログラム141に記述されている、当該基本ブロックに対応する部分のソースコードのアルゴリズムの最適度を示す。   The closer the optimality achievement level corresponding to the basic block is to a value close to 100 (%), the more the source code of the part corresponding to the basic block described in the source program 141, the hardware resources of the target processor, It can be used more efficiently. In other words, the optimum degree of achievement indicates the optimum degree of the algorithm of the source code of the part corresponding to the basic block described in the source program 141.

基本ブロックに対応する最適性到達度が100(%)である場合、ソースプログラム141に記述されている、当該基本ブロックに対応する部分のソースコードは、ターゲットプロセッサのハードウエア資源を最も効率的に使用できていることになる。   When the optimality achievement degree corresponding to the basic block is 100 (%), the source code of the part corresponding to the basic block described in the source program 141 uses the hardware resources of the target processor most efficiently. It will be usable.

例えば、図8では、基本ブロック番号“2”に対応する、分割された第2の中間コードの最適性到達度が最も大きいことになる。すなわち、ソースプログラム141に記述されている、基本ブロック番号“2”に対応する部分のソースコードのアルゴリズムの最適度が最もよいことになる。   For example, in FIG. 8, the optimal reachability of the divided second intermediate code corresponding to the basic block number “2” is the highest. That is, the optimality of the algorithm of the source code of the part corresponding to the basic block number “2” described in the source program 141 is the best.

図8に示される情報(最適性到達度情報142)が、表示部540に表示されることにより、プログラマは、作成しているソースプログラム141に記述されているソースコードのアルゴリズムの最適度を把握することができる。   The information (optimum reachability information 142) shown in FIG. 8 is displayed on the display unit 540, so that the programmer grasps the optimum degree of the algorithm of the source code described in the source program 141 being created. can do.

以上説明したように、本実施の形態では、ソースプログラム141のコンパイル時に、ソースプログラム141のアルゴリズムの最適度としての最適性到達度が、表示部540に表示される。   As described above, in this embodiment, when the source program 141 is compiled, the optimality achievement level as the optimality of the algorithm of the source program 141 is displayed on the display unit 540.

したがって、プログラマは、作成しているソースプログラム141に記述されているソースコードのアルゴリズムの最適度を把握することができる。その結果、プログラマは、開発の工程数を無駄にすることなく、ソースプログラム141のチューニングを実施することができる。   Therefore, the programmer can grasp the optimum degree of the algorithm of the source code described in the source program 141 being created. As a result, the programmer can tune the source program 141 without wasting the number of development steps.

つまり、本実施の形態によれば、ソースプログラム141において、改善効果が見込める部分を容易に特定可能となる。そのため、プログラマは、いくら修正しても性能が上がらないようなプログラムのチューニングに無駄な時間を費やすことなく、効率的にプログラムのチューニングを進めることができる。   In other words, according to the present embodiment, it is possible to easily specify a portion in the source program 141 where an improvement effect can be expected. Therefore, the programmer can efficiently tune the program without spending a lot of time in tuning the program that does not improve performance no matter how much it is modified.

すなわち、図8に示される情報(最適性到達度情報142)が、表示部540に表示(出力)されることにより、プログラマに対し、ソースプログラムの効率的なチューニングを支援することができる。   That is, the information (optimum reachability information 142) shown in FIG. 8 is displayed (output) on the display unit 540, so that the programmer can be assisted in efficient tuning of the source program.

<第2の実施の形態>
以下、第2の実施の形態におけるコンパイラシステムについて説明する。
<Second Embodiment>
Hereinafter, a compiler system according to the second embodiment will be described.

第2の実施の形態におけるコンパイラシステムは、図1に示されるコンピュータ500において、プログラムが実行されることにより実現される。   The compiler system in the second embodiment is realized by executing a program in the computer 500 shown in FIG.

(システム構成(特定条件緩和))
図9は、第2の実施の形態におけるコンパイラシステム148Aの構成を示す図である。コンパイラシステム148Aは、プログラム51が制御部510により実行されることにより実現される。すなわち、プログラム51は、コンパイラシステム148Aを含む。
(System configuration (relaxation of specific conditions))
FIG. 9 is a diagram illustrating a configuration of a compiler system 148A according to the second embodiment. The compiler system 148A is realized by the program 51 being executed by the control unit 510. That is, the program 51 includes a compiler system 148A.

図9を参照して、コンパイラシステム148Aは、図3のコンパイラシステム148と比較して、コンパイラ149の代わりにコンパイラ149Aを含む点が異なる。それ以外の構成は、コンパイラシステム148と同様なので詳細な説明は繰り返さない。   9, compiler system 148A differs from compiler system 148 in FIG. 3 in that it includes compiler 149A instead of compiler 149. Since other configurations are the same as those of the compiler system 148, detailed description will not be repeated.

(コンパイラの構成(特定条件緩和))
図10は、第2の実施の形態におけるコンパイラ149Aの構成を示す図である。
(Compiler configuration (relaxation of specific conditions))
FIG. 10 is a diagram illustrating a configuration of the compiler 149A according to the second embodiment.

図10を参照して、コンパイラ149Aは、図4のコンパイラ149と比較して、特定条件緩和最適化部183をさらに含む点と、最適性到達度解析部186の代わりに最適性到達度解析部186Aを含む点とが異なる。それ以外の構成は、コンパイラ149と同様なので詳細な説明は繰り返さない。コンパイラ149A内の各部は、プログラムモジュールとして実現される。   Referring to FIG. 10, compiler 149 </ b> A further includes a specific condition relaxation optimization unit 183 as compared with compiler 149 of FIG. 4, and an optimality reachability analysis unit instead of optimality reachability analysis unit 186. The difference is that it includes 186A. Since other configurations are the same as those of the compiler 149, detailed description will not be repeated. Each unit in the compiler 149A is realized as a program module.

構文解析部182は、前述した第1の中間コードを、論理保証最適化部184および特定条件緩和最適化部183へ送信する。   The syntax analysis unit 182 transmits the above-described first intermediate code to the logic guarantee optimization unit 184 and the specific condition relaxation optimization unit 183.

特定条件緩和最適化部183は、構文解析部182から受信する第1の中間コードに対して、特定の条件を緩和させた最適化処理(以下、特定条件緩和最適化処理という)を行う。すなわち、特定条件緩和最適化処理は、特定条件を緩和させた条件(以下、緩和特定条件という)に基づいた最適化処理である。特定条件とは、一般的なコンパイラに実装される複数種類の最適化の条件のうちの1つの最適化の条件である。   The specific condition relaxation optimization unit 183 performs an optimization process (hereinafter referred to as a specific condition relaxation optimization process) in which a specific condition is relaxed for the first intermediate code received from the syntax analysis unit 182. That is, the specific condition relaxation optimization process is an optimization process based on a condition in which the specific condition is relaxed (hereinafter referred to as a relaxation specific condition). The specific condition is one optimization condition among a plurality of types of optimization conditions implemented in a general compiler.

特定条件には、例えば、前述のメモリアクセスにおける見かけの依存(見かけのメモリ依存)やポインタレジスタのアラインメント等の制約や、命令数(コードサイズ)、使用演算器資源等の指標がある。以下においては、見かけのメモリ依存を、単に、見かけの依存という。   Specific conditions include, for example, the above-described restrictions on apparent memory access (apparent memory dependence), alignment of pointer registers, and the like, the number of instructions (code size), and operational unit resources used. In the following, apparent memory dependence is simply referred to as apparent dependence.

特定条件は、例えば、見かけの依存に関する制約では、複数のポインタ変数による互いのメモリアクセスは、見かけの依存が発生していると仮定しなければならないという条件である。この場合、緩和特定条件は、例えば、仮引数のポインタ変数に関しては見かけの依存が発生しないものして仮定するという条件である。この場合、特定条件を緩和させた最適化処理(特定条件緩和最適化処理)は、最適化処理の対象となるコードの見かけの依存を、例えば、仮引数のポインタ変数に関して発生しないとする処理を含む。   The specific condition is a condition that, for example, in the constraint on the apparent dependency, it is assumed that the mutual memory access by the plurality of pointer variables has an apparent dependency. In this case, the relaxation specifying condition is, for example, a condition that it is assumed that no apparent dependence occurs with respect to the pointer variable of the dummy argument. In this case, the optimization process (specific condition relaxation optimization process) in which the specific condition is relaxed is a process in which the apparent dependency of the code targeted for the optimization process does not occur with respect to the pointer variable of the dummy argument, for example. Including.

また、特定条件は、例えば、アラインメントに関する制約では、ポインタ変数によるメモリアクセスは、アラインメントに応じたメモリアクセス命令を生成しなければならないという条件である。この場合、緩和特定条件は、例えば、仮引数のポインタ変数に関してはアラインメントが8バイトアラインメントであるという条件である。この場合、特定条件を緩和させた最適化処理(特定条件緩和最適化処理)は、最適化処理の対象となるコードに含まれるメモリアクセスのアラインメントを、例えば、仮引数のポインタ変数に関して8バイトアラインメントとする処理を含む。   The specific condition is, for example, a condition that a memory access instruction corresponding to the alignment must be generated for a memory access using a pointer variable in a constraint related to alignment. In this case, the relaxation specifying condition is, for example, a condition that the alignment is 8-byte alignment with respect to the pointer variable of the dummy argument. In this case, the optimization process (specific condition relaxation optimization process) in which the specific condition is relaxed performs the alignment of the memory access included in the code to be optimized, for example, 8-byte alignment with respect to the pointer variable of the dummy argument. Including processing.

また、特定条件は、例えば、最適化処理の対象となるコードにおける命令の数を、50%以下にするという条件である。この場合、緩和特定条件は、例えば、最適化処理の対象となるコードにおける命令の数を、例えば、60%以下にするという条件である。この場合、特定条件を緩和させた最適化処理(特定条件緩和最適化処理)は、最適化処理の対象となるコードにおける命令の数を、例えば、60%以下にする処理を含む。   The specific condition is, for example, a condition that the number of instructions in the code to be optimized is 50% or less. In this case, the relaxation specifying condition is, for example, a condition that the number of instructions in the code to be optimized is, for example, 60% or less. In this case, the optimization process in which the specific condition is relaxed (specific condition relaxation optimization process) includes a process in which the number of instructions in the code to be optimized is, for example, 60% or less.

また、特定条件は、例えば、最適化処理の対象となるコードにおける命令の使用演算器資源数を、50%以下にするという条件である。この場合、緩和特定条件は、例えば、最適化処理の対象となるコードにおける命令の使用演算器資源数を、例えば、60%以下にするという条件である。この場合、特定条件を緩和させた最適化処理(特定条件緩和最適化処理)は、最適化処理の対象となるコードにおける命令の使用演算器資源数を、例えば、60%以下にする処理を含む。   The specific condition is, for example, a condition that the number of used computing unit resources of instructions in the code to be optimized is 50% or less. In this case, the relaxation specifying condition is, for example, a condition that the number of used arithmetic unit resources of instructions in the code to be optimized is, for example, 60% or less. In this case, the optimization process in which the specific condition is relaxed (specific condition relaxation optimization process) includes a process in which, for example, the number of used arithmetic unit resources in the code targeted for the optimization process is reduced to 60% or less. .

緩和特定条件は、コンパイラに実装される様々な最適化の条件に適用できる。
特定条件緩和最適化部183は、第1の中間コードに対して特定条件緩和最適化処理を行うことにより、特定条件緩和最適化処理が施された中間コード(以下、第3の中間コードという)を出力する。すなわち、特定条件緩和最適化部183は、第1の中間コードに対して特定条件緩和最適化処理を行うことにより、第3の中間コードを生成する。
The relaxation specific condition can be applied to various optimization conditions implemented in the compiler.
The specific condition relaxation optimizing unit 183 performs the specific condition relaxation optimization process on the first intermediate code, so that the intermediate code subjected to the specific condition relaxation optimization process (hereinafter referred to as a third intermediate code). Is output. That is, the specific condition relaxation optimizing unit 183 generates the third intermediate code by performing the specific condition relaxation optimization process on the first intermediate code.

特定条件緩和最適化部183は、第3の中間コードを、最適性到達度解析部186Aへ送信する。   The specific condition relaxation optimization unit 183 transmits the third intermediate code to the optimality achievement degree analysis unit 186A.

論理保証最適化部184は、第1の実施の形態で説明した処理に加え、第2の中間コードを、最適性到達度解析部186Aへ送信する。   In addition to the processing described in the first embodiment, the logic guarantee optimization unit 184 transmits the second intermediate code to the optimality reachability analysis unit 186A.

最適性到達度解析部186Aは、第2の中間コードおよび第3の中間コードを受信する。最適性到達度解析部186Aは、第2の中間コードと、第3の中間コードとの性能の比較が可能なように、第2の中間コードおよび第3の中間コードの性能の分析(解析)を行い、第2の中間コードおよび第3の中間コードの性能の分析結果を示す最適性到達度情報142を出力する。   Optimality reach analysis unit 186A receives the second intermediate code and the third intermediate code. Optimality reach analysis unit 186A analyzes (analyzes) the performance of the second intermediate code and the third intermediate code so that the performance of the second intermediate code and the third intermediate code can be compared. And the optimum reachability information 142 indicating the analysis results of the performance of the second intermediate code and the third intermediate code is output.

この場合、最適性到達度情報142は、第2の中間コードの性能と、第3の中間コードの性能とが比較可能なように分析結果を示す。   In this case, the optimality achievement degree information 142 indicates an analysis result so that the performance of the second intermediate code can be compared with the performance of the third intermediate code.

(コンパイラ処理の流れ(特定条件緩和))
次に、コンパイラ149Aが実行する処理の流れについて説明する。
(Flow of compiler processing (relaxation of specific conditions))
Next, the flow of processing executed by the compiler 149A will be described.

図11は、コンパイラ149Aが実行する処理のフローチャートである。図11において、図5のステップ番号と同じステップ番号の処理は、第1の実施の形態で説明した処理と同様な処理が行なわれるので詳細な説明は繰り返さない。   FIG. 11 is a flowchart of processing executed by the compiler 149A. In FIG. 11, the process with the same step number as the step number of FIG. 5 is performed in the same way as the process described in the first embodiment, and therefore detailed description will not be repeated.

構文解析部182は、ソースプログラム141の構文解析を行い、第1の中間コードを生成する(S1)。構文解析部182は、第1の中間コードを、論理保証最適化部184および特定条件緩和最適化部183へ送信する。   The syntax analysis unit 182 performs syntax analysis of the source program 141 and generates a first intermediate code (S1). The syntax analysis unit 182 transmits the first intermediate code to the logic guarantee optimization unit 184 and the specific condition relaxation optimization unit 183.

論理保証最適化部184は、第1の実施の形態と同様に、第1の中間コードに対し前述した論理保証最適化処理を行うことにより、第2の中間コードを生成する。そして、論理保証最適化部184は、第2の中間コードを最適性到達度解析部186Aおよびコード出力部188へ送信する(S2A)。   Similarly to the first embodiment, the logic guarantee optimization unit 184 generates the second intermediate code by performing the above-described logic guarantee optimization process on the first intermediate code. Then, the logic guarantee optimization unit 184 transmits the second intermediate code to the optimality reachability analysis unit 186A and the code output unit 188 (S2A).

特定条件緩和最適化部183は、第1の中間コードに対し前述した特定条件緩和最適化処理を行うことにより、第3の中間コードを生成し、第3の中間コードを、最適性到達度解析部186Aへ送信する(S6)。   The specific condition relaxation optimization unit 183 generates the third intermediate code by performing the above-described specific condition relaxation optimization process on the first intermediate code, and analyzes the third intermediate code with the optimality reachability analysis. Transmit to the unit 186A (S6).

最適性到達度解析部186Aは、第2の中間コードおよび第3の中間コードの最適性の到達度を解析(分析)し、解析(分析)の結果を示す最適性到達度情報142を出力する(S3Aの最適性到達度解析処理A)。すなわち、最適性到達度解析部186Aは、第2の中間コードおよび第3の中間コードの性能の分析結果を示す最適性到達度情報142を出力する。   Optimality reachability analysis unit 186A analyzes (analyzes) the reachability of optimality of the second intermediate code and the third intermediate code, and outputs optimality reachability information 142 indicating the result of the analysis (analysis). (S3A optimality achievement analysis process A). That is, the optimality reachability analysis unit 186A outputs the optimality reachability information 142 indicating the analysis results of the performance of the second intermediate code and the third intermediate code.

(最適性到達度解析処理Aの詳細な流れ(特定条件緩和))
次に、図11のステップS3Aの最適性到達度解析処理Aについて詳細に説明する。
(Detailed flow of optimality achievement analysis process A (relaxation of specific conditions))
Next, the optimality achievement analysis process A in step S3A of FIG. 11 will be described in detail.

図12は、最適性到達度解析処理Aのフローチャートである。図12において、図6のステップ番号と同じステップ番号の処理は、第1の実施の形態で説明した処理と同様な処理が行なわれるので詳細な説明は繰り返さない。   FIG. 12 is a flowchart of the optimality achievement level analysis process A. In FIG. 12, the process with the same step number as the step number of FIG. 6 is performed in the same way as the process described in the first embodiment, and therefore detailed description will not be repeated.

最適性到達度解析部186Aは、第2の中間コードを、関数(手続き)毎に分割して第2の中間コードを解析する(S31)。   The optimality reachability analysis unit 186A analyzes the second intermediate code by dividing the second intermediate code for each function (procedure) (S31).

次に、最適性到達度解析部186Aは、ステップS31にて関数毎に分割された第2の中間コードを、基本ブロック毎に分割して、分割された各第2の中間コードを解析する(S32)。   Next, the optimality achievement level analysis unit 186A divides the second intermediate code divided for each function in step S31 for each basic block, and analyzes each divided second intermediate code ( S32).

次に、最適性到達度解析部186Aは、基本ブロック毎に分割された各第2の中間コードに対応するDAG情報を生成する(S33)。   Next, the optimality achievement degree analysis unit 186A generates DAG information corresponding to each second intermediate code divided for each basic block (S33).

次に、最適性到達度解析部186Aは、生成されたDAG情報が示すDAGの高さを解析することにより、サイクル情報としてのサイクル数(以下、論理保証サイクル数という)を求める(S36)。当該論理保証サイクル数は、処理対象のDAG情報に対応する第2の中間コードを、ターゲットプロセッサが実行するために必要なサイクル数である。   Next, the optimality achievement level analysis unit 186A determines the number of cycles as cycle information (hereinafter referred to as the number of logic guarantee cycles) by analyzing the height of the DAG indicated by the generated DAG information (S36). The number of logic assurance cycles is the number of cycles necessary for the target processor to execute the second intermediate code corresponding to the DAG information to be processed.

また、最適性到達度解析部186Aは、関数シンボル名を主キーとして、基本ブロックを特定する番号と、サイクル情報としての論理保証サイクル数とを対応づけて性能解析情報データベース211Dに登録する(S36)。   Further, the optimality achievement level analysis unit 186A registers the number identifying the basic block with the function symbol name as the primary key in association with the number of logical guarantee cycles as the cycle information in the performance analysis information database 211D (S36). ).

図12のステップS31〜S36と同様に、最適性到達度解析部186Aは、以下の処理を行う。   Similar to steps S31 to S36 in FIG. 12, the optimality achievement degree analysis unit 186A performs the following processing.

まず、最適性到達度解析部186Aは、第3の中間コードを、関数(手続き)毎に分割して第3の中間コードを解析する(S61)。   First, the optimality achievement level analysis unit 186A analyzes the third intermediate code by dividing the third intermediate code for each function (procedure) (S61).

次に、最適性到達度解析部186Aは、ステップS61にて関数毎に分割された第2の中間コードを、基本ブロック毎に分割して、分割された各第3の中間コードを解析する(S62)。   Next, the optimality achievement level analysis unit 186A divides the second intermediate code divided for each function in step S61 for each basic block, and analyzes each divided third intermediate code ( S62).

次に、最適性到達度解析部186Aは、基本ブロック毎に分割された各第3の中間コードに対応するDAG情報を生成する(S63)。   Next, the optimality achievement degree analysis unit 186A generates DAG information corresponding to each third intermediate code divided for each basic block (S63).

次に、最適性到達度解析部186Aは、生成されたDAG情報が示すDAGの高さを解析することにより、サイクル情報としてのサイクル数(以下、条件緩和サイクル数という)を求める(S64)。   Next, the optimality achievement degree analysis unit 186A obtains the number of cycles (hereinafter referred to as the number of condition relaxation cycles) as cycle information by analyzing the height of the DAG indicated by the generated DAG information (S64).

また、最適性到達度解析部186Aは、関数シンボル名を主キーとして、基本ブロックを特定する番号と、サイクル情報としての条件緩和サイクル数とを対応づけて性能解析情報データベース212Dに登録する(S64)。   Further, the optimality achievement level analysis unit 186A registers the number identifying the basic block with the function symbol name as the main key and the condition relaxation cycle number as the cycle information in the performance analysis information database 212D (S64). ).

次に、ステップS35Aにて、最適性到達度解析部186Aは、性能解析情報データベース211Dおよび性能解析情報データベース212Dの各々から、主キーの関数名毎に基本ブロック番号およびサイクル情報を整形し、整形された後の情報を示す最適性到達度情報142を出力する。この場合、制御部510は、最適性到達度情報142を、例えば、表示部540に表示させるための処理を行う。そして、この最適性到達度解析処理Aは終了する。   Next, in step S35A, the optimality achievement degree analysis unit 186A shapes the basic block number and cycle information for each function name of the primary key from each of the performance analysis information database 211D and the performance analysis information database 212D. The optimality achievement degree information 142 indicating the information after being output is output. In this case, the control unit 510 performs a process for causing the display unit 540 to display the optimality achievement degree information 142, for example. And this optimality achievement analysis process A is complete | finished.

ここで、ソースプログラム141が、一例として、図7に示されるプログラムであるとする。この場合、図11の処理および図12の最適性到達度解析処理Aが行われることにより出力される最適性到達度情報142は、一例として、図13に示される情報である。   Here, it is assumed that the source program 141 is a program shown in FIG. 7 as an example. In this case, the optimality achievement information 142 output by performing the process of FIG. 11 and the optimality achievement analysis process A of FIG. 12 is information shown in FIG. 13 as an example.

図13は、第2の実施の形態における一例としての最適性到達度情報142を示す図である。   FIG. 13 is a diagram illustrating optimality achievement degree information 142 as an example in the second embodiment.

図13において、「BasicBlockNum」とは、基本ブロック番号である。「論理保証サイクル数」とは、最適性到達度解析処理Aにより得られた、分割された第2の中間コードに対応する、サイクル情報としての論理保証サイクル数である。「条件緩和サイクル数」とは、最適性到達度解析処理Aにより得られた、分割された第3の中間コードに対応する、サイクル情報としての条件緩和サイクル数である。   In FIG. 13, “BasicBlockNum” is a basic block number. The “number of logic guarantee cycles” is the number of logic guarantee cycles as cycle information corresponding to the divided second intermediate code obtained by the optimality reachability analysis process A. “The number of condition relaxation cycles” is the number of condition relaxation cycles as cycle information corresponding to the divided third intermediate code obtained by the optimum reachability analysis process A.

図13の「最適性到達度」は、(条件緩和サイクル数/論理保証サイクル数)の式により算出される値である。「最適性到達度」は、ステップS35Aの処理において、最適性到達度解析部186Aが算出する。なお、最適性到達度解析部186Aは、条件緩和サイクル数が論理保証サイクル数より大きい場合、最適性到達度を100とする。   The “optimum achievement degree” in FIG. 13 is a value calculated by the equation (number of condition relaxation cycles / number of logic guarantee cycles). The “optimum achievement level” is calculated by the optimality level analysis unit 186A in the process of step S35A. The optimality achievement level analysis unit 186A sets the optimality achievement level to 100 when the number of condition relaxation cycles is larger than the number of logical guarantee cycles.

図13の「最適性到達度」は、図8で説明した「最適性到達度」と同様なので詳細な説明は繰り返さない。つまり、基本ブロックに対応する最適性到達度が100(%)に近い値であるほど、ソースプログラム141に記述されている、当該基本ブロックに対応する部分のソースコードが、ターゲットプロセッサのハードウエア資源を、より効率的に使用できていることになる。すなわち、最適性到達度は、ソースプログラム141に記述されている、当該基本ブロックに対応する部分のソースコードのアルゴリズムの最適度を示す。   The “optimum achievement degree” in FIG. 13 is the same as the “optimum achievement degree” described in FIG. 8, and therefore, detailed description thereof will not be repeated. That is, the closer the optimality achievement level corresponding to the basic block is to 100 (%), the more the source code of the part corresponding to the basic block described in the source program 141 is the hardware resource of the target processor. Can be used more efficiently. In other words, the optimum degree of achievement indicates the optimum degree of the algorithm of the source code of the part corresponding to the basic block described in the source program 141.

例えば、図13では、基本ブロック番号“1”に対応する、分割された第2の中間コードの最適性到達度が最も大きいことになる。すなわち、ソースプログラム141に記述されている、基本ブロック番号“1”に対応する部分のソースコードのアルゴリズムの最適度が最もよいことになる。   For example, in FIG. 13, the optimal reachability of the divided second intermediate code corresponding to the basic block number “1” is the highest. That is, the optimality of the algorithm of the source code corresponding to the basic block number “1” described in the source program 141 is the best.

図13に示される情報(最適性到達度情報142)が、表示部540に表示されることにより、プログラマは、作成しているソースプログラム141に記述されているソースコードのアルゴリズムの最適度を把握することができる。   The information shown in FIG. 13 (optimum achievement level information 142) is displayed on the display unit 540, whereby the programmer grasps the optimum degree of the algorithm of the source code described in the source program 141 being created. can do.

以上説明したように、本実施の形態においても、第1の実施の形態と同様な効果を得ることができる。すなわち、プログラマは、作成しているソースプログラム141に記述されているソースコードのアルゴリズムの最適度を把握することができる。その結果、プログラマは、開発の工程数を無駄にすることなく、ソースプログラム141のチューニングを実施することができる。   As described above, also in this embodiment, the same effect as that of the first embodiment can be obtained. That is, the programmer can grasp the optimum degree of the algorithm of the source code described in the source program 141 being created. As a result, the programmer can tune the source program 141 without wasting the number of development steps.

すなわち、図13に示される情報(最適性到達度情報142)が、表示部540に表示(出力)されることにより、プログラマに対し、ソースプログラムの効率的なチューニングを支援することができる。   That is, the information (optimum reachability information 142) shown in FIG. 13 is displayed (output) on the display unit 540, so that the programmer can be assisted in efficient tuning of the source program.

<第2の実施の形態の変形例1>
次に、特定条件を緩和した条件(以下、緩和特定条件という)の情報を出力する構成について説明する。
<Modification 1 of the second embodiment>
Next, a configuration for outputting information on conditions (hereinafter referred to as relaxation specific conditions) in which specific conditions are relaxed will be described.

第2の実施の形態の変形例1におけるコンパイラシステムは、図9のコンパイラシステム148Aである。   The compiler system in the first modification of the second embodiment is the compiler system 148A in FIG.

(緩和特定条件の出力)
図14は、第2の実施の形態の変形例1におけるコンパイラ149Aの構成を示す図である。図14に示されるコンパイラ149Aは、図10のコンパイラ149Aと同じ構成を有するので詳細な説明は繰り返さない。
(Output of relaxation specific conditions)
FIG. 14 is a diagram illustrating a configuration of the compiler 149A according to the first modification of the second embodiment. Since compiler 149A shown in FIG. 14 has the same configuration as compiler 149A of FIG. 10, detailed description thereof will not be repeated.

図14の特定条件緩和最適化部183は、第2の実施の形態で説明した処理に加え、特定条件を緩和した緩和特定条件の情報を出力する。緩和特定条件の情報は、最適性到達度情報142に登録される。   The specific condition relaxation optimizing unit 183 in FIG. 14 outputs information on the relaxed specific condition with the specific condition relaxed, in addition to the processing described in the second embodiment. Information on the relaxation specifying condition is registered in the optimality achievement degree information 142.

<第2の実施の形態の変形例2>
次に、緩和特定条件を外部から受け取るための構成について説明する。
<Modification 2 of the second embodiment>
Next, a configuration for receiving the relaxation specific condition from the outside will be described.

(システム構成)
図15は、第2の実施の形態の変形例2におけるコンパイラシステム148Bの構成を示す図である。コンパイラシステム148Bは、プログラム51が制御部510により実行されることにより実現される。すなわち、プログラム51は、コンパイラシステム148Bを含む。
(System configuration)
FIG. 15 is a diagram illustrating a configuration of a compiler system 148B according to the second modification of the second embodiment. The compiler system 148B is realized by the program 51 being executed by the control unit 510. That is, the program 51 includes a compiler system 148B.

図15を参照して、コンパイラシステム148Bは、図3のコンパイラシステム148と比較して、コンパイラ149の代わりにコンパイラ149Bを含む点が異なる。それ以外の構成は、コンパイラシステム148と同様なので詳細な説明は繰り返さない。   Referring to FIG. 15, compiler system 148 </ b> B is different from compiler system 148 in FIG. 3 in that it includes compiler 149 </ b> B instead of compiler 149. Since other configurations are the same as those of the compiler system 148, detailed description will not be repeated.

(緩和特定条件の入力)
図16は、第2の実施の形態の変形例2におけるコンパイラ149Bの構成を示す図である。
(Enter relaxation specific conditions)
FIG. 16 is a diagram illustrating a configuration of the compiler 149B according to the second modification of the second embodiment.

図16を参照して、コンパイラ149Bは、図10のコンパイラ149Aと比較して、受付部189をさらに含む点が異なる。それ以外の構成は、コンパイラ149Aと同様なので詳細な説明は繰り返さない。コンパイラ149B内の各部は、プログラムモジュールとして実現される。   Referring to FIG. 16, compiler 149 </ b> B is different from compiler 149 </ b> A in FIG. 10 in that it further includes a reception unit 189. Since other configurations are similar to those of compiler 149A, detailed description will not be repeated. Each unit in the compiler 149B is realized as a program module.

受付部189は、外部からの指示を受付ける。具体的には、受付部189は、受付けた指示が示す緩和特定条件160を受付ける。受付部189は、受付けた緩和特定条件160を、特定条件緩和最適化部183へ送信する。   The accepting unit 189 accepts an instruction from the outside. Specifically, the reception unit 189 receives the relaxation specifying condition 160 indicated by the received instruction. The accepting unit 189 transmits the accepted relaxation specific condition 160 to the specific condition relaxation optimization unit 183.

受付部189は、一例として、コマンドラインによる指示が示す緩和特定条件160を受付ける。コマンドラインによる指示は、コンパイラオプションとしての指示である。コマンドラインによる指示は、例えば、プログラマがキーボード551を操作することにより行われる。   For example, the accepting unit 189 accepts the relaxation specifying condition 160 indicated by the command line instruction. The command line instruction is an instruction as a compiler option. The command line instruction is performed, for example, when the programmer operates the keyboard 551.

また、受付部189は、一例として、ソースプログラム141に記述されている#pragma指令(図7参照)による指示が示す緩和特定条件160を受付ける。この場合、受付部189は、ソースプログラム141から緩和特定条件160を受付ける。   For example, the accepting unit 189 accepts the relaxation specifying condition 160 indicated by the instruction by the #pragma instruction (see FIG. 7) described in the source program 141. In this case, the accepting unit 189 accepts the relaxation specifying condition 160 from the source program 141.

なお、コンパイラ149B内の各部は、第2の実施の形態と同様な処理を行うので詳細な説明は繰り返さない。   Note that each part in the compiler 149B performs the same processing as in the second embodiment, and thus detailed description will not be repeated.

すなわち、特定条件緩和最適化部183は、第1の中間コードに対し、受付部189が受付けた指示が示す緩和特定条件160に基づいた特定条件緩和最適化処理を行うことにより、第3の中間コードを生成する。   That is, the specific condition relaxation optimizing unit 183 performs the third intermediate code by performing the specific condition relaxation optimization process based on the relaxed specific condition 160 indicated by the instruction received by the receiving unit 189 with respect to the first intermediate code. Generate code.

<第3の実施の形態>
次に、第3の実施の形態におけるコンパイラシステムについて説明する。
<Third Embodiment>
Next, a compiler system according to the third embodiment will be described.

第3の実施の形態におけるコンパイラシステムは、図1に示されるコンピュータ500において、プログラムが実行されることにより実現される。   The compiler system in the third embodiment is realized by executing a program in the computer 500 shown in FIG.

(システム構成(論理未保証))
図17は、第3の実施の形態におけるコンパイラシステム148Cの構成を示す図である。コンパイラシステム148Cは、プログラム51が制御部510により実行されることにより実現される。すなわち、プログラム51は、コンパイラシステム148Cを含む。
(System configuration (logical unguaranteed))
FIG. 17 is a diagram illustrating a configuration of a compiler system 148C according to the third embodiment. The compiler system 148C is realized by the program 51 being executed by the control unit 510. That is, the program 51 includes a compiler system 148C.

図17を参照して、コンパイラシステム148Cは、図3のコンパイラシステム148と比較して、コンパイラ149の代わりにコンパイラ149Cを含む点が異なる。それ以外の構成は、コンパイラシステム148と同様なので詳細な説明は繰り返さない。   17, compiler system 148C is different from compiler system 148 in FIG. 3 in that a compiler 149C is included instead of compiler 149. Since other configurations are the same as those of the compiler system 148, detailed description will not be repeated.

(コンパイラの構成(論理未保証))
図18は、第3の実施の形態におけるコンパイラ149Cの構成を示す図である。
(Compiler configuration (logic not guaranteed))
FIG. 18 is a diagram illustrating a configuration of the compiler 149C according to the third embodiment.

図18を参照して、コンパイラ149Cは、図4のコンパイラ149と比較して、論理未保証最適化部185をさらに含む点と、最適性到達度解析部186の代わりに最適性到達度解析部186Cを含む点とが異なる。それ以外の構成は、コンパイラ149と同様なので詳細な説明は繰り返さない。コンパイラ149C内の各部は、プログラムモジュールとして実現される。   Referring to FIG. 18, compiler 149 </ b> C further includes a logic unguaranteed optimization unit 185 as compared with compiler 149 of FIG. 4, and an optimality reachability analysis unit instead of optimality reachability analysis unit 186. The difference is that it includes 186C. Since other configurations are the same as those of the compiler 149, detailed description will not be repeated. Each unit in the compiler 149C is realized as a program module.

構文解析部182は、前述した第1の中間コードを、論理保証最適化部184および論理未保証最適化部185へ送信する。   The syntax analysis unit 182 transmits the above-described first intermediate code to the logic guarantee optimization unit 184 and the logic unguarantement optimization unit 185.

論理未保証最適化部185は、構文解析部182から受信する第1の中間コードに対して、特定条件の論理の正当性を保証しない最適化処理(以下、論理未保証最適化処理という)を行う。以下においては、論理未保証最適化処理により、論理の保証がされなかった特定条件を、論理未保証条件という。   The logic unguaranteed optimization unit 185 performs an optimization process (hereinafter referred to as a logic unguaranteed optimization process) that does not guarantee the validity of the logic of the specific condition for the first intermediate code received from the syntax analysis unit 182. Do. Hereinafter, a specific condition for which logic is not guaranteed by the logic unguaranteed optimization process is referred to as a logic unguaranteed condition.

なお、後述するが、論理未保証条件は、外部から指定されてもよい。この場合、指定された論理未保証条件は、論理の保証が不要な条件である。すなわち、論理未保証最適化処理は、論理未保証条件に基づいた最適化処理である。この場合、論理未保証条件に基づいた論理未保証最適化処理は、指定された論理未保証条件を保証しない処理である。   As will be described later, the logical unguaranteed condition may be designated from the outside. In this case, the specified logic unguaranteed condition is a condition that does not require a logic guarantee. That is, the logical unguaranteed optimization process is an optimization process based on the logical unguaranteed condition. In this case, the logical unguaranteed optimization process based on the logical unguaranteed condition is a process that does not guarantee the specified logical unguaranteed condition.

論理未保証最適化処理は、例えば、当該論理未保証最適化処理が行われることにより得られる中間コードの論理(アルゴリズム)に矛盾が生じる可能性がある処理である。つまり、論理未保証最適化処理は、中間コードに対して論理保証の制約を緩和した最適化処理である。   The logic unguaranteed optimization process is, for example, a process that may cause a contradiction in the logic (algorithm) of the intermediate code obtained by performing the logic unguaranteed optimization process. That is, the logic unguaranteed optimization process is an optimization process in which the restriction of the logic guarantee is relaxed for the intermediate code.

ここで、一例として、特定条件(論理未保証条件)は、例えば、メモリの割り当てに矛盾がないという条件であるとする。この場合、論理未保証最適化処理が行われることにより、メモリの割り当てに矛盾がないという条件が保証されなくなる。すなわち、論理未保証最適化処理が行われることにより、メモリの割り当てに矛盾が生じる可能性がある。   Here, as an example, the specific condition (logical unguaranteed condition) is, for example, a condition that there is no contradiction in memory allocation. In this case, the logic non-guaranteed optimization process is performed, so that the condition that there is no contradiction in memory allocation cannot be guaranteed. In other words, the logic unguaranteed optimization process may cause inconsistency in memory allocation.

論理未保証条件は、コンパイラに実装される様々な最適化の条件に適用できる。
論理未保証最適化処理は、例えば、前述した見かけのメモリ依存を無視した最適化処理である。この場合、論理未保証条件は、見かけのメモリ依存を保証するという条件である。
The logic unguaranteed condition can be applied to various optimization conditions implemented in the compiler.
The logic unguaranteed optimization process is, for example, an optimization process that ignores the apparent memory dependence described above. In this case, the logical unguaranteed condition is a condition that guarantees an apparent memory dependence.

論理未保証最適化部185は、第1の中間コードに対して論理未保証最適化処理を行うことにより、論理未保証最適化処理が施された中間コード(以下、第4の中間コードという)を出力する。すなわち、論理未保証最適化部185は、第1の中間コードに対して論理未保証最適化処理を行うことにより、第4の中間コードを生成する。   The logic unguaranteed optimization unit 185 performs the logic unguaranteed optimization process on the first intermediate code, thereby performing the logic unguaranteed optimization process (hereinafter referred to as the fourth intermediate code). Is output. That is, the logic unguaranteed optimization unit 185 generates the fourth intermediate code by performing the logic unguaranteed optimization process on the first intermediate code.

第4の中間コードは、論理の正当性が保証されない中間コードである。すなわち、第4の中間コードは、論理(アルゴリズム)に矛盾がある可能性がある中間コードである。   The fourth intermediate code is an intermediate code whose logic validity is not guaranteed. That is, the fourth intermediate code is an intermediate code that may have a contradiction in logic (algorithm).

論理未保証最適化部185は、第4の中間コードを、最適性到達度解析部186Cへ送信する。   The logic unguaranteed optimization unit 185 transmits the fourth intermediate code to the optimality reachability analysis unit 186C.

論理保証最適化部184は、第1の実施の形態で説明した処理に加え、第2の中間コードを、最適性到達度解析部186Cへ送信する。   In addition to the processing described in the first embodiment, the logic guarantee optimization unit 184 transmits the second intermediate code to the optimality reachability analysis unit 186C.

最適性到達度解析部186Cは、第2の中間コードおよび第4の中間コードを受信する。最適性到達度解析部186Cは、第2の中間コードと、第4の中間コードとの性能の比較が可能なように、第2の中間コードおよび第4の中間コードの性能の分析(解析)を行い、第2の中間コードおよび第4の中間コードの性能の分析結果を示す最適性到達度情報142を出力する。   Optimality reach analysis unit 186C receives the second intermediate code and the fourth intermediate code. The optimality reachability analysis unit 186C analyzes (analyzes) the performance of the second intermediate code and the fourth intermediate code so that the performance of the second intermediate code and the fourth intermediate code can be compared. And the optimum reachability information 142 indicating the analysis results of the performance of the second intermediate code and the fourth intermediate code is output.

この場合、最適性到達度情報142は、第2の中間コードの性能と、第4の中間コードの性能とが比較可能なように分析結果を示す。   In this case, the optimality achievement degree information 142 indicates the analysis result so that the performance of the second intermediate code can be compared with the performance of the fourth intermediate code.

(コンパイラ処理の流れ(論理未保証))
次に、コンパイラ149Cが実行する処理の流れについて説明する。
(Flow of compiler processing (logic not guaranteed))
Next, the flow of processing executed by the compiler 149C will be described.

図19は、コンパイラ149Cが実行する処理のフローチャートである。図19において、図5のステップ番号と同じステップ番号の処理は、第1の実施の形態で説明した処理と同様な処理が行なわれるので詳細な説明は繰り返さない。   FIG. 19 is a flowchart of processing executed by the compiler 149C. In FIG. 19, the process with the same step number as the step number of FIG. 5 is performed in the same way as the process described in the first embodiment, and therefore detailed description will not be repeated.

構文解析部182は、ソースプログラム141の構文解析を行い、第1の中間コードを生成する(S1)。構文解析部182は、第1の中間コードを、論理保証最適化部184および論理未保証最適化部185へ送信する。   The syntax analysis unit 182 performs syntax analysis of the source program 141 and generates a first intermediate code (S1). The syntax analysis unit 182 transmits the first intermediate code to the logical guarantee optimization unit 184 and the logical unguarantement optimization unit 185.

論理保証最適化部184は、第1の実施の形態と同様に、第1の中間コードに対し前述した論理保証最適化処理を行うことにより、第2の中間コードを生成する。そして、論理保証最適化部184は、第2の中間コードを最適性到達度解析部186Cおよびコード出力部188へ送信する(S2C)。   Similarly to the first embodiment, the logic guarantee optimization unit 184 generates the second intermediate code by performing the above-described logic guarantee optimization process on the first intermediate code. Then, the logic guarantee optimization unit 184 transmits the second intermediate code to the optimality reachability analysis unit 186C and the code output unit 188 (S2C).

特定条件緩和最適化部183は、第1の中間コードに対し前述した論理未保証最適化処理を行うことにより、第4の中間コードを生成し、第4の中間コードを、最適性到達度解析部186Cへ送信する(S7)。   The specific condition relaxation optimizing unit 183 generates the fourth intermediate code by performing the above-described logic unguaranteed optimization processing on the first intermediate code, and analyzes the fourth intermediate code with the optimality reachability analysis. Transmit to the unit 186C (S7).

最適性到達度解析部186Cは、第2の中間コードおよび第4の中間コードの最適性の到達度を解析(分析)し、解析(分析)の結果を示す最適性到達度情報142を出力する(S3Cの最適性到達度解析処理C)。すなわち、最適性到達度解析部186Cは、第2の中間コードおよび第4の中間コードの性能の分析結果を示す最適性到達度情報142を出力する。   Optimality reach analysis unit 186C analyzes (analyzes) the reach of optimality of the second intermediate code and the fourth intermediate code, and outputs optimum reachability information 142 indicating the result of the analysis (analysis). (S3C Optimality Achievement Analysis Process C). That is, the optimality reachability analysis unit 186C outputs the optimality reachability information 142 indicating the analysis results of the performance of the second intermediate code and the fourth intermediate code.

(最適性到達度解析処理Cの詳細な流れ(論理未保証))
次に、図19のステップS3Cの最適性到達度解析処理Cについて詳細に説明する。
(Detailed flow of optimality achievement analysis process C (logical unguaranteed))
Next, the optimum reachability analysis process C in step S3C of FIG. 19 will be described in detail.

図20は、最適性到達度解析処理Cのフローチャートである。図20において、図12のステップ番号と同じステップ番号の処理は、第2の実施の形態で説明した処理と同様な処理が行なわれるので詳細な説明は繰り返さない。   FIG. 20 is a flowchart of the optimality achievement analysis process C. In FIG. 20, the processing with the same step number as the step number of FIG. 12 is performed in the same manner as the processing described in the second embodiment, and therefore detailed description will not be repeated.

ステップS31,S32,S33,S36では、第2の実施の形態で説明した処理が最適性到達度解析部186Cにより行なわれるので詳細な説明は繰り返さない。これにより、最適性到達度解析部186Cは、関数シンボル名を主キーとして、基本ブロックを特定する番号と、サイクル情報としての論理保証サイクル数とを対応づけて性能解析情報データベース211Dに登録する。   In steps S31, S32, S33, and S36, since the process described in the second embodiment is performed by the optimality achievement level analysis unit 186C, detailed description will not be repeated. As a result, the optimality attainment analysis unit 186C registers the number identifying the basic block and the number of logical guarantee cycles as the cycle information in the performance analysis information database 211D using the function symbol name as the main key.

図20のステップS31〜S36と同様に、最適性到達度解析部186Cは、以下の処理を行う。   Similarly to steps S31 to S36 in FIG. 20, the optimality achievement degree analysis unit 186C performs the following processing.

まず、最適性到達度解析部186Cは、第4の中間コードを、関数(手続き)毎に分割して第4の中間コードを解析する(S71)。   First, the optimality attainment analysis unit 186C analyzes the fourth intermediate code by dividing the fourth intermediate code for each function (procedure) (S71).

次に、最適性到達度解析部186Cは、ステップS71にて関数毎に分割された第4の中間コードを、基本ブロック毎に分割して、分割された各第4の中間コードを解析する(S72)。   Next, the optimality achievement level analysis unit 186C divides the fourth intermediate code divided for each function in step S71 for each basic block, and analyzes each divided fourth intermediate code ( S72).

次に、最適性到達度解析部186Cは、基本ブロック毎に分割された各第4の中間コードに対応するDAG情報を生成する(S73)。   Next, the optimality achievement degree analysis unit 186C generates DAG information corresponding to each fourth intermediate code divided for each basic block (S73).

次に、最適性到達度解析部186Cは、生成されたDAG情報が示すDAGの高さを解析することにより、サイクル情報としてのサイクル数(以下、論理未保証サイクル数という)を求める(S74)。   Next, the optimality achievement level analysis unit 186C analyzes the height of the DAG indicated by the generated DAG information, thereby obtaining the number of cycles as cycle information (hereinafter referred to as the number of logical unguaranteed cycles) (S74). .

また、最適性到達度解析部186Cは、関数シンボル名を主キーとして、基本ブロックを特定する番号と、サイクル情報としての論理未保証サイクル数とを対応づけて性能解析情報データベース222Dに登録する(S74)。   Further, the optimality reachability analysis unit 186C registers the number identifying the basic block and the number of logical unguaranteed cycles as cycle information in the performance analysis information database 222D using the function symbol name as a main key ( S74).

次に、ステップS35Cにて、最適性到達度解析部186Cは、性能解析情報データベース211Dおよび性能解析情報データベース222Dの各々から、主キーの関数名毎に基本ブロック番号およびサイクル情報を整形し、整形された後の情報を示す最適性到達度情報142を出力する。この場合、制御部510は、最適性到達度情報142を、例えば、表示部540に表示させるための処理を行う。そして、この最適性到達度解析処理Cは終了する。   Next, in step S35C, the optimality achievement level analysis unit 186C shapes the basic block number and cycle information for each function name of the primary key from each of the performance analysis information database 211D and the performance analysis information database 222D. The optimality achievement degree information 142 indicating the information after being output is output. In this case, the control unit 510 performs a process for causing the display unit 540 to display the optimality achievement degree information 142, for example. Then, the optimality achievement level analysis process C ends.

ここで、ソースプログラム141が、一例として、図7に示されるプログラムであるとする。この場合、図19の処理および図20の最適性到達度解析処理Cが行われることにより出力される最適性到達度情報142は、一例として、図21に示される情報である。   Here, it is assumed that the source program 141 is a program shown in FIG. 7 as an example. In this case, the optimality achievement information 142 output by performing the process of FIG. 19 and the optimality achievement analysis process C of FIG. 20 is information shown in FIG. 21 as an example.

図21は、第3の実施の形態における一例としての最適性到達度情報142を示す図である。   FIG. 21 is a diagram showing the optimality achievement degree information 142 as an example in the third embodiment.

図21において、「BasicBlockNum」とは、基本ブロック番号である。「論理保証サイクル数」とは、最適性到達度解析処理Cにより得られた、分割された第2の中間コードに対応する、サイクル情報としての論理保証サイクル数である。「論理未保証サイクル数」とは、最適性到達度解析処理Cにより得られた、分割された第4の中間コードに対応する、サイクル情報としての論理保証サイクル数である。   In FIG. 21, “BasicBlockNum” is a basic block number. The “number of logic guarantee cycles” is the number of logic guarantee cycles as cycle information corresponding to the divided second intermediate code obtained by the optimum reachability analysis process C. The “number of logical unguaranteed cycles” is the number of logically guaranteed cycles as cycle information corresponding to the divided fourth intermediate code obtained by the optimum reachability analysis process C.

図21の「最適性到達度」は、(論理未保証サイクル数/論理保証サイクル数)の式により算出される値である。「最適性到達度」は、ステップS35Cの処理において、最適性到達度解析部186Cが算出する。なお、最適性到達度解析部186Cは、論理未保証サイクル数が論理保証サイクル数より大きい場合、最適性到達度を100とする。   21 is a value calculated by the formula (number of logical unguaranteed cycles / number of logically guaranteed cycles). The “optimum achievement level” is calculated by the optimality level analysis unit 186C in the process of step S35C. The optimality achievement level analysis unit 186C sets the optimality achievement level to 100 when the number of logical unguaranteed cycles is larger than the number of logically guaranteed cycles.

図21の「最適性到達度」は、図8で説明した「最適性到達度」と同様なので詳細な説明は繰り返さない。つまり、基本ブロックに対応する最適性到達度が100(%)に近い値であるほど、ソースプログラム141に記述されている、当該基本ブロックに対応する部分のソースコードが、ターゲットプロセッサのハードウエア資源を、より効率的に使用できていることになる。すなわち、最適性到達度は、ソースプログラム141に記述されている、当該基本ブロックに対応する部分のソースコードのアルゴリズムの最適度を示す。   The “optimum achievement level” in FIG. 21 is the same as the “optimum achievement level” described with reference to FIG. 8, and therefore, detailed description thereof will not be repeated. That is, the closer the optimality achievement degree corresponding to the basic block is to a value close to 100 (%), the more the source code of the part corresponding to the basic block described in the source program 141 is the hardware resource of the target processor. Can be used more efficiently. In other words, the optimum degree of achievement indicates the optimum degree of the algorithm of the source code of the part corresponding to the basic block described in the source program 141.

図21に示される情報(最適性到達度情報142)が、表示部540に表示されることにより、プログラマは、作成しているソースプログラム141に記述されているソースコードのアルゴリズムの最適度を把握することができる。   The information shown in FIG. 21 (optimum achievement level information 142) is displayed on the display unit 540, whereby the programmer grasps the optimum degree of the algorithm of the source code described in the source program 141 being created. can do.

以上説明したように、本実施の形態においても、第1の実施の形態と同様な効果を得ることができる。すなわち、プログラマは、作成しているソースプログラム141に記述されているソースコードのアルゴリズムの最適度を把握することができる。その結果、プログラマは、開発の工程数を無駄にすることなく、ソースプログラム141のチューニングを実施することができる。   As described above, also in this embodiment, the same effect as that of the first embodiment can be obtained. That is, the programmer can grasp the optimum degree of the algorithm of the source code described in the source program 141 being created. As a result, the programmer can tune the source program 141 without wasting the number of development steps.

すなわち、図21に示される情報(最適性到達度情報142)が、表示部540に表示(出力)されることにより、プログラマに対し、ソースプログラムの効率的なチューニングを支援することができる。   That is, the information (optimum reachability information 142) shown in FIG. 21 is displayed (output) on the display unit 540, so that the programmer can be assisted in efficient tuning of the source program.

<第3の実施の形態の変形例1>
次に、論理未保証条件の情報を出力する構成について説明する。
<Variation 1 of the third embodiment>
Next, a configuration for outputting information on logical unguaranteed conditions will be described.

第3の実施の形態の変形例1におけるコンパイラシステムは、図17のコンパイラシステム148Cである。   The compiler system in the first modification of the third embodiment is a compiler system 148C in FIG.

(論理未保証条件の出力)
図22は、第3の実施の形態の変形例1におけるコンパイラ149Cの構成を示す図である。図22に示されるコンパイラ149Cは、図18のコンパイラ149Cと同じ構成を有するので詳細な説明は繰り返さない。
(Logical unguaranteed condition output)
FIG. 22 is a diagram illustrating a configuration of the compiler 149C according to the first modification of the third embodiment. Since compiler 149C shown in FIG. 22 has the same configuration as compiler 149C of FIG. 18, detailed description will not be repeated.

図22の論理未保証最適化部185は、第3の実施の形態で説明した処理に加え、論理未保証条件の情報を出力する。論理未保証条件の情報は、最適性到達度情報142に登録される。   The logical unguaranteed optimization unit 185 in FIG. 22 outputs information on the logical unguaranteed condition in addition to the processing described in the third embodiment. Information on the logical unguaranteed condition is registered in the optimality achievement degree information 142.

<第3の実施の形態の変形例2>
次に、論理未保証条件を外部から受け取るための構成について説明する。
<Modification 2 of the third embodiment>
Next, a configuration for receiving a logical unguaranteed condition from the outside will be described.

(システム構成)
図23は、第3の実施の形態の変形例2におけるコンパイラシステム148Dの構成を示す図である。コンパイラシステム148Dは、プログラム51が制御部510により実行されることにより実現される。すなわち、プログラム51は、コンパイラシステム148Dを含む。
(System configuration)
FIG. 23 is a diagram illustrating a configuration of a compiler system 148D according to the second modification of the third embodiment. The compiler system 148D is realized by the program 51 being executed by the control unit 510. That is, the program 51 includes a compiler system 148D.

図23を参照して、コンパイラシステム148Dは、図3のコンパイラシステム148と比較して、コンパイラ149の代わりにコンパイラ149Dを含む点が異なる。それ以外の構成は、コンパイラシステム148と同様なので詳細な説明は繰り返さない。   Referring to FIG. 23, compiler system 148D differs from compiler system 148 in FIG. 3 in that it includes compiler 149D instead of compiler 149. Since other configurations are the same as those of the compiler system 148, detailed description will not be repeated.

(論理未保証条件の入力)
図24は、第3の実施の形態の変形例2におけるコンパイラ149Dの構成を示す図である。
(Input of logical unguaranteed conditions)
FIG. 24 is a diagram illustrating a configuration of the compiler 149D according to the second modification of the third embodiment.

図24を参照して、コンパイラ149Dは、図18のコンパイラ149Cと比較して、受付部189Dをさらに含む点が異なる。それ以外の構成は、コンパイラ149Cと同様なので詳細な説明は繰り返さない。コンパイラ149D内の各部は、プログラムモジュールとして実現される。   Referring to FIG. 24, compiler 149D is different from compiler 149C in FIG. 18 in that it further includes a reception unit 189D. Since the other configuration is the same as that of compiler 149C, detailed description will not be repeated. Each unit in the compiler 149D is realized as a program module.

受付部189Dは、外部からの指示を受付ける。具体的には、受付部189Dは、受付けた指示が示す論理未保証条件161を受付ける。受付部189Dが受付けた論理未保証条件161は、論理の保証が不要な条件である。受付部189Dは、受付けた論理未保証条件161を、論理未保証最適化部185へ送信する。   The accepting unit 189D accepts an instruction from the outside. Specifically, accepting unit 189D accepts logical unguaranteed condition 161 indicated by the accepted instruction. The logic unguaranteed condition 161 accepted by the accepting unit 189D is a condition that does not require logic guarantee. The reception unit 189D transmits the received logical unguaranteed condition 161 to the logical unguaranteed optimization unit 185.

受付部189Dは、一例として、コマンドラインによる指示が示す論理未保証条件161を受付ける。コマンドラインによる指示は、コンパイラオプションとしての指示である。コマンドラインによる指示は、例えば、プログラマがキーボード551を操作することにより行われる。   As an example, the accepting unit 189D accepts the logical unguaranteed condition 161 indicated by the command line instruction. The command line instruction is an instruction as a compiler option. The command line instruction is performed, for example, when the programmer operates the keyboard 551.

また、受付部189Dは、一例として、ソースプログラム141に記述されている#pragma指令(図7参照)による指示が示す論理未保証条件161を受付ける。この場合、受付部189Dは、ソースプログラム141から論理未保証条件161を受付ける。   For example, the accepting unit 189D accepts the logic unguaranteed condition 161 indicated by the instruction by the #pragma instruction (see FIG. 7) described in the source program 141. In this case, the accepting unit 189D accepts the logic unguaranteed condition 161 from the source program 141.

なお、コンパイラ149D内の各部は、第3の実施の形態と同様な処理を行うので詳細な説明は繰り返さない。   Note that each unit in the compiler 149D performs the same processing as in the third embodiment, and thus detailed description will not be repeated.

すなわち、論理未保証最適化部185は、第1の中間コードに対し、受付部189Dが受付けた指示が示す論理未保証条件161に基づいた論理未保証最適化処理を行う。すなわち、論理未保証最適化部185は、第1の中間コードに対して、論理未保証条件161を保証しない論理未保証最適化処理を行うことにより、第4の中間コードを生成する。   That is, the logic unguaranteed optimization unit 185 performs a logic unguaranteed optimization process based on the logic unguaranteed condition 161 indicated by the instruction received by the accepting unit 189D for the first intermediate code. That is, the logical unguaranteed optimization unit 185 generates a fourth intermediate code by performing a logical unguaranteed optimization process that does not guarantee the logical unguaranteed condition 161 on the first intermediate code.

以上、本発明の各実施の形態におけるコンパイルシステムについて、実施の形態に基づいて説明したが、本発明は、上記実施の形態に限定されるものではない。例えば、最適性到達度情報142は、サイクル数に基づく最適性到達度に限定されることなく、命令サイズ、スタックサイズ等のチューニングに有用な情報であれば他のパラメータに基づく最適性到達度を示す情報であってもよい。   As mentioned above, although the compile system in each embodiment of this invention was demonstrated based on embodiment, this invention is not limited to the said embodiment. For example, the optimality attainment information 142 is not limited to the optimality attainment based on the number of cycles. If the information is useful for tuning the instruction size, stack size, etc., the optimality attainment based on other parameters is obtained. It may be the information shown.

また、第1の実施の形態の図6のS34の処理において、比較対象とするものは、IPCに限らず、レジスタ使用効率など性能比較に有用な情報であれば他のパラメータであってもよい。   In the process of S34 in FIG. 6 of the first embodiment, the comparison target is not limited to the IPC, and may be other parameters as long as the information is useful for performance comparison such as register use efficiency. .

また、図10の最適性到達度解析部186Aおよび図18の最適性到達度解析部186Cの各々が比較対象とするものは、サイクル数に限られず、チューニングに有用な情報であれば他のパラメータであってもよい。   Also, what is to be compared by each of the optimality achievement level analysis unit 186A in FIG. 10 and the optimality achievement level analysis unit 186C in FIG. 18 is not limited to the number of cycles. It may be.

また、チューニングポイントとなる最適性到達度情報の着目ポイントのサイクル数は一例であり、サイクル数以外にも、命令数、コードサイズ、メモリサイズ、バス占有率、キャッシュヒット率、コンパイル時間など様々な最適性の観点があることは言うまでもない。   In addition, the number of cycles of the target point of the optimality achievement level information that is the tuning point is an example. Besides the number of cycles, there are various instructions such as the number of instructions, code size, memory size, bus occupancy, cache hit rate, and compile time. Needless to say, there is an optimality viewpoint.

なお、本発明は、このような特徴的な情報を生成するコンパイラとして実現することができるだけでなく、コンパイラがコンピュータを機能させるための特徴的な手段を備えるコンパイル装置として実現したり、当該手段をステップとするコンパイル方法として実現したりすることもできる。   Note that the present invention can be realized not only as a compiler that generates such characteristic information, but also as a compile device including characteristic means for the compiler to function the computer, It can also be realized as a compilation method with steps.

そして、このようなコンパイラは、CD−ROM等の記録媒体やインターネット等の伝送媒体を介して流通させることができるのは言うまでもない。   It goes without saying that such a compiler can be distributed via a recording medium such as a CD-ROM or a transmission medium such as the Internet.

以上、本発明におけるコンパイラ又はコンパイラシステムについて、実施の形態に基づいて説明したが、本発明は、これらの実施の形態に限定されるものではない。本発明の趣旨を逸脱しない限り、当業者が思いつく各種変形を本実施の形態に施したもの、あるいは異なる実施の形態における構成要素を組み合わせて構築される形態も、本発明の範囲内に含まれる。   As described above, the compiler or the compiler system according to the present invention has been described based on the embodiments. However, the present invention is not limited to these embodiments. Unless it deviates from the meaning of this invention, the form which carried out various deformation | transformation which those skilled in the art can think to this embodiment, or the structure constructed | assembled combining the component in different embodiment is also contained in the scope of the present invention. .

今回開示された実施の形態はすべての点で例示であって制限的なものではないと考えられるべきである。本発明の範囲は上記した説明ではなくて特許請求の範囲によって示され、特許請求の範囲と均等の意味および範囲内でのすべての変更が含まれることが意図される。   The embodiment disclosed this time should be considered as illustrative in all points and not restrictive. The scope of the present invention is defined by the terms of the claims, rather than the description above, and is intended to include any modifications within the scope and meaning equivalent to the terms of the claims.

本発明は、意ソースプログラムの効率的なチューニングを支援するプログラム変換装置およびプログラム変換システムとして、利用することができる。   The present invention can be used as a program conversion device and a program conversion system that support efficient tuning of a source program.

また、本発明は、最適性到達度情報を出力するコンパイラ、OS(Operating System)、プロセッサで実行されるプロセス等に適用できる。   Further, the present invention can be applied to a compiler that outputs optimality reachability information, an OS (Operating System), a process executed by a processor, and the like.

148,148A,148B,148C,148D コンパイラシステム
149,149A,149B,149C,149D コンパイラ
150 アセンブラ
151 リンカ
160 緩和特定条件
161 論理未保証条件
182 構文解析部
183 特定条件緩和最適化部
184 論理保証最適化部
185 論理未保証最適化部
186,186A,186C 最適性到達度解析部
188 コード出力部
189,189D 受付部
500 コンピュータ
510 制御部
148, 148A, 148B, 148C, 148D Compiler system 149, 149A, 149B, 149C, 149D Compiler 150 Assembler 151 Linker 160 Relaxation specific condition 161 Logical unguaranteed condition 182 Parsing unit 183 Specific condition relaxation optimization unit 184 Logic assurance optimization Unit 185 logic unguaranteed optimization unit 186, 186A, 186C optimality reachability analysis unit 188 code output unit 189, 189D reception unit 500 computer 510 control unit

Claims (13)

高級言語で記述されたソースプログラムを、ターゲットプロセッサ向けのコードに変換するプログラム変換装置であって、
前記ソースプログラムから第1の中間コードを生成する中間コード生成部と、
前記第1の中間コードに対し前記ターゲットプロセッサに応じた最適化処理を行うことにより、第2の中間コードを生成する最適化部と、
前記第2の中間コードの性能の分析を行い、性能分析の結果を示す最適性到達度情報を出力する解析部と
を備える、プログラム変換装置。
A program conversion device that converts a source program written in a high-level language into a code for a target processor,
An intermediate code generator for generating a first intermediate code from the source program;
An optimization unit that generates a second intermediate code by performing an optimization process on the first intermediate code according to the target processor;
A program conversion apparatus comprising: an analysis unit that analyzes the performance of the second intermediate code and outputs optimum reachability information indicating a result of the performance analysis.
前記プログラム変換装置は、さらに、
前記第1の中間コードに対し、特定の条件を.緩和させた最適化処理である特定条件緩和最適化処理を行うことにより、第3の中間コードを生成する特定条件緩和最適化部を備え、
前記解析部は、さらに、前記第3の中間コードの性能を分析し、前記第2の中間コードおよび前記第3の中間コードの性能の分析結果を示す前記最適性到達度情報を出力する、
請求項1に記載のプログラム変換装置。
The program conversion device further includes:
A specific condition relaxation optimization unit that generates a third intermediate code by performing a specific condition relaxation optimization process that is an optimization process in which a specific condition is relaxed for the first intermediate code;
The analysis unit further analyzes the performance of the third intermediate code and outputs the optimality attainment information indicating the analysis results of the performance of the second intermediate code and the third intermediate code.
The program conversion apparatus according to claim 1.
前記特定条件緩和最適化部は、さらに、前記特定の条件を緩和させた条件の情報を出力する、
請求項2に記載のプログラム変換装置。
The specific condition relaxation optimizing unit further outputs information on a condition in which the specific condition is relaxed,
The program conversion apparatus according to claim 2.
前記プログラム変換装置は、さらに、
指示を受付ける受付部を備え、
前記特定条件緩和最適化部は、前記受付部が受付けた指示が示す条件に基づいた前記特定条件緩和最適化処理を行う、
請求項2に記載のプログラム変換装置。
The program conversion device further includes:
It has a reception unit that accepts instructions,
The specific condition relaxation optimization unit performs the specific condition relaxation optimization process based on a condition indicated by an instruction received by the reception unit;
The program conversion apparatus according to claim 2.
前記受付部が受付けた指示は、コマンドラインによる指示である、
請求項4に記載のプログラム変換装置。
The instruction received by the reception unit is an instruction by a command line.
The program conversion apparatus according to claim 4.
前記受付部が受付けた指示は、前記ソースプログラムに含まれる指示である、
請求項4に記載のプログラム変換装置。
The instruction received by the reception unit is an instruction included in the source program.
The program conversion apparatus according to claim 4.
前記プログラム変換装置は、さらに、
前記第1の中間コードに対し、論理の正当性を保証しない最適化処理である論理未保証最適化処理を行うことにより、第4の中間コードを生成する論理未保証最適化部を備え、
前記解析部は、さらに、前記第4の中間コードの性能を分析し、前記第2の中間コードおよび前記第4の中間コードの性能の分析結果を示す前記最適性到達度情報を出力する、
請求項1に記載のプログラム変換装置。
The program conversion device further includes:
A logic unguaranteed optimization unit that generates a fourth intermediate code by performing a logic unguaranteed optimization process that is an optimization process that does not guarantee the logical correctness of the first intermediate code;
The analysis unit further analyzes the performance of the fourth intermediate code and outputs the optimality attainment information indicating the analysis results of the performance of the second intermediate code and the fourth intermediate code.
The program conversion apparatus according to claim 1.
前記論理未保証最適化部は、さらに、論理の正当性を保証していない条件の情報を出力する、
請求項7に記載のプログラム変換装置。
The logic unguaranteed optimization unit further outputs information on conditions that do not guarantee the validity of the logic,
The program conversion apparatus according to claim 7.
前記プログラム変換装置は、さらに、
指示を受付ける受付部を備え、
前記論理未保証最適化部は、前記受付部が受付けた指示が示す、論理の保証が不要な条件に基づいた前記論理未保証最適化処理を行う、
請求項7に記載のプログラム変換装置。
The program conversion device further includes:
It has a reception unit that accepts instructions,
The logical unguaranteed optimization unit performs the logical unguaranteed optimization process based on a condition that does not require a logical guarantee indicated by the instruction received by the accepting unit.
The program conversion apparatus according to claim 7.
前記受付部が受付けた指示は、コマンドラインによる指示である、
請求項9に記載のプログラム変換装置。
The instruction received by the reception unit is an instruction by a command line.
The program conversion apparatus according to claim 9.
前記受付部が受付けた指示は、前記ソースプログラムに含まれる指示である、
請求項9に記載のプログラム変換装置。
The instruction received by the reception unit is an instruction included in the source program.
The program conversion apparatus according to claim 9.
前記最適性到達度情報は、前記ターゲットプロセッサに対する前記第2の中間コードの最適度合いを少なくとも示す、
請求項1〜11のいずれかに記載のプログラム変換装置。
The optimality reachability information at least indicates the optimal degree of the second intermediate code for the target processor;
The program conversion apparatus according to claim 1.
高級言語で記述されたソースプログラムを、ターゲットプロセッサ向けの機械語コードに変換するプログラム変換システムであって、
前記プログラムから第1の中間コードを生成する中間コード生成部と、
前記第1の中間コードに対し前記ターゲットプロセッサに応じた最適化処理を行うことにより、第2の中間コードを生成する最適化部と、
前記第2の中間コードの性能の分析を行うことにより、性能分析の結果を示す最適性到達度情報を出力する解析部と、
前記第2の中間コードに基づくファイルを使用して前記ターゲットプロセッサで動作する機械語コードを生成する機械語コード生成部と
を備える、プログラム変換システム。
A program conversion system for converting a source program written in a high-level language into a machine language code for a target processor,
An intermediate code generation unit for generating a first intermediate code from the program;
An optimization unit that generates a second intermediate code by performing an optimization process on the first intermediate code according to the target processor;
Analyzing the performance of the second intermediate code to output optimality achievement information indicating the result of the performance analysis; and
A machine language code generation unit that generates a machine language code that operates on the target processor using a file based on the second intermediate code.
JP2009173735A 2009-07-24 2009-07-24 Program conversion device and program conversion system Pending JP2011028523A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
JP2009173735A JP2011028523A (en) 2009-07-24 2009-07-24 Program conversion device and program conversion system
PCT/JP2010/004473 WO2011010435A1 (en) 2009-07-24 2010-07-09 Program conversion device and program conversion system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2009173735A JP2011028523A (en) 2009-07-24 2009-07-24 Program conversion device and program conversion system

Publications (1)

Publication Number Publication Date
JP2011028523A true JP2011028523A (en) 2011-02-10

Family

ID=43498917

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2009173735A Pending JP2011028523A (en) 2009-07-24 2009-07-24 Program conversion device and program conversion system

Country Status (2)

Country Link
JP (1) JP2011028523A (en)
WO (1) WO2011010435A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP6548836B2 (en) * 2016-11-22 2019-07-24 三菱電機株式会社 INFORMATION PROCESSING APPARATUS, INFORMATION PROCESSING METHOD, AND INFORMATION PROCESSING PROGRAM

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2636665B2 (en) * 1993-02-26 1997-07-30 日本電気株式会社 Execution information collection device
JP4291306B2 (en) * 2005-07-22 2009-07-08 株式会社日立製作所 Tuning parameter calculation program and method for numerical calculation library
JP2007114934A (en) * 2005-10-19 2007-05-10 Matsushita Electric Ind Co Ltd Compiler system
JP2008003840A (en) * 2006-06-22 2008-01-10 Toshiba Corp System for selecting combination of optimization option of compiler
JP2008293378A (en) * 2007-05-25 2008-12-04 Panasonic Corp Program rewriting device

Also Published As

Publication number Publication date
WO2011010435A1 (en) 2011-01-27

Similar Documents

Publication Publication Date Title
Windh et al. High-level language tools for reconfigurable computing
Verdoolaege et al. Polyhedral extraction tool
Goossens et al. Embedded software in real-time signal processing systems: Design technologies
Kennedy et al. Telescoping languages: A strategy for automatic generation of scientific problem-solving systems from annotated libraries
Huang et al. Pylog: An algorithm-centric python-based FPGA programming and synthesis flow
Morvan et al. Polyhedral bubble insertion: A method to improve nested loop pipelining for high-level synthesis
US20090328016A1 (en) Generalized expression trees
Franke et al. Array recovery and high-level transformations for DSP applications
Khalate et al. An LLVM-based C++ compiler toolchain for variational hybrid quantum-classical algorithms and quantum accelerators
LaMielle et al. Enabling code generation within the sparse polyhedral framework
Oh et al. Efficient execution of stream graphs on coarse-grained reconfigurable architectures
Hohenauer et al. A SIMD optimization framework for retargetable compilers
Silber-Chaussumier et al. Generating data transfers for distributed GPU parallel programs
Schlaak et al. Optimizing data reshaping operations in functional IRs for high-level synthesis
WO2011010435A1 (en) Program conversion device and program conversion system
US11656857B2 (en) Method and apparatus for optimizing code for field programmable gate arrays
Balasa et al. Storage estimation and design space exploration methodologies for the memory management of signal processing applications
Cabrera et al. Toward evaluating high-level synthesis portability and performance between intel and xilinx fpgas
Ferreira et al. Graph-based code restructuring targeting HLS for FPGAs
EP3827336B1 (en) Method and apparatus for optimizing code for field programmable gate arrays
Liao et al. Automatic parallelization using OpenMP based on STL semantics
Plesco et al. Coupling loop transformations and high-level synthesis
Lin et al. Vector data flow analysis for SIMD optimizations on OpenCL programs
Kiemele et al. Kfusion: Optimizing data flow without compromising modularity
Konstantinidis Source-to-source compilation of loop programs for manycore processors