JP2004252728A - Method for compiling, compiler, compilation device, program code creation method, program, calculation method and device for optimum utilization of cache - Google Patents

Method for compiling, compiler, compilation device, program code creation method, program, calculation method and device for optimum utilization of cache Download PDF

Info

Publication number
JP2004252728A
JP2004252728A JP2003042628A JP2003042628A JP2004252728A JP 2004252728 A JP2004252728 A JP 2004252728A JP 2003042628 A JP2003042628 A JP 2003042628A JP 2003042628 A JP2003042628 A JP 2003042628A JP 2004252728 A JP2004252728 A JP 2004252728A
Authority
JP
Japan
Prior art keywords
data
target
loops
localizable
cache
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
JP2003042628A
Other languages
Japanese (ja)
Other versions
JP4177681B2 (en
Inventor
Hironori Kasahara
博徳 笠原
Kazuhisa Ishizaka
一久 石坂
Hiroshi Nakano
啓史 中野
Motoki Obata
元樹 小幡
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.)
Waseda University
Original Assignee
Waseda University
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 Waseda University filed Critical Waseda University
Priority to JP2003042628A priority Critical patent/JP4177681B2/en
Publication of JP2004252728A publication Critical patent/JP2004252728A/en
Application granted granted Critical
Publication of JP4177681B2 publication Critical patent/JP4177681B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Images

Landscapes

  • Memory System Of A Hierarchy Structure (AREA)
  • Devices For Executing Special Programs (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To provide a method for compiling that reduces a total cache miss including a cache line conflict and improves processing speed, a compiler, a compilation device, a program code creation method, a program, a calculation method of optimum utilization of cache and a calculation device for optimum utilization of cache. <P>SOLUTION: Scheduling sequentially carries out each small loop belonging to the same data localizable group (DLG) as much as possible after loop alignment and partitioning, and by executing layout change of array data used by each DLG using a padding, allocates a plurality of partial array data used by each small loop belonging to the same DLG on a cache without them being overlapped. <P>COPYRIGHT: (C)2004,JPO&NCIPI

Description

【0001】
【発明の属する技術分野】
本発明は、ソースプログラムをコンパイルして目的プログラムを生成するコンパイル方法、コンパイラ、およびコンパイル装置、プログラムを構成するコードを作成するプログラムコード作成方法、これらにより生成または作成されたプログラム、並びにこれらのプログラムを用いたキャッシュ最適利用演算方法およびキャッシュ最適利用演算装置に係り、例えば、主記憶共有型マルチプロセッサマシンを用いてキャッシュメモリを効果的に利用して演算を行う場合等に利用できる。
【0002】
【背景技術】
一般に、多くのコンピュータは、高速に動作するプロセッサと、アクセス速度の遅い主メモリと、これらの速度のギャップを埋めるために設けられたアクセス速度の速い比較的小容量のキャッシュメモリとを備えている。主メモリとキャッシュメモリ(以下、単にキャッシュということがある。)との間のデータ転送単位はブロックと称されている。主メモリから転送されてくるブロックを、キャッシュ上のいずれのキャッシュラインに置くかを決定する方式には、フルアソシアティブ方式、セットアソシアティブ方式、およびダイレクトマップ方式の3種類がある。
【0003】
ダイレクトマップ方式では、主メモリから転送されてくる各ブロックの一つ一つは、ある一つの決まったキャッシュライン(例えば、主メモリのアドレスの下位ビットによりキャッシュラインのアドレスを決めることが多い。)にマッピングされるので、一度キャッシュライン上に置かれたデータであっても、同一のキャッシュラインにマッピングされるブロックに含まれるデータの参照があると、キャッシュライン上に置かれたデータは、キャッシュから追い出され、次の参照時には、キャッシュ上に存在しない状態となる。この現象をキャッシュラインコンフリクトと呼び、これによって生じるキャッシュミスをキャッシュラインコンフリクトミスという。
【0004】
また、セットアソシアティブ方式では、主メモリから転送されてくる各ブロックの一つ一つは、ある決められた複数(nウェイ・セットアソシアティブの場合には、n個)のキャッシュラインにマッピングされ、空いている方のキャッシュラインに置かれるが、空いているキャッシュラインが無ければ、ダイレクトマップ方式の場合と同様に、キャッシュラインコンフリクトが起きる。
【0005】
従って、ダイレクトマップ方式やセットアソシアティブ方式のキャッシュを備えたコンピュータでは、プログラムによってはキャッシュラインコンフリクトが多発し、処理速度が著しく低下する場合がある。
【0006】
そこで、従来より、このようなキャッシュラインコンフリクトミスを削減する方法として、例えば、変数の宣言サイズを変更する変数内パディング(Intra−variable padding)、複数変数の間にダミー変数を入れる変数間パディング(Inter−variable padding)等のデータレイアウト変更による手法などが研究されている(例えば、特許文献1等参照)。
【0007】
一方、マルチプロセッサシステムの実効性能を向上させるためのマルチグレイン並列処理の粗粒度タスク並列処理においても、データローカライゼーション手法が研究されてきた。データローカライゼーション手法をSMPマシン上のキャッシュに応用し、データを共有する粗粒度タスクを同一プロセッサ上で連続実行させることにより、粗粒度タスク間でのデータ転送にキャッシュを有効利用する手法が本願出願人により提案されている(非特許文献1,2参照)。
【0008】
なお、この粗粒度タスク並列処理においては、ソースプログラムを階層的に分割してマクロタスクを生成し、マクロタスク間のコントロールフロー、データ依存を解析した後に、マクロタスク間の並列性を抽出するために、各マクロタスクの最早実行可能条件を解析するという手順がとられる。マクロタスクの最早実行可能条件とは、そのマクロタスクが最も早い時点で実行可能になる条件である(非特許文献3参照)。
【0009】
【特許文献1】
特開平8−212081号公報(段落[0021]〜[0024]、[0027]、[0028]、[0094]、図15)
【非特許文献1】
笠原博徳(Hironori Kasahara),外1名,「ア・データ−ローカライゼーション・コンピレーション・スキーム・ユーズィング・パーシャル−スタティック・タスク・アサインメント・フォー・フォートラン・コース−グレイン・パラレル・プロセスィング(A data−localization compilation scheme using partial−static task assignment for Fortran coarse−grain parallel processing)」,パラレル・コンピューティング(PARALLEL COMPUTING),(オランダ),パラレル・コンピューティング(PARALLEL COMPUTING)発行,1998年,Parallel Computing24(1998),p.579−596
【非特許文献2】
石坂,中野,八木,小幡,笠原,「共有メモリマルチプロセッサ上でのキャッシュ最適化を考慮した粗粒度タスク並列処理」,情報処理学会論文誌,情報処理学会発行,2002年,Vol.43,No.4
【非特許文献3】
笠原博徳,「並列処理技術」,コロナ社発行,1991年6月20日(初版),p.140−148
【0010】
【発明が解決しようとする課題】
前述したように、従来より単一ループ、若しくは複数のループを融合したループ(このループフュージョンについては、前述した非特許文献3のp.125−128に詳述されている。)に対するコンフリクトミスの削減法が研究されている。これらの技術は、主として、同一イタレーションで使用する配列間でラインコンフリクトミスを削減するためのパディングや、外側ループのイタレーションで使用したデータを次のイタレーションで使用する場合に、それらの間でデータがキャッシュから追い出されないようにするためのパディング法である。
【0011】
しかし、従来のパディングは、コンフリクトミス削減により単一ループ内でのローカリティの向上を図ることはできるが、複数のループ間でアクセスされるデータに対してグローバルなコンフリクトミスの削減を行うことはできないという問題があった。
【0012】
また、従来のデータローカライゼーション手法では、同一のデータローカライザブルグループに属する分割ループ集合間でアクセスされるデータ集合を同一プロセッサ上のキャッシュに割り当てることにより、キャッシュミスは軽減できるものの、ラインコンフリクトの削減はできないという問題があった(後述する図6の右上部分、図14〜図17の各右側部分、図22の左側部分参照)。
【0013】
本発明の目的は、ラインコンフリクトを含めたトータルなキャッシュミスを軽減でき、処理速度を向上させることができるコンパイル方法、コンパイラ、コンパイル装置、プログラムコード作成方法、プログラム、キャッシュ最適利用演算方法、およびキャッシュ最適利用演算装置を提供するところにある。
【0014】
【課題を解決するための手段】
本発明は、ソースプログラムをコンパイルして目的プログラムを生成するコンパイル方法であって、ソースプログラムに含まれるデータ依存を有する複数のループをそれぞれ分割して各ループについてそれぞれ複数の小ループを生成し、これらの各小ループのうち同一の部分的な配列データを使用する小ループ同士を集合させて複数のデータローカライザブルグループを形成し、かつ、この分割・グループ化処理の際には、各データローカライザブルグループに属する各小ループによりそれぞれ使用される部分的な各配列データの合計サイズが、各データローカライザブルグループ毎にキャッシュメモリのサイズ以下に収まるように整合分割を行い、その後、各小ループの実行が確定する実行確定条件および各小ループの実行に必要なデータが使用可能状態になるデータアクセス条件からなる最早実行可能条件を満たす範囲内で、同一のデータローカライザブルグループに属する各小ループ同士が、可能な限り連続して実行されるスケジューリングを行うとともに、各データローカライザブルグループに属する各小ループにより使用される部分的な各配列データ同士がキャッシュメモリ上で重なりを持たないように、各配列データに対してパディングを用いたデータレイアウト変更を行うことを特徴とするものである。
【0015】
ここで、本発明における「コンパイル」とは、広義のコンパイルを意味し、ソースプログラムから機械語コードにより構成される狭義のオブジェクトプログラムへの変換処理(狭義のコンパイル)のみならず、例えばFortran等の高級言語コードにより構成されるソースプログラムから同じFortran等の高級言語コードにより構成されるプログラムへの変換処理も含まれる。さらに、リンカ(リンケージ・エディタ)によって実行可能プログラムとされる前の状態のプログラムへの変換処理も含まれる。以下の発明においても同様である。
【0016】
また、本発明における「目的プログラム」とは、機械語コードにより構成される狭義のオブジェクトプログラムのみならず、例えばFortran等の高級言語コードにより構成されるプログラムも含まれる。さらに、リンカによって実行可能プログラムとされる前の状態のプログラムも含まれる。以下の発明においても同様である。
【0017】
さらに、「部分的な配列データ」とは、一つの配列データのうちの一部分をいい、その配列データを使用するループを分割することにより生じるものである。例えば、配列データがA(1:1024,1:1024)であるときに、A(1:1024,1:256)やA(1:1024,257:512)等が部分的な配列データに相当する。
【0018】
そして、「各データローカライザブルグループに属する各小ループによりそれぞれ使用される部分的な各配列データの合計サイズが、各データローカライザブルグループ毎にキャッシュメモリのサイズ以下に収まるように整合分割を行い」とは、同一のデータローカライザブルグループに属する各小ループにより使用される複数の部分的な配列データの合計サイズが、キャッシュサイズ以下に収まるように整合分割するという意味であり、このことが各データローカライザブルグループ毎に、それぞれ成立するという意味である。
【0019】
また、「各データローカライザブルグループに属する各小ループにより使用される部分的な各配列データ同士がキャッシュメモリ上で重なりを持たないように、各配列データに対してパディングを用いたデータレイアウト変更を行う」とされているのは、キャッシュメモリ上で重なりを持たないように配慮される対象となるのは、部分的な配列データ単位であるのに対し、パディングを入れる際には、部分的な配列データ単位ではなく、配列データまたは複数の配列データの集合を単位として考えるという意味である。
【0020】
さらに、「スケジューリング」と「データレイアウト変更」とは、いずれを先に行ってもよい。
【0021】
そして、「スケジューリングを行う」ことには、目的プログラム内における各データローカライザブルグループに属する各小ループの配置順序や配置位置そのものを変更して実行順序を定めること、および目的プログラム内にスケジューリング情報(例えば、GOTO文等のジャンプ機能を付与するための情報など)を挿入して実行順序を定めること等が含まれる。
【0022】
このような本発明のコンパイル方法においては、ソースプログラムに含まれるデータ依存を有する複数のループを対象としてループ整合分割行い、かつ、パディングを用いてこれらのループにより使用(アクセス)される配列データについてレイアウト変更を行う。そして、同一のデータローカライザブルグループに属する各小ループ同士を可能な限り連続実行するスケジューリングを行う。
【0023】
このため、上記のようなスケジューリングを行う結果、同一のデータローカライザブルグループに属する整合分割後の各小ループにより使用される複数の部分的な配列データは、連続して一つのキャッシュに置かれることが多くなり、この際、これらの複数の部分的な配列データは、パディングを用いたレイアウトが行われているため、キャッシュ上の異なるラインにマッピングされ、キャッシュ上で重なりを持つことはなくなる。例えば、配列データがA(1:1024,1:1024)およびB(1:1024,1:1024)であるときに、これらについての部分的な配列データであるA(1:1024,1:256)およびB(1:1024,1:256)が同一のデータローカライザブルグループに属する各小ループにより使用されるとすると、A(1:1024,1:256)とB(1:1024,1:256)とは、一つのキャッシュに置かれ、しかもキャッシュ上の異なるラインにマッピングされるようになる(後述する図7〜図10、図18〜図21、図22の右側部分参照)。
【0024】
従って、キャッシュラインコンフリクトミスが回避され、計算機(用途は問わない。例えば、学術計算用、会計処理用、ゲーム用、事務処理用、その他の演算処理用等、任意である。)の処理速度を向上させることが可能となり、これらにより前記目的が達成される。
【0025】
また、前述したコンパイル方法において、複数のプロセッサを用いて並列処理を行うためのマルチプロセッサ用のスケジューリングを行う際には、最早実行可能条件を満たす範囲内で、同一のデータローカライザブルグループに属する各小ループ同士が、可能な限り同一のプロセッサ上で連続して実行されるスケジューリングを行うことが望ましい。
【0026】
ここで、プロセッサ数と、ループ整合分割の分割数とは、一致していてもよく、一致していなくてもよい。
【0027】
このようにマルチプロセッサマシンへの適用を図った場合には、各データローカライザブルグループで行うループ処理を、複数のプロセッサに分散して行わせることができるようになり、例えば、各データローカライザブルグループに属する各小ループの処理を、各データローカライザブルグループ毎にそれぞれ異なるプロセッサに割り当てること等が可能となり、各データローカライザブルグループで行われるループ処理の並列性を利用して処理速度を、より一層向上させることが可能となる。
【0028】
さらに、前述したコンパイル方法において、パディングは、各データローカライザブルグループに属する各小ループにより使用される配列とは異なるデータ(いわゆるダミーデータ)により確保される領域としてもよく(例えば、後述する図18〜図21の場合等)、あるいは、各データローカライザブルグループに属する各小ループにより使用される配列のうちの少なくとも一つの配列のサイズを、非連続アクセス次元について拡大して確保される領域としてもよい(例えば、後述する図7〜図10、図22の場合等)。
【0029】
また、上記のうち、配列サイズを非連続アクセス次元について拡大してパディングを行う後者の場合においては、各データローカライザブルグループに属する各小ループにより使用される配列のサイズを、各配列毎にそれぞれ非連続アクセス次元について拡大してパディングを行ってもよく(例えば、後述する図7〜図10、図22の場合等)、あるいは、各配列毎ではなく、複数の配列の集合を一つの単位として考えてパディングを行ってもよい(例えば、後述する図18〜図21において、配列E,K,Rの各後ろ側にダミーデータを挿入するのではなく、各配列E,K,Rを拡大する場合等)。但し、各配列毎にパディングを行う際には、最後の配列については、必ずしもパディングを行う必要はない。
【0030】
なお、「非連続アクセス次元」とは、配列の宣言次元のうちメモリ格納時に最も大きなアクセスストライドを持つ次元であり、例えば、Fortranの場合には、カラムメジャーオーダーなので、右端で宣言される次元、すなわちA(i,j,k)であれば、kの次元の宣言サイズを拡大変更する。換言すれば、「非連続アクセス次元」とは、複数次元の配列の場合に、ループ処理において各イタレーションで固定された状態が続く次元であり、例えば、二重ループの場合には、外側のループ(処理の効率化の観点から、外側に配置されるべきループ)で変化する次元である。具体的には、例えば、A(1,1)、A(2,1)、A(3,1)、…、A(1,2)、A(2,2)、A(3,2)、…という順にアクセスする場合には、第2次元目のサイズを拡大変更する。
【0031】
また、本発明のコンパイラは、以上に述べたコンパイル方法を用いてコンパイルを行うことを特徴とするものである。
【0032】
このような本発明のコンパイラにおいては、前述した本発明のコンパイル方法で得られる作用・効果がそのまま得られ、これにより前記目的が達成される。
【0033】
さらに、本発明は、ソースプログラムをコンパイルして目的プログラムを生成するコンパイラであって、ソースプログラムをブロック単位で分割して複数のマクロタスクを生成するマクロタスク生成手段と、各マクロタスクの実行が確定する実行確定条件および各マクロタスクの実行に必要なデータが使用可能状態になるデータアクセス条件からなる最早実行可能条件を解析する並列性解析手段と、各マクロタスクとしてソースプログラムに含まれるデータ依存を有する各ループのうちから、キャッシュメモリを効果的に利用するためのループ整合分割が可能な複数のループを、キャッシュ最適化用のターゲットループグループとして選択するターゲットループグループ選択手段と、このターゲットループグループ選択手段により選択されたターゲットループグループをターゲットループグループテーブルに格納するターゲットループグループ格納手段と、ターゲットループグループを構成する複数のループによりそれぞれ使用される各配列データを、キャッシュ最適化用の対象配列データとして選択する対象配列データ選択手段と、この対象配列データ選択手段により選択された各対象配列データを対象配列データテーブルに格納する対象配列データ格納手段と、各対象配列データの合計サイズおよびキャッシュメモリのサイズに基づき、ターゲットループグループを構成する複数のループの分割数を決定する分割数決定手段と、この分割数決定手段により決定した分割数に基づき、ターゲットループグループテーブルに格納されたターゲットループグループを構成する複数のループをそれぞれ分割して各ループについてそれぞれ複数の小ループを生成し、これらの各小ループのうち同一の部分的な対象配列データを使用する小ループ同士を集合させて複数のデータローカライザブルグループを形成するループ整合分割手段と、各小ループの実行が確定する実行確定条件および各小ループの実行に必要なデータが使用可能状態になるデータアクセス条件からなる最早実行可能条件を満たす範囲内で、同一のデータローカライザブルグループに属する各小ループ同士が、可能な限り連続して実行されるスケジューリングを行うスケジューリング手段と、各データローカライザブルグループに属する各小ループにより使用される部分的な各対象配列データ同士がキャッシュメモリ上で重なりを持たないように、各対象配列データの主メモリへの格納位置をずらすために挿入するパディング用データのサイズを決定するパディングサイズ決定手段と、このパディングサイズ決定手段により決定したサイズに相当するパディング用データを、対象配列データテーブルに格納された対象配列データの内部または対象配列データ間に挿入することによりパディングを用いたデータレイアウト変更を行うデータレイアウト変更手段として、コンピュータを機能させることを特徴とするものである。
【0034】
ここで、「分割数決定手段」における「各対象配列データの合計サイズおよびキャッシュメモリのサイズに基づき」とは、全ての対象配列データの合計サイズをキャッシュメモリのサイズで除した値に基づき、分割数を決定するという意味である。
【0035】
また、「対象配列データの内部または対象配列データ間に挿入する」とは、対象配列のサイズを非連続アクセス次元について拡大するか、または対象配列データ間にいわゆるダミーデータを入れるという意味である。
【0036】
このような本発明のコンパイラにおいては、前述した本発明のコンパイル方法で得られる作用・効果がそのまま得られ、これにより前記目的が達成される。
【0037】
そして、本発明は、ソースプログラムをコンパイルして目的プログラムを生成するコンパイル装置であって、ソースプログラムをブロック単位で分割して複数のマクロタスクを生成するマクロタスク生成手段と、各マクロタスクの実行が確定する実行確定条件および各マクロタスクの実行に必要なデータが使用可能状態になるデータアクセス条件からなる最早実行可能条件を解析する並列性解析手段と、各マクロタスクとしてソースプログラムに含まれるデータ依存を有する各ループのうちから、キャッシュメモリを効果的に利用するためのループ整合分割が可能な複数のループを、キャッシュ最適化用のターゲットループグループとして選択するターゲットループグループ選択手段と、このターゲットループグループ選択手段により選択されたターゲットループグループを格納するターゲットループグループテーブルと、ターゲットループグループを構成する複数のループによりそれぞれ使用される各配列データを、キャッシュ最適化用の対象配列データとして選択する対象配列データ選択手段と、この対象配列データ選択手段により選択された各対象配列データを格納する対象配列データテーブルと、各対象配列データの合計サイズおよびキャッシュメモリのサイズに基づき、ターゲットループグループを構成する複数のループの分割数を決定する分割数決定手段と、この分割数決定手段により決定した分割数に基づき、ターゲットループグループテーブルに格納されたターゲットループグループを構成する複数のループをそれぞれ分割して各ループについてそれぞれ複数の小ループを生成し、これらの各小ループのうち同一の部分的な対象配列データを使用する小ループ同士を集合させて複数のデータローカライザブルグループを形成するループ整合分割手段と、各小ループの実行が確定する実行確定条件および各小ループの実行に必要なデータが使用可能状態になるデータアクセス条件からなる最早実行可能条件を満たす範囲内で、同一のデータローカライザブルグループに属する各小ループ同士が、可能な限り連続して実行されるスケジューリングを行うスケジューリング手段と、各データローカライザブルグループに属する各小ループにより使用される部分的な各対象配列データ同士がキャッシュメモリ上で重なりを持たないように、各対象配列データの主メモリへの格納位置をずらすために挿入するパディング用データのサイズを決定するパディングサイズ決定手段と、このパディングサイズ決定手段により決定したサイズに相当するパディング用データを、対象配列データテーブルに格納された対象配列データの内部または対象配列データ間に挿入することによりパディングを用いたデータレイアウト変更を行うデータレイアウト変更手段とを備えたことを特徴とするものである。
【0038】
このような本発明のコンパイル装置においては、前述した本発明のコンパイル方法で得られる作用・効果がそのまま得られ、これにより前記目的が達成される。
【0039】
また、本発明は、プログラムを構成するコードを作成するプログラムコード作成方法であって、実行対象とするデータ依存を有する複数のループをそれぞれ分割して各ループについてそれぞれ複数の小ループを作成し、これらの各小ループのうち同一の部分的な配列データを使用する小ループ同士を集合させて複数のデータローカライザブルグループを形成し、かつ、この分割・グループ化作業の際には、各データローカライザブルグループに属する各小ループによりそれぞれ使用される部分的な各配列データの合計サイズが、各データローカライザブルグループ毎にキャッシュメモリのサイズ以下に収まるように整合分割を行い、その後、各小ループの実行が確定する実行確定条件および各小ループの実行に必要なデータが使用可能状態になるデータアクセス条件からなる最早実行可能条件を満たす範囲内で、同一のデータローカライザブルグループに属する各小ループ同士が、可能な限り連続して実行されるようにスケジューリングを行うとともに、各データローカライザブルグループに属する各小ループにより使用される部分的な各配列データ同士がキャッシュメモリ上で重なりを持たないように、各配列データをパディングを用いてレイアウトすることを特徴とするものである。
【0040】
このような本発明のプログラムコード作成方法においては、前述した本発明のコンパイル方法で得られる作用・効果がそのまま得られ、これにより前記目的が達成される。
【0041】
さらに、前述したプログラムコード作成方法において、複数のプロセッサを用いて並列処理を行うためのマルチプロセッサ用のスケジューリングを行う際には、最早実行可能条件を満たす範囲内で、同一のデータローカライザブルグループに属する各小ループ同士が、可能な限り同一のプロセッサ上で連続して実行されるようにスケジューリングを行うことが望ましい。
【0042】
このようにマルチプロセッサマシンへの適用を図った場合には、各データローカライザブルグループで行うループ処理を、複数のプロセッサに分散して行わせることができるようになり、例えば、各データローカライザブルグループに属する各小ループの処理を、各データローカライザブルグループ毎にそれぞれ異なるプロセッサに割り当てること等が可能となり、各データローカライザブルグループで行われるループ処理の並列性を利用して処理速度を、より一層向上させることが可能となる。
【0043】
また、本発明のプログラムは、以上に述べたコンパイル方法またはプログラムコード作成方法を用いて生成または作成されたことを特徴とするものである。
【0044】
さらに、本発明のプログラムは、以上に述べたコンパイラにより生成されたことを特徴とするものである。
【0045】
なお、以上に述べたプログラムまたはその一部は、例えば、光磁気ディスク(MO)、コンパクトディスク(CD)を利用した読出し専用メモリ(CD−ROM)、CDレコーダブル(CD−R)、CDリライタブル(CD−RW)、デジタル・バーサタイル・ディスク(DVD)を利用した読出し専用メモリ(DVD−ROM)、DVDを利用したランダム・アクセス・メモリ(DVD−RAM)、フレキシブルディスク(FD)、磁気テープ、ハードディスク、読出し専用メモリ(ROM)、電気的消去および書換可能な読出し専用メモリ(EEPROM)、フラッシュ・メモリ、ランダム・アクセス・メモリ(RAM)等の記録媒体に記録して保存や流通等させることが可能であるとともに、例えば、ローカル・エリア・ネットワーク(LAN)、メトロポリタン・エリア・ネットワーク(MAN)、ワイド・エリア・ネットワーク(WAN)、インターネット、イントラネット、エクストラネット等の有線ネットワーク、あるいは無線通信ネットワーク、さらにはこれらの組合せ等の伝送媒体を用いて伝送することが可能であり、また、搬送波に載せて搬送することも可能である。さらに、以上に述べたプログラムは、他のプログラムの一部分であってもよく、あるいは別個のプログラムと共に記録媒体に記録されていてもよい。
【0046】
また、本発明のキャッシュ最適利用演算方法は、プロセッサと、主メモリと、これらの間に設けられたキャッシュメモリとを備えた演算装置を用いて、以上に述べたプログラムを実行することにより、キャッシュラインコンフリクトミスの発生を抑えながらキャッシュメモリを利用して演算処理を行うことを特徴とするものである。
【0047】
さらに、本発明のキャッシュ最適利用演算装置は、プロセッサと、主メモリと、これらの間に設けられたキャッシュメモリとを備え、以上に述べたプログラムが搭載され、このプログラムが実行されることにより、キャッシュラインコンフリクトミスの発生を抑えながらキャッシュメモリが利用されて演算処理が行われる構成とされていることを特徴とするものである。
【0048】
なお、本発明のキャッシュ最適利用演算装置の用途は、例えば、学術計算用、会計処理用、ゲーム用、事務処理用、その他の演算処理用等、任意である。
【0049】
【発明の実施の形態】
以下に本発明の一実施形態を図面に基づいて説明する。図1には、本実施形態のコンパイル装置10およびキャッシュ最適利用演算装置20の全体構成が示されている。また、図2は、コンパイル装置10を機能的に示した構成図である。
【0050】
コンパイル装置10は、ソースプログラム1をコンパイルして目的プログラム2を生成する装置である。キャッシュ最適利用演算装置20は、コンパイル装置10で生成した目的プログラム2、またはこの目的プログラム2をさらにコンパイルして得られたプログラムが、実行可能な状態でプログラム3として搭載されている装置である。これらのコンパイル装置10およびキャッシュ最適利用演算装置20は、説明の便宜上、別の装置として記載されているが、物理的に同じ装置(コンピュータ)を用いて実現されてもよい。
【0051】
図1において、コンパイル装置10は、CPU(中央演算処理装置)11を備えたコンピュータにより構成され、ソースプログラム1をコンパイルして目的プログラム2を生成するための言語処理プログラムであるコンパイラ12を搭載している。
【0052】
キャッシュ最適利用演算装置20は、主記憶共有型マルチプロセッサマシンであり、高速で動作して各種演算処理を行う複数(本実施形態では、一例として4つとする。)のプロセッサ30,31,32,33と、これらのプロセッサ30〜33により共有される状態でアクセスされる主メモリ40と、各プロセッサ30〜33と主メモリ40との間に設けられた複数(本実施形態では、一例として4つとする。)のL2キャッシュ50,51,52,53と、主メモリ40に接続された外部記憶装置60とを備えている。
【0053】
各L2キャッシュ50〜53は、アクセス速度の遅い主メモリ40に比べ、高速アクセスが可能なレベル2のキャッシュメモリであり、比較的小容量のメモリである。
【0054】
外部記憶装置60は、例えばハードディスク等の大容量のメモリであり、キャッシュ最適利用演算装置20で実行されるプログラム3が記憶されている。プログラム3の用途、つまりキャッシュ最適利用演算装置20の用途は、例えば、学術計算用、会計処理用、ゲーム用、事務処理用、その他の演算処理用等、任意である。
【0055】
また、各プロセッサ30,31,32,33は、L1キャッシュ70,71,72,73をそれぞれ有している。これらのL1キャッシュ70〜73は、L2キャッシュ50〜53に比べ、より高速アクセスが可能なキャッシュメモリであるが、メモリ容量はL2キャッシュ50〜53よりもさらに小さい。本実施形態では、キャッシュ最適化の対象として、L2キャッシュ50〜53を選択するものとする。但し、本発明によるキャッシュ最適化の対象は、L2キャッシュ50〜53だけではなく、L1キャッシュ70〜73としてもよい。また、L3キャッシュ、あるいはL4以上のキャッシュがある場合には、それらのキャッシュも本発明による最適化の対象となり得る。
【0056】
なお、図示は省略されているが、コンパイル装置10およびキャッシュ最適利用演算装置20は、それぞれ例えば、マウス、キーボード、トラックボール、ライトペン、トラックパッド、トラックポイント、タブレットおよびスタイラス、ジョイスティック、あるいはこれらの組合せ等の入力手段と、例えば、液晶ディスプレイ、CRTディスプレイ、有機ELディスプレイ、ECLディスプレイ、プロジェクタおよびスクリーン、あるいはこれらの組合せ等の表示手段と、例えば、プリンタ、プロッタ、あるいはこれらの組合せ等の出力手段とを適宜備えている。
【0057】
図2において、コンパイル装置10は、コンパイルに必要な各種処理を行う処理手段13と、この処理手段13による処理で必要となるデータを格納するターゲットループグループテーブル14および対象配列データテーブル15等の各種テーブルとを含んで構成されている。
【0058】
処理手段13は、マクロタスク生成手段13Aと、並列性解析手段13Bと、ターゲットループグループ選択手段13Cと、ターゲットループグループ格納手段13Dと、対象配列データ選択手段13Eと、対象配列データ格納手段13Fと、分割数決定手段13Gと、ループ整合分割手段13Hと、スケジューリング手段13Jと、パディングサイズ決定手段13Kと、データレイアウト変更手段13Lとを含んで構成されている。
【0059】
そして、処理手段13を構成する各手段13A〜13Lは、CPU11およびこのCPU11の動作手順を規定するコンパイラ12により実現される。また、ターゲットループグループテーブル14および対象配列データテーブル15等の各種テーブルは、コンパイル装置10の主メモリ(不図示)に保持され、あるいは必要に応じ、コンパイル装置10に設けられた例えばハードディスク等の外部記憶装置(不図示)に記憶される。
【0060】
マクロタスク生成手段13Aは、ソースプログラム1をブロック単位で分割して複数のマクロタスクを生成する処理を行うものである。
【0061】
並列性解析手段13Bは、各マクロタスクの実行が確定する実行確定条件および各マクロタスクの実行に必要なデータが使用可能状態になるデータアクセス条件からなる最早実行可能条件(最早実行開始条件とも称される。)を解析する処理を行うものである。
【0062】
ここで、あるマクロタスクXの最早実行可能条件は、簡単に表現すると、次のようになる。前者の実行確定条件は、プログラムの流れ(コントロールフロー)を定めるものであり、粗粒度タスク間の並列性を表現するマクロタスクグラフにおいて、マクロタスクXがコントロール依存する条件分岐を含むマクロタスクが、マクロタスクXの実行を確定する方向に分岐するという条件である。後者のデータアクセス条件は、マクロタスクXの前にそのデータを定義あるいは使用する先行タスク(データ依存先行マクロタスク)の実行が終了するか、あるいはデータ依存先行マクロタスクが実行されないことが確定し、マクロタスクXが必要とするデータが使用可能となるという条件である。最早実行可能条件については、前述した非特許文献3のp.145付近に詳述されているので、ここでは詳しい説明は省略する。
【0063】
ターゲットループグループ選択手段13Cは、各マクロタスクとしてソースプログラム1に含まれるデータ依存を有する各ループのうちから、キャッシュメモリ(本実施形態では、L2キャッシュ50〜53)を効果的に利用するためのループ整合分割が可能な複数のループを、キャッシュ最適化用のターゲットループグループ(TLG:Target Loop Group)として選択する処理を行うものである。
【0064】
ターゲットループグループ格納手段13Dは、ターゲットループグループ選択手段13Cにより選択された複数のループを、ターゲットループグループテーブル14に格納する処理を行うものである。
【0065】
対象配列データ選択手段13Eは、ターゲットループグループを構成する複数のループによりそれぞれ使用(アクセス)される各配列データを、キャッシュ最適化用の対象配列データとして選択する処理を行うものである。
【0066】
対象配列データ格納手段13Fは、対象配列データ選択手段13Eにより選択された各対象配列データを、対象配列データテーブル15に格納する処理を行うものである。
【0067】
分割数決定手段13Gは、各対象配列データの合計サイズおよびキャッシュサイズに基づき、ターゲットループグループを構成する複数のループの分割数(複数のループをそれぞれ分割する際の分割数)を決定する処理を行うものである。具体的には、各対象配列データの合計サイズがキャッシュサイズよりも大きい場合には、各対象配列データの合計サイズを分割数で除した値が、キャッシュサイズ以下となるように各ループの分割数を決定する。すなわち、分割数は、各対象配列データの合計サイズをキャッシュサイズで除した値以上とする。なお、各対象配列データの合計サイズがキャッシュサイズと同じか、キャッシュサイズよりも小さい場合には、パディングは行わない。
【0068】
ループ整合分割手段13Hは、分割数決定手段13Gにより決定した分割数に基づき、ターゲットループグループテーブル14に格納されたターゲットループグループを構成する複数のループをそれぞれ分割して各ループについてそれぞれ複数の小ループを生成し、これらの各小ループのうち同一の部分的な対象配列データを使用する小ループ同士を集合させて複数のデータローカライザブルグループ(DLG:Data Localizable Group)を形成する処理を行うものである。なお、ループ整合分割については、前述した非特許文献1に詳述されているので、ここでは詳しい説明は省略する。
【0069】
スケジューリング手段13Jは、各小ループの実行が確定する実行確定条件および各小ループの実行に必要なデータが使用可能状態になるデータアクセス条件からなる最早実行可能条件を満たす範囲内で、同一のデータローカライザブルグループに属する各小ループ同士が、可能な限り連続して実行されるスケジューリング処理を行うものである。
【0070】
また、本実施形態のキャッシュ最適利用演算装置20のような複数のプロセッサを備えた装置で実行されるプログラムをコンパイル対象とする場合には、スケジューリング手段13Jは、次のような処理を行う。すなわち、複数のプロセッサを用いて並列処理を行うためのマルチプロセッサ用のスケジューリングを行う際には、最早実行可能条件を満たす範囲内で、同一のデータローカライザブルグループに属する各小ループ同士が、可能な限り同一のプロセッサ上で連続して実行されるスケジューリング処理を行う。
【0071】
パディングサイズ決定手段13Kは、各データローカライザブルグループに属する各小ループにより使用される部分的な各対象配列データ同士がキャッシュ上で重なりを持たないように、各対象配列データの主メモリ40への格納位置をずらすために挿入するパディング用データのサイズを決定する処理を行うものである。
【0072】
データレイアウト変更手段13Lは、パディングサイズ決定手段13Kにより決定したサイズに相当するパディング用データを、対象配列データテーブル15に格納された対象配列データの内部または対象配列データ間に挿入することにより、パディングを用いたデータレイアウト変更処理を行うものである。
【0073】
ターゲットループグループテーブル14は、ターゲットループグループ選択手段13Cにより選択されたターゲットループグループを格納するものである。
【0074】
対象配列データテーブル15は、対象配列データ選択手段13Eにより選択された各対象配列データを格納するものである。
【0075】
このような本実施形態においては、以下のようにしてコンパイル装置10を用いてコンパイルが行われる。図3には、コンパイル装置10によるコンパイル処理の流れがフローチャートで示されている。
【0076】
先ず、コンパイルの対象となるソースプログラム1を用意する。ここでは、理解を容易にするため、具体的な例として、図4に示すようなプログラム100を用いて説明を行うものとする。また、キャッシュ最適利用演算装置20のL2キャッシュ50〜53の各サイズを4メガバイトとする(図4参照)。さらに、主メモリ40から各L2キャッシュ50〜53へのデータ転送は、ダイレクトマップ方式(アソシアティビティが1)によるものとする。但し、本発明は、ダイレクトマップ方式に限らず、セットアソシアティブ方式(アソシアティビティが2以上)について適用しても有効である。なお、転送ブロック長(キャッシュライン長)については、特に想定はなく、例えば32バイトや64バイト等、任意である。
【0077】
図4において、プログラム100は、Fortran等の高級言語により記述されている。プログラム100には、配列宣言部101と、互いにデータ依存を有する複数(ここでは、2つとする。)のループ102,103とが含まれている。
【0078】
配列宣言部101では、4つの2次元の配列が宣言されている。各配列は、A(1024,1024)、B(1024,1024)、C(1024,1024)、D(1024,1024)であり、各配列の一つの要素は、integer(整数型)で4バイトである。従って、配列Aのサイズは、1024×1024×4=4メガバイトである。他の配列B,C,Dも同様である。また、各配列A,B,C,Dの合計サイズは、16メガバイトである。図4の右側部分には、各4メガバイトの配列A,B,C,Dを、4メガバイトのキャッシュ上に割り当てたときのイメージが示されている。なお、この例では、各配列A,B,C,Dのサイズが全て同じとされているが、本発明は、各配列のサイズが異なっている場合にも、適用することができる。
【0079】
そして、コンパイル装置10の電源を投入し、コンパイラ12(図1参照)を起動して、用意したソースプログラム1についてのコンパイル処理を開始する(図3のステップS1)。
【0080】
次に、マクロタスク生成手段13Aおよび並列性解析手段13B等により、前処理を行う(ステップS2)。この前処理では、ソースコードを中間言語に変換するとともに、変数テーブルを作成する。それから、マクロタスク生成手段13Aにより、コンパイル対象のプログラム100を、ループ、サブルーチン、基本ブロック等のブロック単位で分割し、複数のマクロタスクを生成する。
【0081】
続いて、並列性解析手段13Bにより、マクロタスク生成手段13で生成した各マクロタスクについて、データ依存解析、コントロールフロー解析を行った後、実行確定条件およびデータアクセス条件からなる最早実行可能条件の解析を行い、プログラム100中に含まれるループ、サブルーチン、基本ブロック等の各マクロタスク間の並列性を解析する。
【0082】
それから、ターゲットループグループ選択手段13Cにより、プログラム100中に含まれるデータ依存を伴う各ループのうちから、キャッシュ最適化用にループ分割が可能、すなわち整合分割が可能な複数のループを、キャッシュ最適化用のターゲットループグループ(TLG)として選択する(図3のステップS3)。図4の例では、2つのループ102,103がターゲットループグループ(以下、TLG1という。)として選択されるものとする。
【0083】
そして、ターゲットループグループ選択手段13Cにより選択されたTLG1を構成するループ102,103は、ターゲットループグループ格納手段13Dにより、ターゲットループグループテーブル14に格納される。
【0084】
続いて、対象配列データ選択手段13Eにより、TLG1を構成する複数のループ102,103によりそれぞれ使用(アクセス)される各配列A,B,C,Dを、キャッシュ最適化用の対象配列として選択する(図3のステップS4)。
【0085】
そして、対象配列データ選択手段13Eにより選択された各対象配列A,B,C,Dは、対象配列データ格納手段13Fにより、対象配列データテーブル15に格納される。
【0086】
その後、分割数決定手段13Gにより、各対象配列A,B,C,Dの合計サイズおよびキャッシュサイズに基づき、TLG1を構成する複数のループ102,103の分割数(複数のループ102,103をそれぞれ分割する際の分割数)を決定する(図3のステップS5)。
【0087】
図4の例では、各対象配列A,B,C,Dの合計サイズが16メガバイトであり、キャッシュサイズが4メガバイトであるから、各対象配列データの合計サイズがキャッシュサイズよりも大きい。従って、各対象配列データA,B,C,Dの合計サイズを分割数で除した値が、キャッシュサイズ以下となるように、各ループ102,103の分割数を決定する。すなわち、各対象配列A,B,C,Dの合計サイズをキャッシュサイズで除すると、16メガバイト÷4メガバイト=4となるので、4分割以上とする。ここでは、一例として4分割とする。
【0088】
分割数決定手段13Gにより分割数を決定した後には、図5に示すように、決定した分割数(ここでは、4分割)に基づき、ループ整合分割手段13Hにより、ターゲットループグループテーブル14に格納されたTLG1を構成する複数のループ102,103をそれぞれ分割(ここでは、4分割)し、ループ102について、複数(ここでは、4つ)の小ループ102A,102B,102C,102Dを生成し、ループ103について、複数(ここでは、4つ)の小ループ103A,103B,103C,103Dを生成する(図3のステップS6)。
【0089】
図4の例では、配列Aの各要素A(i,j)、但し、i=1〜1024、j=1〜1024のデータの並び順は、A(1,1)、A(2,1)、A(3,1)、…であるから、第1次元目のiが連続アクセス次元であり、第2次元目のjが非連続アクセス次元となる。他の配列B,C,Dも同様である。また、ループ102,103では、図4に示すように、外側のループがj=1〜1024であるため、この非連続アクセス次元である第2次元目のjについて4分割し、j=1〜256を小ループ102A,103Aとし、j=257〜512を小ループ102B,103Bとし、j=513〜768を小ループ102C,103Cとし、j=769〜1024を小ループ102D,103Dとする。
【0090】
そして、配列A,B,C,Dもこれに合わせてj=1〜256、j=257〜512、j=513〜768、j=769〜1024で4分割し、各配列A,B,C,Dについて、それぞれ4つの部分的な配列を生成する。例えば、配列データA(1:1024,1:1024)については、A(1:1024,1:256)、A(1:1024,257:512)、A(1:1024,513:768)、A(1:1024,769:1024)という4つの部分的な配列データを生成する。他の配列B,C,Dも同様である。
【0091】
ここで、図5に示すように、2つの小ループ102A,103Aは、A(1:1024,1:256)、B(1:1024,1:256)、C(1:1024,1:256)、D(1:1024,1:256)という同じ部分的な配列データにアクセスする。従って、2つの小ループ102A,103Aの集合により、データローカライザブルグループ(以下、DLG10という。)が形成される。同様にして、2つの小ループ102B,103Bの集合により、データローカライザブルグループ(以下、DLG11という。)が形成され、2つの小ループ102C,103Cの集合により、データローカライザブルグループ(以下、DLG12という。)が形成され、2つの小ループ102D,103Dの集合により、データローカライザブルグループ(以下、DLG13という。)が形成される。
【0092】
また、ループ整合分割手段13Hにより、図5に示すようなループ整合分割を行って得られた各小ループ102A,102B,102C,102D,103A,103B,103C,103Dについても、マクロタスクとして扱われる。
【0093】
続いて、ループ整合分割を行った後には、再び、並列性解析手段13Bにより、新たに生成されたマクロタスクである各小ループ102A,102B,102C,102D,103A,103B,103C,103Dを含め、実行確定条件およびデータアクセス条件からなる最早実行可能条件の解析を行い、各小ループ102A,102B,102C,102D,103A,103B,103C,103Dを含めたマクロタスク間の並列性を解析する。
【0094】
それから、スケジューリング手段13Jにより、各小ループの実行が確定する実行確定条件および各小ループの実行に必要なデータが使用可能状態になるデータアクセス条件からなる最早実行可能条件を満たす範囲内で、同一のデータローカライザブルグループに属する各小ループ同士が、可能な限り同一のプロセッサ上で連続して実行されるようにスケジューリングを行う(図3のステップS7)。
【0095】
図4の例では、DLG10に属する102A,103Aを同一プロセッサ上で連続実行し、DLG11に属する102B,103Bを同一プロセッサ上で連続実行し、DLG12に属する102C,103Cを同一プロセッサ上で連続実行し、DLG13に属する102D,103Dを同一プロセッサ上で連続実行するようにスケジューリングを行う。
【0096】
図11には、4つのプロセッサ30〜33に、それぞれ異なるデータローカライザブルグループを割り当てるスケジューリングを行ったときの実行イメージが示されている。図11では、DLG10,DLG11,DLG12,DLG13が、各プロセッサ30〜33で並列処理される。
【0097】
図12には、一つのプロセッサ(ここでは、プロセッサ30とする。)に全てのデータローカライザブルグループを割り当てるスケジューリングを行ったときの実行イメージが示されている。図12では、DLG10,DLG11,DLG12,DLG13の順に処理される。この場合は、シングルプロセッサのマシンの場合と同様である。
【0098】
スケジューリング手段13Jによりスケジューリングを行った後には、パディングサイズ決定手段13により、DLG10,DLG11,DLG12,DLG13に属する各小ループにより使用される部分的な各対象配列データ同士がキャッシュ上で重なりを持たないように、各対象配列データの主メモリ40への格納位置をずらすために挿入するパディング用データのサイズを決定する(図3のステップS8)。
【0099】
図5に示すように、DLG10では、A(1:1024,1:256)、B(1:1024,1:256)、C(1:1024,1:256)、D(1:1024,1:256)という部分的な各配列データにアクセスするので、これらがキャッシュ上で重なりを持たないようにパディング量を決定する。DLG11,DLG12,DLG13についても同様である。
【0100】
図6は、DLG10の実行時に起きるラインコンフリクトおよびこれを回避するためのパディング量の説明図である。図6の右上部分に示すように、パディングを行わないと、DLG10に属する各小ループ102A,103Aによりアクセスされる部分的な各配列データの全てがキャッシュ上の同じ領域に割り当てられるため、キャッシュラインコンフリクトが起こる。
【0101】
そこで、図6の右下部分に示すようなデータレイアウトとすれば、部分的な各配列データは、キャッシュ上の異なる領域に割り当てられ、重なりがなくなるため、ラインコンフリクトが削減される。従って、4メガバイトの一つの配列データ(例えば、A(1:1024,1:1024)等)についてのパディング量は、ループ整合分割により生成された一つの部分的な配列データ(例えば、A(1:1024,1:256)等)と同じサイズであり、1メガバイトである。
【0102】
続いて、データレイアウト変更手段13Lにより、パディングサイズ決定手段13Kで決定したサイズに相当するパディング用データを、対象配列データテーブル15に格納された各対象配列A,B,C,Dの内部または各対象配列A,B,C,D間に挿入することにより、パディングを用いたデータレイアウト変更を行う(図3のステップS9)。
【0103】
図7〜図10には、パディングを行ってDLG10,DLG11,DLG12,DLG13の実行時にラインコンフリクトが回避される状態の説明図が示されている。図7〜図10の右上部分には、各対象配列A,B,C,Dのそれぞれの内部にパディング用データ(図中の斜線部分の領域)を挿入した状態が示されている。各対象配列A,B,C,Dは、非連続アクセス次元である第2次元目のj(図中の数値にアンダーラインが付されている次元)について、それぞれ配列サイズを拡大されている。配列Aについては、A(1:1024,1025:1280)が1メガバイトのパディング用データとして挿入されている。同様にして、配列Bについては、B(1:1024,1025:1280)が、配列Cについては、C(1:1024,1025:1280)が、それぞれ1メガバイトのパディング用データとして挿入されている。なお、最後の配列Dについては、パディング用データは挿入されない。
【0104】
図7の右下部分に示すように、DLG10の実行時には、キャッシュ上への部分的な各配列データの割り当て領域は、図中の点線の矢印で示す如く、キャッシュ先頭から、A(1:1024,1:256)、B(1:1024,1:256)、C(1:1024,1:256)、D(1:1024,1:256)という順になり、重なることはない。従って、ラインコンフリクトが回避されることがわかる。
【0105】
図8の右下部分に示すように、DLG11の実行時には、キャッシュ上への部分的な各配列データの割り当て領域は、図中の点線の矢印で示す如く、キャッシュ先頭から、D(1:1024,257:512)、A(1:1024,257:512)、B(1:1024,257:512)、C(1:1024,257:512)という順になり、重なることはない。従って、ラインコンフリクトが回避されることがわかる。
【0106】
図9の右下部分に示すように、DLG12の実行時には、キャッシュ上への部分的な各配列データの割り当て領域は、図中の点線の矢印で示す如く、キャッシュ先頭から、C(1:1024,513:768)、D(1:1024,513:768)、A(1:1024,513:768)、B(1:1024,513:768)という順になり、重なることはない。従って、ラインコンフリクトが回避されることがわかる。
【0107】
図10の右下部分に示すように、DLG13の実行時には、キャッシュ上への部分的な各配列データの割り当て領域は、図中の点線の矢印で示す如く、キャッシュ先頭から、B(1:1024,769:1024)、C(1:1024,769:1024)、D(1:1024,769:1024)、A(1:1024,769:1024)という順になり、重なることはない。従って、ラインコンフリクトが回避されることがわかる。
【0108】
データレイアウト変更手段13Lによるパディングを用いたデータレイアウト変更が終了すると、目的プログラム2が生成される。この目的プログラム2は、Fortran等の高級言語コードの状態である場合もあり、また、機械語コードで構成された狭義のオブジェクトコードの状態である場合もある。なお、コンパイルして生成された目的プログラム2が、Fortran等の高級言語コードの状態である場合には、さらにコンパイルを行う。この際のコンパイルは、Fortran等の高級言語の翻訳のために用意された通常のコンパイラ(本発明のコンパイラではないもの)により行われ、ハードウェアとしては、本実施形態のコンパイル装置10を実現しているコンピュータで処理してもよく、別のコンピュータで処理してもよい。
【0109】
以上により、コンパイラ12によるコンパイル処理を終了する(図3のステップS10)。なお、以上に述べたコンパイラ12によるコンパイル処理と同様なプログラムコードの作成作業を、人間が手作業で行うことも可能である。
【0110】
その後、図1に示すように、目的プログラム2またはこれをさらにコンパイルして得られたプログラムを、実行可能なプログラム3として、キャッシュ最適利用演算装置20に搭載する。そして、キャッシュ最適利用演算装置20でプログラム3を実行すると、前述した図11または図12で示すような流れで、DLG10,DLG11,DLG12,DLG13を含むプログラムの処理が実行され、キャッシュラインコンフリクトミスの発生を抑えながら、効率的な演算処理が行われる。
【0111】
また、以上においては、図4に示すようなプログラム100を具体例として挙げて説明を行っていたが、以下では、図13に示すようなプログラム200を具体例とする説明を行う。
【0112】
図13において、プログラム200は、Fortran等の高級言語により記述されている。プログラム200は、パラメータ文が記述された定数値設定部201と、配列宣言部202と、互いにデータ依存を有する複数(ここでは、3つとする。)のループ203,204,205とが含まれている。
【0113】
定数値設定部201では、配列宣言部202で宣言される各配列のサイズを指定するための定数N1,N2の値が定められている。ここでは、N1=513、N2=513とされている。
【0114】
配列宣言部202では、13個の2次元の配列が宣言されている。各配列は、U(N1,N2)、V(N1,N2)、T(N1,N2)、E(N1,N2)、F(N1,N2)、G(N1,N2)、H(N1,N2)、K(N1,N2)、N(N1,N2)、P(N1,N2)、Q(N1,N2)、R(N1,N2)、S(N1,N2)であり、各配列の一つの要素は、real(実数型)で4バイトである。従って、配列Uのサイズは、513×513×4=約1メガバイトである。他の配列V,T,E,F,G,H,K,N,P,Q,R,Sも同様である。また、13個の各配列データの合計サイズは、約13メガバイトである。図13の右側部分には、それぞれ約1メガバイトの13個の配列データを、各ループ203,204,205の処理時に4メガバイトのキャッシュ上に割り当てたときのイメージが示されている。なお、この例では、13個の各配列のサイズが全て同じとされているが、本発明は、各配列のサイズが異なっている場合にも、適用することができる。
【0115】
図13の例の場合には、ターゲットループグループ選択手段13Cにより選択されるターゲットループグループは、3つのループ203,204,205により構成されるターゲットループグループ(以下、TLG2という。)であり、このTLG2を構成する各ループ203,204,205が、ターゲットループグループ格納手段13Dによりターゲットループグループテーブル14に格納される。
【0116】
また、対象配列データ選択手段13Eにより選択される対象配列は、13個の配列U,V,T,E,F,G,H,K,N,P,Q,R,Sであり、これらの13個の各配列データが、対象配列データ格納手段13Fにより対象配列データテーブル15に格納される。
【0117】
さらに、分割数決定手段13Gによる分割数の決定は、次のように行われる。13個の各配列の合計サイズをキャッシュサイズで除すると、約13メガバイト÷4メガバイト=約3.25となるので、分割数は4以上となる。ここでは、4分割とする。
【0118】
そして、ループ整合分割手段13Hによるループ整合分割は、次のように行われる。図14〜図17には、図13のプログラム200についてループ整合分割を行った状態が示されている。図14〜図17の左側部分には、ループ整合分割を行って得られた各データローカライザブルグループが示され、右側部分には、各データローカライザブルグループを構成する各小ループによりアクセスされる部分的な各配列データが、キャッシュ上に割り当てられる状態のイメージが示されている。
【0119】
図13のプログラム200に含まれる3つのループ203,204,205は、図14〜図17に示すように、それぞれ4つの小ループに分割され、これらの小ループにより4つのデータローカライザブルグループが形成される。
【0120】
すなわち、図13のループ203(j=1〜512)については、図14〜図17に示すように、小ループ203A(j=1〜128)と、小ループ203B(j=129〜256)と、小ループ203C(j=257〜384)と、小ループ203D(j=385〜512)とに分割される。図13のループ204(j=1〜512)については、図14〜図17に示すように、小ループ204A(j=1〜128)と、小ループ204B(j=129〜256)と、小ループ204C(j=257〜384)と、小ループ204D(j=385〜512)とに分割される。図13のループ205(j=1〜512)については、図14〜図17に示すように、小ループ205A(j=1〜128)と、小ループ205B(j=129〜256)と、小ループ205C(j=257〜384)と、小ループ205D(j=385〜512)とに分割される。
【0121】
また、図14に示すように、3つの小ループ203A,204A,205Aにより、一つのデータローカライザブルグループ(以下、DLG20という。)が形成される。図14の右下部分に示すように、DLG20を構成する各小ループ203A,204A,205Aによりアクセスされる部分的な各配列データ(図中の斜線部分)は、キャッシュ上の同じ領域に割り当てられ、これによりラインコンフリクトが発生することがわかる。
【0122】
図15に示すように、3つの小ループ203B,204B,205Bにより、一つのデータローカライザブルグループ(以下、DLG21という。)が形成される。図15の右下部分に示すように、DLG21を構成する各小ループ203B,204B,205Bによりアクセスされる部分的な各配列データ(図中の斜線部分)は、キャッシュ上の同じ領域に割り当てられ、これによりラインコンフリクトが発生することがわかる。
【0123】
図16に示すように、3つの小ループ203C,204C,205Cにより、一つのデータローカライザブルグループ(以下、DLG22という。)が形成される。図16の右下部分に示すように、DLG22を構成する各小ループ203C,204C,205Cによりアクセスされる部分的な各配列データ(図中の斜線部分)は、キャッシュ上の同じ領域に割り当てられ、これによりラインコンフリクトが発生することがわかる。
【0124】
図17に示すように、3つの小ループ203D,204D,205Dにより、一つのデータローカライザブルグループ(以下、DLG23という。)が形成される。図17の右下部分に示すように、DLG23を構成する各小ループ203D,204D,205Dによりアクセスされる部分的な各配列データ(図中の斜線部分)は、キャッシュ上の同じ領域に割り当てられ、これによりラインコンフリクトが発生することがわかる。
【0125】
そこで、パディングサイズ決定手段13Kによりパディング用データのサイズを決定する。ここでは、4つの配列データの集合(つまり、4つの合計で約4メガバイト)に対し、一つの部分的な配列データ(つまり、約256キロバイト)と同じか若しくは略同じサイズのパディング用データの挿入を行うものとする。
【0126】
図18〜図21には、パディングを行ってDLG20,DLG21,DLG22,DLG23の実行時にラインコンフリクトが回避される状態の説明図が示されている。図18〜図21の右側部分には、データレイアウト変更手段13Lにより配列E,K,Rの各後ろ側にパディング用のダミーデータ(図中の網掛部分の領域)を挿入した状態が示されている。なお、ダミーデータの挿入ではなく、配列E,K,Rのサイズを拡大してパディングを行ってもよい。
【0127】
図18〜図21において、DLG20,DLG21,DLG22,DLG23を構成する各小ループによりアクセスされる部分的な各配列データ(図中の斜線部分の領域)は、図18〜図21の右下部分に示すように、キャッシュ上に重なることなく割り当てられる。従って、ラインコンフリクトが回避されることがわかる。
【0128】
なお、前述した図4のプログラム100をコンパイルした場合には、図11に示す如く、DLG10,DLG11,DLG12,DLG13をそれぞれ異なるプロセッサ30,31,32,33に割り当てて並列処理させ、あるいは図12に示す如く、DLG10,DLG11,DLG12,DLG13をこの順で一つのプロセッサ30等に処理させるスケジューリングを行っていたが、これと同様に、図13のプログラム200をコンパイルした場合にも、DLG20,DLG21,DLG22,DLG23をそれぞれ異なるプロセッサ30,31,32,33に割り当てて並列処理させるスケジューリングを行ってもよく、あるいはDLG20,DLG21,DLG22,DLG23をこの順で一つのプロセッサ30等に処理させるスケジューリングを行ってもよい。
【0129】
また、図18〜図21においては、配列E,K,Rの各後ろ側にパディング用のダミーデータ(図中の網掛部分の領域)を挿入することによりパディングを行っているが、各配列(但し、最後の配列は除いてもよい。)毎に非連続アクセス次元の配列サイズを拡大し、または各配列(但し、最後の配列は除いてもよい。)のそれぞれの後ろ側にダミーデータを挿入することによりパディングを行ってもよい。
【0130】
図22には、各配列毎に非連続アクセス次元の配列サイズを拡大してパディングを行った状態が示されている。図22の左側部分には、パディング前のラインコンフリクトが起きる状態が示され、右側部分は、パディング後のラインコンフリクトの発生が回避される状態が示されている。
【0131】
図22において、パディング前には、プログラム200(図13参照)中の定数値設定部201で、第1次元目の配列サイズがN1=513、第2次元目の配列サイズがN2=513と指定されているが、データレイアウト変更手段13Lにより非連続アクセス次元である第2次元目の配列サイズN2を、513から544に拡大し、パディング後には、N2=544とする。従って、13個の各配列U,V,T,E,F,G,H,K,N,P,Q,R,Sについて、それぞれ(544−513)×513×4=約64キロバイトの配列サイズの拡大が行われる。これを4つの配列分で合計して考えれば、約64キロバイト×4=約256キロバイトとなるので、前述した図18〜図21のような4つの配列の集合に対してパディングを行う場合と比べ、パディング量は同じになる。なお、最後の配列Sについては、配列サイズを拡大しなくてもよい。また、図22の例では、各配列毎に非連続アクセス次元の配列サイズを拡大することによりパディングを行っているが、各配列のそれぞれの後ろ側にダミーデータを挿入することによりパディングを行ってもよい。
【0132】
このような本実施形態によれば、次のような効果がある。すなわち、コンパイル装置10によりコンパイルを行う際には、ソースプログラム1に含まれるデータ依存を有する複数のループを対象としてループ整合分割行った後、同一のデータローカライザブルグループに属する各小ループ同士を可能な限り連続実行するスケジューリングを行うとともに、パディングを用いて各データローカライザブルグループで使用される配列データについてレイアウト変更を行うので、同一のデータローカライザブルグループに属する整合分割後の各小ループにより使用される複数の部分的な配列データを、キャッシュ上に重なることなく割り当てることができる(図7〜図10、図18〜図21、図22の右側部分参照)。このため、キャッシュラインコンフリクトの発生を抑えることができるので、キャッシュ最適利用演算装置20の処理速度を向上させることができる。
【0133】
また、キャッシュ最適利用演算装置20は、主記憶共有型マルチプロセッサマシンであるが、このような複数のプロセッサを備えたマシンで実行されるプログラムをコンパイル装置10によりコンパイルする際には、同一のデータローカライザブルグループに属する各小ループ同士が、可能な限り同一のプロセッサ上で連続して実行されるスケジューリングを行うので、各データローカライザブルグループで行うループ処理を、複数のプロセッサに分散して行わせることができる。例えば、図11に示すように、DLG10,DLG11,DLG12,DLG13の各処理を、それぞれ異なるプロセッサ30,31,32,33に割り当てることができる。このため、DLG10,DLG11,DLG12,DLG13のループ処理の並列性を利用し、キャッシュ最適利用演算装置20の処理速度を、より一層向上させることができる。
【0134】
なお、本発明は前記実施形態に限定されるものではなく、本発明の目的を達成できる範囲内での変形等は本発明に含まれるものである。
【0135】
すなわち、前記実施形態では、キャッシュ最適利用演算装置20は、主記憶共有型マルチプロセッサマシンであったが、本発明は、マルチプロセッサマシンのみならず、シングルプロセッサマシンにも適用することができる。
【0136】
また、前記実施形態では、図3に示すように、スケジューリング処理(ステップS7)が、パディングサイズの決定処理(ステップS8)およびデータレイアウトの変更処理(ステップS9)の前に行われるようになっていたが、これらの処理順序は、逆順としてもよい。
【0137】
さらに、前記実施形態では、L2キャッシュ50〜53(キャッシュサイズは、例えば4メガバイト等)を対象としてキャッシュ最適化を行っていたが、本発明は、L1キャッシュ70〜73を対象とするキャッシュ最適化を行うこともできる。
【0138】
【発明の効果】
以上に述べたように本発明によれば、ソースプログラムに含まれるデータ依存を有する複数のループを対象としてループ整合分割行った後、同一のデータローカライザブルグループに属する各小ループ同士を可能な限り連続実行するスケジューリングを行うとともに、パディングを用いて各データローカライザブルグループで使用される配列データについてレイアウト変更を行うので、同一のデータローカライザブルグループに属する整合分割後の各小ループにより使用される複数の部分的な配列データを、キャッシュ上に重なることなく割り当てることができ、キャッシュラインコンフリクトの発生を抑えて処理速度を向上させることができるという効果がある。
【図面の簡単な説明】
【図1】本発明の一実施形態のコンパイル装置およびキャッシュ最適利用演算装置の全体構成図。
【図2】前記実施形態のコンパイル装置を機能的に示した構成図。
【図3】前記実施形態のコンパイル装置によるコンパイル処理の流れを示すフローチャートの図。
【図4】前記実施形態のコンパイル対象となるプログラム例、およびこのプログラム中に含まれるキャッシュ最適化対象ループで使用される対象配列データをキャッシュ上に割り当てたときのイメージを示す図。
【図5】前記実施形態のコンパイル対象となるプログラム中に含まれるキャッシュ最適化対象ループについてループ整合分割を行ったときの状態を示す図。
【図6】前記実施形態のループ整合分割で得られたデータローカライザブルグループ(DLG10)の実行時に起きるラインコンフリクト、およびこれを回避するためのパディング量の説明図。
【図7】前記実施形態において、パディングを行ってデータローカライザブルグループ(DLG10)の実行時にラインコンフリクトが回避される状態の説明図。
【図8】前記実施形態において、パディングを行ってデータローカライザブルグループ(DLG11)の実行時にラインコンフリクトが回避される状態の説明図。
【図9】前記実施形態において、パディングを行ってデータローカライザブルグループ(DLG12)の実行時にラインコンフリクトが回避される状態の説明図。
【図10】前記実施形態において、パディングを行ってデータローカライザブルグループ(DLG13)の実行時にラインコンフリクトが回避される状態の説明図。
【図11】前記実施形態において、複数のプロセッサにそれぞれ異なるデータローカライザブルグループを割り当てるスケジューリングを行ったときの実行イメージを示す図。
【図12】前記実施形態において、一つのプロセッサに全てのデータローカライザブルグループを割り当てるスケジューリングを行ったときの実行イメージを示す図。
【図13】前記実施形態のコンパイル対象となる別のプログラム例、およびこのプログラム中に含まれるキャッシュ最適化対象ループで使用される対象配列データをキャッシュ上に割り当てたときのイメージを示す図。
【図14】前記実施形態において、ループ整合分割を行って得られたデータローカライザブルグループ(DLG20)、およびこのDLG20を構成する各小ループによりアクセスされる部分的な各配列データが、キャッシュ上に割り当てられる状態のイメージを示す図。
【図15】前記実施形態において、ループ整合分割を行って得られたデータローカライザブルグループ(DLG21)、およびこのDLG21を構成する各小ループによりアクセスされる部分的な各配列データが、キャッシュ上に割り当てられる状態のイメージを示す図。
【図16】前記実施形態において、ループ整合分割を行って得られたデータローカライザブルグループ(DLG22)、およびこのDLG22を構成する各小ループによりアクセスされる部分的な各配列データが、キャッシュ上に割り当てられる状態のイメージを示す図。
【図17】前記実施形態において、ループ整合分割を行って得られたデータローカライザブルグループ(DLG23)、およびこのDLG23を構成する各小ループによりアクセスされる部分的な各配列データが、キャッシュ上に割り当てられる状態のイメージを示す図。
【図18】前記実施形態において、パディングを行ってデータローカライザブルグループ(DLG20)の実行時にラインコンフリクトが回避される状態の説明図。
【図19】前記実施形態において、パディングを行ってデータローカライザブルグループ(DLG21)の実行時にラインコンフリクトが回避される状態の説明図。
【図20】前記実施形態において、パディングを行ってデータローカライザブルグループ(DLG22)の実行時にラインコンフリクトが回避される状態の説明図。
【図21】前記実施形態において、パディングを行ってデータローカライザブルグループ(DLG23)の実行時にラインコンフリクトが回避される状態の説明図。
【図22】前記実施形態において、パディング前のラインコンフリクトが起きる状態、および各配列毎に非連続アクセス次元の配列サイズを拡大してパディングを行うことによりラインコンフリクトの発生が回避される状態を示す図。
【符号の説明】
1 ソースプログラム
2 目的プログラム
3 プログラム
10 コンパイル装置
13A マクロタスク生成手段
13B 並列性解析手段
13C ターゲットループグループ選択手段
13D ターゲットループグループ格納手段
13E 対象配列データ選択手段
13F 対象配列データ格納手段
13G 分割数決定手段
13H ループ整合分割手段
13J スケジューリング手段
13K パディングサイズ決定手段
13L データレイアウト変更手段
14 ターゲットループグループテーブル
15 対象配列データテーブル
20 キャッシュ最適利用演算装置
30〜33 プロセッサ
40 主メモリ
50〜53 キャッシュメモリであるL2キャッシュ
102,103,203,204,205 ループ
102A,102B,102C,102D,103A,103B,103C,103D,203A,203B,203C,203D,204A,204B,204C,204D,205A,205B,205C,205D 小ループ
DLG10,DLG11,DLG12,DLG13,DLG20,DLG21,DLG22,DLG23 データローカライザブルグループ
TLG1,TLG2 ターゲットループグループ
A,B,C,D,E,F,G,H,K,N,P,Q,R,S,T,U,V 配列
[0001]
TECHNICAL FIELD OF THE INVENTION
The present invention relates to a compiling method for compiling a source program to generate a target program, a compiler, and a compiling device, a program code generating method for generating codes constituting the program, programs generated or generated by these, and programs for these. For example, the present invention relates to a method for optimally using cache and an arithmetic device for optimally using cache, which can be used, for example, when performing an arithmetic operation by effectively using a cache memory using a shared-memory multiprocessor machine.
[0002]
[Background Art]
In general, many computers include a fast-running processor, a slow-access main memory, and a relatively fast-access, relatively small-capacity cache memory provided to bridge these speed gaps. . A data transfer unit between the main memory and the cache memory (hereinafter, sometimes simply referred to as cache) is called a block. There are three types of methods for deciding which cache line on the cache to place a block transferred from the main memory, a full associative method, a set associative method, and a direct map method.
[0003]
In the direct map method, each of the blocks transferred from the main memory has a certain fixed cache line (for example, the address of the cache line is often determined by the lower bits of the address of the main memory). Therefore, even if the data is placed on the cache line once, if the data contained in the block mapped to the same cache line is referenced, the data placed on the cache line will be At the time of the next reference, it will not be in the cache. This phenomenon is called a cache line conflict, and a cache miss caused by this is called a cache line conflict miss.
[0004]
Further, in the set associative method, each of the blocks transferred from the main memory is mapped to a predetermined plurality of (n in the case of n-way set associative) cache lines, and becomes empty. If there is no empty cache line, a cache line conflict occurs as in the case of the direct map method.
[0005]
Therefore, in a computer having a direct map type or set associative type cache, depending on the program, cache line conflicts frequently occur, and the processing speed may be significantly reduced.
[0006]
Conventionally, as a method of reducing such cache line conflict miss, for example, intra-variable padding for changing the declared size of a variable, and inter-variable padding for inserting a dummy variable between a plurality of variables (intra-variable padding). A method of changing the data layout such as inter-variable padding has been studied (for example, see Patent Document 1).
[0007]
On the other hand, a data localization method has also been studied for coarse-grained task parallel processing of multi-grain parallel processing for improving the effective performance of a multiprocessor system. The applicant of the present invention applies a data localization method to a cache on an SMP machine and executes a coarse-grained task for sharing data continuously on the same processor, thereby effectively utilizing the cache for data transfer between coarse-grained tasks. (See Non-Patent Documents 1 and 2).
[0008]
In this coarse-grained task parallel processing, the source program is divided hierarchically to generate macrotasks, and after analyzing the control flow and data dependence between macrotasks, the parallelism between macrotasks is extracted. Then, a procedure of analyzing the earliest executable condition of each macro task is taken. The earliest execution condition of a macro task is a condition under which the macro task can be executed at the earliest point (see Non-Patent Document 3).
[0009]
[Patent Document 1]
JP-A-8-212081 (paragraphs [0021] to [0024], [0027], [0028], [0094], FIG. 15)
[Non-patent document 1]
Hironori Kasahara, one other, "A-data-localization compilation scheme using partial-static task assignment for fortran course-grain parallel processing (A data-localization) compilation scheme using partial-static task assignment for Fortran course-grain parallel processing ", Parallel Computing (PARALLEL COMPUTING), (Netherlands), Parallel Computing (PARALLEL COLLING) mputing 24 (1998), p. 579-596
[Non-patent document 2]
Ishizaka, Nakano, Yagi, Obata, Kasahara, "Coarse-grained task parallel processing considering cache optimization on shared memory multiprocessor", Transactions of Information Processing Society of Japan, IPSJ, 2002, Vol. 43, no. 4
[Non-Patent Document 3]
Hironori Kasahara, "Parallel Processing Technology," Corona Publishing, June 20, 1991 (first edition), p. 140-148
[0010]
[Problems to be solved by the invention]
As described above, a conflict miss with respect to a single loop or a loop in which a plurality of loops are conventionally fused (this loop fusion is described in detail in p.125-128 of Non-Patent Document 3 described above). Reduction methods are being studied. These techniques are mainly used for padding to reduce line conflict errors between sequences used in the same iteration, and when data used in the outer iteration is used in the next iteration. Is a padding method to prevent data from being evicted from the cache.
[0011]
However, conventional padding can improve locality within a single loop by reducing conflict errors, but cannot reduce global conflict errors for data accessed between multiple loops. There was a problem.
[0012]
In the conventional data localization method, a cache miss can be reduced by allocating a data set accessed between divided loop sets belonging to the same data localizable group to a cache on the same processor, but a line conflict can be reduced. There was a problem that it could not be performed (see the upper right part of FIG. 6 described later, the right parts of FIGS. 14 to 17 and the left part of FIG. 22).
[0013]
An object of the present invention is to reduce a total cache miss including a line conflict and improve a processing speed, a compiling method, a compiler, a compiling device, a program code creating method, a program, a cache optimal use calculation method, and a cache. It is an object of the present invention to provide an optimal utilization arithmetic unit.
[0014]
[Means for Solving the Problems]
The present invention is a compiling method for compiling a source program to generate a target program, wherein each of the plurality of loops having data dependence included in the source program is divided to generate a plurality of small loops for each loop, Of these small loops, small loops using the same partial array data are aggregated to form a plurality of data localizable groups, and at the time of this division / grouping processing, each data localizer Alignment division is performed so that the total size of the partial array data used by each small loop belonging to each small loop falls within the size of the cache memory for each data localizable group. Execution confirmation condition that execution is decided and data required for execution of each small loop Within the range that satisfies the earliest executable condition consisting of the data access condition that can be used, each small loop belonging to the same data localizable group performs scheduling that is executed as continuously as possible, The data layout using padding is performed on each array data so that each array data partially used by each small loop belonging to the localizable group has no overlap on the cache memory. Is what you do.
[0015]
Here, the term "compile" in the present invention means compilation in a broad sense, which means not only conversion processing from a source program to a narrowly-defined object program composed of machine language code (strictly-defined compilation), but also, for example, Fortran or the like. A conversion process from a source program composed of high-level language codes to a program composed of high-level language codes such as Fortran is also included. Furthermore, the conversion process into a program in a state before being made an executable program by a linker (linkage editor) is also included. The same applies to the following inventions.
[0016]
Further, the "object program" in the present invention includes not only an object program in a narrow sense constituted by machine language codes but also a program constituted by high-level language codes such as Fortran. Further, a program in a state before being made an executable program by the linker is also included. The same applies to the following inventions.
[0017]
Further, "partial array data" refers to a part of one array data, and is generated by dividing a loop using the array data. For example, when the array data is A (1: 1024, 1: 1024), A (1: 1024, 1: 256), A (1: 1024, 257: 512), and the like correspond to partial array data. I do.
[0018]
Then, "perform consistent division so that the total size of each partial array data used by each small loop belonging to each data localizable group falls within the cache memory size for each data localizable group." Means that the total size of a plurality of partial array data used by each of the small loops belonging to the same data localizable group is consistently divided so as to be smaller than the cache size. This means that it is established for each localizable group.
[0019]
In addition, the data layout change using padding is performed on each array data so that the partial array data used by each small loop belonging to each data localizable group do not overlap on the cache memory. `` Do '' means that the cache memory does not have an overlap, but the target is a partial array data unit. This means that array data or a set of a plurality of array data is considered as a unit instead of an array data unit.
[0020]
Further, any of "scheduling" and "data layout change" may be performed first.
[0021]
To "perform scheduling" means to change the arrangement order and arrangement position of each small loop belonging to each data localizable group in the target program to determine the execution order, and to set the scheduling information ( For example, this includes inserting information for providing a jump function such as a GOTO statement, etc.) to determine the execution order.
[0022]
In the compiling method of the present invention, loop matching division is performed for a plurality of data-dependent loops included in a source program, and array data used (accessed) by these loops using padding. Make layout changes. Then, scheduling is performed to execute the small loops belonging to the same data localizable group as continuously as possible.
[0023]
For this reason, as a result of performing the scheduling as described above, a plurality of partial array data used by each of the small loops after the matching division belonging to the same data localizable group must be successively placed in one cache. At this time, since the plurality of partial array data are laid out using padding, they are mapped to different lines in the cache, so that there is no overlap in the cache. For example, when the sequence data is A (1: 1024, 1: 1024) and B (1: 1024, 1: 1024), A (1: 1024, 1: 256) which is a partial sequence data of these data is used. ) And B (1: 1024, 1: 256) are used by each small loop belonging to the same data localizable group, and A (1: 1024, 1: 256) and B (1: 1024, 1: 256) 256) is placed in one cache and is mapped to a different line on the cache (see the right part of FIGS. 7 to 10, 18 to 21, and 22 described later).
[0024]
Therefore, a cache line conflict miss is avoided, and the processing speed of the computer (for any purpose, for example, for academic calculation, accounting, game, office work, other arithmetic processing, etc. is arbitrary). It is possible to improve the above, thereby achieving the above object.
[0025]
Further, in the above-mentioned compiling method, when performing scheduling for a multiprocessor for performing parallel processing using a plurality of processors, each of the groups belonging to the same data localizable group within a range satisfying the earliest executable condition. It is desirable to perform scheduling in which small loops are executed continuously on the same processor as much as possible.
[0026]
Here, the number of processors and the number of divisions of the loop matching division may or may not match.
[0027]
In the case where application to a multi-processor machine is performed in this way, loop processing performed in each data localizable group can be performed in a distributed manner by a plurality of processors. For example, each data localizable group Can be assigned to different processors for each data localizable group, and the processing speed can be further increased by utilizing the parallelism of the loop processing performed in each data localizable group. It can be improved.
[0028]
Further, in the above-mentioned compiling method, the padding may be an area secured by data (so-called dummy data) different from an array used by each small loop belonging to each data localizable group (for example, FIG. 18 described later). 21), or the size of at least one of the arrays used by each small loop belonging to each data localizable group may be increased and secured for the non-contiguous access dimension. Good (for example, in the case of FIGS. 7 to 10 and FIG. 22 described later).
[0029]
Further, among the above, in the latter case of performing padding by expanding the array size for the non-contiguous access dimension, the size of the array used by each small loop belonging to each data localizable group is set for each array. The padding may be performed by expanding the non-contiguous access dimension (for example, in the case of FIGS. 7 to 10 and FIG. 22 described later), or a set of a plurality of arrays is used as one unit instead of each array. The padding may be considered (for example, in FIGS. 18 to 21 described later, the arrays E, K, and R are enlarged instead of inserting dummy data after each of the arrays E, K, and R). Case). However, when padding is performed for each array, it is not always necessary to perform padding for the last array.
[0030]
Note that the “non-contiguous access dimension” is the dimension having the largest access stride at the time of memory storage among the declared dimensions of the array. For example, in the case of Fortran, the dimension declared at the right end is the column major order, That is, if it is A (i, j, k), the declaration size of the dimension of k is enlarged and changed. In other words, the “non-contiguous access dimension” is a dimension in which a state fixed in each iteration continues in a loop process in the case of a multi-dimensional array. This is a dimension that changes in a loop (a loop to be placed outside from the viewpoint of processing efficiency). Specifically, for example, A (1,1), A (2,1), A (3,1),..., A (1,2), A (2,2), A (3,2) , ..., the size of the second dimension is enlarged and changed.
[0031]
Further, a compiler according to the present invention is characterized in that compilation is performed using the compilation method described above.
[0032]
In such a compiler of the present invention, the operation and effect obtained by the above-described compiling method of the present invention can be obtained as it is, thereby achieving the above object.
[0033]
Further, the present invention is a compiler for compiling a source program to generate a target program, wherein the macro task generating means for generating a plurality of macro tasks by dividing the source program into blocks is provided. Parallelism analysis means for analyzing the earliest executable condition consisting of the execution determination condition to be determined and the data access condition that makes the data necessary for the execution of each macro task usable, and the data dependency included in the source program as each macro task Target loop group selecting means for selecting, as a target loop group for cache optimization, a plurality of loops capable of performing loop matching division for effectively using a cache memory from among the loops having Selected by group selection means Target loop group storage means for storing the target loop group in the target loop group table, and a target for selecting each array data used by each of a plurality of loops constituting the target loop group as target array data for cache optimization An array data selection unit, a target array data storage unit that stores each target array data selected by the target array data selection unit in a target array data table, and a total size of each target array data and a size of a cache memory. Division number determining means for determining the number of divisions of the plurality of loops constituting the target loop group, and a plurality of division numbers for constituting the target loop group stored in the target loop group table based on the division number determined by the division number determining means. Le Each of the loops is divided into a plurality of small loops, and each of the small loops using the same partial target sequence data is aggregated to form a plurality of data localizable groups. Within a range that satisfies an earliest executable condition including a loop matching division unit to be formed, an execution determination condition for determining execution of each small loop, and a data access condition for enabling data necessary for execution of each small loop to be usable. Scheduling means for performing scheduling in which small loops belonging to the same data localizable group are executed as continuously as possible, and partial target arrays used by small loops belonging to each data localizable group Each target array data is stored so that the data do not overlap in the cache memory. Padding size determining means for determining the size of padding data to be inserted to shift the storage position of the data in the main memory, and padding data corresponding to the size determined by the padding size determining means are stored in the target array data table. The present invention is characterized by causing a computer to function as data layout changing means for changing a data layout using padding by inserting it into the stored target sequence data or between target sequence data.
[0034]
Here, "based on the total size of each target array data and the size of the cache memory" in the "division number determining means" means that the division is based on a value obtained by dividing the total size of all the target array data by the size of the cache memory. It means determining the number.
[0035]
Further, "inserting inside the target array data or between target array data" means that the size of the target array is expanded for the non-contiguous access dimension, or so-called dummy data is inserted between the target array data.
[0036]
In such a compiler of the present invention, the operation and effect obtained by the above-described compiling method of the present invention can be obtained as it is, thereby achieving the above object.
[0037]
The present invention relates to a compiling apparatus for compiling a source program to generate a target program, the macro task generating means for generating a plurality of macro tasks by dividing the source program into blocks, and executing each macro task. Parallel analysis means for analyzing the earliest executable condition consisting of an execution finalizing condition to be determined and a data access condition in which data necessary for the execution of each macro task become usable, and data included in the source program as each macro task A target loop group selecting unit for selecting, as a target loop group for cache optimization, a plurality of loops capable of performing loop matching division for effectively using the cache memory from among the loops having dependencies; Selected by the loop group selection means A target loop group table for storing the target loop group, and target array data selecting means for selecting each array data used by each of a plurality of loops constituting the target loop group as target array data for cache optimization, A target array data table for storing each target array data selected by the target array data selecting means, and the number of divisions of a plurality of loops constituting a target loop group based on the total size of each target array data and the size of the cache memory A plurality of loops constituting the target loop group stored in the target loop group table based on the number of divisions determined by the number of divisions determined by the number of divisions determining means. small Loop matching dividing means for generating a plurality of data localizable groups by collecting small loops using the same partial target sequence data among these small loops, and forming a plurality of data localizable groups. Each small loop belonging to the same data localizable group within a range that satisfies the earliest executable condition consisting of the execution determination condition that execution is determined and the data access condition that makes data necessary for execution of each small loop available. However, scheduling means for performing scheduling that is executed as continuously as possible and partial target array data used by each small loop belonging to each data localizable group do not overlap each other on the cache memory. The pad inserted to shift the storage location of each target sequence data in the main memory Padding size determining means for determining the size of the padding data, and padding data corresponding to the size determined by the padding size determining means, inside the target array data stored in the target array data table or between the target array data. Data layout changing means for performing a data layout change using padding by insertion.
[0038]
In such a compiling device of the present invention, the operation and effect obtained by the above-described compiling method of the present invention can be obtained as it is, thereby achieving the above object.
[0039]
Further, the present invention is a program code creating method for creating a code constituting a program, wherein a plurality of loops having data dependence to be executed are respectively divided to create a plurality of small loops for each loop, Of these small loops, small loops using the same partial array data are aggregated to form a plurality of data localizable groups, and at the time of this division / grouping work, each data localizer Alignment division is performed so that the total size of the partial array data used by each small loop belonging to each small loop falls within the size of the cache memory for each data localizable group. The execution confirmation condition that the execution is confirmed and the data necessary to execute each small loop are available. The scheduling is performed so that the small loops belonging to the same data localizable group are executed as continuously as possible within a range that satisfies the earliest executable condition consisting of the data access conditions. Each array data is laid out using padding so that partial array data used by each small loop belonging to the group do not overlap on the cache memory.
[0040]
In such a program code creating method of the present invention, the operation and effect obtained by the above-described compiling method of the present invention can be obtained as it is, thereby achieving the above object.
[0041]
Furthermore, in the above-described method of creating a program code, when performing scheduling for a multiprocessor for performing parallel processing using a plurality of processors, the same data localizable group is set within a range satisfying the earliest executable condition. It is desirable to perform scheduling so that the small loops belonging to each other are executed continuously on the same processor as much as possible.
[0042]
In the case where application to a multi-processor machine is performed in this way, loop processing performed in each data localizable group can be performed in a distributed manner by a plurality of processors. For example, each data localizable group Can be assigned to different processors for each data localizable group, and the processing speed can be further increased by utilizing the parallelism of the loop processing performed in each data localizable group. It can be improved.
[0043]
A program according to the present invention is characterized by being generated or created by using the compile method or the program code creating method described above.
[0044]
Furthermore, a program of the present invention is characterized by being generated by the compiler described above.
[0045]
The above-described program or a part thereof is, for example, a magneto-optical disk (MO), a read-only memory (CD-ROM) using a compact disk (CD), a CD recordable (CD-R), a CD rewritable disk. (CD-RW), read-only memory (DVD-ROM) using digital versatile disk (DVD), random access memory (DVD-RAM) using DVD, flexible disk (FD), magnetic tape, It can be recorded on a recording medium such as a hard disk, a read-only memory (ROM), an electrically erasable and rewritable read-only memory (EEPROM), a flash memory, a random access memory (RAM), and stored or distributed. Possible and, for example, local area networks LAN, a metropolitan area network (MAN), a wide area network (WAN), a wired network such as the Internet, an intranet, an extranet, or a wireless communication network, or a transmission medium such as a combination thereof. It is also possible to carry on a carrier wave. Furthermore, the program described above may be a part of another program, or may be recorded on a recording medium together with a separate program.
[0046]
In addition, the method for optimally using cache according to the present invention executes the above-described program by using an arithmetic unit having a processor, a main memory, and a cache memory provided therebetween, and It is characterized in that arithmetic processing is performed using a cache memory while suppressing the occurrence of line conflict miss.
[0047]
Furthermore, the cache optimal use operation device of the present invention includes a processor, a main memory, and a cache memory provided therebetween, and the above-described program is mounted thereon, and by executing this program, It is characterized in that arithmetic processing is performed using a cache memory while suppressing the occurrence of a cache line conflict miss.
[0048]
The application of the cache optimum utilization arithmetic device of the present invention is arbitrary, for example, for academic calculation, accounting, game, office work, and other arithmetic processing.
[0049]
BEST MODE FOR CARRYING OUT THE INVENTION
An embodiment of the present invention will be described below with reference to the drawings. FIG. 1 shows an overall configuration of a compiling device 10 and a cache optimum use arithmetic device 20 of the present embodiment. FIG. 2 is a configuration diagram functionally showing the compiling device 10.
[0050]
The compiling device 10 is a device that compiles the source program 1 and generates the target program 2. The cache optimal use operation device 20 is a device in which the target program 2 generated by the compiling device 10 or a program obtained by further compiling the target program 2 is mounted as a program 3 in an executable state. Although the compiling device 10 and the cache optimal use computing device 20 are described as separate devices for the sake of convenience of description, they may be realized by using physically the same device (computer).
[0051]
In FIG. 1, a compiling device 10 is constituted by a computer having a CPU (Central Processing Unit) 11, and has a compiler 12 which is a language processing program for compiling a source program 1 and generating a target program 2. ing.
[0052]
The cache optimal use arithmetic unit 20 is a shared main memory multiprocessor machine, and operates at high speed to perform various arithmetic processes (in the present embodiment, four processors by way of example). 33, a main memory 40 that is accessed in a shared state by the processors 30 to 33, and a plurality of memory units provided between the processors 30 to 33 and the main memory 40. ) L2 caches 50, 51, 52, and 53, and an external storage device 60 connected to the main memory 40.
[0053]
Each of the L2 caches 50 to 53 is a level 2 cache memory that can be accessed at a higher speed than the main memory 40 that has a slower access speed, and has a relatively small capacity.
[0054]
The external storage device 60 is, for example, a large-capacity memory such as a hard disk, and stores the program 3 executed by the cache optimal use operation device 20. The use of the program 3, that is, the use of the cache optimal use arithmetic device 20 is arbitrary, for example, for academic calculation, accounting, game, office work, and other arithmetic processing.
[0055]
The processors 30, 31, 32, and 33 have L1 caches 70, 71, 72, and 73, respectively. These L1 caches 70 to 73 are cache memories that can be accessed at a higher speed than the L2 caches 50 to 53, but have a smaller memory capacity than the L2 caches 50 to 53. In the present embodiment, it is assumed that the L2 caches 50 to 53 are selected as cache optimization targets. However, the cache optimization target according to the present invention may be not only the L2 caches 50 to 53 but also the L1 caches 70 to 73. If there are L3 caches or L4 or higher caches, those caches can also be targeted for optimization according to the present invention.
[0056]
Although not shown in the drawings, the compiling device 10 and the cache optimal use calculating device 20 may be, for example, a mouse, a keyboard, a trackball, a light pen, a trackpad, a trackpoint, a tablet and a stylus, a joystick, Input means such as a combination, display means such as a liquid crystal display, a CRT display, an organic EL display, an ECL display, a projector and a screen, or a combination thereof, and output means such as a printer, a plotter, or a combination thereof Are provided as appropriate.
[0057]
2, a compiling device 10 includes a processing unit 13 for performing various processes required for compiling, and a target loop group table 14 and a target array data table 15 for storing data necessary for the processing by the processing unit 13. It is configured to include a table.
[0058]
The processing unit 13 includes a macro task generation unit 13A, a parallelism analysis unit 13B, a target loop group selection unit 13C, a target loop group storage unit 13D, a target array data selection unit 13E, and a target array data storage unit 13F. , A division number determining unit 13G, a loop matching dividing unit 13H, a scheduling unit 13J, a padding size determining unit 13K, and a data layout changing unit 13L.
[0059]
Each of the units 13A to 13L constituting the processing unit 13 is realized by the CPU 11 and the compiler 12 that specifies the operation procedure of the CPU 11. Various tables such as the target loop group table 14 and the target sequence data table 15 are held in a main memory (not shown) of the compiling device 10 or, if necessary, provided on an external device such as a hard disk provided in the compiling device 10. It is stored in a storage device (not shown).
[0060]
The macro task generating means 13A performs a process of dividing the source program 1 into blocks to generate a plurality of macro tasks.
[0061]
The parallelism analysis unit 13B is configured to execute the earliest execution condition (also referred to as the earliest execution start condition) including an execution determination condition for determining execution of each macrotask and a data access condition for enabling data necessary for the execution of each macrotask. ) Is analyzed.
[0062]
Here, the earliest executable condition of a certain macro task X is simply expressed as follows. The former execution determination condition defines the flow of a program (control flow). In a macrotask graph expressing parallelism between coarse-grained tasks, a macrotask including a conditional branch in which macrotask X depends on control is defined as: This is a condition for branching in a direction to determine the execution of the macro task X. The latter data access condition determines that the execution of the preceding task (data-dependent preceding macro task) that defines or uses the data before the macro task X ends, or that the data-dependent preceding macro task is not executed, This is a condition that data required by the macro task X can be used. The earliest executable condition is described in p. Since it is described in detail near 145, detailed description is omitted here.
[0063]
The target loop group selecting means 13C is for making effective use of the cache memory (in the present embodiment, the L2 caches 50 to 53) among the loops having data dependence included in the source program 1 as macro tasks. A process of selecting a plurality of loops that can be subjected to loop matching division as a target loop group (TLG: Target Loop Group) for cache optimization is performed.
[0064]
The target loop group storage unit 13D stores the plurality of loops selected by the target loop group selection unit 13C in the target loop group table 14.
[0065]
The target array data selecting means 13E performs a process of selecting each array data used (accessed) by a plurality of loops constituting the target loop group as target array data for cache optimization.
[0066]
The target sequence data storage unit 13F performs a process of storing each target sequence data selected by the target sequence data selection unit 13E in the target sequence data table 15.
[0067]
The number-of-divisions determining unit 13G performs a process of determining the number of divisions of a plurality of loops constituting the target loop group (the number of divisions when each of the plurality of loops is divided) based on the total size and cache size of each target sequence data. Is what you do. Specifically, when the total size of each target array data is larger than the cache size, the number of divisions of each loop is set so that the value obtained by dividing the total size of each target array data by the number of divisions is equal to or smaller than the cache size. To determine. That is, the number of divisions is equal to or larger than a value obtained by dividing the total size of each target array data by the cache size. If the total size of each target array data is equal to or smaller than the cache size, padding is not performed.
[0068]
The loop matching division unit 13H divides a plurality of loops constituting the target loop group stored in the target loop group table 14 based on the number of divisions determined by the number-of-divisions determination unit 13G, and divides each of the plurality of loops into a plurality of small loops. A process of generating loops and collecting small loops using the same partial target sequence data among the small loops to form a plurality of data localizable groups (DLGs); It is. Since the loop matching division is described in detail in Non-Patent Document 1, the detailed description is omitted here.
[0069]
The scheduling means 13J outputs the same data within a range that satisfies the earliest executable condition including the execution determination condition for determining the execution of each small loop and the data access condition for enabling the data necessary for the execution of each small loop to become usable. Each small loop belonging to the localizable group performs a scheduling process that is executed as continuously as possible.
[0070]
When a program to be executed by a device having a plurality of processors, such as the cache optimal use operation device 20 of the present embodiment, is to be compiled, the scheduling means 13J performs the following processing. That is, when performing scheduling for a multiprocessor for performing parallel processing using a plurality of processors, each small loop belonging to the same data localizable group can be set within a range that satisfies the earliest executable condition. A scheduling process executed continuously on the same processor is performed as much as possible.
[0071]
The padding size determining unit 13K stores the target array data in the main memory 40 so that the partial target array data used by each small loop belonging to each data localizable group do not overlap each other on the cache. The processing for determining the size of padding data to be inserted to shift the storage position is performed.
[0072]
The data layout changing unit 13L inserts padding data corresponding to the size determined by the padding size determining unit 13K into the target array data stored in the target array data table 15 or between the target array data, thereby performing padding. The data layout changing process is performed by using.
[0073]
The target loop group table 14 stores the target loop groups selected by the target loop group selection unit 13C.
[0074]
The target sequence data table 15 stores each target sequence data selected by the target sequence data selecting means 13E.
[0075]
In this embodiment, compilation is performed using the compilation device 10 as follows. FIG. 3 is a flowchart illustrating the flow of the compile process performed by the compile device 10.
[0076]
First, a source program 1 to be compiled is prepared. Here, in order to facilitate understanding, description will be made using a program 100 as shown in FIG. 4 as a specific example. In addition, the size of each of the L2 caches 50 to 53 of the cache optimal use arithmetic unit 20 is set to 4 megabytes (see FIG. 4). Further, the data transfer from the main memory 40 to each of the L2 caches 50 to 53 is based on the direct map method (association is 1). However, the present invention is not limited to the direct map method, and is also effective when applied to a set associative method (associability of 2 or more). Note that the transfer block length (cache line length) is not particularly assumed, and is arbitrary, for example, 32 bytes or 64 bytes.
[0077]
In FIG. 4, the program 100 is described in a high-level language such as Fortran. The program 100 includes an array declaration unit 101 and a plurality of (here, two) loops 102 and 103 having data dependency with each other.
[0078]
In the array declaration unit 101, four two-dimensional arrays are declared. Each array is A (1024, 1024), B (1024, 1024), C (1024, 1024), D (1024, 1024), and one element of each array is an integer (integer type) of 4 bytes. It is. Therefore, the size of the array A is 1024 × 1024 × 4 = 4 megabytes. The same applies to the other arrays B, C, and D. The total size of each array A, B, C, D is 16 megabytes. The right part of FIG. 4 shows an image when the 4-megabyte arrays A, B, C, and D are allocated on a 4-megabyte cache. In this example, the sizes of the arrays A, B, C, and D are all the same, but the present invention can be applied to a case where the sizes of the arrays are different.
[0079]
Then, the power of the compiling device 10 is turned on, the compiler 12 (see FIG. 1) is started, and the compiling process for the prepared source program 1 is started (step S1 in FIG. 3).
[0080]
Next, preprocessing is performed by the macro task generating means 13A and the parallelism analyzing means 13B (step S2). In this preprocessing, the source code is converted into an intermediate language, and a variable table is created. Then, the macro task generating means 13A divides the program 100 to be compiled into blocks such as loops, subroutines, and basic blocks to generate a plurality of macro tasks.
[0081]
Subsequently, the parallelism analysis unit 13B performs data dependency analysis and control flow analysis on each macro task generated by the macro task generation unit 13, and then analyzes the earliest executable condition including the execution determination condition and the data access condition. To analyze the parallelism between macro tasks such as loops, subroutines, and basic blocks included in the program 100.
[0082]
Then, the target loop group selecting unit 13C can perform a loop division for the cache optimization among the loops with data dependence included in the program 100, that is, a plurality of loops that can be subjected to the coherent division to the cache optimization. Is selected as a target loop group (TLG) (step S3 in FIG. 3). In the example of FIG. 4, it is assumed that two loops 102 and 103 are selected as a target loop group (hereinafter, referred to as TLG1).
[0083]
Then, the loops 102 and 103 constituting the TLG1 selected by the target loop group selection unit 13C are stored in the target loop group table 14 by the target loop group storage unit 13D.
[0084]
Subsequently, the arrays A, B, C, and D used (accessed) by the plurality of loops 102 and 103 constituting the TLG 1 are selected as target arrays for cache optimization by the target array data selection unit 13E. (Step S4 in FIG. 3).
[0085]
Then, the target arrays A, B, C, and D selected by the target array data selection unit 13E are stored in the target array data table 15 by the target array data storage unit 13F.
[0086]
Then, based on the total size and the cache size of each of the target arrays A, B, C, and D, the number of divisions of the plurality of loops 102 and 103 constituting the TLG 1 (the plurality of loops 102 and 103 The number of divisions at the time of division is determined (step S5 in FIG. 3).
[0087]
In the example of FIG. 4, since the total size of each target array A, B, C, and D is 16 megabytes and the cache size is 4 megabytes, the total size of each target array data is larger than the cache size. Therefore, the number of divisions of each of the loops 102 and 103 is determined so that the value obtained by dividing the total size of each of the target array data A, B, C, and D by the number of divisions is equal to or smaller than the cache size. That is, when the total size of the target arrays A, B, C, and D is divided by the cache size, 16 megabytes / 4 megabytes = 4. Here, it is assumed to be divided into four as an example.
[0088]
After the division number is determined by the division number determining means 13G, as shown in FIG. 5, based on the determined number of divisions (here, four divisions), the data is stored in the target loop group table 14 by the loop matching division means 13H. Each of the plurality of loops 102 and 103 constituting the TLG1 is divided (here, divided into four), and a plurality of (here, four) small loops 102A, 102B, 102C, 102D are generated for the loop 102, and With respect to 103, a plurality (here, four) of small loops 103A, 103B, 103C, and 103D are generated (step S6 in FIG. 3).
[0089]
In the example of FIG. 4, each element A (i, j) of the array A, where i = 1 to 1024 and j = 1 to 1024, is arranged in the order of A (1,1), A (2,1). ), A (3,1),..., The first dimension i is a continuous access dimension, and the second dimension j is a discontinuous access dimension. The same applies to the other arrays B, C, and D. In the loops 102 and 103, as shown in FIG. 4, since the outer loop has j = 1 to 1024, the second dimension j which is the discontinuous access dimension is divided into four, and j = 1 to Let 256 be small loops 102A and 103A, j = 257 to 512 be small loops 102B and 103B, j = 513 to 768 be small loops 102C and 103C, and j = 769 to 1024 be small loops 102D and 103D.
[0090]
Arrays A, B, C, and D are also divided into four according to j = 1 to 256, j = 257 to 512, j = 513 to 768, and j = 769 to 1024, so that each array A, B, C , D, each generate four partial arrays. For example, regarding the sequence data A (1: 1024, 1: 1024), A (1: 1024, 1: 256), A (1: 1024, 257: 512), A (1: 1024, 513: 768), A (1: 1024, 769: 1024) of four partial array data is generated. The same applies to the other arrays B, C, and D.
[0091]
Here, as shown in FIG. 5, the two small loops 102A and 103A are composed of A (1: 1024, 1: 256), B (1: 1024, 1: 256), and C (1: 1024, 1: 256). ) And D (1: 1024, 1: 256). Therefore, a data localizable group (hereinafter, referred to as DLG10) is formed by a set of the two small loops 102A and 103A. Similarly, a set of two small loops 102B and 103B forms a data localizable group (hereinafter referred to as DLG11), and a set of two small loops 102C and 103C forms a data localizable group (hereinafter referred to as DLG12). .) Are formed, and a set of two small loops 102D and 103D forms a data localizable group (hereinafter, referred to as DLG13).
[0092]
Each of the small loops 102A, 102B, 102C, 102D, 103A, 103B, 103C, and 103D obtained by performing the loop matching division as shown in FIG. 5 by the loop matching division unit 13H is also treated as a macro task. .
[0093]
Subsequently, after performing the loop matching division, the parallelism analysis unit 13B again includes the small loops 102A, 102B, 102C, 102D, 103A, 103B, 103C, and 103D, which are newly generated macro tasks. The analysis of the earliest executable condition including the execution determination condition and the data access condition is performed, and the parallelism between the macro tasks including the small loops 102A, 102B, 102C, 102D, 103A, 103B, 103C, and 103D is analyzed.
[0094]
Then, the scheduling unit 13J sets the same execution condition within the range that satisfies the earliest execution condition including the execution determination condition for determining execution of each small loop and the data access condition for making data necessary for execution of each small loop available. Is performed such that the small loops belonging to the data localizable group are continuously executed as much as possible on the same processor (step S7 in FIG. 3).
[0095]
In the example of FIG. 4, 102A and 103A belonging to the DLG 10 are continuously executed on the same processor, 102B and 103B belonging to the DLG 11 are continuously executed on the same processor, and 102C and 103C belonging to the DLG 12 are continuously executed on the same processor. , DLD13, 102D and 103D are continuously executed on the same processor.
[0096]
FIG. 11 shows an execution image when scheduling for allocating different data localizable groups to the four processors 30 to 33 is performed. In FIG. 11, the DLG 10, DLG 11, DLG 12, and DLG 13 are processed in parallel by the processors 30 to 33.
[0097]
FIG. 12 shows an execution image when the scheduling for allocating all the data localizable groups to one processor (here, the processor 30) is performed. In FIG. 12, processing is performed in the order of DLG10, DLG11, DLG12, and DLG13. This case is similar to that of a single processor machine.
[0098]
After scheduling is performed by the scheduling unit 13J, the padding size determination unit 13 causes the partial target array data used by each of the small loops belonging to the DLG10, DLG11, DLG12, and DLG13 to have no overlap in the cache. Thus, the size of the padding data to be inserted to shift the storage position of each target array data in the main memory 40 is determined (step S8 in FIG. 3).
[0099]
As shown in FIG. 5, in the DLG 10, A (1: 1024, 1: 256), B (1: 1024, 1: 256), C (1: 1024, 1: 256), D (1: 1024, 1) : 256), the padding amount is determined so that they do not overlap on the cache. The same applies to DLG11, DLG12, and DLG13.
[0100]
FIG. 6 is an explanatory diagram of a line conflict occurring when the DLG 10 is executed and a padding amount for avoiding the line conflict. As shown in the upper right part of FIG. 6, if no padding is performed, all of the partial array data accessed by the small loops 102A and 103A belonging to the DLG 10 are all allocated to the same area on the cache, so that the cache line Conflicts occur.
[0101]
Therefore, if a data layout as shown in the lower right part of FIG. 6 is used, partial array data is allocated to different areas on the cache, and there is no overlap, so that line conflict is reduced. Therefore, the padding amount for one array data of 4 megabytes (for example, A (1: 1024, 1: 1024), etc.) is determined by one partial array data (for example, A (1 : 1024, 1: 256)) and 1 megabyte.
[0102]
Subsequently, the padding data corresponding to the size determined by the padding size determining unit 13K is stored in the target array A, B, C, or D stored in the target array data table 15 or by the data layout changing unit 13L. The data layout is changed using padding by inserting data between the target arrays A, B, C, and D (step S9 in FIG. 3).
[0103]
FIGS. 7 to 10 are explanatory diagrams illustrating a state in which padding is performed to avoid a line conflict when the DLG 10, DLG 11, DLG 12, or DLG 13 is executed. The upper right part of FIGS. 7 to 10 shows a state in which padding data (the shaded area in the drawing) is inserted into each of the target arrays A, B, C, and D. The size of each of the target arrays A, B, C, and D is enlarged for the second dimension j (the dimension in which the numerical value in the figure is underlined), which is a discontinuous access dimension. For array A, A (1: 1024, 1025: 1280) is inserted as 1 megabyte of padding data. Similarly, for array B, B (1: 1024, 1025: 1280) is inserted for array C, and for array C, C (1: 1024, 1025: 1280) is inserted as 1 Mbytes of padding data. . No padding data is inserted for the last array D.
[0104]
As shown in the lower right part of FIG. 7, when the DLG 10 is executed, the allocation area of the partial array data on the cache is A (1: 1024) from the top of the cache as indicated by the dotted arrow in the figure. , 1: 256), B (1: 1024, 1: 256), C (1: 1024, 1: 256), D (1: 1024, 1: 256), and do not overlap. Therefore, it can be seen that line conflict is avoided.
[0105]
As shown in the lower right part of FIG. 8, when the DLG 11 is executed, a partial allocation area of array data on the cache is D (1: 1024) from the top of the cache as indicated by a dotted arrow in the figure. , 257: 512), A (1: 1024, 257: 512), B (1: 1024, 257: 512), and C (1: 1024, 257: 512), and do not overlap. Therefore, it can be seen that line conflict is avoided.
[0106]
As shown in the lower right part of FIG. 9, when the DLG 12 is executed, an area where partial array data is partially allocated on the cache is, as indicated by a dotted arrow in the figure, C (1: 1024) from the top of the cache. , 513: 768), D (1: 1024, 513: 768), A (1: 1024, 513: 768), and B (1: 1024, 513: 768), and do not overlap. Therefore, it can be seen that line conflict is avoided.
[0107]
As shown in the lower right part of FIG. 10, when the DLG 13 is executed, a partial allocation area of array data on the cache is B (1: 1024) from the head of the cache as indicated by a dotted arrow in the figure. , 769: 1024), C (1: 1024, 769: 1024), D (1: 1024, 769: 1024), and A (1: 1024, 769: 1024), which do not overlap. Therefore, it can be seen that line conflict is avoided.
[0108]
When the data layout change using the padding by the data layout changing means 13L is completed, the target program 2 is generated. The target program 2 may be in the state of a high-level language code such as Fortran, or may be in the state of a narrowly defined object code composed of machine language codes. If the target program 2 generated by compiling is in a state of a high-level language code such as Fortran, further compiling is performed. The compilation at this time is performed by a normal compiler (not the compiler of the present invention) prepared for translating a high-level language such as Fortran, and the hardware implements the compiling device 10 of the present embodiment. The processing may be performed by one computer or another computer.
[0109]
Thus, the compile processing by the compiler 12 is completed (step S10 in FIG. 3). It should be noted that it is also possible for a person to manually create a program code similar to the compile processing by the compiler 12 described above.
[0110]
After that, as shown in FIG. 1, the target program 2 or a program obtained by further compiling the target program 2 is mounted on the cache optimum utilization arithmetic unit 20 as an executable program 3. Then, when the program 3 is executed by the cache optimum use arithmetic unit 20, the processing of the program including the DLG10, DLG11, DLG12, and DLG13 is executed according to the flow shown in FIG. 11 or FIG. Efficient arithmetic processing is performed while suppressing occurrence.
[0111]
Further, in the above description, the program 100 as shown in FIG. 4 has been described as a specific example, but in the following, description will be made using the program 200 as shown in FIG. 13 as a specific example.
[0112]
In FIG. 13, the program 200 is described in a high-level language such as Fortran. The program 200 includes a constant value setting unit 201 in which a parameter statement is described, an array declaration unit 202, and a plurality (here, three) of loops 203, 204, and 205 having data dependency with each other. I have.
[0113]
In the constant value setting unit 201, values of constants N1 and N2 for specifying the size of each array declared by the array declaration unit 202 are determined. Here, N1 = 513 and N2 = 513.
[0114]
In the array declaration section 202, thirteen two-dimensional arrays are declared. Each array has U (N1, N2), V (N1, N2), T (N1, N2), E (N1, N2), F (N1, N2), G (N1, N2), H (N1, N2). N2), K (N1, N2), N (N1, N2), P (N1, N2), Q (N1, N2), R (N1, N2), and S (N1, N2). One element is real (real number type) and is 4 bytes. Therefore, the size of the array U is 513 × 513 × 4 = about 1 megabyte. The same applies to the other arrays V, T, E, F, G, H, K, N, P, Q, R, and S. The total size of each of the 13 pieces of array data is about 13 megabytes. The right part of FIG. 13 shows an image when 13 array data of about 1 megabyte are allocated to a 4 megabyte cache during the processing of each of the loops 203, 204 and 205. Note that, in this example, the size of each of the thirteen arrays is all the same, but the present invention can also be applied to the case where the sizes of the arrays are different.
[0115]
In the case of the example of FIG. 13, the target loop group selected by the target loop group selection unit 13C is a target loop group (hereinafter, referred to as TLG2) including three loops 203, 204, and 205. Each of the loops 203, 204, 205 constituting the TLG2 is stored in the target loop group table 14 by the target loop group storage unit 13D.
[0116]
The target arrays selected by the target array data selecting means 13E are thirteen arrays U, V, T, E, F, G, H, K, N, P, Q, R, and S. Each of the 13 array data is stored in the target array data table 15 by the target array data storage unit 13F.
[0117]
Further, the determination of the number of divisions by the division number determining means 13G is performed as follows. When the total size of each of the 13 arrays is divided by the cache size, about 13 megabytes ÷ 4 megabytes = about 3.25, so the number of divisions is 4 or more. Here, it is divided into four.
[0118]
Then, the loop matching division by the loop matching division unit 13H is performed as follows. FIGS. 14 to 17 show a state where the loop matching division is performed on the program 200 of FIG. The left part of FIGS. 14 to 17 shows each data localizable group obtained by performing the loop matching division, and the right part is a part accessed by each small loop constituting each data localizable group. An image is shown in which each of the typical array data is allocated on the cache.
[0119]
The three loops 203, 204, 205 included in the program 200 of FIG. 13 are each divided into four small loops as shown in FIGS. 14 to 17, and these four small loops form four data localizable groups. Is done.
[0120]
That is, for the loop 203 (j = 1 to 512) in FIG. 13, as shown in FIGS. 14 to 17, a small loop 203A (j = 1 to 128) and a small loop 203B (j = 129 to 256) , A small loop 203C (j = 257 to 384) and a small loop 203D (j = 385 to 512). As for the loop 204 (j = 1 to 512) in FIG. 13, as shown in FIGS. 14 to 17, the small loop 204A (j = 1 to 128), the small loop 204B (j = 129 to 256), It is divided into a loop 204C (j = 257 to 384) and a small loop 204D (j = 385 to 512). Regarding the loop 205 (j = 1 to 512) in FIG. 13, as shown in FIGS. 14 to 17, the small loop 205A (j = 1 to 128), the small loop 205B (j = 129 to 256), The loop is divided into a loop 205C (j = 257 to 384) and a small loop 205D (j = 385 to 512).
[0121]
As shown in FIG. 14, one small data loop localizable group (hereinafter, DLG20) is formed by three small loops 203A, 204A, and 205A. As shown in the lower right part of FIG. 14, partial array data (hatched portions in the figure) accessed by the small loops 203A, 204A, 205A constituting the DLG 20 are allocated to the same area on the cache. It can be seen that this causes a line conflict.
[0122]
As shown in FIG. 15, three small loops 203B, 204B, and 205B form one data localizable group (hereinafter, referred to as DLG21). As shown in the lower right part of FIG. 15, partial array data (shaded portions in the figure) accessed by the small loops 203B, 204B, and 205B constituting the DLG 21 are allocated to the same area on the cache. It can be seen that this causes a line conflict.
[0123]
As shown in FIG. 16, three small loops 203C, 204C, and 205C form one data localizable group (hereinafter, DLG22). As shown in the lower right part of FIG. 16, each partial array data (hatched portion in the figure) accessed by each of the small loops 203C, 204C, 205C constituting the DLG 22 is allocated to the same area on the cache. It can be seen that this causes a line conflict.
[0124]
As shown in FIG. 17, three small loops 203D, 204D, and 205D form one data localizable group (hereinafter, referred to as DLG23). As shown in the lower right part of FIG. 17, each partial array data (hatched portion in the figure) accessed by each of the small loops 203D, 204D, 205D constituting the DLG 23 is allocated to the same area on the cache. It can be seen that this causes a line conflict.
[0125]
Therefore, the size of the padding data is determined by the padding size determination unit 13K. Here, for a set of four array data (that is, about four megabytes in total), insertion of padding data having the same or substantially the same size as one partial array data (that is, about 256 kilobytes) Shall be performed.
[0126]
FIGS. 18 to 21 are explanatory diagrams showing a state in which padding is performed to avoid a line conflict when the DLG 20, DLG 21, DLG 22, or DLG 23 is executed. The right part of FIGS. 18 to 21 shows a state in which padding dummy data (shaded area in the drawing) is inserted behind each of the arrays E, K, and R by the data layout changing unit 13L. I have. Instead of inserting dummy data, padding may be performed by increasing the size of the arrays E, K, and R.
[0127]
18 to 21, partial array data (areas indicated by oblique lines in the drawings) accessed by the small loops constituting DLG20, DLG21, DLG22, and DLG23 are shown in the lower right part of FIGS. Are assigned without overlapping on the cache. Therefore, it can be seen that line conflict is avoided.
[0128]
When the program 100 of FIG. 4 described above is compiled, as shown in FIG. 11, the DLG 10, DLG 11, DLG 12, and DLG 13 are allocated to different processors 30, 31, 32, and 33, respectively, and are processed in parallel. As shown in FIG. 13, the scheduling for processing the DLG 10, DLG 11, DLG 12, and DLG 13 by one processor 30 in this order is performed. Similarly, when the program 200 of FIG. 13 is compiled, the DLG 20, DLG 21 , DLG22, and DLG23 may be assigned to different processors 30, 31, 32, and 33, respectively, or scheduling may be performed such that one processor 30 processes the DLG20, DLG21, DLG22, and DLG23 in this order. Yuringu may be carried out.
[0129]
In FIGS. 18 to 21, padding is performed by inserting padding dummy data (shaded area in the figure) behind each of the arrays E, K, and R. However, the last array may be omitted.) The array size of the non-contiguous access dimension may be increased for each array, or dummy data may be added to the rear of each array (however, the last array may be omitted). Padding may be performed by insertion.
[0130]
FIG. 22 shows a state in which the array size of the discontinuous access dimension is expanded and padding is performed for each array. The left part of FIG. 22 shows a state in which a line conflict occurs before padding, and the right part shows a state in which the occurrence of a line conflict after padding is avoided.
[0131]
In FIG. 22, before padding, the constant size setting unit 201 in the program 200 (see FIG. 13) specifies that the first dimension array size is N1 = 513 and the second dimension array size is N2 = 513. However, the array size N2 of the second dimension, which is a discontinuous access dimension, is increased from 513 to 544 by the data layout changing unit 13L, and N2 is set to 544 after padding. Therefore, for each of the 13 arrays U, V, T, E, F, G, H, K, N, P, Q, R, and S, an array of (544-513) .times.513.times.4 = approximately 64 kilobytes. The size is increased. If this is summed up for the four arrays, it will be about 64 kilobytes x 4 = about 256 kilobytes, which is compared to the case of padding a set of four arrays as shown in Figs. , The padding amount will be the same. The size of the last array S does not need to be increased. In the example of FIG. 22, padding is performed by increasing the array size of the non-contiguous access dimension for each array. However, padding is performed by inserting dummy data behind each array. Is also good.
[0132]
According to this embodiment, the following effects can be obtained. That is, when compiling by the compiling apparatus 10, after performing loop matching division on a plurality of data-dependent loops included in the source program 1, each small loop belonging to the same data localizable group can be connected. In addition to performing scheduling as long as possible and using padding to change the layout of array data used in each data localizable group, it is used by each small loop after matching division belonging to the same data localizable group. A plurality of partial array data can be allocated on the cache without overlapping (see the right part of FIGS. 7 to 10, 18 to 21, and 22). Therefore, the occurrence of a cache line conflict can be suppressed, so that the processing speed of the cache optimal use arithmetic unit 20 can be improved.
[0133]
Further, the cache optimum use arithmetic unit 20 is a multiprocessor machine with a shared main memory, but when compiling a program executed by such a machine having a plurality of processors by the compiling device 10, the same data is used. Since the small loops belonging to the localizable group perform scheduling that is continuously executed on the same processor as much as possible, the loop processing performed in each data localizable group is distributed to a plurality of processors. be able to. For example, as shown in FIG. 11, each process of DLG10, DLG11, DLG12, and DLG13 can be assigned to different processors 30, 31, 32, and 33, respectively. For this reason, the parallel processing of the loop processing of the DLG 10, DLG 11, DLG 12, and DLG 13 can be used to further improve the processing speed of the cache optimal use arithmetic unit 20.
[0134]
It should be noted that the present invention is not limited to the above embodiment, and modifications and the like within a range that can achieve the object of the present invention are included in the present invention.
[0135]
That is, in the above-described embodiment, the cache optimal use operation device 20 is a multiprocessor machine with a shared main storage. However, the present invention can be applied not only to a multiprocessor machine but also to a single processor machine.
[0136]
In the above embodiment, as shown in FIG. 3, the scheduling process (step S7) is performed before the padding size determination process (step S8) and the data layout change process (step S9). However, the order of these processes may be reversed.
[0137]
Further, in the above embodiment, the cache optimization is performed for the L2 caches 50 to 53 (the cache size is, for example, 4 megabytes). However, the present invention provides a cache optimization for the L1 caches 70 to 73. Can also be performed.
[0138]
【The invention's effect】
As described above, according to the present invention, after performing loop matching division on a plurality of loops having data dependence included in a source program, each small loop belonging to the same data localizable group is In addition to performing scheduling for continuous execution, since the layout is changed for the array data used in each data localizable group using padding, a plurality of data used by each small loop after the matching division belonging to the same data localizable group is used. Can be allocated without overlapping on the cache, and the processing speed can be improved by suppressing the occurrence of cache line conflict.
[Brief description of the drawings]
FIG. 1 is an overall configuration diagram of a compiling device and a cache optimal use operation device according to an embodiment of the present invention.
FIG. 2 is a configuration diagram functionally showing the compiling device of the embodiment.
FIG. 3 is an exemplary flowchart showing the flow of a compile process by the compile device of the embodiment.
FIG. 4 is a view showing an example of a program to be compiled in the embodiment and an image when target array data used in a cache optimization target loop included in the program is allocated to a cache;
FIG. 5 is a view showing a state when a loop matching division is performed on a cache optimization target loop included in a program to be compiled in the embodiment.
FIG. 6 is an explanatory diagram of a line conflict occurring at the time of execution of a data localizable group (DLG10) obtained by the loop matching division of the embodiment and a padding amount for avoiding the line conflict.
FIG. 7 is an explanatory diagram of a state in which padding is performed to avoid a line conflict when a data localizable group (DLG10) is executed in the embodiment.
FIG. 8 is an explanatory diagram of a state in which padding is performed to avoid a line conflict when executing a data localizable group (DLG11) in the embodiment.
FIG. 9 is an explanatory diagram of a state in which padding is performed to avoid a line conflict when a data localizable group (DLG12) is executed in the embodiment.
FIG. 10 is an explanatory diagram of a state in which padding is performed to avoid a line conflict when a data localizable group (DLG13) is executed in the embodiment.
FIG. 11 is a diagram showing an execution image when scheduling for allocating different data localizable groups to a plurality of processors is performed in the embodiment.
FIG. 12 is a diagram showing an execution image when scheduling for allocating all data localizable groups to one processor is performed in the embodiment.
FIG. 13 is a view showing another example of a program to be compiled according to the embodiment and an image when target array data used in a cache optimization target loop included in the program is allocated to a cache;
FIG. 14 is a diagram showing a data localizable group (DLG20) obtained by performing loop matching division and partial array data accessed by each small loop constituting the DLG20 in the cache in the embodiment; The figure which shows the image of the state allocated.
FIG. 15 is a diagram showing a data localizable group (DLG21) obtained by performing loop matching division and partial array data accessed by each small loop constituting the DLG21 in the cache in the embodiment. The figure which shows the image of the state allocated.
FIG. 16 is a diagram showing a data localizable group (DLG22) obtained by performing loop matching division and partial array data accessed by each small loop constituting the DLG22 in the cache in the embodiment; The figure which shows the image of the state allocated.
FIG. 17 is a diagram showing a data localizable group (DLG23) obtained by performing loop matching division and partial array data accessed by each small loop constituting the DLG23 in the cache in the embodiment. The figure which shows the image of the state allocated.
FIG. 18 is an explanatory diagram of a state in which padding is performed to prevent a line conflict when executing a data localizable group (DLG20) in the embodiment.
FIG. 19 is an explanatory diagram of a state in which padding is performed to avoid a line conflict when a data localizable group (DLG21) is executed in the embodiment.
FIG. 20 is an explanatory diagram of a state in which padding is performed to avoid a line conflict when executing a data localizable group (DLG22) in the embodiment.
FIG. 21 is an explanatory diagram of a state in which padding is performed to avoid a line conflict when a data localizable group (DLG23) is executed in the embodiment.
FIG. 22 shows a state in which a line conflict occurs before padding and a state in which the occurrence of a line conflict is avoided by performing padding by expanding the array size of the discontinuous access dimension in each array in the embodiment. FIG.
[Explanation of symbols]
1 Source program
2 Purpose program
3 programs
10 Compiling device
13A Macro task generation means
13B Parallelism analysis means
13C Target loop group selection means
13D target loop group storage means
13E Target sequence data selection means
13F Target array data storage means
13G division number determination means
13H Loop matching division means
13J scheduling means
13K padding size determination means
13L data layout changing means
14 Target loop group table
15 Target array data table
20 Cache optimal use arithmetic unit
30-33 processor
40 main memory
50-53 L2 cache which is a cache memory
102, 103, 203, 204, 205 loop
102A, 102B, 102C, 102D, 103A, 103B, 103C, 103D, 203A, 203B, 203C, 203D, 204A, 204B, 204C, 204D, 205A, 205B, 205C, 205D Small loop
DLG10, DLG11, DLG12, DLG13, DLG20, DLG21, DLG22, DLG23 Data Localizable Group
TLG1, TLG2 Target loop group
A, B, C, D, E, F, G, H, K, N, P, Q, R, S, T, U, V arrays

Claims (14)

ソースプログラムをコンパイルして目的プログラムを生成するコンパイル方法であって、
前記ソースプログラムに含まれるデータ依存を有する複数のループをそれぞれ分割して前記各ループについてそれぞれ複数の小ループを生成し、これらの各小ループのうち同一の部分的な配列データを使用する小ループ同士を集合させて複数のデータローカライザブルグループを形成し、かつ、この分割・グループ化処理の際には、前記各データローカライザブルグループに属する前記各小ループによりそれぞれ使用される部分的な各配列データの合計サイズが、前記各データローカライザブルグループ毎にキャッシュメモリのサイズ以下に収まるように整合分割を行い、
その後、前記各小ループの実行が確定する実行確定条件および前記各小ループの実行に必要なデータが使用可能状態になるデータアクセス条件からなる最早実行可能条件を満たす範囲内で、同一の前記データローカライザブルグループに属する前記各小ループ同士が、可能な限り連続して実行されるスケジューリングを行うとともに、
前記各データローカライザブルグループに属する前記各小ループにより使用される部分的な前記各配列データ同士が前記キャッシュメモリ上で重なりを持たないように、前記各配列データに対してパディングを用いたデータレイアウト変更を行う
ことを特徴とするコンパイル方法。
A compiling method for compiling a source program to generate a target program,
A plurality of small loops each having a data dependence included in the source program are divided to generate a plurality of small loops for each of the loops, and a small loop using the same partial array data among these small loops A plurality of data localizable groups are formed by aggregating each other, and in this division / grouping process, partial arrays used by the small loops belonging to the data localizable groups, respectively. Performing consistent division so that the total size of the data falls within the size of the cache memory for each of the data localizable groups,
Thereafter, the same data is set within a range that satisfies the earliest executable condition including the execution determination condition for determining the execution of each of the small loops and the data access condition for enabling data necessary for the execution of each of the small loops. Each of the small loops belonging to the localizable group performs scheduling that is executed as continuously as possible,
A data layout using padding for each of the array data so that the partial array data used by each of the small loops belonging to each of the data localizable groups do not overlap on the cache memory. A compilation method characterized by making a change.
請求項1に記載のコンパイル方法において、
複数のプロセッサを用いて並列処理を行うためのマルチプロセッサ用のスケジューリングを行う際には、
前記最早実行可能条件を満たす範囲内で、同一の前記データローカライザブルグループに属する前記各小ループ同士が、可能な限り同一のプロセッサ上で連続して実行されるスケジューリングを行う
ことを特徴とするコンパイル方法。
2. The compiling method according to claim 1, wherein
When performing scheduling for a multiprocessor to perform parallel processing using a plurality of processors,
Compiling wherein the small loops belonging to the same data localizable group are continuously executed on the same processor as much as possible within a range satisfying the earliest executable condition. Method.
請求項1または2に記載のコンパイル方法において、
前記パディングは、前記各データローカライザブルグループに属する前記各小ループにより使用される配列とは異なるデータにより確保される領域である
ことを特徴とするコンパイル方法。
3. The compiling method according to claim 1, wherein
The compiling method according to claim 1, wherein the padding is an area secured by data different from an array used by each of the small loops belonging to each of the data localizable groups.
請求項1または2に記載のコンパイル方法において、
前記パディングは、前記各データローカライザブルグループに属する前記各小ループにより使用される配列のうちの少なくとも一つの配列のサイズを、非連続アクセス次元について拡大して確保される領域である
ことを特徴とするコンパイル方法。
3. The compiling method according to claim 1, wherein
The padding is an area secured by enlarging the size of at least one array among the arrays used by each of the small loops belonging to each of the data localizable groups in a non-contiguous access dimension. How to compile.
請求項4に記載のコンパイル方法において、
前記パディングは、前記各データローカライザブルグループに属する前記各小ループにより使用される配列のサイズを、各配列毎にそれぞれ非連続アクセス次元について拡大して確保される領域である
ことを特徴とするコンパイル方法。
5. The compiling method according to claim 4, wherein
The compilation is characterized in that the padding is an area in which the size of an array used by each of the small loops belonging to each of the data localizable groups is expanded and secured for a non-contiguous access dimension for each array. Method.
請求項1〜5のいずれかに記載のコンパイル方法を用いてコンパイルを行うことを特徴とするコンパイラ。A compiler that performs compilation using the compilation method according to claim 1. ソースプログラムをコンパイルして目的プログラムを生成するコンパイラであって、
前記ソースプログラムをブロック単位で分割して複数のマクロタスクを生成するマクロタスク生成手段と、
前記各マクロタスクの実行が確定する実行確定条件および前記各マクロタスクの実行に必要なデータが使用可能状態になるデータアクセス条件からなる最早実行可能条件を解析する並列性解析手段と、
前記各マクロタスクとして前記ソースプログラムに含まれるデータ依存を有する各ループのうちから、キャッシュメモリを効果的に利用するためのループ整合分割が可能な複数のループを、キャッシュ最適化用のターゲットループグループとして選択するターゲットループグループ選択手段と、
このターゲットループグループ選択手段により選択された前記ターゲットループグループをターゲットループグループテーブルに格納するターゲットループグループ格納手段と、
前記ターゲットループグループを構成する前記複数のループによりそれぞれ使用される各配列データを、キャッシュ最適化用の対象配列データとして選択する対象配列データ選択手段と、
この対象配列データ選択手段により選択された前記各対象配列データを対象配列データテーブルに格納する対象配列データ格納手段と、
前記各対象配列データの合計サイズおよび前記キャッシュメモリのサイズに基づき、前記ターゲットループグループを構成する前記複数のループの分割数を決定する分割数決定手段と、
この分割数決定手段により決定した前記分割数に基づき、前記ターゲットループグループテーブルに格納された前記ターゲットループグループを構成する前記複数のループをそれぞれ分割して前記各ループについてそれぞれ複数の小ループを生成し、これらの各小ループのうち同一の部分的な前記対象配列データを使用する小ループ同士を集合させて複数のデータローカライザブルグループを形成するループ整合分割手段と、
前記各小ループの実行が確定する実行確定条件および前記各小ループの実行に必要なデータが使用可能状態になるデータアクセス条件からなる最早実行可能条件を満たす範囲内で、同一の前記データローカライザブルグループに属する前記各小ループ同士が、可能な限り連続して実行されるスケジューリングを行うスケジューリング手段と、
前記各データローカライザブルグループに属する前記各小ループにより使用される部分的な前記各対象配列データ同士が前記キャッシュメモリ上で重なりを持たないように、前記各対象配列データの主メモリへの格納位置をずらすために挿入するパディング用データのサイズを決定するパディングサイズ決定手段と、
このパディングサイズ決定手段により決定した前記サイズに相当するパディング用データを、前記対象配列データテーブルに格納された前記対象配列データの内部または前記対象配列データ間に挿入することによりパディングを用いたデータレイアウト変更を行うデータレイアウト変更手段として、
コンピュータを機能させることを特徴とするコンパイラ。
A compiler that compiles a source program to generate a target program,
Macrotask generating means for generating a plurality of macrotasks by dividing the source program into blocks;
Parallelism analysis means for analyzing an execution determination condition for determining execution of each macrotask and an earliest execution condition including a data access condition for enabling data necessary for execution of each macrotask to be usable;
From among the loops having data dependence included in the source program as the respective macro tasks, a plurality of loops that can be subjected to loop matching division for effectively using a cache memory are set as target loop groups for cache optimization. Target loop group selecting means to select as
Target loop group storage means for storing the target loop group selected by the target loop group selection means in a target loop group table;
Target array data selecting means for selecting each array data used by each of the plurality of loops constituting the target loop group as target array data for cache optimization,
Target sequence data storage means for storing the target sequence data selected by the target sequence data selection means in a target sequence data table;
Division number determining means for determining a division number of the plurality of loops constituting the target loop group based on a total size of the respective target array data and a size of the cache memory;
On the basis of the division number determined by the division number determination means, the plurality of loops constituting the target loop group stored in the target loop group table are respectively divided to generate a plurality of small loops for each of the loops And a loop matching division unit that aggregates small loops using the same partial target sequence data among these small loops to form a plurality of data localizable groups,
The same data localizable as long as it satisfies the earliest executable condition including an execution determination condition for determining execution of each of the small loops and a data access condition for enabling data necessary for the execution of each of the small loops. A scheduling means for performing scheduling in which the small loops belonging to a group are executed as continuously as possible;
The storage position of each of the target array data in the main memory so that the partial target array data used by each of the small loops belonging to each of the data localizable groups do not overlap on the cache memory. Padding size determining means for determining the size of padding data to be inserted to shift
A data layout using padding by inserting padding data corresponding to the size determined by the padding size determining means inside the target array data stored in the target array data table or between the target array data. As a data layout change means for making changes,
A compiler that causes a computer to function.
ソースプログラムをコンパイルして目的プログラムを生成するコンパイル装置であって、
前記ソースプログラムをブロック単位で分割して複数のマクロタスクを生成するマクロタスク生成手段と、
前記各マクロタスクの実行が確定する実行確定条件および前記各マクロタスクの実行に必要なデータが使用可能状態になるデータアクセス条件からなる最早実行可能条件を解析する並列性解析手段と、
前記各マクロタスクとして前記ソースプログラムに含まれるデータ依存を有する各ループのうちから、キャッシュメモリを効果的に利用するためのループ整合分割が可能な複数のループを、キャッシュ最適化用のターゲットループグループとして選択するターゲットループグループ選択手段と、
このターゲットループグループ選択手段により選択された前記ターゲットループグループを格納するターゲットループグループテーブルと、
前記ターゲットループグループを構成する前記複数のループによりそれぞれ使用される各配列データを、キャッシュ最適化用の対象配列データとして選択する対象配列データ選択手段と、
この対象配列データ選択手段により選択された前記各対象配列データを格納する対象配列データテーブルと、
前記各対象配列データの合計サイズおよび前記キャッシュメモリのサイズに基づき、前記ターゲットループグループを構成する前記複数のループの分割数を決定する分割数決定手段と、
この分割数決定手段により決定した前記分割数に基づき、前記ターゲットループグループテーブルに格納された前記ターゲットループグループを構成する前記複数のループをそれぞれ分割して前記各ループについてそれぞれ複数の小ループを生成し、これらの各小ループのうち同一の部分的な前記対象配列データを使用する小ループ同士を集合させて複数のデータローカライザブルグループを形成するループ整合分割手段と、
前記各小ループの実行が確定する実行確定条件および前記各小ループの実行に必要なデータが使用可能状態になるデータアクセス条件からなる最早実行可能条件を満たす範囲内で、同一の前記データローカライザブルグループに属する前記各小ループ同士が、可能な限り連続して実行されるスケジューリングを行うスケジューリング手段と、
前記各データローカライザブルグループに属する前記各小ループにより使用される部分的な前記各対象配列データ同士が前記キャッシュメモリ上で重なりを持たないように、前記各対象配列データの主メモリへの格納位置をずらすために挿入するパディング用データのサイズを決定するパディングサイズ決定手段と、
このパディングサイズ決定手段により決定した前記サイズに相当するパディング用データを、前記対象配列データテーブルに格納された前記対象配列データの内部または前記対象配列データ間に挿入することによりパディングを用いたデータレイアウト変更を行うデータレイアウト変更手段と
を備えたことを特徴とするコンパイル装置。
A compiling device for compiling a source program to generate a target program,
Macrotask generating means for generating a plurality of macrotasks by dividing the source program into blocks;
Parallelism analysis means for analyzing an execution determination condition for determining execution of each macrotask and an earliest execution condition including a data access condition for enabling data necessary for execution of each macrotask to be usable;
From among the loops having data dependence included in the source program as the respective macro tasks, a plurality of loops that can be subjected to loop matching division for effectively using a cache memory are set as target loop groups for cache optimization. Target loop group selecting means to select as
A target loop group table storing the target loop group selected by the target loop group selection means,
Target array data selecting means for selecting each array data used by each of the plurality of loops constituting the target loop group as target array data for cache optimization,
A target sequence data table storing the target sequence data selected by the target sequence data selecting means,
Division number determining means for determining a division number of the plurality of loops constituting the target loop group based on a total size of the respective target array data and a size of the cache memory;
On the basis of the division number determined by the division number determination means, the plurality of loops constituting the target loop group stored in the target loop group table are respectively divided to generate a plurality of small loops for each of the loops And a loop matching division unit that aggregates small loops using the same partial target sequence data among these small loops to form a plurality of data localizable groups,
The same data localizable as long as it satisfies the earliest executable condition including an execution determination condition for determining execution of each of the small loops and a data access condition for enabling data necessary for the execution of each of the small loops. A scheduling means for performing scheduling in which the small loops belonging to a group are executed as continuously as possible;
The storage position of each of the target array data in the main memory so that the partial target array data used by each of the small loops belonging to each of the data localizable groups do not overlap on the cache memory. Padding size determining means for determining the size of padding data to be inserted to shift
A data layout using padding by inserting padding data corresponding to the size determined by the padding size determining means into the target array data stored in the target array data table or between the target array data. A compiling device comprising: a data layout changing means for performing a change.
プログラムを構成するコードを作成するプログラムコード作成方法であって、
実行対象とするデータ依存を有する複数のループをそれぞれ分割して前記各ループについてそれぞれ複数の小ループを作成し、これらの各小ループのうち同一の部分的な配列データを使用する小ループ同士を集合させて複数のデータローカライザブルグループを形成し、かつ、この分割・グループ化作業の際には、前記各データローカライザブルグループに属する前記各小ループによりそれぞれ使用される部分的な各配列データの合計サイズが、前記各データローカライザブルグループ毎にキャッシュメモリのサイズ以下に収まるように整合分割を行い、
その後、前記各小ループの実行が確定する実行確定条件および前記各小ループの実行に必要なデータが使用可能状態になるデータアクセス条件からなる最早実行可能条件を満たす範囲内で、同一の前記データローカライザブルグループに属する前記各小ループ同士が、可能な限り連続して実行されるようにスケジューリングを行うとともに、
前記各データローカライザブルグループに属する前記各小ループにより使用される部分的な前記各配列データ同士が前記キャッシュメモリ上で重なりを持たないように、前記各配列データをパディングを用いてレイアウトする
ことを特徴とするプログラムコード作成方法。
A program code creating method for creating code constituting a program,
A plurality of loops each having a data dependency to be executed are divided, and a plurality of small loops are created for each of the loops. Of these small loops, small loops using the same partial array data are separated from each other. Collectively form a plurality of data localizable groups, and at the time of this division / grouping work, partial array data of partial array data respectively used by the small loops belonging to the data localizable groups. Performing consistent division so that the total size falls within the size of the cache memory for each of the data localizable groups,
Thereafter, the same data is satisfied within a range that satisfies the earliest executable condition including the execution determination condition for determining the execution of each of the small loops and the data access condition in which data necessary for the execution of each of the small loops becomes available. Each of the small loops belonging to the localizable group performs scheduling so as to be executed as continuously as possible,
Laying out each of the array data using padding so that the partial array data used by each of the small loops belonging to each of the data localizable groups do not overlap on the cache memory. Characteristic program code creation method.
請求項9に記載のプログラムコード作成方法において、
複数のプロセッサを用いて並列処理を行うためのマルチプロセッサ用のスケジューリングを行う際には、
前記最早実行可能条件を満たす範囲内で、同一の前記データローカライザブルグループに属する前記各小ループ同士が、可能な限り同一のプロセッサ上で連続して実行されるようにスケジューリングを行う
ことを特徴とするプログラムコード作成方法。
10. The method according to claim 9, wherein:
When performing scheduling for a multiprocessor to perform parallel processing using a plurality of processors,
Within the range that satisfies the earliest executable condition, scheduling is performed such that the small loops belonging to the same data localizable group are continuously executed on the same processor as much as possible. How to create program code.
請求項1〜5のいずれかに記載のコンパイル方法または請求項9,10のいずれかに記載のプログラムコード作成方法を用いて生成または作成されたことを特徴とするプログラム。A program created or created by using the compiling method according to any one of claims 1 to 5 or the program code creating method according to any one of claims 9 and 10. 請求項6または7に記載のコンパイラにより生成されたことを特徴とするプログラム。A program generated by the compiler according to claim 6. プロセッサと、主メモリと、これらの間に設けられたキャッシュメモリとを備えた演算装置を用いて、
請求項11または12に記載のプログラムを実行することにより、キャッシュラインコンフリクトミスの発生を抑えながら前記キャッシュメモリを利用して演算処理を行う
ことを特徴とするキャッシュ最適利用演算方法。
Using an arithmetic unit including a processor, a main memory, and a cache memory provided therebetween,
13. A method for optimally using a cache, wherein the program according to claim 11 or 12 is executed to perform arithmetic processing using the cache memory while suppressing occurrence of a cache line conflict miss.
プロセッサと、主メモリと、これらの間に設けられたキャッシュメモリとを備え、
請求項11または12に記載のプログラムが搭載され、このプログラムが実行されることにより、キャッシュラインコンフリクトミスの発生を抑えながら前記キャッシュメモリが利用されて演算処理が行われる構成とされている
ことを特徴とするキャッシュ最適利用演算装置。
A processor, a main memory, and a cache memory provided therebetween;
The program according to claim 11 or 12, wherein the program is executed to execute arithmetic processing using the cache memory while suppressing occurrence of a cache line conflict miss. Characteristic cache optimal use arithmetic unit.
JP2003042628A 2003-02-20 2003-02-20 Compiling method, compiler, and compiling device Expired - Lifetime JP4177681B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2003042628A JP4177681B2 (en) 2003-02-20 2003-02-20 Compiling method, compiler, and compiling device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2003042628A JP4177681B2 (en) 2003-02-20 2003-02-20 Compiling method, compiler, and compiling device

Publications (2)

Publication Number Publication Date
JP2004252728A true JP2004252728A (en) 2004-09-09
JP4177681B2 JP4177681B2 (en) 2008-11-05

Family

ID=33025857

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2003042628A Expired - Lifetime JP4177681B2 (en) 2003-02-20 2003-02-20 Compiling method, compiler, and compiling device

Country Status (1)

Country Link
JP (1) JP4177681B2 (en)

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7895453B2 (en) 2005-04-12 2011-02-22 Waseda University Multiprocessor system and multigrain parallelizing compiler
US8051412B2 (en) 2006-06-06 2011-11-01 Waseda University Global compiler for controlling heterogeneous multiprocessor
US8250548B2 (en) 2006-06-06 2012-08-21 Waseda University Method for controlling heterogeneous multiprocessor and multigrain parallelizing compiler
JP2012242855A (en) * 2011-05-13 2012-12-10 Canon Inc Data processing apparatus and data processing method
US8745339B2 (en) 2011-01-27 2014-06-03 Samsung Electronics Co., Ltd. Multi-core system and method for processing data in parallel in multi-core system
WO2014170036A1 (en) * 2013-04-18 2014-10-23 Siemens Aktiengesellschaft Method and apparatus for exploiting data locality in dynamic task scheduling
US9262209B2 (en) 2010-08-10 2016-02-16 Fujitsu Limited Scheduler, multi-core processor system, and scheduling method
EP3035196A2 (en) 2014-12-16 2016-06-22 Fujitsu Limited Data processing method, information processing device, and data processing program
US9934012B2 (en) 2015-03-31 2018-04-03 Denso Corporation Parallelization compiling method, parallelization compiler, and vehicular device
US10228923B2 (en) 2015-03-31 2019-03-12 Denso Corporation Parallelization compiling method, parallelization compiler, and vehicular device
JP2021018711A (en) * 2019-07-23 2021-02-15 富士通株式会社 Task execution management device, task execution management method, and task execution management program

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP6018022B2 (en) 2013-06-14 2016-11-02 株式会社デンソー Parallel compilation method, parallel compiler, parallel compilation device, and in-vehicle device
JP6488739B2 (en) 2015-02-05 2019-03-27 株式会社デンソー Parallelizing compilation method and parallelizing compiler
EP3343351B1 (en) 2016-12-28 2023-04-26 Waseda University Parallel program generating method and parallelization compiling apparatus

Cited By (18)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP2620840A1 (en) 2005-04-12 2013-07-31 Waseda University Multiprocessor system
EP2657839A2 (en) 2005-04-12 2013-10-30 Waseda University Multiprocessor system and multigrain parallelizing compiler
US8812880B2 (en) 2005-04-12 2014-08-19 Waseda University Multiprocessor system and multigrain parallelizing compiler
US7895453B2 (en) 2005-04-12 2011-02-22 Waseda University Multiprocessor system and multigrain parallelizing compiler
US8051412B2 (en) 2006-06-06 2011-11-01 Waseda University Global compiler for controlling heterogeneous multiprocessor
US8250548B2 (en) 2006-06-06 2012-08-21 Waseda University Method for controlling heterogeneous multiprocessor and multigrain parallelizing compiler
US9262209B2 (en) 2010-08-10 2016-02-16 Fujitsu Limited Scheduler, multi-core processor system, and scheduling method
US8745339B2 (en) 2011-01-27 2014-06-03 Samsung Electronics Co., Ltd. Multi-core system and method for processing data in parallel in multi-core system
US9256439B2 (en) 2011-05-13 2016-02-09 Canon Kabushiki Kaisha Parallel processing of two-dimensional data, storage of plural data of the processing results in a cache line and transfer of the data to a memory as in the cache line
JP2012242855A (en) * 2011-05-13 2012-12-10 Canon Inc Data processing apparatus and data processing method
WO2014170036A1 (en) * 2013-04-18 2014-10-23 Siemens Aktiengesellschaft Method and apparatus for exploiting data locality in dynamic task scheduling
US9176716B2 (en) 2013-04-18 2015-11-03 Siemens Aktiengesellschaft Method and apparatus for exploiting data locality in dynamic task scheduling
EP3035196A2 (en) 2014-12-16 2016-06-22 Fujitsu Limited Data processing method, information processing device, and data processing program
US9864693B2 (en) 2014-12-16 2018-01-09 Fujitsu Limited Data processing method, information processing device, and recording medium
US9934012B2 (en) 2015-03-31 2018-04-03 Denso Corporation Parallelization compiling method, parallelization compiler, and vehicular device
US10228923B2 (en) 2015-03-31 2019-03-12 Denso Corporation Parallelization compiling method, parallelization compiler, and vehicular device
JP2021018711A (en) * 2019-07-23 2021-02-15 富士通株式会社 Task execution management device, task execution management method, and task execution management program
JP7367365B2 (en) 2019-07-23 2023-10-24 富士通株式会社 Task execution management device, task execution management method, and task execution management program

Also Published As

Publication number Publication date
JP4177681B2 (en) 2008-11-05

Similar Documents

Publication Publication Date Title
Rotem et al. Glow: Graph lowering compiler techniques for neural networks
US9798528B2 (en) Software solution for cooperative memory-side and processor-side data prefetching
JP5224498B2 (en) MEMORY MANAGEMENT METHOD, INFORMATION PROCESSING DEVICE, PROGRAM CREATION METHOD, AND PROGRAM
Unat et al. Mint: realizing CUDA performance in 3D stencil methods with annotated C
JP7220914B2 (en) Computer-implemented methods, computer-readable media and heterogeneous computing systems
JP4177681B2 (en) Compiling method, compiler, and compiling device
Henriksen et al. Incremental flattening for nested data parallelism
US20090064112A1 (en) Technique for allocating register to variable for compiling
US11226798B2 (en) Information processing device and information processing method
Sioutas et al. Loop transformations leveraging hardware prefetching
US6324629B1 (en) Method for determining an optimized data organization
Madsen et al. Towards a streaming model for nested data parallelism
Shin et al. Exploiting superword-level locality in multimedia extension architectures
Popov et al. Piecewise holistic autotuning of compiler and runtime parameters
Hepp et al. Splitting functions into single-entry regions
Sakdhnagool et al. RegDem: Increasing GPU performance via shared memory register spilling
Sharma et al. Data layout optimization for portable performance
Wolf et al. Associative caches in formal software timing analysis
Schuler et al. XEngine: Optimal tensor rematerialization for neural networks in heterogeneous environments
Tian et al. Optimizing gpu register usage: Extensions to openacc and compiler optimizations
JP6442967B2 (en) Information processing program, information processing apparatus, and information processing method
Kim et al. WCET-aware function-level dynamic code management on scratchpad memory
JP3638171B2 (en) Resource allocation device
Papadimitriou et al. Automatically exploiting the memory hierarchy of gpus through just-in-time compilation
JP2022140995A (en) Information processing device, compile program, and compile method

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20051125

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20080410

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20080603

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20080717

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

A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20080822

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

Free format text: PAYMENT UNTIL: 20110829

Year of fee payment: 3

R150 Certificate of patent or registration of utility model

Ref document number: 4177681

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

Free format text: JAPANESE INTERMEDIATE CODE: R150

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

Free format text: PAYMENT UNTIL: 20140829

Year of fee payment: 6

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

S201 Request for registration of exclusive licence

Free format text: JAPANESE INTERMEDIATE CODE: R314201

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

S804 Written request for registration of cancellation of exclusive licence

Free format text: JAPANESE INTERMEDIATE CODE: R314803

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

EXPY Cancellation because of completion of term