JP2021009443A - Information processing apparatus and compiler program - Google Patents

Information processing apparatus and compiler program Download PDF

Info

Publication number
JP2021009443A
JP2021009443A JP2019121513A JP2019121513A JP2021009443A JP 2021009443 A JP2021009443 A JP 2021009443A JP 2019121513 A JP2019121513 A JP 2019121513A JP 2019121513 A JP2019121513 A JP 2019121513A JP 2021009443 A JP2021009443 A JP 2021009443A
Authority
JP
Japan
Prior art keywords
instruction
matrix
loop
dependency
information
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
JP2019121513A
Other languages
Japanese (ja)
Other versions
JP7239827B2 (en
Inventor
恭伸 谷村
Yasunobu Tanimura
恭伸 谷村
山中 栄次
Eiji Yamanaka
栄次 山中
俊 鎌塚
Shun Kamatsuka
俊 鎌塚
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.)
Fujitsu Ltd
Original Assignee
Fujitsu Ltd
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 Fujitsu Ltd filed Critical Fujitsu Ltd
Priority to JP2019121513A priority Critical patent/JP7239827B2/en
Publication of JP2021009443A publication Critical patent/JP2021009443A/en
Application granted granted Critical
Publication of JP7239827B2 publication Critical patent/JP7239827B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Devices For Executing Special Programs (AREA)

Abstract

To provide an information processing apparatus and a compiler program that enable high-speed division of loops included in a source code.SOLUTION: Dependency information indicating a dependency relationship between instructions included in a loop of an intermediate language generated from a source code is generated, a first matrix is generated by converting the generated dependency information into a matrix, the instructions included in the loop are assigned to a plurality of groups based on a degree of dependency among the instructions calculated from the generated first matrix, and the loop is divided for each assigned group.SELECTED DRAWING: Figure 19

Description

本発明は、情報処理装置及びコンパイラプログラムに関する。 The present invention relates to an information processing device and a compiler program.

例えば、HPC(High Performance Conputing)等に用いられるコンパイラプログラム(以下、単にコンパイラとも呼ぶ)は、ソースコードのコンパイルを行う際に、処理速度等の処理性能を向上させるための最適化処理を行う。具体的に、コンパイラは、例えば、ソースコードに含まれるループ(以下、分割対象のループとも呼ぶ)を複数のループに分割するループ分割を行う。 For example, a compiler program (hereinafter, also simply referred to as a compiler) used for HPC (High Performance Computing) or the like performs optimization processing for improving processing performance such as processing speed when compiling source code. Specifically, the compiler performs loop splitting, for example, to split a loop included in the source code (hereinafter, also referred to as a loop to be split) into a plurality of loops.

これにより、コンパイラは、例えば、ハード資源不足等に起因する最適化阻害要因の発生を抑制することが可能になる。また、コンパイラは、例えば、キャッシュ効率の低下を抑制することが可能になる(例えば、特許文献1及び2参照)。 This makes it possible for the compiler to suppress the occurrence of optimization-inhibiting factors caused by, for example, lack of hardware resources. Further, the compiler can suppress a decrease in cache efficiency, for example (see, for example, Patent Documents 1 and 2).

特開2002−123563号公報JP-A-2002-123563 特開2009−104422号公報JP-A-2009-104422

ここで、上記のようなコンパイラは、例えば、分割対象のループに含まれる各命令間の依存関係をそれぞれ解析し、その解析結果に基づいて各命令を複数の分割ループにそれぞれ振り分けることにより、分析対象のループの分割を行う。 Here, a compiler as described above analyzes, for example, the dependency between each instruction included in the loop to be divided, and distributes each instruction to a plurality of divided loops based on the analysis result. Split the target loop.

しかしながら、依存関係を解析する必要がある命令の組合せ数は、分割対象のループに含まれる命令の数に従って多くなる。そのため、分割対象のループに含まれる命令の数が膨大である場合、コンパイラは、ループ分割に多くの時間を要することになり、ソースコードのコンパイルを効率的に行うことができなくなる。 However, the number of instruction combinations for which dependency analysis needs to be analyzed increases according to the number of instructions contained in the loop to be divided. Therefore, if the number of instructions contained in the loop to be split is enormous, the compiler will take a lot of time to split the loop, and the source code cannot be compiled efficiently.

そこで、一つの側面では、本発明は、ソースコードに含まれるループの分割を高速に行うことを可能とする情報処理装置及びコンパイラプログラムを提供することを目的とする。 Therefore, in one aspect, it is an object of the present invention to provide an information processing apparatus and a compiler program capable of dividing a loop included in a source code at high speed.

実施の形態の一態様では、ソースコードから生成した中間言語のループに含まれる各命令間の依存関係を示す依存情報を生成し、生成した前記依存情報を行列に変換することによって第1行列を生成する情報生成部と、生成した前記第1行列から算出した各命令間における依存度合いに基づいて、前記ループに含まれる各命令を複数のグループに振り分けるグループ振分部と、振り分けた前記複数のグループごとに、前記ループの分割を行うループ分割部と、を有する。 In one aspect of the embodiment, the first matrix is formed by generating dependency information indicating the dependency between each instruction included in the loop of the intermediate language generated from the source code and converting the generated dependency information into a matrix. A group distribution unit that distributes each instruction included in the loop to a plurality of groups based on the degree of dependence between the information generation unit to be generated and each instruction calculated from the generated first matrix, and the plurality of distribution units. Each group has a loop dividing portion for dividing the loop.

一つの側面によれば、ソースコードに含まれるループの分割を高速に行うことを可能とする。 According to one aspect, it is possible to divide the loop included in the source code at high speed.

図1は、情報処理システム10の構成について説明する図である。FIG. 1 is a diagram illustrating a configuration of the information processing system 10. 図2は、情報処理装置1が行うコンパイル処理を説明するフローチャートである。FIG. 2 is a flowchart illustrating a compilation process performed by the information processing apparatus 1. 図3は、情報処理装置1のハードウエア構成を説明する図である。FIG. 3 is a diagram illustrating a hardware configuration of the information processing device 1. 図4は、情報処理装置1の機能のブロック図である。FIG. 4 is a block diagram of the function of the information processing device 1. 図5は、S2の処理の概略について説明するフローチャートである。FIG. 5 is a flowchart illustrating an outline of the process of S2. 図6は、S2の処理の詳細を説明するフローチャート図である。FIG. 6 is a flowchart illustrating the details of the process of S2. 図7は、S2の処理の詳細を説明するフローチャート図である。FIG. 7 is a flowchart illustrating the details of the process of S2. 図8は、S2の処理の詳細を説明するフローチャート図である。FIG. 8 is a flowchart illustrating the details of the process of S2. 図9は、中間言語22の内容を説明する具体例である。FIG. 9 is a specific example for explaining the contents of the intermediate language 22. 図10は、依存情報131の具体例について説明する図である。FIG. 10 is a diagram illustrating a specific example of the dependency information 131. 図11は、依存グラフ131aの具体例について説明する図である。FIG. 11 is a diagram illustrating a specific example of the dependency graph 131a. 図12は、第1行列132の具体例について説明する図である。FIG. 12 is a diagram illustrating a specific example of the first matrix 132. 図13は、第2行列133の具体例について説明する図である。FIG. 13 is a diagram illustrating a specific example of the second matrix 133. 図14は、依存情報131の具体例について説明する図である。FIG. 14 is a diagram illustrating a specific example of the dependency information 131. 図15は、第1行列132の具体例について説明する図である。FIG. 15 is a diagram illustrating a specific example of the first matrix 132. 図16は、第2行列133の具体例について説明する図である。FIG. 16 is a diagram illustrating a specific example of the second matrix 133. 図17は、依存情報131の具体例について説明する図である。FIG. 17 is a diagram illustrating a specific example of the dependency information 131. 図18は、第1行列132の具体例について説明する図である。FIG. 18 is a diagram illustrating a specific example of the first matrix 132. 図19は、依存グラフ131aの具体例について説明する図である。FIG. 19 is a diagram illustrating a specific example of the dependency graph 131a. 図20は、分割ループの内容を説明する具体例である。FIG. 20 is a specific example for explaining the contents of the split loop. 図21は、第2の実施の形態におけるS2の処理を説明するフローチャート図である。FIG. 21 is a flowchart illustrating the process of S2 in the second embodiment. 図22は、第2の実施の形態におけるS2の処理を説明するフローチャート図である。FIG. 22 is a flowchart illustrating the process of S2 in the second embodiment. 図23は、第2の実施の形態におけるS2の処理を説明するフローチャート図である。FIG. 23 is a flowchart illustrating the process of S2 in the second embodiment. 図24は、依存情報131の具体例について説明する図である。FIG. 24 is a diagram illustrating a specific example of the dependency information 131. 図25は、第1行列132の具体例について説明する図である。FIG. 25 is a diagram illustrating a specific example of the first matrix 132. 図26は、第1行列132の具体例について説明する図である。FIG. 26 is a diagram illustrating a specific example of the first matrix 132. 図27は、依存グラフ131aの具体例について説明する図である。FIG. 27 is a diagram illustrating a specific example of the dependency graph 131a. 図28は、分割ループの内容を説明する具体例である。FIG. 28 is a specific example for explaining the contents of the split loop.

[情報処理システムの構成]
初めに、情報処理システム10の構成について説明を行う。図1は、情報処理システム10の構成について説明する図である。
[Information processing system configuration]
First, the configuration of the information processing system 10 will be described. FIG. 1 is a diagram illustrating a configuration of the information processing system 10.

図1に示すように、情報処理システム10は、例えば、1台以上の物理マシンからなる情報処理装置1と、情報処理装置1の内部または外部に設けられる記憶部130と、操作端末5とを含む。操作端末5は、例えば、ソースコードのコンパイルを行う作業者が使用するPC(Personal Computer)であり、ネットワークNWを介して情報処理装置1と接続する。 As shown in FIG. 1, the information processing system 10 includes, for example, an information processing device 1 composed of one or more physical machines, a storage unit 130 provided inside or outside the information processing device 1, and an operation terminal 5. Including. The operation terminal 5 is, for example, a PC (Personal Computer) used by a worker who compiles the source code, and is connected to the information processing device 1 via a network NW.

情報処理装置1(情報処理装置1において動作するコンパイラ)は、コンパイルを開始するタイミング(以下、コンパイル開始タイミングとも呼ぶ)になった場合、例えば、記憶部130に記憶されたソースコード21を取得し、取得したソースコード21のコンパイルを行う処理(以下、コンパイル処理とも呼ぶ)を行うことによって中間言語22を生成し、さらに、生成した中間言語22からオブジェクトコード23を生成する。コンパイル開始タイミングは、例えば、作業者が操作端末5を介してコンパイル処理を開始する旨の指示を行ったタイミングであってよい。 When the information processing device 1 (compiler operating in the information processing device 1) comes to the timing of starting compilation (hereinafter, also referred to as compilation start timing), for example, the source code 21 stored in the storage unit 130 is acquired. , The intermediate language 22 is generated by performing a process of compiling the acquired source code 21 (hereinafter, also referred to as a compilation process), and further, an object code 23 is generated from the generated intermediate language 22. The compilation start timing may be, for example, the timing at which the operator gives an instruction to start the compilation process via the operation terminal 5.

また、情報処理装置1は、オブジェクトコード23を実行するタイミング(以下、コード実行タイミングとも呼ぶ)になった場合、記憶部130に記憶されたオブジェクトコード23を取得し、コンパイル処理によって生成されたオブジェクトコード23を実行する処理(以下、コード実行処理とも呼ぶ)を行う。以下、情報処理装置1が行うコンパイル処理及びコード実行処理について説明を行う。 Further, when the timing for executing the object code 23 (hereinafter, also referred to as the code execution timing) is reached, the information processing device 1 acquires the object code 23 stored in the storage unit 130, and the object generated by the compilation process. A process for executing the code 23 (hereinafter, also referred to as a code execution process) is performed. Hereinafter, the compilation process and the code execution process performed by the information processing apparatus 1 will be described.

[情報処理装置によるコンパイル処理]
初めに、情報処理装置1が行うコンパイル処理について説明を行う。図2は、情報処理装置1が行うコンパイル処理を説明するフローチャートである。
[Compilation process by information processing device]
First, the compilation process performed by the information processing apparatus 1 will be described. FIG. 2 is a flowchart illustrating a compilation process performed by the information processing apparatus 1.

情報処理装置1は、図2に示すように、ソースコード21の字句解析及び構文解析を行うことにより、中間言語22を生成する(S1)。そして、情報処理装置1は、例えば、生成した中間言語22を情報格納領域130に記憶する。 As shown in FIG. 2, the information processing apparatus 1 generates the intermediate language 22 by performing lexical analysis and syntactic analysis of the source code 21 (S1). Then, the information processing device 1 stores, for example, the generated intermediate language 22 in the information storage area 130.

その後、情報処理装置1は、S1の処理において生成された中間言語22の最適化を行う(S2)。具体的に、情報処理装置1は、中間言語22に含まれるループのそれぞれに対して、ループ分割等の処理を行う。 After that, the information processing apparatus 1 optimizes the intermediate language 22 generated in the process of S1 (S2). Specifically, the information processing device 1 performs processing such as loop splitting for each of the loops included in the intermediate language 22.

続いて、情報処理装置1は、例えば、S1で最適化を行った中間言語22からオブジェクトコード23の生成を行う(S3)。そして、情報処理装置1は、例えば、生成したオブジェクトコード23を記憶部130に記憶する。 Subsequently, the information processing apparatus 1 generates the object code 23 from the intermediate language 22 optimized in S1, for example (S3). Then, the information processing device 1 stores, for example, the generated object code 23 in the storage unit 130.

ここで、図2で説明したS2の処理を行う場合、情報処理装置1は、例えば、ループに含まれる各命令間の依存関係をそれぞれ解析し、その解析結果に基づいて各命令を複数の分割ループにそれぞれ振り分けることにより、分析対象のループの分割を行う。 Here, when performing the processing of S2 described with reference to FIG. 2, the information processing apparatus 1 analyzes, for example, the dependency relationship between each instruction included in the loop, and divides each instruction into a plurality of units based on the analysis result. By allocating to each loop, the loop to be analyzed is divided.

しかしながら、依存関係を解析する必要がある命令の組合せ数は、分割対象のループに含まれる命令の数に従って多くなる。そのため、例えば、分割対象のループに含まれる命令の数が膨大である場合、情報処理装置1は、ループ分割に多くの時間を要することになり、ソースコードのコンパイルを効率的に行うことができなくなる。 However, the number of instruction combinations for which dependency analysis needs to be analyzed increases according to the number of instructions contained in the loop to be divided. Therefore, for example, when the number of instructions included in the loop to be divided is enormous, the information processing apparatus 1 requires a lot of time for loop division, and the source code can be compiled efficiently. It disappears.

そこで、本実施の形態における情報処理装置1は、ソースコード21から生成した中間言語22のループに含まれる各命令間の依存関係を示す情報(以下、依存情報とも呼ぶ)を生成し、生成した依存情報を変換することによって行列(以下、第1行列とも呼ぶ)を生成する。 Therefore, the information processing device 1 in the present embodiment generates and generates information (hereinafter, also referred to as dependency information) indicating the dependency relationship between each instruction included in the loop of the intermediate language 22 generated from the source code 21. A matrix (hereinafter, also referred to as a first matrix) is generated by transforming the dependency information.

そして、情報処理装置1は、生成した第1行列から算出した各命令間における依存度合いに基づいて、ループに含まれる各命令を複数のグループに振り分け、振り分けたグループごとにループの分割を行う。 Then, the information processing apparatus 1 distributes each instruction included in the loop into a plurality of groups based on the degree of dependence between the instructions calculated from the generated first matrix, and divides the loop into each of the distributed groups.

すなわち、本実施の形態における情報処理装置1は、依存情報から生成された第1行列を用いる演算を行うことで、分割対象のループに含まれる命令の組合せごとの依存関係の解析等を行うことなく、各命令の振り分け先を決定する。 That is, the information processing apparatus 1 in the present embodiment analyzes the dependency relationship for each combination of instructions included in the loop to be divided by performing an operation using the first matrix generated from the dependency information. Instead, determine the distribution destination of each command.

これにより、情報処理装置1は、ループ分割を効率的に行うことが可能になり、ソースコード21のコンパイルに要する時間を短縮することが可能になる。 As a result, the information processing apparatus 1 can efficiently perform loop splitting, and the time required for compiling the source code 21 can be shortened.

また、情報処理装置1は、分割対象のループに含まれる各命令の振り分け先を計算によって決定することで、異なる分割ループに含まれる命令間の依存関係が最も疎になるループ分割の方法を特定することが可能になる。そのため、情報処理装置1は、特定した方法に従ってループの分割を行うことにより、ソースコード21から生成されるオブジェクトコード23の実行時間についても短縮させることが可能になる。 Further, the information processing device 1 specifies a loop splitting method in which the dependency between the instructions included in the different split loops is the sparsest by determining the distribution destination of each instruction included in the loop to be split by calculation. It becomes possible to do. Therefore, the information processing apparatus 1 can also shorten the execution time of the object code 23 generated from the source code 21 by dividing the loop according to the specified method.

[情報処理システムのハードウエア構成]
次に、情報処理システム10のハードウエア構成について説明する。図3は、情報処理装置1のハードウエア構成を説明する図である。
[Hardware configuration of information processing system]
Next, the hardware configuration of the information processing system 10 will be described. FIG. 3 is a diagram illustrating a hardware configuration of the information processing device 1.

情報処理装置1は、図3に示すように、プロセッサであるCPU101と、メモリ102と、外部インターフェース(I/Oユニット)103と、記憶媒体104とを有する。各部は、バス105を介して互いに接続される。 As shown in FIG. 3, the information processing device 1 includes a CPU 101 which is a processor, a memory 102, an external interface (I / O unit) 103, and a storage medium 104. The parts are connected to each other via the bus 105.

記憶媒体104は、例えば、コンパイル処理を行うためのプログラム110(コンパイラ)を記憶するプログラム格納領域(図示しない)を有する。また、記憶媒体104は、例えば、コンパイル処理を行う際に用いられる情報を記憶する記憶部130(以下、情報格納領域130とも呼ぶ)を有する。なお、記憶媒体104は、例えば、HDD(Hard Disk Drive)やSSD(Sokid State Drive)であってよい。 The storage medium 104 has, for example, a program storage area (not shown) for storing a program 110 (compiler) for performing a compilation process. Further, the storage medium 104 has, for example, a storage unit 130 (hereinafter, also referred to as an information storage area 130) for storing information used when performing a compilation process. The storage medium 104 may be, for example, an HDD (Hard Disk Drive) or an SSD (Sock State Drive).

CPU101は、記憶媒体104からメモリ102にロードされたプログラム110を実行してコンパイル処理を行う。 The CPU 101 executes the program 110 loaded from the storage medium 104 into the memory 102 to perform a compilation process.

また、外部インターフェース103は、例えば、操作端末5と通信を行う。 Further, the external interface 103 communicates with, for example, the operation terminal 5.

[情報処理システムの機能]
次に、情報処理システム10の機能について説明を行う。図4は、情報処理装置1の機能のブロック図である。
[Information processing system functions]
Next, the function of the information processing system 10 will be described. FIG. 4 is a block diagram of the function of the information processing device 1.

情報処理装置1は、図4に示すように、例えば、CPU101やメモリ102等のハードウエアとプログラム110とが有機的に協働することにより、分割判定部111と、情報生成部112と、情報管理部113と、グループ振分部114と、ループ分割部115と、近接判定部116とを含む各種機能を実現する。 As shown in FIG. 4, the information processing device 1 organically cooperates with hardware such as the CPU 101 and the memory 102 and the program 110 to form a division determination unit 111, an information generation unit 112, and information. Various functions including the management unit 113, the group distribution unit 114, the loop splitting unit 115, and the proximity determination unit 116 are realized.

また、情報処理装置1は、例えば、図4に示すように、依存情報131と、第1行列132と、第2行列133とを情報格納領域130に記憶する。 Further, the information processing apparatus 1 stores, for example, the dependency information 131, the first matrix 132, and the second matrix 133 in the information storage area 130, as shown in FIG.

分割判定部111は、例えば、ソースコード21から生成した中間言語22に含まれる各ループについてループ分割を行うか否かを判定する。具体的に、分割判定部111は、例えば、実行時に用いられるレジスタ数やストリーム数がCPU101のレジスタ数やストリーム数を超えるループが中間言語22に含まれている場合、そのループについてループ分割を行う旨の判定を行う。 The division determination unit 111 determines, for example, whether or not to perform loop division for each loop included in the intermediate language 22 generated from the source code 21. Specifically, for example, when the intermediate language 22 contains a loop in which the number of registers and the number of streams used at the time of execution exceeds the number of registers and the number of streams of the CPU 101, the division determination unit 111 performs loop division for the loop. Make a judgment to that effect.

情報生成部112は、分割対象のループに含まれる各命令間の依存関係を示す依存情報131を生成する。具体的に、情報生成部112は、分割判定部111がループ分割を行う旨の判定を行ったループが存在する場合、そのループに対応する依存情報131を生成する。また、情報生成部112は、生成した依存情報131を行列に変換することによって第1行列132を生成する。 The information generation unit 112 generates dependency information 131 indicating the dependency relationship between each instruction included in the loop to be divided. Specifically, the information generation unit 112 generates the dependency information 131 corresponding to the loop when the division determination unit 111 determines that the loop split is performed. Further, the information generation unit 112 generates the first matrix 132 by converting the generated dependency information 131 into a matrix.

情報管理部113は、例えば、情報生成部112が生成した依存情報131や第1行列132を情報格納領域130に記憶する。 The information management unit 113 stores, for example, the dependency information 131 and the first matrix 132 generated by the information generation unit 112 in the information storage area 130.

グループ振分部114は、情報生成部112が生成した第1行列132から算出した各命令間における依存度合いに基づいて、分割対象のループに含まれる各命令を複数のグループに振り分ける。 The group distribution unit 114 distributes each instruction included in the loop to be divided into a plurality of groups based on the degree of dependence between the instructions calculated from the first matrix 132 generated by the information generation unit 112.

ループ分割部115は、グループ振分部114が振り分けたグループごとに、分割対象のループについてのループ分割を行う。 The loop splitting unit 115 performs loop splitting on the loop to be divided for each group distributed by the group sorting unit 114.

近接判定部116は、例えば、メモリ102内において近接するアドレスに格納された各データに対してアクセスを行う複数の命令が分割対象のループに含まれているか否かを判定する。 The proximity determination unit 116 determines, for example, whether or not a plurality of instructions for accessing each data stored at adjacent addresses in the memory 102 are included in the loop to be divided.

そして、例えば、メモリ102内において近接するアドレスに格納された各データに対してアクセスを行う複数の命令が分割対象のループに含まれていると近接判定部116が判定した場合、情報生成部112は、分割対象のループに含まれる各命令間の依存関係と、各命令がアクセスするデータのメモリ102内における位置関係とに対応する依存情報131を生成する。第2行列133の説明については後述する。 Then, for example, when the proximity determination unit 116 determines that a plurality of instructions for accessing each data stored at adjacent addresses in the memory 102 are included in the loop to be divided, the information generation unit 112 Generates dependency information 131 corresponding to the dependency relationship between each instruction included in the loop to be divided and the positional relationship in the memory 102 of the data accessed by each instruction. The explanation of the second matrix 133 will be described later.

[第1の実施の形態の概略]
次に、第1の実施の形態の概略について説明する。具体的に、図2で説明したS2の処理の概略について説明する。図5は、S2の処理の概略について説明するフローチャートである。
[Outline of the first embodiment]
Next, the outline of the first embodiment will be described. Specifically, the outline of the process of S2 described with reference to FIG. 2 will be described. FIG. 5 is a flowchart illustrating an outline of the process of S2.

情報処理装置1の情報生成部112は、ソースコード21から生成した中間言語22のループに含まれる各命令間の依存関係を示す依存情報131を生成する(S11)。 The information generation unit 112 of the information processing device 1 generates dependency information 131 indicating the dependency relationship between each instruction included in the loop of the intermediate language 22 generated from the source code 21 (S11).

そして、情報生成部112は、S11の処理で生成した依存情報131を行列に変換することによって第1行列132を生成する(S12)。 Then, the information generation unit 112 generates the first matrix 132 by converting the dependency information 131 generated in the process of S11 into a matrix (S12).

続いて、情報処理装置1のグループ振分部114は、S12の処理で生成した第1行列132から算出した各命令間の依存度合いに基づいて、分割対象のループに含まれる各命令を複数のグループに振り分ける(S13)。 Subsequently, the group distribution unit 114 of the information processing apparatus 1 sets a plurality of instructions included in the loop to be divided based on the degree of dependence between the instructions calculated from the first matrix 132 generated in the process of S12. Allocate to groups (S13).

その後、情報処理装置のループ分割部115は、S13の処理で振り分けたグループごとに、分割対象のループの分割を行う(S14)。 After that, the loop splitting unit 115 of the information processing apparatus divides the loop to be split for each group sorted in the process of S13 (S14).

これにより、情報処理装置1は、ループ分割を効率的に行うことが可能になり、ソースコード21のコンパイルに要する時間を短縮することが可能になる。 As a result, the information processing apparatus 1 can efficiently perform loop splitting, and the time required for compiling the source code 21 can be shortened.

また、情報処理装置1は、分割対象のループに含まれる各命令の振り分け先を計算によって決定することで、異なる分割ループに含まれる命令間の依存関係が最も疎になるループ分割の方法を特定することが可能になる。そのため、情報処理装置1は、特定した方法に従ってループの分割を行うことにより、ソースコード21から生成されるオブジェクトコード23の実行時間についても短縮させることが可能になる。 Further, the information processing device 1 specifies a loop splitting method in which the dependency between the instructions included in the different split loops is the sparsest by determining the distribution destination of each instruction included in the loop to be split by calculation. It becomes possible to do. Therefore, the information processing apparatus 1 can also shorten the execution time of the object code 23 generated from the source code 21 by dividing the loop according to the specified method.

[第1の実施の形態の詳細]
次に、第1の実施の形態の詳細について説明する。図6から図9は、図2で説明したS2の処理の詳細を説明するフローチャート図である。また、図9から図20は、S2の処理の詳細を説明する図である。
[Details of the first embodiment]
Next, the details of the first embodiment will be described. 6 to 9 are flowcharts illustrating the details of the process of S2 described with reference to FIG. 9 to 20 are views for explaining the details of the process of S2.

情報処理装置1の分割判定部111は、図6に示すように、情報格納領域130に記憶された中間言語22に、分割対象のループが含まれているか否かを判定する(S21)。以下、中間言語22の具体例について説明を行う。 As shown in FIG. 6, the division determination unit 111 of the information processing device 1 determines whether or not the intermediate language 22 stored in the information storage area 130 includes a loop to be divided (S21). Hereinafter, specific examples of the intermediate language 22 will be described.

[中間言語の具体例]
図9は、中間言語22の内容を説明する具体例である。具体的に、図9は、ソースコード21をアセンブラ命令相当で表現した場合の中間言語22を説明する具体例である。
[Specific examples of intermediate languages]
FIG. 9 is a specific example for explaining the contents of the intermediate language 22. Specifically, FIG. 9 is a specific example for explaining the intermediate language 22 when the source code 21 is represented by an assembler instruction.

図9に示す中間言語22は、変数reg_iに初期値として1を設定することを示す命令である「mov reg_i,1」と、ループの開始位置を示すラベルである「LABEL1:」とを含む。 The intermediate language 22 shown in FIG. 9 includes "mov reg_i, 1" which is an instruction indicating that the variable reg_i is set to 1 as an initial value, and "LABEL1:" which is a label indicating the start position of the loop.

また、図9に示す中間言語22は、配列Aのreg_i番目に格納されている値を変数reg1に設定することを示す命令である「load reg1,mem“A(reg_i)”」と、配列Bのreg_i番目に格納されている値を変数reg2に設定することを示す命令である「load reg2,mem“B(reg_i)”」とを含む。 Further, the intermediate language 22 shown in FIG. 9 is an instruction indicating that the value stored in the reg_ith position of the array A is set in the variable reg1, which is an instruction "load reg1, mem" A (reg_i) "" and the array B. Includes "load reg2, mem" B (reg_i) "" which is an instruction indicating that the value stored in the reg_i th position of is set in the variable reg2.

また、図9に示す中間言語22は、変数reg1に設定されている値と変数reg2に設定されている値とを加算することによって算出した値を、変数reg3に設定することを示す命令である「add reg3,reg1,reg2」と、配列Cのreg_i番目に格納されている値を変数reg4に設定することを示す命令である「load reg4,mem“C(reg_i)”」とを含む。 Further, the intermediate language 22 shown in FIG. 9 is an instruction indicating that the value calculated by adding the value set in the variable reg1 and the value set in the variable reg2 is set in the variable reg3. It includes "add reg3, reg1, reg2" and "load reg4, mem" C (reg_i) "" which is an instruction indicating that the value stored in the reg_ith position of the array C is set in the variable reg4.

また、図9に示す中間言語22は、配列Dのreg_i番目に格納されている値を変数reg5に設定することを示す命令である「load reg5,mem“D(reg_i)”」と、配列Cのreg_i+10番目に格納されているデータを変数reg6に設定することを示す命令である「load reg6,mem“C(reg_i+10)”」とを含む。 Further, the intermediate language 22 shown in FIG. 9 is an instruction indicating that the value stored in the reg_i position of the array D is set in the variable reg5, which is an instruction "load reg5, mem" D (reg_i) "" and the array C Includes "load reg6, mem" C (reg_i + 10) "" which is an instruction indicating that the data stored in the reg_i + 10th position of the above is set in the variable reg6.

また、配列Eのreg_i番目に格納されている値を変数reg7に設定することを示す命令である「load reg7,mem“E(reg_i)”」と、変数reg3に設定されている値と変数reg4に設定されている値とを加算することによって算出した値を、変数reg8に設定することを示す命令である「add reg8,reg3,reg4」とを含む。 In addition, "load reg7, mem" E (reg_i) "", which is an instruction indicating that the value stored in the reg_ith position of the array E is set in the variable reg7, and the value set in the variable reg3 and the variable reg4. Includes "add reg8, reg3, reg4" which is an instruction indicating that the value calculated by adding the value set in is set in the variable reg8.

また、図9に示す中間言語22は、変数reg4に設定されている値と変数reg8に設定されている値とを加算することによって算出した値を、変数reg9に設定することを示す命令である「add reg9,reg4,reg8」と、変数reg3に設定されている値と変数reg5に設定されている値とを乗算することによって算出した値に、変数reg9に設定されている値を加算することによって算出した値を、変数reg10に設定に設定することを示す命令である「madd reg10,reg3,reg5,reg9」とを含む。 Further, the intermediate language 22 shown in FIG. 9 is an instruction indicating that the value calculated by adding the value set in the variable reg4 and the value set in the variable reg8 is set in the variable reg9. Adding the value set in the variable reg9 to the value calculated by multiplying "add reg9, reg4, reg8" by the value set in the variable reg3 and the value set in the variable reg5. Includes "madd reg10, reg3, reg5, reg9" which is an instruction indicating that the value calculated by the above is set in the variable reg10.

また、図9に示す中間言語22は、変数reg5に設定されている値と変数reg6に設定されている値とを乗算することによって算出した値に、変数reg10に設定されている値を加算することによって算出した値を、変数reg11に設定することを示す命令である「madd reg11,reg5,reg6,reg10」と、変数reg7に設定されている値と変数reg11に設定されている値とを加算することによって算出した値を、変数reg12に設定することを示す命令である「add reg12,reg7,reg11」とを含む。 Further, in the intermediate language 22 shown in FIG. 9, the value set in the variable reg10 is added to the value calculated by multiplying the value set in the variable reg5 and the value set in the variable reg6. Add the value set in the variable reg7 and the value set in the variable reg11 to the command "madd reg11, reg5, reg6, reg10" indicating that the value calculated by this is set in the variable reg11. It includes "add reg12, reg7, reg11" which is an instruction indicating that the value calculated by the above is set in the variable reg12.

また、図9に示す中間言語22は、変数reg12に設定されている値を配列Fのreg_i番目に格納することを示す命令である「store mem“F(reg_i)”,reg12」と、変数reg_iに設定されている値に1を加算することによって算出した値を、変数reg_iに設定することを示す命令である「add reg_i,reg_i,1」とを含む。 Further, the intermediate language 22 shown in FIG. 9 is an instruction indicating that the value set in the variable reg12 is stored in the reg_ith position of the array F, which is an instruction "store mem" F (reg_i) ", reg12" and the variable reg_i. It includes "add reg_i, reg_i, 1" which is an instruction indicating that the value calculated by adding 1 to the value set in is set in the variable reg_i.

さらに、図9に示す中間言語22は、変数reg_iに設定されている値と100とを比較することを示す命令である「cmp reg_i,100」と、変数reg_iに設定されている値が100以下である場合、ループの開始位置を示す「LABEL1:」に分岐し、変数reg_iに設定されている値が100を上回る場合、ループを終了することを示す命令である「ble icc,LABAL1」とを含む。 Further, the intermediate language 22 shown in FIG. 9 has "cmp reg_i, 100" which is an instruction indicating to compare the value set in the variable reg_i with 100, and the value set in the variable reg_i is 100 or less. In the case of, it branches to "LABEL1:" indicating the start position of the loop, and when the value set in the variable reg_i exceeds 100, it is an instruction indicating the end of the loop "bleicc, LABAL1". Including.

なお、以下、図9に示す中間言語22において各命令の左端に記載されている番号を、各命令の命令番号とも呼ぶ。また、以下、命令番号が「1」から「13」である命令のそれぞれを命令1から命令13とも呼ぶ。 Hereinafter, the number described at the left end of each instruction in the intermediate language 22 shown in FIG. 9 is also referred to as an instruction number of each instruction. Further, hereinafter, each of the instructions whose instruction numbers are "1" to "13" will also be referred to as instruction 1 to instruction 13.

図6に戻り、情報格納領域130に記憶された中間言語22に、分割対象のループが含まれている場合(S22のYES)、情報処理装置1の情報生成部112は、S21の処理で分割対象のループであると判定したループに含まれる各命令間の依存関係を示す依存情報131を生成する(S23)。以下、依存情報131の具体例について説明を行う。 Returning to FIG. 6, when the intermediate language 22 stored in the information storage area 130 includes a loop to be divided (YES in S22), the information generation unit 112 of the information processing apparatus 1 is divided by the process of S21. Dependency information 131 indicating the dependency relationship between each instruction included in the loop determined to be the target loop is generated (S23). Hereinafter, a specific example of the dependency information 131 will be described.

[依存情報の具体例]
図10は、依存情報131の具体例について説明する図である。
[Specific example of dependency information]
FIG. 10 is a diagram illustrating a specific example of the dependency information 131.

図10に示す依存情報131は、中間言語22に含まれる各命令の命令番号が記憶される「命令番号」と、各命令と依存関係にある命令の命令番号についてのリストである「データ依存リスト」と、各命令が含まれるグループ(分割ループ)の名称が記憶される「グループ名」とを項目として有する。 The dependency information 131 shown in FIG. 10 is a "data dependency list" which is a list of "instruction numbers" in which instruction numbers of each instruction included in the intermediate language 22 are stored and instruction numbers of instructions having a dependency relationship with each instruction. , And a "group name" in which the name of the group (split loop) including each instruction is stored is included as an item.

具体的に、図9で説明した中間言語22において、命令1で値が設定された変数reg1は、命令3のみにおいて参照されている。そのため、情報生成部112は、例えば、図10に示すように、「命令番号」が「1」である情報の「データ依存リスト」に「3」を記憶する。 Specifically, in the intermediate language 22 described with reference to FIG. 9, the variable reg1 whose value is set by the instruction 1 is referred to only by the instruction 3. Therefore, for example, as shown in FIG. 10, the information generation unit 112 stores "3" in the "data dependency list" of the information whose "instruction number" is "1".

また、図9で説明した中間言語22において、命令2で値が設定された変数reg2は、命令3のみにおいて参照されている。そのため、情報生成部112は、例えば、図10に示すように、「命令番号」が「2」である情報の「データ依存リスト」に「3」を記憶する。 Further, in the intermediate language 22 described with reference to FIG. 9, the variable reg2 whose value is set by the instruction 2 is referred to only by the instruction 3. Therefore, for example, as shown in FIG. 10, the information generation unit 112 stores "3" in the "data dependency list" of the information whose "instruction number" is "2".

さらに、図9で説明した中間言語22において、命令3は、命令1で値が設定された変数reg1と命令2で値が設定された変数reg2とを参照している。また、図9で説明した中間言語22において、命令3で値が設定された変数reg3は、命令8及び命令10において参照されている。そのため、情報生成部112は、例えば、図10に示すように、「命令番号」が「3」である情報の「データ依存リスト」に「1」、「2」、「8」及び「10」を記憶する。 Further, in the intermediate language 22 described with reference to FIG. 9, the instruction 3 refers to the variable reg1 whose value is set by the instruction 1 and the variable reg2 whose value is set by the instruction 2. Further, in the intermediate language 22 described with reference to FIG. 9, the variable reg3 whose value is set by the instruction 3 is referred to by the instruction 8 and the instruction 10. Therefore, for example, as shown in FIG. 10, the information generation unit 112 adds "1", "2", "8", and "10" to the "data dependency list" of the information whose "instruction number" is "3". Remember.

また、情報生成部112は、例えば、図10に示すように、各命令に対応する「グループ名」の初期値として各命令の命令番号を記憶する。図10に含まれる他の情報についての説明は省略する。 Further, the information generation unit 112 stores, for example, the instruction number of each instruction as the initial value of the "group name" corresponding to each instruction, as shown in FIG. The description of other information included in FIG. 10 will be omitted.

なお、情報生成部112は、S23の処理において、依存情報131に含まれる内容に対応する依存グラフ131aを生成するものであってもよい。以下、依存グラフ131aの具体例について説明を行う。 The information generation unit 112 may generate the dependency graph 131a corresponding to the content included in the dependency information 131 in the process of S23. Hereinafter, a specific example of the dependency graph 131a will be described.

[依存グラフの具体例(1)]
図11は、依存グラフ131aの具体例について説明する図である。以下、双方向の関係を示すエッジを双方向エッジとも呼び、単方向の関係を示すエッジを単方向エッジとも呼ぶ。
[Specific example of dependency graph (1)]
FIG. 11 is a diagram illustrating a specific example of the dependency graph 131a. Hereinafter, an edge showing a bidirectional relationship is also referred to as a bidirectional edge, and an edge showing a unidirectional relationship is also referred to as a unidirectional edge.

具体的に、図11に示す依存グラフ131aでは、命令1に対応するノードと命令3に対応するノードとの間、命令2に対応するノードと命令3に対応するノードとの間、命令3に対応するノードと命令8に対応するノードとの間、命令3に対応するノードと命令10に対応するノードとの間、及び、命令4に対応するノードと命令8に対応するノードとの間のそれぞれに双方向エッジが設定されている。また、図11に示す依存グラフ131aでは、命令4に対応するノードと命令9に対応するノードとの間、命令5に対応するノードと命令10に対応するノードとの間、命令5に対応するノードと命令11に対応するノードとの間、命令6に対応するノードと命令11に対応するノードとの間、及び、命令7に対応するノードと命令12に対応するノードとの間のそれぞれに双方向エッジが設定されている。さらに、図11に示す依存グラフ131aでは、命令8に対応するノードと命令9に対応するノードとの間、命令9に対応するノードと命令10に対応するノードとの間、命令10に対応するノードと命令11に対応するノードとの間、命令11に対応するノードと命令12に対応するノードとの間、及び、命令12に対応するノードと命令13に対応するノードとの間のそれぞれに双方向エッジが設定されている。すなわち、図11に示す依存グラフ131aには、15本の双方向エッジが設定されている。 Specifically, in the dependency graph 131a shown in FIG. 11, between the node corresponding to the instruction 1 and the node corresponding to the instruction 3, the node corresponding to the instruction 2 and the node corresponding to the instruction 3 are connected to the instruction 3. Between the corresponding node and the node corresponding to the instruction 8, between the node corresponding to the instruction 3 and the node corresponding to the instruction 10, and between the node corresponding to the instruction 4 and the node corresponding to the instruction 8. Bidirectional edges are set for each. Further, in the dependency graph 131a shown in FIG. 11, between the node corresponding to the instruction 4 and the node corresponding to the instruction 9, the node corresponding to the instruction 5 and the node corresponding to the instruction 10 correspond to the instruction 5. Between the node and the node corresponding to the instruction 11, between the node corresponding to the instruction 6 and the node corresponding to the instruction 11, and between the node corresponding to the instruction 7 and the node corresponding to the instruction 12. Bidirectional edges are set. Further, in the dependency graph 131a shown in FIG. 11, the node corresponding to the instruction 8 and the node corresponding to the instruction 9 correspond to the instruction 10, and the node corresponding to the instruction 9 and the node corresponding to the instruction 10 correspond to the instruction 10. Between the node and the node corresponding to the instruction 11, between the node corresponding to the instruction 11 and the node corresponding to the instruction 12, and between the node corresponding to the instruction 12 and the node corresponding to the instruction 13. Bidirectional edges are set. That is, 15 bidirectional edges are set in the dependency graph 131a shown in FIG.

図10で説明した依存情報131において、例えば、「命令番号」が「1」である情報の「データ依存リスト」には、「3」が記憶されており、「命令番号」が「3」である情報の「データ依存リスト」には、「1」が記憶されている。そのため、情報生成部112は、例えば、図11に示すように、命令1に対応するノードと命令3に対応するノードとの間に双方向エッジを設定する。 In the dependency information 131 described with reference to FIG. 10, for example, "3" is stored in the "data dependency list" of the information in which the "instruction number" is "1", and the "instruction number" is "3". "1" is stored in the "data dependency list" of certain information. Therefore, for example, as shown in FIG. 11, the information generation unit 112 sets a bidirectional edge between the node corresponding to the instruction 1 and the node corresponding to the instruction 3.

また、図10で説明した依存情報131において、例えば、「命令番号」が「2」である情報の「データ依存リスト」には、「3」が記憶されており、「命令番号」が「3」である情報の「データ依存リスト」には、「2」が記憶されている。そのため、情報生成部112は、例えば、図11に示すように、命令2に対応するノードと命令3に対応するノードとの間に双方向エッジを設定する。 Further, in the dependency information 131 described with reference to FIG. 10, for example, "3" is stored in the "data dependency list" of the information in which the "instruction number" is "2", and the "instruction number" is "3". "2" is stored in the "data dependency list" of the information. Therefore, for example, as shown in FIG. 11, the information generation unit 112 sets a bidirectional edge between the node corresponding to the instruction 2 and the node corresponding to the instruction 3.

さらに、図10で説明した依存情報131において、例えば、「命令番号」が「3」である情報の「データ依存リスト」には、「8」が記憶されており、「命令番号」が「8」である情報の「データ依存リスト」には、「3」が記憶されている。そのため、情報生成部112は、例えば、図11に示すように、命令3に対応するノードと命令8に対応するノードとの間に双方向エッジを設定する。図11に含まれる他の情報についての説明は省略する。 Further, in the dependency information 131 described with reference to FIG. 10, for example, "8" is stored in the "data dependency list" of the information in which the "instruction number" is "3", and the "instruction number" is "8". "3" is stored in the "data dependency list" of the information. Therefore, for example, as shown in FIG. 11, the information generation unit 112 sets a bidirectional edge between the node corresponding to the instruction 3 and the node corresponding to the instruction 8. The description of other information included in FIG. 11 will be omitted.

図6に戻り、情報生成部112は、S23の処理で生成した依存情報131を行列に変換することによって第1行列132を生成する(S24)。以下、第1行列132の具体例について説明を行う。 Returning to FIG. 6, the information generation unit 112 generates the first matrix 132 by converting the dependency information 131 generated in the process of S23 into a matrix (S24). Hereinafter, a specific example of the first matrix 132 will be described.

[第1行列の具体例]
図12は、第1行列132の具体例について説明する図である。
[Specific example of the first matrix]
FIG. 12 is a diagram illustrating a specific example of the first matrix 132.

図12に示す第1行列132において、「1」から「13」のそれぞれに対応する行は、命令1から命令13のそれぞれに対応する行であり、「1」から「13」のそれぞれに対応する列は、命令1から命令13のそれぞれに対応する列である。また、図12に示す第1行列132の各要素(各欄)には、行に対応する命令と列に対応する命令との間に依存関係が存在することを示す値である「1」、または、行に対応する命令と列に対応する命令との間に依存関係が存在しないことを示す値である「0」が記憶される。 In the first matrix 132 shown in FIG. 12, the rows corresponding to each of "1" to "13" are the rows corresponding to each of the instructions 1 to 13, and correspond to each of "1" to "13". The columns to be used are the columns corresponding to each of the instructions 1 to 13. Further, each element (each column) of the first matrix 132 shown in FIG. 12 has a value of "1" indicating that there is a dependency between the instruction corresponding to the row and the instruction corresponding to the column. Alternatively, "0", which is a value indicating that there is no dependency between the instruction corresponding to the row and the instruction corresponding to the column, is stored.

具体的に、図10に示す依存情報131において、「命令番号」が「1」である情報の「データ依存リスト」には、「3」が記憶されている。そのため、情報生成部112は、図12に示すように、例えば、命令1に対応する行に含まれる欄のうち、命令3に対応する列に含まれる欄に「1」を記憶する。 Specifically, in the dependency information 131 shown in FIG. 10, "3" is stored in the "data dependency list" of the information in which the "instruction number" is "1". Therefore, as shown in FIG. 12, the information generation unit 112 stores, for example, "1" in the column included in the column corresponding to the instruction 3 among the columns included in the row corresponding to the instruction 1.

また、図10に示す依存情報131において、「命令番号」が「2」である情報の「データ依存リスト」には、「3」が記憶されている。そのため、情報生成部112は、図12に示すように、例えば、命令2に対応する行に含まれる欄のうち、命令3に対応する列に含まれる欄に「1」を記憶する。 Further, in the dependency information 131 shown in FIG. 10, "3" is stored in the "data dependency list" of the information in which the "instruction number" is "2". Therefore, as shown in FIG. 12, the information generation unit 112 stores, for example, "1" in the column included in the column corresponding to the instruction 3 among the columns included in the row corresponding to the instruction 2.

さらに、図10に示す依存情報131において、「命令番号」が「3」である情報の「データ依存リスト」には、「1」、「2」、「8」及び「10」が記憶されている。そのため、情報生成部112は、図12に示すように、例えば、命令3に対応する行に含まれる欄のうち、命令1に対応する列に含まれる欄と、命令2に対応する列に含まれる欄と、命令8に対応する列に含まれる欄と、命令10に対応する列に含まれる欄とのそれぞれに「1」を記憶する。図12に含まれる他の情報についての説明は省略する。 Further, in the dependency information 131 shown in FIG. 10, "1", "2", "8" and "10" are stored in the "data dependency list" of the information whose "instruction number" is "3". There is. Therefore, as shown in FIG. 12, the information generation unit 112 is included in, for example, a column included in the column corresponding to the instruction 1 and a column corresponding to the instruction 2 among the columns included in the row corresponding to the instruction 3. "1" is stored in each of the column, the column included in the column corresponding to the instruction 8, and the column included in the column corresponding to the instruction 10. The description of other information included in FIG. 12 will be omitted.

図6に戻り、情報処理装置1のグループ振分部114は、S24の処理で生成した第1行列132から、各命令間における依存度合いを示す第2行列133を生成する(S25)。以下、第2行列の具体例について説明を行う。 Returning to FIG. 6, the group distribution unit 114 of the information processing apparatus 1 generates a second matrix 133 indicating the degree of dependence between each instruction from the first matrix 132 generated in the process of S24 (S25). Hereinafter, a specific example of the second matrix will be described.

[第2行列の具体例]
図13は、第2行列133の具体例について説明する図である。
[Specific example of the second matrix]
FIG. 13 is a diagram illustrating a specific example of the second matrix 133.

図13に示す第2行列133において、「1」から「13」のそれぞれに対応する行は、命令1から命令13のそれぞれに対応する行であり、「1」から「13」のそれぞれに対応する列は、命令1から命令13のそれぞれに対応する列である。また、図13に示す第2行列133の各要素(各欄)には、行に対応する命令と列に対応する命令との間の依存度合いが記憶される。 In the second matrix 133 shown in FIG. 13, the rows corresponding to each of "1" to "13" are the rows corresponding to each of the instructions 1 to 13, and correspond to each of "1" to "13". The columns to be used are the columns corresponding to each of the instructions 1 to 13. Further, in each element (each column) of the second matrix 133 shown in FIG. 13, the degree of dependence between the instruction corresponding to the row and the instruction corresponding to the column is stored.

ここで、各命令間の依存度合いは、例えば、Newmanアルゴリズムによって算出されるクラスタリング指標値であってよい。この場合、グループ振分部114は、例えば、以下の式1を用いることによってクラスタリング指標値ΔQを算出する。 Here, the degree of dependence between the instructions may be, for example, a clustering index value calculated by the Newman algorithm. In this case, the group distribution unit 114 calculates the clustering index value ΔQ by using, for example, the following equation 1.

ΔQ=eij+eji−2a=2(eij−a) (式1) ΔQ = e ij + e ji -2a i a j = 2 (e ij- a i a j ) (Equation 1)

上記の式1において、変数aは、図11で説明した依存グラフ131aに含まれる単方向エッジのうち、命令iに対応するノードと他の命令に対するノードとの間における単方向エッジの数の割合を示し、変数aは、図11で説明した依存グラフ131aに含まれる単方向エッジのうち、命令jに対応するノードと他の命令に対するノードとの間における単方向エッジの数の割合を示す。また、式1において、変数eijは、図11で説明した依存グラフ131aに含まれる単方向エッジのうち、命令iに対応するノードと命令jに対応するノードとの間における単方向エッジの数の割合を示す。 In Equation 1 above, the variable ai is the number of unidirectional edges between the node corresponding to the instruction i and the node for another instruction among the unidirectional edges included in the dependency graph 131a described with reference to FIG. The variable a j indicates the ratio, and the variable a j indicates the ratio of the number of unidirectional edges between the node corresponding to the instruction j and the node for other instructions among the unidirectional edges included in the dependency graph 131a described with reference to FIG. Shown. Further, in Equation 1, the variable e ij is the number of unidirectional edges between the node corresponding to the instruction i and the node corresponding to the instruction j among the unidirectional edges included in the dependency graph 131a described with reference to FIG. Indicates the ratio of.

具体的に、図11で説明した依存グラフ131aが示す状態は、双方向エッジが15本含まれている状態であり、単方向エッジが30本含まれている場合と同じ状態である。また、図11で説明した依存グラフ131aにおいて、命令12に対応するノードと他のノードとの間における単方向エッジの数、命令13に対応するノードと他のノードとの間における単方向エッジの数及び命令12に対応するノードと命令13に対応するノードとの間における単方向エッジの数は、それぞれ3本、1本及び1本である。そのため、グループ振分部114は、例えば、命令iが命令12であって命令jが命令13である場合、以下の式(2)のように、クラスタリング指標値ΔQとして「0.060」を算出する。 Specifically, the state shown by the dependency graph 131a described with reference to FIG. 11 is a state in which 15 bidirectional edges are included, which is the same as a state in which 30 unidirectional edges are included. Further, in the dependency graph 131a described with reference to FIG. 11, the number of unidirectional edges between the node corresponding to the instruction 12 and the other node, and the unidirectional edge between the node corresponding to the instruction 13 and the other node. The number and the number of unidirectional edges between the node corresponding to the instruction 12 and the node corresponding to the instruction 13 are 3, 1, and 1, respectively. Therefore, for example, when the instruction i is the instruction 12 and the instruction j is the instruction 13, the group distribution unit 114 calculates “0.060” as the clustering index value ΔQ as in the following equation (2). To do.

2*((1/30)−(3/30)*(1/30))=0.06 ・・・(式2) 2 * ((1/30)-(3/30) * (1/30)) = 0.06 ... (Equation 2)

そのため、グループ振分部114は、図13に示すように、例えば、命令12に対応する行に含まれる欄のうち、命令13に対応する列に含まれる欄に「0.060」を記憶する。 Therefore, as shown in FIG. 13, the group distribution unit 114 stores, for example, "0.060" in the column included in the column corresponding to the instruction 13 among the columns included in the row corresponding to the instruction 12. ..

なお、命令iが命令13であって命令jが12である場合のクラスタリング指標値ΔQは、命令iが命令12であって命令jが13である場合のクラスタリング指標値ΔQと同じ値になる。そのため、グループ振分部114は、例えば、命令iが命令12であって命令jが13である場合のクラスタリング指標値ΔQについての算出を行った場合、命令iが命令13であって命令jが12である場合のクラスタリング指標値ΔQについての算出を行わないものであってもよい。そして、グループ振分部114は、この場合、図13に示すように、命令13に対応する行に含まれる欄のうち、命令12に対応する列に含まれる欄に、クラスタリング指標値ΔQの算出を行っていないことを示す値である「0.000」を記憶するものであってよい。図13に含まれる他の情報についての説明は省略する。 The clustering index value ΔQ when the instruction i is the instruction 13 and the instruction j is 12, is the same as the clustering index value ΔQ when the instruction i is the instruction 12 and the instruction j is 13. Therefore, for example, when the group distribution unit 114 calculates the clustering index value ΔQ when the instruction i is the instruction 12 and the instruction j is 13, the instruction i is the instruction 13 and the instruction j is The clustering index value ΔQ in the case of 12 may not be calculated. Then, in this case, as shown in FIG. 13, the group distribution unit 114 calculates the clustering index value ΔQ in the column included in the column corresponding to the instruction 12 among the columns included in the row corresponding to the instruction 13. It may store "0.000" which is a value indicating that the above is not performed. The description of other information included in FIG. 13 will be omitted.

図7に戻り、グループ振分部114は、S25の処理で生成した第2行列133の要素の値のうち、最大の値に対応する各命令の振り分け先を同じグループに決定する(S31)。 Returning to FIG. 7, the group distribution unit 114 determines the distribution destination of each instruction corresponding to the maximum value among the values of the elements of the second matrix 133 generated in the process of S25 to the same group (S31).

具体的に、図13で説明した第2行列133において、命令12に対応する行に含まれる欄のうち、命令13に対応する列に含まれる欄と、命令7に対応する行に含まれる欄のうち、命令12に対応する列に含まれる欄とのそれぞれには、最大の値である「0.060」が設定されている。そのため、グループ振分部114は、図13で説明した第2行列133の各要素に対応する命令の組合せのうち、命令12及び命令13の組合せまたは命令7及び命令12の組合せを特定する。そして、グループ振分部114は、例えば、命令12及び命令13の組合せを特定した場合、命令12と命令13とを同じグループに振り分ける旨の決定を行う。 Specifically, in the second matrix 133 described with reference to FIG. 13, among the columns included in the row corresponding to the instruction 12, the column included in the column corresponding to the instruction 13 and the column included in the row corresponding to the instruction 7. Among them, the maximum value "0.060" is set in each of the columns included in the column corresponding to the instruction 12. Therefore, the group distribution unit 114 specifies the combination of the instruction 12 and the instruction 13 or the combination of the instruction 7 and the instruction 12 among the combinations of the instructions corresponding to each element of the second matrix 133 described with reference to FIG. Then, for example, when the combination of the instruction 12 and the instruction 13 is specified, the group distribution unit 114 determines that the instruction 12 and the instruction 13 are distributed to the same group.

そして、グループ振分部114は、S25の処理で生成した第2行列133またはS33の処理(後述する処理)で再生成した第2行列133における行のうち、S31の処理で振り分け先を決定した各命令に対応する複数の行を、その複数の行における同一列ごとの要素の和を要素とする単一の行に変換し、S25の処理で生成した第2行列133またはS33の処理で再生成した第2行列133における列のうち、S31の処理で振り分け先を決定した各命令に対応する複数の列を、その複数の列における同一行ごとの要素の和を要素とする単一の列に変換することにより、第1行列132を再生成する(S32)。 Then, the group distribution unit 114 determines the distribution destination in the process of S31 among the rows in the second matrix 133 generated in the process of S25 or the row in the second matrix 133 regenerated in the process of S33 (process described later). A plurality of rows corresponding to each instruction are converted into a single row having the sum of the elements of the same column in the plurality of rows as an element, and reproduced by the processing of the second matrix 133 or S33 generated in the processing of S25. Among the columns in the second matrix 133 formed, a single column having a plurality of columns corresponding to each instruction whose distribution destination is determined in the process of S31 and the sum of the elements of the same row in the plurality of columns as elements. The first matrix 132 is regenerated by converting to (S32).

具体的に、グループ振分部114は、例えば、S31の処理における決定結果に基づいて依存情報131を更新する。そして、グループ振分部114は、例えば、更新した依存情報131を参照することによって第1行列132の再生成を行う。以下、S32の処理の具体例について説明を行う。 Specifically, the group distribution unit 114 updates the dependency information 131 based on the determination result in the process of S31, for example. Then, the group distribution unit 114 regenerates the first matrix 132 by referring to the updated dependency information 131, for example. Hereinafter, a specific example of the processing of S32 will be described.

[S32の処理の具体例]
図14及び図15は、S32の処理の具体例を説明する図である。
[Specific example of processing of S32]
14 and 15 are diagrams for explaining a specific example of the process of S32.

例えば、S31の処理で同じグループに振り分けることを決定した各命令が命令12及び命令13である場合、グループ振分部114は、図14に示すように、「命令番号」が「13」である情報の「グループ名」に記憶された値を、「命令番号」が「12」である情報の「グループ名」に記憶された値である「12」に更新するように、依存情報131を更新する。 For example, when the instructions 12 and the instruction 13 are determined to be distributed to the same group in the process of S31, the group distribution unit 114 has the "instruction number" of "13" as shown in FIG. Dependency information 131 is updated so that the value stored in the "group name" of the information is updated to "12" which is the value stored in the "group name" of the information whose "instruction number" is "12". To do.

その後、グループ振分部114は、例えば、図15に示すように、命令12に対応する行に含まれる欄に、命令12に対応する行に含まれる欄に設定されている値と、命令13に対応する行に含まれる欄に設定されている値とを同一列ごとに加算することによって算出した値をそれぞれ記憶する。また、グループ振分部114は、例えば、図15に示すように、命令12に対応する列に含まれる欄に、命令12に対応する列に含まれる欄に設定されている値と、命令13に対応する列に含まれる欄に設定されている値とを同一行ごとに加算することによって算出した値をそれぞれ記憶する。 After that, as shown in FIG. 15, for example, the group distribution unit 114 sets a value set in a column included in the line corresponding to the instruction 12 in a column included in the line corresponding to the instruction 12 and an instruction 13 The value calculated by adding the value set in the column included in the row corresponding to is added for each same column is stored. Further, as shown in FIG. 15, for example, the group distribution unit 114 has a value set in a column included in the column corresponding to the instruction 12 and a value set in the column included in the column corresponding to the instruction 12, and the instruction 13 The value calculated by adding the value set in the column included in the column corresponding to is added for each row is stored.

具体的に、図12で説明した第1行列132において、例えば、命令12に対応する行に含まれる欄のうち、命令7に対応する列に含まれる欄には、「1」が記憶されており、命令13に対応する行に含まれる欄のうち、命令7に対応する列に含まれる欄には、「0」が記憶されている。そのため、グループ振分部114は、図15に示すように、例えば、命令12に対応する行に含まれる欄のうち、命令7に対応する列に含まれる欄に、「1」及び「0」の和である「1」を記憶する。 Specifically, in the first matrix 132 described with reference to FIG. 12, for example, among the columns included in the row corresponding to the instruction 12, "1" is stored in the column included in the column corresponding to the instruction 7. Therefore, among the columns included in the row corresponding to the instruction 13, "0" is stored in the column included in the column corresponding to the instruction 7. Therefore, as shown in FIG. 15, the group distribution unit 114 has, for example, "1" and "0" in the columns included in the column corresponding to the instruction 7 among the columns included in the row corresponding to the instruction 12. Memorize "1" which is the sum of.

また、図12で説明した第1行列132において、例えば、命令11に対応する行に含まれる欄のうち、命令12に対応する列に含まれる欄には、「1」が記憶されており、命令11に対応する行に含まれる欄のうち、命令13に対応する列に含まれる欄には、「0」が記憶されている。そのため、グループ振分部114は、図15に示すように、例えば、命令11に対応する行に含まれる欄のうち、命令12に対応する列に含まれる欄に、「1」及び「0」の和である「1」を記憶する。 Further, in the first matrix 132 described with reference to FIG. 12, for example, among the columns included in the row corresponding to the instruction 11, "1" is stored in the column included in the column corresponding to the instruction 12. Among the columns included in the row corresponding to the instruction 11, "0" is stored in the column included in the column corresponding to the instruction 13. Therefore, as shown in FIG. 15, the group distribution unit 114 has, for example, "1" and "0" in the columns included in the column corresponding to the instruction 12 among the columns included in the row corresponding to the instruction 11. Memorize "1" which is the sum of.

さらに、図12で説明した第1行列132において、例えば、命令12に対応する行に含まれる欄のうち、命令12に対応する列に含まれる欄には、「0」が記憶されており、命令12に対応する行に含まれる欄のうち、命令13に対応する列に含まれる欄には、「1」が記憶されており、命令13に対応する行に含まれる欄のうち、命令12に対応する列に含まれる欄には、「1」が記憶されており、命令13に対応する行に含まれる欄のうち、命令13に対応する列に含まれる欄には、「0」が記憶されている。そのため、グループ振分部114は、図15に示すように、例えば、命令12に対応する行に含まれる欄のうち、命令12に対応する列に含まれる欄に、「0」、「1」、「1」及び「0」の和である「2」を記憶する。図15に含まれる他の情報についての説明は省略する。 Further, in the first matrix 132 described with reference to FIG. 12, for example, among the columns included in the row corresponding to the instruction 12, "0" is stored in the column included in the column corresponding to the instruction 12. Of the columns included in the row corresponding to the instruction 12, "1" is stored in the column included in the column corresponding to the instruction 13, and among the columns included in the row corresponding to the instruction 13, the instruction 12 "1" is stored in the column corresponding to the column corresponding to, and "0" is stored in the column included in the column corresponding to the instruction 13 among the columns included in the row corresponding to the instruction 13. It is remembered. Therefore, as shown in FIG. 15, the group distribution unit 114 has, for example, "0" and "1" in the columns included in the column corresponding to the instruction 12 among the columns included in the row corresponding to the instruction 12. , "2" which is the sum of "1" and "0" is stored. The description of other information included in FIG. 15 will be omitted.

図7に戻り、グループ振分部114は、S32の処理で再生成した第1行列132から第2行列133を再生成する(S33)。 Returning to FIG. 7, the group distribution unit 114 regenerates the second matrix 133 from the first matrix 132 regenerated in the process of S32 (S33).

具体的に、グループ振分部114は、例えば、図15で説明した第1行列132に対してS25の処理と同じ処理を行うことにより、図16に示す第2行列133を生成(再生成)する。 Specifically, for example, the group distribution unit 114 generates (regenerates) the second matrix 133 shown in FIG. 16 by performing the same processing as the processing of S25 on the first matrix 132 described with reference to FIG. To do.

そして、グループ振分部114は、S21の処理で分割対象であると判定したループに含まれる各命令の振り分け先のグループの数が所定数以下に到達したか否かを判定する(S34)。 Then, the group distribution unit 114 determines whether or not the number of distribution destination groups of each instruction included in the loop determined to be the division target in the process of S21 has reached a predetermined number or less (S34).

具体的に、図14で説明した依存情報131の「グループ名」には、「1」から「12」までの値(12種類の値)が記憶されている。そのため、グループ振分部114は、この場合、S21の処理で分割対象であると判定したループに含まれる各命令の振り分け先のグループの数として「12」を特定する。そして、例えば、S34の処理における所定数が「2」である場合、グループ振分部114は、S21の処理で分割対象であると判定したループに含まれる各命令の振り分け先のグループの数が所定数以下に到達していないと判定する。 Specifically, values (12 types of values) from "1" to "12" are stored in the "group name" of the dependency information 131 described with reference to FIG. Therefore, in this case, the group distribution unit 114 specifies "12" as the number of distribution destination groups of each instruction included in the loop determined to be the division target in the process of S21. Then, for example, when the predetermined number in the process of S34 is "2", the group distribution unit 114 has the number of groups to which each instruction is distributed included in the loop determined to be the division target in the process of S21. It is determined that the number has not reached the predetermined number or less.

一方、図17に示す依存情報131の「グループ名」には、「1」及び「5」のみ(2種類の値)が記憶されている。そのため、グループ振分部114は、この場合、S21の処理で分割対象であると判定したループに含まれる各命令の振り分け先のグループの数として「2」を特定する。そして、例えば、S34の処理における所定数が「2」である場合、グループ振分部114は、S21の処理で分割対象であると判定したループに含まれる各命令の振り分け先のグループの数が所定数以下に到達したと判定する。 On the other hand, only "1" and "5" (two kinds of values) are stored in the "group name" of the dependency information 131 shown in FIG. Therefore, in this case, the group distribution unit 114 specifies "2" as the number of distribution destination groups of each instruction included in the loop determined to be the division target in the process of S21. Then, for example, when the predetermined number in the process of S34 is "2", the group distribution unit 114 has the number of groups to which each instruction is distributed included in the loop determined to be the division target in the process of S21. It is determined that the number has reached a predetermined number or less.

なお、グループ振分部114は、図17に示す依存情報131を生成したことに応じて、例えば、図18に示す第1行列132の生成を行う。また、グループ振分部114は、図17に示す依存情報131を生成したことに応じて、例えば、図19に示す依存グラフ131aを生成する。以下、図19に示す依存グラフ131aの具体例について説明を行う。 The group distribution unit 114 generates, for example, the first matrix 132 shown in FIG. 18 in response to the generation of the dependency information 131 shown in FIG. Further, the group distribution unit 114 generates, for example, the dependency graph 131a shown in FIG. 19 in response to the generation of the dependency information 131 shown in FIG. Hereinafter, a specific example of the dependency graph 131a shown in FIG. 19 will be described.

[依存グラフの具体例(2)]
図19に示す依存グラフ131aにおいて、命令1、命令2、命令3、命令4、命令8及び命令9のそれぞれに対応するノード群と、命令5、命令6、命令7、命令10、命令11、命令12及び命令13のそれぞれに対応するノード群とは、それぞれ異なるグループに含まれている。
[Specific example of dependency graph (2)]
In the dependency graph 131a shown in FIG. 19, the node group corresponding to each of instruction 1, instruction 2, instruction 3, instruction 4, instruction 8 and instruction 9, and instruction 5, instruction 6, instruction 7, instruction 10, instruction 11, The node group corresponding to each of the instruction 12 and the instruction 13 is included in a different group.

そして、図19に示す依存グラフ131aにおいて、命令1に対応するノードを含むグループと、命令5に対応するノードを含むグループとの間には、命令3に対応するノードと命令10に対応するノードとの間のエッジと、命令9に対応するノードと命令10に対応するノードとの間のエッジとが設定されている。 Then, in the dependency graph 131a shown in FIG. 19, between the group including the node corresponding to the instruction 1 and the group including the node corresponding to the instruction 5, the node corresponding to the instruction 3 and the node corresponding to the instruction 10 are connected. An edge between the two, and an edge between the node corresponding to the instruction 9 and the node corresponding to the instruction 10 are set.

すなわち、図19に示す依存グラフ131aは、命令1、命令2、命令3、命令4、命令8及び命令9が一方の分割ループに含まれ、かつ、命令5、命令6、命令7、命令10、命令11、命令12及び命令13が他方の分割ループに含まれるようにループ分割を行った場合、異なる分割ループのそれぞれに含まれる命令間におけるエッジの数を2本に抑えることが可能になることを示している。 That is, in the dependency graph 131a shown in FIG. 19, instruction 1, instruction 2, instruction 3, instruction 4, instruction 8, and instruction 9 are included in one of the split loops, and instruction 5, instruction 6, instruction 7, and instruction 10 are included. When loop splitting is performed so that the instructions 11, instruction 12, and instruction 13 are included in the other division loop, the number of edges between the instructions included in each of the different division loops can be suppressed to two. It is shown that.

図9に戻り、S21の処理で分割対象であると判定したループに含まれる各命令の振り分け先のグループの数が所定数以下に到達したと判定した場合(S41のYES)、情報処理装置1のループ分割部115は、S33の処理で生成された第2行列133の内容に従って、S21の処理で分割対象であると判定したループのループ分割を行う(S42)。 Returning to FIG. 9, when it is determined that the number of distribution destination groups of each instruction included in the loop determined to be the division target in the process of S21 has reached a predetermined number or less (YES in S41), the information processing device 1 The loop splitting unit 115 of the above performs loop splitting of the loop determined to be the split target in the processing of S21 according to the contents of the second matrix 133 generated in the processing of S33 (S42).

その後、情報処理装置1は、S2の処理を終了する。なお、情報処理装置1は、情報格納領域130に記憶された中間言語22に、分割対象のループが含まれていないと判定した場合も同様に(S22のNO)、S2の処理を終了する。 After that, the information processing device 1 ends the processing of S2. When it is determined that the intermediate language 22 stored in the information storage area 130 does not include the loop to be divided, the information processing device 1 similarly ends the process of S2 (NO in S22).

一方、S21の処理で分割対象であると判定したループに含まれる各命令の振り分け先のグループの数が所定数以下に到達していないと判定した場合(S41のNO)、グループ振分部114は、S32以降の処理を再度行う。以下、ループ分割を行った後の分割ループの具体例について説明を行う。 On the other hand, when it is determined that the number of distribution destination groups of each instruction included in the loop determined to be the division target in the processing of S21 has not reached a predetermined number or less (NO in S41), the group distribution unit 114 Performs the processing after S32 again. Hereinafter, a specific example of the split loop after performing the loop split will be described.

[分割ループの具体例]
図20は、分割ループの内容を説明する具体例である。図20(A)は、分割ループのうちの一方を説明する具体例であり、図20(B)は、分割ループのうちの他方を説明する具体例である。
[Specific example of split loop]
FIG. 20 is a specific example for explaining the contents of the split loop. FIG. 20A is a specific example for explaining one of the divided loops, and FIG. 20B is a specific example for explaining the other of the divided loops.

図20(A)に示す分割ループには、図9で説明した中間言語のうち、命令1、命令2、命令3、命令4、命令8及び命令9が含まれている。 The split loop shown in FIG. 20A includes instruction 1, instruction 2, instruction 3, instruction 4, instruction 8 and instruction 9 among the intermediate languages described in FIG.

そして、図20(A)に示す分割ループは、命令1等の後に、変数reg3に設定された値を、配列tmp_array1のreg_i番目に格納することを示す命令である「store tmp_array1(reg_i),reg3」と、変数reg9に設定された値を、配列tmp_array2のreg_i番目に格納することを示す命令である「store tmp_array2(reg_i),reg9」とを含む。 Then, the split loop shown in FIG. 20 (A) is an instruction indicating that the value set in the variable reg3 is stored in the reg_ith position of the array tp_array1 after the instruction 1 or the like, "store tp_array1 (reg_i), reg3". , And "store tp_array2 (reg_i), reg9", which is an instruction indicating that the value set in the variable reg9 is stored in the reg_ith position of the array tp_array2.

一方、図20(B)に示す分割ループには、図9で説明した中間言語のうち、命令5、命令6、命令7、命令10、命令11、命令12及び命令13が含まれている。 On the other hand, the split loop shown in FIG. 20B includes instruction 5, instruction 6, instruction 7, instruction 10, instruction 11, instruction 12, and instruction 13 among the intermediate languages described in FIG.

そして、図20(B)に示す分割ループは、命令5等の前に、配列tmp_array1のreg_i番目に格納されている値を変数reg3に設定することを示す命令である「load reg3,tmp_array1(reg_i)」と、配列tmp_array2のreg_i番目に格納されている値を変数reg9に設定することを示す命令である「load reg9,tmp_array2(reg_i)」とを含む。 Then, the split loop shown in FIG. 20 (B) is an instruction indicating that the value stored in the reg_i th of the array tm_array1 is set in the variable reg3 before the instruction 5 and the like, "load reg3, tp_array1 (reg_i). ) ”, And“ load reg9, tp_array2 (reg_i) ”which is an instruction indicating that the value stored in the rig_i th of the array tp_array2 is set in the variable reg9.

すなわち、図19で説明したように、変数reg3に設定された値(命令3に対応する値)、及び、変数reg9に設定された値(命令9に対応する値)は、図20(B)に示す分割ループに含まれる命令10において参照される。そのため、図20(A)に示す分割ループには、変数reg3に設定された値及び変数reg9に設定された値を一時配列に格納する命令が含まれている。また、図20(B)に示す分割ループには、一時配列に格納されている値を取り出す命令が含まれている。 That is, as described with reference to FIG. 19, the value set in the variable reg3 (value corresponding to the instruction 3) and the value set in the variable reg9 (value corresponding to the instruction 9) are shown in FIG. 20B. It is referred to in instruction 10 included in the split loop shown in. Therefore, the split loop shown in FIG. 20A includes an instruction to store the value set in the variable reg3 and the value set in the variable reg9 in a temporary array. Further, the division loop shown in FIG. 20B includes an instruction for fetching a value stored in a temporary array.

このように、本実施の形態における情報処理装置1は、ソースコード21から生成した中間言語22のループに含まれる各命令間の依存関係を示す依存情報131を生成し、生成した依存情報131を行列に変換することによって第1行列132を生成する。 As described above, the information processing apparatus 1 in the present embodiment generates the dependency information 131 indicating the dependency relationship between each instruction included in the loop of the intermediate language 22 generated from the source code 21, and generates the dependency information 131. The first matrix 132 is generated by converting to a matrix.

そして、情報処理装置1は、生成した第1行列132から算出した各命令間における依存度合いに基づいて、ループに含まれる各命令を複数のグループに振り分け、振り分けたグループごとにループの分割を行う。 Then, the information processing device 1 distributes each instruction included in the loop into a plurality of groups based on the degree of dependence between the instructions calculated from the generated first matrix 132, and divides the loop into each of the distributed groups. ..

すなわち、本実施の形態における情報処理装置1は、依存情報131から生成された第1行列132を用いた演算を行うことで、分割対象のループに含まれる命令の組合せごとの依存関係の解析等を行うことなく、各命令の振り分け先を決定する。 That is, the information processing device 1 in the present embodiment performs an operation using the first matrix 132 generated from the dependency information 131, thereby analyzing the dependency relationship for each combination of instructions included in the loop to be divided. To determine the distribution destination of each command without performing.

これにより、情報処理装置1は、ループ分割を効率的に行うことが可能になり、ソースコード21のコンパイルに要する時間を短縮することが可能になる。 As a result, the information processing apparatus 1 can efficiently perform loop splitting, and the time required for compiling the source code 21 can be shortened.

また、情報処理装置1は、分割対象のループに含まれる各命令の振り分け先を計算によって決定することで、異なる分割ループに含まれる命令間の依存関係が最も疎になるループ分割の方法を特定することが可能になる。そのため、情報処理装置1は、特定した方法に従ってループの分割を行うことにより、ソースコード21から生成されるオブジェクトコード23の実行時間についても短縮させることが可能になる。 Further, the information processing device 1 specifies a loop splitting method in which the dependency between the instructions included in the different split loops is the sparsest by determining the distribution destination of each instruction included in the loop to be split by calculation. It becomes possible to do. Therefore, the information processing apparatus 1 can also shorten the execution time of the object code 23 generated from the source code 21 by dividing the loop according to the specified method.

なお、情報処理装置1は、S21及びS22の処理において、情報格納領域130に記憶された中間言語22に分割対象のループが複数含まれていると判定した場合、S23以降の処理を分割対象のループごとに行うものであってよい。 When the information processing device 1 determines in the processing of S21 and S22 that the intermediate language 22 stored in the information storage area 130 includes a plurality of loops to be divided, the processing after S23 is to be divided. It may be performed for each loop.

また、情報処理装置1は、S25に処理においてクラスタリング指標値を算出する場合、Newmanアルゴリズム以外のアルゴリズム(例えば、ラベル伝搬法やK−means法等のアルゴリズム)を用いるものであってもよい。 Further, the information processing apparatus 1 may use an algorithm other than the Newsman algorithm (for example, an algorithm such as a label propagation method or a K-means method) when calculating the clustering index value in the processing in S25.

[第2の実施の形態]
次に、第2の実施の形態の詳細について説明する。図21から図23は、第2の実施の形態におけるS2の処理を説明するフローチャート図である。また、図24から図28は、第2の実施の形態におけるS2の処理の詳細を説明する図である。
[Second Embodiment]
Next, the details of the second embodiment will be described. 21 to 23 are flowcharts illustrating the process of S2 in the second embodiment. In addition, FIGS. 24 to 28 are diagrams for explaining the details of the processing of S2 in the second embodiment.

第2の実施の形態におけるコンパイル処理は、第1の実施の形態におけるコンパイル処理と異なり、各命令がアクセスするデータのメモリ102内における位置関係についても参照してループの分割を行う。 The compilation process in the second embodiment is different from the compilation process in the first embodiment, and the loop is divided by referring to the positional relationship of the data accessed by each instruction in the memory 102.

分割判定部111は、図21に示すように、情報格納領域130に記憶された中間言語22に、分割対象のループが含まれるか否かを判定する(S51)。 As shown in FIG. 21, the division determination unit 111 determines whether or not the intermediate language 22 stored in the information storage area 130 includes a loop to be divided (S51).

そして、情報格納領域130に記憶された中間言語22に、分割対象のループが含まれていると判定した場合(S52のYES)、情報処理装置1の近接判定部116は、例えば、メモリ102内において近接するアドレスに格納された各データに対してアクセスを行う複数の命令が分割対象のループに含まれているか否かを判定する(S53)。 Then, when it is determined that the intermediate language 22 stored in the information storage area 130 includes the loop to be divided (YES in S52), the proximity determination unit 116 of the information processing device 1 is, for example, in the memory 102. In (S53), it is determined whether or not a plurality of instructions for accessing each data stored in adjacent addresses are included in the loop to be divided (S53).

具体的に、近接判定部116は、例えば、同一の配列に格納された各データに対してアクセスを行う複数の命令が同一の分割対象のループに含まれているか否かを判定する。 Specifically, the proximity determination unit 116 determines, for example, whether or not a plurality of instructions for accessing each data stored in the same array are included in the same loop to be divided.

すなわち、オブジェクトコード23の実行時において、例えば、第1命令の実行に伴って第1配列の第1データに対するアクセスが発生する場合、CPU101は、メモリ102に格納されている第1配列の各データを含む所定サイズのデータをキャッシュメモリ(図示しない)に一時的に格納し、キャッシュメモリに格納した第1データに対してアクセスを行う。 That is, when the object code 23 is executed, for example, when the first data of the first array is accessed with the execution of the first instruction, the CPU 101 performs each data of the first array stored in the memory 102. Data of a predetermined size including the above is temporarily stored in a cache memory (not shown), and the first data stored in the cache memory is accessed.

そして、例えば、第1命令と異なる第2命令の実行に伴って第1配列の第2データに対するアクセスが発生する場合、CPU101は、第1配列の各データがキャッシュメモリにまだ格納されていれば、キャッシュメモリに格納されている第2データに対してアクセスを行う。一方、他のデータに対するアクセスの発生等に伴って第1配列の各データがキャッシュメモリから既に追い出されている場合、CPU101は、メモリ102に格納されている第1配列の各データを含む所定サイズのデータをキャッシュメモリに再度に格納し、キャッシュメモリに格納した第2データに対してアクセスを行う。 Then, for example, when access to the second data in the first array occurs due to the execution of the second instruction different from the first instruction, the CPU 101 determines that each data in the first array is still stored in the cache memory. , Access the second data stored in the cache memory. On the other hand, when each data in the first array has already been expelled from the cache memory due to the occurrence of access to other data, the CPU 101 has a predetermined size including each data in the first array stored in the memory 102. Data is stored in the cache memory again, and the second data stored in the cache memory is accessed.

そのため、情報処理装置1は、例えば、上記のような第1命令及び第2命令が分割対象のループに含まれている場合、第1命令と第2命令が同じ分割ループに含まれるようにループ分割を行い、第1命令の実行タイミングと第2命令の実行タイミングとを近接させる。 Therefore, for example, when the first instruction and the second instruction as described above are included in the loop to be divided, the information processing apparatus 1 loops so that the first instruction and the second instruction are included in the same division loop. The division is performed so that the execution timing of the first instruction and the execution timing of the second instruction are brought close to each other.

これにより、情報処理装置1は、分割対象のループの実行中に第1データがキャッシュメモリから追い出される確率を抑えることが可能になる。そのため、情報処理装置1は、第1データをキャッシュメモリに再格納する処理の発生頻度を抑えることが可能になり、オブジェクトコード23の実行時間を短縮させることが可能になる。 As a result, the information processing apparatus 1 can suppress the probability that the first data is expelled from the cache memory during the execution of the loop to be divided. Therefore, the information processing device 1 can reduce the frequency of occurrence of the process of re-storing the first data in the cache memory, and can shorten the execution time of the object code 23.

したがって、近接判定部116は、S53の処理において、例えば、分割対象のループに含まれる命令から、同一の配列に含まれる各データに対してアクセスを行う複数の命令の特定を行う。 Therefore, in the process of S53, the proximity determination unit 116 identifies a plurality of instructions for accessing each data included in the same array from the instructions included in the loop to be divided, for example.

なお、近接判定部116は、例えば、ある配列に含まれるデータのうち、所定の回転数に対応する範囲内のデータに対してアクセスを行う複数の命令の特定を行うものであってもよい。 Note that the proximity determination unit 116 may specify, for example, a plurality of instructions for accessing data within a range corresponding to a predetermined rotation speed among the data included in a certain array.

図21に戻り、情報生成部112は、S51の処理で分割対象であると判定したループに含まれる各命令間の依存関係と、各命令がアクセスするデータのメモリ102内における位置関係とを示す依存情報131を生成する(S54)。 Returning to FIG. 21, the information generation unit 112 shows the dependency relationship between each instruction included in the loop determined to be the division target in the process of S51, and the positional relationship of the data accessed by each instruction in the memory 102. Dependency information 131 is generated (S54).

[依存情報の具体例]
図24は、依存情報131の具体例について説明する図である。
[Specific example of dependency information]
FIG. 24 is a diagram illustrating a specific example of the dependency information 131.

図24に示す依存情報131は、図10で説明した依存情報131が有する項目に加え、メモリ102内における近接したアドレスに格納された各データに対してアクセスを行う複数の命令の命令番号についてのリストである「キャッシュ共有依存リスト」を項目として有する。 The dependency information 131 shown in FIG. 24 refers to the instruction numbers of a plurality of instructions for accessing each data stored at adjacent addresses in the memory 102, in addition to the items included in the dependency information 131 described with reference to FIG. It has a "cache sharing dependency list" which is a list as an item.

具体的に、図9で説明した中間言語22において、配列Cに格納されているデータは、命令4及び命令6のそれぞれにおいて参照されている。そのため、情報生成部112は、例えば、図24に示すように、「命令番号」が「4」である情報の「キャッシュ共有依存リスト」に「6」を記憶し、「命令番号」が「6」である情報の「キャッシュ共有依存リスト」に「4」を記憶する。また、情報生成部112は、この場合、例えば、図24に示すように、「命令番号」が「4」及び「6」以外である情報の「キャッシュ共有依存リスト」に、情報が存在しないことを示す「−」を記憶する。 Specifically, in the intermediate language 22 described with reference to FIG. 9, the data stored in the array C is referred to in each of the instruction 4 and the instruction 6. Therefore, for example, as shown in FIG. 24, the information generation unit 112 stores "6" in the "cache sharing dependency list" of the information whose "instruction number" is "4", and the "instruction number" is "6". "4" is stored in the "cache sharing dependency list" of the information. Further, in this case, the information generation unit 112 does not have any information in the "cache sharing dependency list" of the information whose "instruction number" is other than "4" and "6", for example, as shown in FIG. Memorize the "-" indicating.

図21に戻り、情報生成部112は、S54の処理で生成した依存情報131を行列に変換することによって第1行列132を生成する(S55)。以下、第1行列132の具体例について説明を行う。 Returning to FIG. 21, the information generation unit 112 generates the first matrix 132 by converting the dependency information 131 generated in the process of S54 into a matrix (S55). Hereinafter, a specific example of the first matrix 132 will be described.

[第1行列の具体例]
図25は、第1行列132の具体例について説明する図である。
[Specific example of the first matrix]
FIG. 25 is a diagram illustrating a specific example of the first matrix 132.

図25に示す第1行列132の各要素(各欄)には、行に対応する命令と列に対応する命令との間に依存関係が存在することを示す値である「1」、行に対応する命令及び列に対応する命令のそれぞれがアクセスするデータのメモリ102内における位置が近接していることを示す値である「5」、または、行に対応する命令と列に対応する命令との間に依存関係がせず、かつ、行に対応する命令及び列に対応する命令のそれぞれがアクセスするデータのメモリ102内における位置が近接していないことを示す値である「0」が記憶される。 Each element (each column) of the first matrix 132 shown in FIG. 25 has a value of "1" indicating that there is a dependency between the instruction corresponding to the row and the instruction corresponding to the column, in the row. "5", which is a value indicating that the positions of the data to be accessed by the corresponding instruction and the instruction corresponding to the column are close to each other in the memory 102, or the instruction corresponding to the row and the instruction corresponding to the column. There is no dependency between the two, and "0", which is a value indicating that the positions in the memory 102 of the data accessed by each of the instruction corresponding to the row and the instruction corresponding to the column are not close to each other, is stored. Will be done.

具体的に、図24で説明した依存情報131において、「命令番号」が「4」である情報の「キャッシュ共有依存リスト」には、「6」が記憶されており、「命令番号」が「6」である情報の「キャッシュ共有依存リスト」には、「4」が記憶されている。そのため、情報生成部112は、図25に示すように、例えば、命令4に対応する行に含まれる欄のうち、命令6に対応する列に含まれる欄に「5」を記憶する。また、情報生成部112は、図25に示すように、例えば、命令6に対応する行に含まれる欄のうち、命令4に対応する列に含まれる欄に「5」を記憶する。 Specifically, in the dependency information 131 described with reference to FIG. 24, "6" is stored in the "cache sharing dependency list" of the information in which the "instruction number" is "4", and the "instruction number" is "4". "4" is stored in the "cache sharing dependency list" of the information which is "6". Therefore, as shown in FIG. 25, the information generation unit 112 stores, for example, "5" in the column included in the column corresponding to the instruction 6 among the columns included in the row corresponding to the instruction 4. Further, as shown in FIG. 25, the information generation unit 112 stores, for example, "5" in the column included in the column corresponding to the instruction 4 among the columns included in the row corresponding to the instruction 6.

すなわち、依存関係にある複数の命令が異なる分割ループに含まれることによるオブジェクトコード23の実行時間に対する影響よりも、キャッシュミスの発生回数が増加することによるオブジェクトコード23の実行時間に対する影響の方が大きいと判断できる。そのため、情報生成部112は、図25に示すように、例えば、各命令がアクセスするデータのメモリ102内における位置が近接していることを示す値が、各命令間に依存関係が存在することを示す値よりも大きくなるように、第1行列132の生成を行う。 That is, the effect on the execution time of the object code 23 due to the increase in the number of cache misses is greater than the effect on the execution time of the object code 23 due to the inclusion of a plurality of dependent instructions in different split loops. It can be judged that it is large. Therefore, as shown in FIG. 25, the information generation unit 112 has, for example, that the values indicating that the positions of the data accessed by each instruction in the memory 102 are close to each other have a dependency relationship between the instructions. The first matrix 132 is generated so as to be larger than the value indicating.

図21に戻り、グループ振分部114は、S55の処理で生成した第1行列132から、各命令間における依存度合いを示す第2行列133を生成する(S56)。 Returning to FIG. 21, the group distribution unit 114 generates a second matrix 133 indicating the degree of dependence between each instruction from the first matrix 132 generated in the process of S55 (S56).

そして、グループ振分部114は、図22に示すように、S56の処理で生成した第2行列133の要素の値のうち、最大の値に対応する複数の命令の振り分け先を同じグループに決定する(S61)。 Then, as shown in FIG. 22, the group distribution unit 114 determines the distribution destination of a plurality of instructions corresponding to the maximum values among the values of the elements of the second matrix 133 generated in the process of S56 to the same group. (S61).

続いて、グループ振分部114は、S56の処理で生成した第2行列133またはS63の処理で再生成した第2行列133における行のうち、S61の処理で振り分け先を決定した各命令に対応する複数の行を、その複数の行における同一列ごとの要素の和を要素とする単一の行に変換し、S56の処理で生成した第2行列133またはS63の処理で再生成した第2行列133における列のうち、S61の処理で振り分け先を決定した各命令に対応する複数の列を、その複数の列における同一行ごとの要素の和を要素とする単一の列に変換することにより、第1行列132を再生成する(S62)。 Subsequently, the group distribution unit 114 corresponds to each instruction whose distribution destination is determined by the processing of S61 among the rows in the second matrix 133 generated by the processing of S56 or the second matrix 133 regenerated by the processing of S63. The second row is converted into a single row whose elements are the sum of the elements of the same column in the plurality of rows, and regenerated by the processing of the second matrix 133 or S63 generated by the processing of S56. Of the columns in the matrix 133, a plurality of columns corresponding to each instruction whose distribution destination is determined in the process of S61 are converted into a single column having the sum of the elements of the same row in the plurality of columns as elements. Regenerates the first matrix 132 (S62).

さらに、グループ振分部114は、S62の処理で再生成した第1行列132から第2行列133を再生成する(S63)。 Further, the group distribution unit 114 regenerates the second matrix 133 from the first matrix 132 regenerated in the process of S62 (S63).

その後、グループ振分部114は、S51の処理で分割対象であると判定したループに含まれる各命令の振り分け先のグループの数が所定数以下に到達したか否かを判定する(S64)。 After that, the group distribution unit 114 determines whether or not the number of distribution destination groups of each instruction included in the loop determined to be the division target in the process of S51 has reached a predetermined number or less (S64).

具体的に、例えば、S64の処理における所定数が「2」である場合において、図26に示す第1行列132が生成されている場合、グループ振分部114は、S51の処理で分割対象であると判定したループに含まれる各命令の振り分け先のグループの数が所定数以下に到達したと判定する。 Specifically, for example, when the predetermined number in the processing of S64 is "2" and the first matrix 132 shown in FIG. 26 is generated, the group distribution unit 114 is a division target in the processing of S51. It is determined that the number of distribution destination groups of each instruction included in the loop determined to be present has reached a predetermined number or less.

なお、図27に示すように、図26に示す第1行列132に対応する依存グラフ131aでは、同じ配列に格納された各データを参照する各命令(命令4及び命令6)が同じグループに振り分けられている。 As shown in FIG. 27, in the dependency graph 131a corresponding to the first matrix 132 shown in FIG. 26, each instruction (instruction 4 and instruction 6) that refers to each data stored in the same array is distributed to the same group. Has been done.

続いて、S51の処理で分割対象であると判定したループに含まれる各命令の振り分け先のグループの数が所定数以下に到達したと判定した場合(S71のYES)、ループ分割部115は、S63の処理で生成された第2行列133の内容に従って、S51の処理で分割対象であると判定したループのループ分割を行う(S72)。 Subsequently, when it is determined that the number of the distribution destination groups of each instruction included in the loop determined to be the division target in the processing of S51 has reached a predetermined number or less (YES in S71), the loop division unit 115 determines. According to the contents of the second matrix 133 generated in the process of S63, the loop split of the loop determined to be the split target in the process of S51 is performed (S72).

そして、情報処理装置1は、S2の処理を終了する。なお、情報処理装置1は、情報格納領域130に記憶された中間言語22に、分割対象のループが含まれていないと判定した場合も同様に(S52のNO)、S2の処理を終了する。 Then, the information processing device 1 ends the processing of S2. When it is determined that the intermediate language 22 stored in the information storage area 130 does not include the loop to be divided, the information processing device 1 also ends the processing of S2 (NO in S52).

一方、S51の処理で分割対象であると判定したループに含まれる各命令の振り分け先のグループの数が所定数以下に到達していないと判定した場合(S71のNO)、グループ振分部114は、S62以降の処理を再度行う。以下、ループ分割を行った後の分割ループの具体例について説明を行う。 On the other hand, when it is determined that the number of the distribution destination groups of each instruction included in the loop determined to be the division target in the processing of S51 has not reached the predetermined number or less (NO in S71), the group distribution unit 114 Performs the processing after S62 again. Hereinafter, a specific example of the split loop after performing the loop split will be described.

[分割ループの具体例]
図28は、分割ループの内容を説明する具体例である。図28(A)は、分割ループのうちの一方を説明する具体例であり、図28(B)は、分割ループのうちの他方を説明する具体例である。
[Specific example of split loop]
FIG. 28 is a specific example for explaining the contents of the split loop. FIG. 28 (A) is a specific example for explaining one of the divided loops, and FIG. 28 (B) is a specific example for explaining the other of the divided loops.

図28(A)に示す分割ループには、図9で説明した中間言語のうち、命令1、命令2、命令3、命令4、命令6、命令8及び命令9が含まれている。 The split loop shown in FIG. 28A includes instruction 1, instruction 2, instruction 3, instruction 4, instruction 6, instruction 8 and instruction 9 among the intermediate languages described in FIG.

また、図28(A)に示す分割ループは、命令1等の後に、変数reg3に設定された値を、配列tmp_array1のreg_i番目に格納することを示す命令である「store tmp_array1(reg_i),reg3」と、変数reg6に設定された値を、配列tmp_array2のreg_i番目に格納することを示す命令である「store tmp_array2(reg_i),reg6」と、変数reg9に設定された値を、配列tmp_array3のreg_i番目に格納することを示す命令である「store tmp_array3(reg_i),reg9」とを含む。 Further, the split loop shown in FIG. 28 (A) is an instruction indicating that the value set in the variable reg3 is stored in the reg_ith position of the array tp_array1 after the instruction 1 or the like, "store tp_array1 (reg_i), reg3". , Which is an instruction indicating that the value set in the variable reg6 is stored in the reg_ith position of the array tp_array2, and the value set in the variable reg9 is set in the reg_i of the array tp_array3. It includes "store tp_array3 (reg_i), reg9" which is an instruction indicating to store in the third position.

一方、図28(B)に示す分割ループには、図9で説明した中間言語のうち、命令5、命令7、命令10、命令11、命令12及び命令13が含まれている。 On the other hand, the split loop shown in FIG. 28B includes instruction 5, instruction 7, instruction 10, instruction 11, instruction 12, and instruction 13 among the intermediate languages described in FIG.

また、図28(B)に示す分割ループは、命令5等の前に、配列tmp_array1のreg_i番目に格納されている値を変数reg3に設定することを示す命令である「load reg3,tmp_array1(reg_i)」と、配列tmp_array2のreg_i番目に格納されている値を変数reg6に設定することを示す命令である「load reg6,tmp_array2(reg_i)」と、配列tmp_array3のreg_i番目に格納されている値を変数reg9に設定することを示す命令である「load reg9,tmp_array3(reg_i)」とを含む。 Further, the split loop shown in FIG. 28 (B) is an instruction indicating that the value stored in the reg_i th of the array tp_array1 is set in the variable reg3 before the instruction 5 and the like, "load reg3, tp_array1 (reg_i). ) ”,“ Load reg6, tp_array2 (reg_i) ”, which is an instruction to set the value stored in the reg_ith position of the array tp_array2 in the variable reg6, and the value stored in the rig_ith position of the array tp_ary3 It includes "load reg9, tp_array3 (reg_i)" which is an instruction indicating that the variable reg9 is set.

すなわち、図28に示す分割ループは、図20で説明した分割ループよりも一時配列の数が増加している。しかしながら、図28に示す分割ループでは、同じ配列に格納された各データを参照する各命令(命令4及び命令6)が同じ分割ループに含まれている。 That is, the number of temporary sequences in the split loop shown in FIG. 28 is larger than that in the split loop described in FIG. However, in the division loop shown in FIG. 28, each instruction (instruction 4 and instruction 6) that refers to each data stored in the same array is included in the same division loop.

これにより、情報処理装置1は、オブジェクトコード23の実行時間をより短縮させることが可能になる。 As a result, the information processing device 1 can further shorten the execution time of the object code 23.

以上の実施の形態をまとめると、以下の付記のとおりである。 The above embodiments can be summarized as follows.

(付記1)
ソースコードから生成した中間言語のループに含まれる各命令間の依存関係を示す依存情報を生成し、生成した前記依存情報を行列に変換することによって第1行列を生成する情報生成部と、
生成した前記第1行列から算出した各命令間における依存度合いに基づいて、前記ループに含まれる各命令を複数のグループに振り分けるグループ振分部と、
振り分けた前記複数のグループごとに、前記ループの分割を行うループ分割部と、を有する、
ことを特徴とする情報処理装置。
(Appendix 1)
An information generation unit that generates a first matrix by generating dependency information indicating the dependency between each instruction included in the loop of the intermediate language generated from the source code and converting the generated dependency information into a matrix.
A group distribution unit that distributes each instruction included in the loop into a plurality of groups based on the degree of dependence between each instruction calculated from the generated first matrix.
Each of the plurality of sorted groups has a loop splitting unit for splitting the loop.
An information processing device characterized by this.

(付記2)
付記1において、
前記情報生成部は、
前記ループに含まれる命令の組合せごとに、各組合せに含まれる命令間に依存関係があることを前記依存情報が示しているか否かを判定し、
前記命令の組合せのうち、各組合せに含まれる命令間に依存関係があることを前記依存情報が示している組合せに対応する要素を第1の値とし、前記命令の組合せのうち、各組合せに含まれる命令間に依存関係があることを前記依存情報が示していない組合せに対応する要素を第2の値とすることにより、前記第1行列の生成を行う、
ことを特徴とする情報処理装置。
(Appendix 2)
In Appendix 1,
The information generation unit
For each combination of instructions included in the loop, it is determined whether or not the dependency information indicates that there is a dependency between the instructions included in each combination.
Among the combinations of the instructions, the element corresponding to the combination in which the dependency information indicates that there is a dependency between the instructions included in each combination is set as the first value, and each combination of the combinations of the instructions has The first matrix is generated by setting the element corresponding to the combination in which the dependency information does not indicate that there is a dependency between the included instructions as the second value.
An information processing device characterized by this.

(付記3)
付記1において、
前記グループ振分部は、異なるグループにそれぞれ含まれる命令間において存在する依存関係が少なくなるように、前記ループに含まれる各命令を複数のグループに振り分ける、
ことを特徴とする情報処理装置。
(Appendix 3)
In Appendix 1,
The group distribution unit distributes each instruction included in the loop to a plurality of groups so that the dependency relationship existing between the instructions included in the different groups is reduced.
An information processing device characterized by this.

(付記4)
付記1において、
前記グループ振分部は、
前記第1行列から各命令間における依存度合いを示す第2行列を生成し、
生成した前記第2行列に基づいて、前記ループに含まれる各命令を前記複数のグループに振り分ける、
ことを特徴とする情報処理装置。
(Appendix 4)
In Appendix 1,
The group distribution section
From the first matrix, a second matrix showing the degree of dependence between each instruction is generated.
Based on the generated second matrix, each instruction included in the loop is distributed to the plurality of groups.
An information processing device characterized by this.

(付記5)
付記4において、
前記グループ振分部は、
前記ループに含まれる命令の組合せごとに、各組合せに含まれる命令間における依存度合いを算出し、
算出した前記依存度合いのそれぞれを要素とすることにより、前記第2行列を生成する、
ことを特徴とする情報処理装置。
(Appendix 5)
In Appendix 4,
The group distribution section
For each combination of instructions included in the loop, the degree of dependence between the instructions included in each combination is calculated.
The second matrix is generated by using each of the calculated degrees of dependence as an element.
An information processing device characterized by this.

(付記6)
付記5において、
前記グループ振分部は、Newmanアルゴリズムを用いることにより、前記依存度合いを算出する、
ことを特徴とする情報処理装置。
(Appendix 6)
In Appendix 5,
The group distribution unit calculates the degree of dependence by using the Newman algorithm.
An information processing device characterized by this.

(付記7)
付記5において、
前記グループ振分部は、
前記第2行列の要素の値のうち、最大の値に対応する複数の命令の振り分け先を同じグループに決定し、
前記第2行列における前記複数の命令に対応する複数の行を、前記複数の行における同一列ごとの要素の和を要素とする単一の行に変換し、かつ、前記第2行列における前記複数の命令に対応する複数の列を、前記複数の列における同一行ごとの要素の和を要素とする単一の列に変換することによって、前記第1行列を再生成し、
再生成した前記第1行列から前記第2行列を再生成し、
前記ループに含まれる各命令の振り分け先として決定したグループの数が所定数以下になるまで、前記決定する処理と前記第1行列を再生成する処理と前記第2行列を再生成する処理とを繰り返す、
ことを特徴とする情報処理装置。
(Appendix 7)
In Appendix 5,
The group distribution section
Among the values of the elements of the second matrix, the distribution destinations of the plurality of instructions corresponding to the maximum values are determined in the same group.
The plurality of rows corresponding to the plurality of instructions in the second matrix are converted into a single row having the sum of the elements of the same column in the plurality of rows as elements, and the plurality of rows in the second matrix. The first matrix is regenerated by converting the plurality of columns corresponding to the instruction of to a single column having the sum of the elements of the same row in the plurality of columns as elements.
The second matrix is regenerated from the regenerated first matrix, and the second matrix is regenerated.
Until the number of groups determined as the distribution destination of each instruction included in the loop becomes a predetermined number or less, the process of determining, the process of regenerating the first matrix, and the process of regenerating the second matrix are performed. repeat,
An information processing device characterized by this.

(付記8)
付記2において、さらに、
近接する記憶領域に格納された各データに対してアクセスを行う複数の命令が前記ループに含まれているか否かを判定する近接判定部を有し、
前記情報生成部は、前記複数の命令が前記ループに含まれているか否かの判定結果に基づいて、前記第1行列の生成を行う、
ことを特徴とする情報処理装置。
(Appendix 8)
In Appendix 2, further
It has a proximity determination unit that determines whether or not a plurality of instructions for accessing each data stored in adjacent storage areas are included in the loop.
The information generation unit generates the first matrix based on the determination result of whether or not the plurality of instructions are included in the loop.
An information processing device characterized by this.

(付記9)
付記8において、
前記情報生成部は、前記複数の命令が前記ループに含まれていると判定した場合、前記複数の命令間に対応する要素を前記第1の値よりも大きい第3の値とすることにより、前記第1行列の生成を行う、
ことを特徴とする情報処理装置。
(Appendix 9)
In Appendix 8,
When the information generation unit determines that the plurality of instructions are included in the loop, the information generation unit sets the element corresponding to the plurality of instructions to a third value larger than the first value. The first matrix is generated.
An information processing device characterized by this.

(付記10)
付記8において、
前記近接する記憶領域に格納された各データは、同一の配列である、
ことを特徴とする情報処理装置。
(Appendix 10)
In Appendix 8,
Each data stored in the adjacent storage area is the same array.
An information processing device characterized by this.

(付記11)
ソースコードから生成した中間言語のループに含まれる各命令間の依存関係を示す依存情報を生成し、
生成した前記依存情報を行列に変換することによって第1行列を生成し、
生成した前記第1行列から算出した各命令間における依存度合いに基づいて、前記ループに含まれる各命令を複数のグループに振り分け、
振り分けた前記複数のグループごとに、前記ループの分割を行う、
処理をコンピュータに実行させることを特徴とするコンパイラプログラム。
(Appendix 11)
Generates dependency information that shows the dependency between each instruction included in the intermediate language loop generated from the source code.
The first matrix is generated by converting the generated dependency information into a matrix.
Based on the degree of dependence between each instruction calculated from the generated first matrix, each instruction included in the loop is divided into a plurality of groups.
The loop is divided for each of the plurality of sorted groups.
A compiler program characterized by having a computer perform processing.

(付記12)
付記11において、
前記第1行列を生成する処理では、
前記ループに含まれる命令の組合せごとに、各組合せに含まれる命令間に依存関係があることを前記依存情報が示しているか否かを判定し、
前記命令の組合せのうち、各組合せに含まれる命令間に依存関係があることを前記依存情報が示している組合せに対応する要素を第1の値とし、前記命令の組合せのうち、各組合せに含まれる命令間に依存関係があることを前記依存情報が示していない組合せに対応する要素を第2の値とすることにより、前記第1行列の生成を行う、
ことを特徴とするコンパイラプログラム。
(Appendix 12)
In Appendix 11,
In the process of generating the first matrix,
For each combination of instructions included in the loop, it is determined whether or not the dependency information indicates that there is a dependency between the instructions included in each combination.
Among the combinations of the instructions, the element corresponding to the combination in which the dependency information indicates that there is a dependency between the instructions included in each combination is set as the first value, and each combination of the combinations of the instructions has The first matrix is generated by setting the element corresponding to the combination in which the dependency information does not indicate that there is a dependency between the included instructions as the second value.
A compiler program characterized by that.

(付記13)
付記11において、
前記複数のグループに振り分ける処理では、異なるグループにそれぞれ含まれる命令間において存在する依存関係が少なくなるように、前記ループに含まれる各命令を複数のグループに振り分ける、
ことを特徴とするコンパイラプログラム。
(Appendix 13)
In Appendix 11,
In the process of distributing to a plurality of groups, each instruction included in the loop is distributed to a plurality of groups so that the dependency existing between the instructions included in the different groups is reduced.
A compiler program characterized by that.

(付記14)
付記11において、
前記複数のグループに振り分ける処理では、
前記第1行列から各命令間における依存度合いを示す第2行列を生成し、
生成した前記第2行列に基づいて、前記ループに含まれる各命令を前記複数のグループに振り分ける、
ことを特徴とするコンパイラプログラム。
(Appendix 14)
In Appendix 11,
In the process of distributing to a plurality of groups,
From the first matrix, a second matrix showing the degree of dependence between each instruction is generated.
Based on the generated second matrix, each instruction included in the loop is distributed to the plurality of groups.
A compiler program characterized by that.

1:情報処理装置 5:操作端末
21:ソースコード 22:中間言語
23:オブジェクトコード 130:記憶部
NW:ネットワーク
1: Information processing device 5: Operation terminal 21: Source code 22: Intermediate language 23: Object code 130: Storage unit NW: Network

Claims (11)

ソースコードから生成した中間言語のループに含まれる各命令間の依存関係を示す依存情報を生成し、生成した前記依存情報を行列に変換することによって第1行列を生成する情報生成部と、
生成した前記第1行列から算出した各命令間における依存度合いに基づいて、前記ループに含まれる各命令を複数のグループに振り分けるグループ振分部と、
振り分けた前記複数のグループごとに、前記ループの分割を行うループ分割部と、を有する、
ことを特徴とする情報処理装置。
An information generation unit that generates a first matrix by generating dependency information indicating the dependency between each instruction included in the loop of the intermediate language generated from the source code and converting the generated dependency information into a matrix.
A group distribution unit that distributes each instruction included in the loop into a plurality of groups based on the degree of dependence between each instruction calculated from the generated first matrix.
Each of the plurality of sorted groups has a loop splitting unit for splitting the loop.
An information processing device characterized by this.
請求項1において、
前記情報生成部は、
前記ループに含まれる命令の組合せごとに、各組合せに含まれる命令間に依存関係があることを前記依存情報が示しているか否かを判定し、
前記命令の組合せのうち、各組合せに含まれる命令間に依存関係があることを前記依存情報が示している組合せに対応する要素を第1の値とし、前記命令の組合せのうち、各組合せに含まれる命令間に依存関係があることを前記依存情報が示していない組合せに対応する要素を第2の値とすることにより、前記第1行列の生成を行う、
ことを特徴とする情報処理装置。
In claim 1,
The information generation unit
For each combination of instructions included in the loop, it is determined whether or not the dependency information indicates that there is a dependency between the instructions included in each combination.
Among the combinations of the instructions, the element corresponding to the combination in which the dependency information indicates that there is a dependency between the instructions included in each combination is set as the first value, and each combination of the combinations of the instructions has The first matrix is generated by setting the element corresponding to the combination in which the dependency information does not indicate that there is a dependency between the included instructions as the second value.
An information processing device characterized by this.
請求項1において、
前記グループ振分部は、異なるグループにそれぞれ含まれる命令間において存在する依存関係が少なくなるように、前記ループに含まれる各命令を複数のグループに振り分ける、
ことを特徴とする情報処理装置。
In claim 1,
The group distribution unit distributes each instruction included in the loop to a plurality of groups so that the dependency relationship existing between the instructions included in the different groups is reduced.
An information processing device characterized by this.
請求項1において、
前記グループ振分部は、
前記第1行列から各命令間における依存度合いを示す第2行列を生成し、
生成した前記第2行列に基づいて、前記ループに含まれる各命令を前記複数のグループに振り分ける、
ことを特徴とする情報処理装置。
In claim 1,
The group distribution section
From the first matrix, a second matrix showing the degree of dependence between each instruction is generated.
Based on the generated second matrix, each instruction included in the loop is distributed to the plurality of groups.
An information processing device characterized by this.
請求項4において、
前記グループ振分部は、
前記ループに含まれる命令の組合せごとに、各組合せに含まれる命令間における依存度合いを算出し、
算出した前記依存度合いのそれぞれを要素とすることにより、前記第2行列を生成する、
ことを特徴とする情報処理装置。
In claim 4,
The group distribution section
For each combination of instructions included in the loop, the degree of dependence between the instructions included in each combination is calculated.
The second matrix is generated by using each of the calculated degrees of dependence as an element.
An information processing device characterized by this.
請求項5において、
前記グループ振分部は、Newmanアルゴリズムを用いることにより、前記依存度合いを算出する、
ことを特徴とする情報処理装置。
In claim 5,
The group distribution unit calculates the degree of dependence by using the Newman algorithm.
An information processing device characterized by this.
請求項5において、
前記グループ振分部は、
前記第2行列の要素の値のうち、最大の値に対応する複数の命令の振り分け先を同じグループに決定し、
前記第2行列における前記複数の命令に対応する複数の行を、前記複数の行における同一列ごとの要素の和を要素とする単一の行に変換し、かつ、前記第2行列における前記複数の命令に対応する複数の列を、前記複数の列における同一行ごとの要素の和を要素とする単一の列に変換することによって、前記第1行列を再生成し、
再生成した前記第1行列から前記第2行列を再生成し、
前記ループに含まれる各命令の振り分け先として決定したグループの数が所定数以下になるまで、前記決定する処理と前記第1行列を再生成する処理と前記第2行列を再生成する処理とを繰り返す、
ことを特徴とする情報処理装置。
In claim 5,
The group distribution section
Among the values of the elements of the second matrix, the distribution destinations of the plurality of instructions corresponding to the maximum values are determined in the same group.
The plurality of rows corresponding to the plurality of instructions in the second matrix are converted into a single row having the sum of the elements of the same column in the plurality of rows as elements, and the plurality of rows in the second matrix. The first matrix is regenerated by converting the plurality of columns corresponding to the instruction of to a single column having the sum of the elements of the same row in the plurality of columns as elements.
The second matrix is regenerated from the regenerated first matrix, and the second matrix is regenerated.
Until the number of groups determined as the distribution destination of each instruction included in the loop becomes a predetermined number or less, the process of determining, the process of regenerating the first matrix, and the process of regenerating the second matrix are performed. repeat,
An information processing device characterized by this.
請求項2において、さらに、
近接する記憶領域に格納された各データに対してアクセスを行う複数の命令が前記ループに含まれているか否かを判定する近接判定部を有し、
前記情報生成部は、前記複数の命令が前記ループに含まれているか否かの判定結果に基づいて、前記第1行列の生成を行う、
ことを特徴とする情報処理装置。
In claim 2, further
It has a proximity determination unit that determines whether or not a plurality of instructions for accessing each data stored in adjacent storage areas are included in the loop.
The information generation unit generates the first matrix based on the determination result of whether or not the plurality of instructions are included in the loop.
An information processing device characterized by this.
請求項8において、
前記情報生成部は、前記複数の命令が前記ループに含まれていると判定した場合、前記複数の命令間に対応する要素を前記第1の値よりも大きい第3の値とすることにより、前記第1行列の生成を行う、
ことを特徴とする情報処理装置。
In claim 8.
When the information generation unit determines that the plurality of instructions are included in the loop, the information generation unit sets the element corresponding to the plurality of instructions to a third value larger than the first value. The first matrix is generated.
An information processing device characterized by this.
請求項8において、
前記近接する記憶領域に格納された各データは、同一の配列である、
ことを特徴とする情報処理装置。
In claim 8.
Each data stored in the adjacent storage area is the same array.
An information processing device characterized by this.
ソースコードから生成した中間言語のループに含まれる各命令間の依存関係を示す依存情報を生成し、
生成した前記依存情報を行列に変換することによって第1行列を生成し、
生成した前記第1行列から算出した各命令間における依存度合いに基づいて、前記ループに含まれる各命令を複数のグループに振り分け、
振り分けた前記複数のグループごとに、前記ループの分割を行う、
処理をコンピュータに実行させることを特徴とするコンパイラプログラム。
Generates dependency information that shows the dependency between each instruction included in the intermediate language loop generated from the source code.
The first matrix is generated by converting the generated dependency information into a matrix.
Based on the degree of dependence between each instruction calculated from the generated first matrix, each instruction included in the loop is divided into a plurality of groups.
The loop is divided for each of the plurality of sorted groups.
A compiler program characterized by having a computer perform processing.
JP2019121513A 2019-06-28 2019-06-28 Information processing device and compiler program Active JP7239827B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2019121513A JP7239827B2 (en) 2019-06-28 2019-06-28 Information processing device and compiler program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2019121513A JP7239827B2 (en) 2019-06-28 2019-06-28 Information processing device and compiler program

Publications (2)

Publication Number Publication Date
JP2021009443A true JP2021009443A (en) 2021-01-28
JP7239827B2 JP7239827B2 (en) 2023-03-15

Family

ID=74199960

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2019121513A Active JP7239827B2 (en) 2019-06-28 2019-06-28 Information processing device and compiler program

Country Status (1)

Country Link
JP (1) JP7239827B2 (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH04211830A (en) * 1990-02-05 1992-08-03 Matsushita Electric Ind Co Ltd Parallel compiling system
JP2001306333A (en) * 2000-04-24 2001-11-02 Hitachi Ltd Loop parallelizing method
US6651246B1 (en) * 1999-11-08 2003-11-18 International Business Machines Corporation Loop allocation for optimizing compilers

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4211830B2 (en) 2006-09-14 2009-01-21 三浦工業株式会社 Safety control system for combustion equipment

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH04211830A (en) * 1990-02-05 1992-08-03 Matsushita Electric Ind Co Ltd Parallel compiling system
US6651246B1 (en) * 1999-11-08 2003-11-18 International Business Machines Corporation Loop allocation for optimizing compilers
JP2001306333A (en) * 2000-04-24 2001-11-02 Hitachi Ltd Loop parallelizing method

Also Published As

Publication number Publication date
JP7239827B2 (en) 2023-03-15

Similar Documents

Publication Publication Date Title
Wang et al. Performance prediction for apache spark platform
Dryden et al. Clairvoyant prefetching for distributed machine learning I/O
US20090249004A1 (en) Data caching for distributed execution computing
US9684493B2 (en) R-language integration with a declarative machine learning language
JP6432450B2 (en) Parallel computing device, compiling device, parallel processing method, compiling method, parallel processing program, and compiling program
US11182523B2 (en) Incremental generation of quantum circuits
Gu et al. Improving execution concurrency of large-scale matrix multiplication on distributed data-parallel platforms
Kireev et al. Fragmentation of numerical algorithms for parallel subroutines library
dos Anjos et al. Smart: An application framework for real time big data analysis on heterogeneous cloud environments
Liu et al. Scientific workflow partitioning in multisite cloud
Liao et al. Prefetching on storage servers through mining access patterns on blocks
US8006238B2 (en) Workload partitioning in a parallel system with hetergeneous alignment constraints
Song et al. Powerinfer: Fast large language model serving with a consumer-grade gpu
US20170147943A1 (en) Global data flow optimization for machine learning programs
Belgin et al. A library for pattern-based sparse matrix vector multiply
Lu et al. A new data sieving approach for high performance I/O
Janssen et al. A specification invariant technique for regularity improvement between flow-graph clusters
JP7239827B2 (en) Information processing device and compiler program
JP2023180315A (en) Conversion program and conversion processing method
Liu et al. A survey of speculative execution strategy in MapReduce
US11288046B2 (en) Methods and systems for program optimization utilizing intelligent space exploration
Liu et al. Model‐based MPI‐IO tuning with Periscope tuning framework
EP4083785B1 (en) Profiling and optimization of compiler-generated code
Istrate et al. Exploring graph analytics with the PCJ toolbox
Boito et al. I/O performance of multiscale finite element simulations on HPC environments

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20220308

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20221221

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20230131

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20230213

R150 Certificate of patent or registration of utility model

Ref document number: 7239827

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150