JP6665720B2 - 情報処理装置、コンパイルプログラム、コンパイル方法、およびキャッシュ制御方法 - Google Patents
情報処理装置、コンパイルプログラム、コンパイル方法、およびキャッシュ制御方法 Download PDFInfo
- Publication number
- JP6665720B2 JP6665720B2 JP2016139830A JP2016139830A JP6665720B2 JP 6665720 B2 JP6665720 B2 JP 6665720B2 JP 2016139830 A JP2016139830 A JP 2016139830A JP 2016139830 A JP2016139830 A JP 2016139830A JP 6665720 B2 JP6665720 B2 JP 6665720B2
- Authority
- JP
- Japan
- Prior art keywords
- loop
- data
- area
- sector
- array
- 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.)
- Active
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/40—Transformation of program code
- G06F8/41—Compilation
- G06F8/45—Exploiting coarse grain parallelism in compilation, i.e. parallelism between groups of instructions
- G06F8/451—Code distribution
- G06F8/452—Loops
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F12/00—Accessing, addressing or allocating within memory systems or architectures
- G06F12/02—Addressing or allocation; Relocation
- G06F12/08—Addressing or allocation; Relocation in hierarchically structured memory systems, e.g. virtual memory systems
- G06F12/0802—Addressing of a memory level in which the access to the desired data or data block requires associative addressing means, e.g. caches
- G06F12/0862—Addressing of a memory level in which the access to the desired data or data block requires associative addressing means, e.g. caches with prefetch
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F12/00—Accessing, addressing or allocating within memory systems or architectures
- G06F12/02—Addressing or allocation; Relocation
- G06F12/08—Addressing or allocation; Relocation in hierarchically structured memory systems, e.g. virtual memory systems
- G06F12/0802—Addressing of a memory level in which the access to the desired data or data block requires associative addressing means, e.g. caches
- G06F12/0875—Addressing of a memory level in which the access to the desired data or data block requires associative addressing means, e.g. caches with dedicated cache, e.g. instruction or stack
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/40—Transformation of program code
- G06F8/41—Compilation
- G06F8/44—Encoding
- G06F8/443—Optimisation
- G06F8/4441—Reducing the execution time required by the program code
- G06F8/4442—Reducing the number of cache misses; Data prefetching
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/30—Arrangements for executing machine instructions, e.g. instruction decode
- G06F9/30003—Arrangements for executing specific machine instructions
- G06F9/3004—Arrangements for executing specific machine instructions to perform operations on memory
- G06F9/30047—Prefetch instructions; cache control instructions
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/30—Arrangements for executing machine instructions, e.g. instruction decode
- G06F9/30003—Arrangements for executing specific machine instructions
- G06F9/3005—Arrangements for executing specific machine instructions to perform operations for flow control
- G06F9/30065—Loop control instructions; iterative instructions, e.g. LOOP, REPEAT
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/30—Arrangements for executing machine instructions, e.g. instruction decode
- G06F9/38—Concurrent instruction execution, e.g. pipeline or look ahead
- G06F9/3802—Instruction prefetching
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/30—Arrangements for executing machine instructions, e.g. instruction decode
- G06F9/38—Concurrent instruction execution, e.g. pipeline or look ahead
- G06F9/3824—Operand accessing
- G06F9/383—Operand prefetching
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F2212/00—Indexing scheme relating to accessing, addressing or allocation within memory systems or architectures
- G06F2212/45—Caching of specific data in cache memory
- G06F2212/452—Instruction code
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F2212/00—Indexing scheme relating to accessing, addressing or allocation within memory systems or architectures
- G06F2212/60—Details of cache memory
- G06F2212/6024—History based prefetching
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Memory System Of A Hierarchy Structure (AREA)
- Devices For Executing Special Programs (AREA)
Description
図1は、実施の形態にかかるコンパイル方法の一実施例を示す説明図である。図1において、情報処理装置101は、ソースプログラムscをコンパイルして実行可能ファイルfを生成するコンピュータである。情報処理装置101は、例えば、PC(パーソナル・コンピュータ)、タブレットPCなどの汎用演算装置であってもよく、また、サーバであってもよい。
図2は、情報処理装置101のハードウェア構成例を示すブロック図である。図2において、情報処理装置101は、CPU(Central Processing Unit)201と、メモリ202と、I/F(Interface)203と、ディスクドライブ204と、ディスク205と、を有する。また、各構成部は、バス200によってそれぞれ接続される。
図3は、情報処理装置101の機能的構成例を示すブロック図である。図3において、情報処理装置101は、取得部301と、解析部302と、第1の生成部303と、最適化部304と、第2の生成部305と、決定部306と、出力部307と、を含む構成である。取得部301〜出力部307は制御部となる機能であり、具体的には、例えば、図2に示したメモリ202、ディスク205などの記憶装置に記憶されたプログラムをCPU201に実行させることにより、または、I/F203により、その機能を実現する。各機能部の処理結果は、例えば、メモリ202、ディスク205などの記憶装置に記憶される。
つぎに、情報処理装置101のコンパイル処理手順について説明する。
つぎに、図5に示したステップS504のループ変形処理の具体的な処理手順について説明する。
つぎに、図5に示したステップS507のライン数探索処理の具体的な処理手順について説明する。ここでは、二分法を利用して、キャッシュメモリ内のセクタAの最小のサイズ(ライン数)を探索する場合を例に挙げて説明する。
前記第1ループ処理において、キャッシュメモリ内の第1領域を用いて前記配列のデータのアクセスを行うとともに、前記キャッシュメモリ内の第2領域を用いて前記配列のデータのプリフェッチを行い、前記第2ループ処理において、前記第2領域を用いて前記配列のデータのアクセスおよびプリフェッチを行う中間言語コードを生成する、
制御部を有することを特徴とする情報処理装置。
生成した前記中間言語コードに基づいて、前記プログラムの実行可能ファイルを生成する、ことを特徴とする付記1に記載の情報処理装置。
前記第1領域のサイズを変えながら、生成した前記実行可能ファイルを実行して、前記サイズに対応する前記第1領域についてのキャッシュミスの数を測定し、
測定した前記キャッシュミスの数が、前記サイズをキャッシュラインで割った値以下となる最小のサイズを前記第1領域のサイズに決定し、
決定した前記第1領域のサイズを示す情報を前記実行可能ファイルと対応付けて出力する、ことを特徴とする付記2に記載の情報処理装置。
前記制御部は、
前記第1領域のサイズを示す情報に基づいて、前記キャッシュメモリ内の前記第1領域および前記第2領域のサイズを設定して、前記実行可能ファイルを実行する、ことを特徴とする付記3に記載の情報処理装置。
プログラムをコンパイルする際に、それぞれの繰り返しで配列のデータにアクセスするとともに所定回先の繰り返しでアクセスする前記配列のデータのプリフェッチを行うループ処理を、先頭から前記所定回先の繰り返しの直前までの第1ループ処理と、前記所定回先の繰り返しから最後までの第2ループ処理とに分割し、
前記第1ループ処理において、キャッシュメモリ内の第1領域を用いて前記配列のデータのアクセスを行うとともに、前記キャッシュメモリ内の第2領域を用いて前記配列のデータのプリフェッチを行い、前記第2ループ処理において、前記第2領域を用いて前記配列のデータのアクセスおよびプリフェッチを行う中間言語コードを生成する、
処理を実行させることを特徴とするコンパイルプログラム。
プログラムをコンパイルする際に、それぞれの繰り返しで配列のデータにアクセスするとともに所定回先の繰り返しでアクセスする前記配列のデータのプリフェッチを行うループ処理を、先頭から前記所定回先の繰り返しの直前までの第1ループ処理と、前記所定回先の繰り返しから最後までの第2ループ処理とに分割し、
前記第1ループ処理において、キャッシュメモリ内の第1領域を用いて前記配列のデータのアクセスを行うとともに、前記キャッシュメモリ内の第2領域を用いて前記配列のデータのプリフェッチを行い、前記第2ループ処理において、前記第2領域を用いて前記配列のデータのアクセスおよびプリフェッチを行う中間言語コードを生成する、
処理を実行することを特徴とするコンパイル方法。
プログラムを実行する際に、ループ処理の先頭から所定回先の繰り返しの直前までの第1ループ処理において、キャッシュメモリ内の第1領域を用いて、それぞれの繰り返しで配列のデータにアクセスするとともに、前記キャッシュメモリ内の第2領域を用いて、前記所定回先の繰り返しでアクセスする前記配列のデータのプリフェッチを行い、
前記ループ処理の前記所定回先の繰り返しから最後までの第2ループ処理において、前記第2領域を用いて、それぞれの繰り返しで前記配列のデータにアクセスするとともに、前記所定回先の繰り返しでアクセスする前記配列のデータのプリフェッチを行う、
処理を実行することを特徴とするキャッシュ制御方法。
110,400 プログラム
200 バス
201 CPU
202 メモリ
203 I/F
204 ディスクドライブ
205 ディスク
210 ネットワーク
301 取得部
302 解析部
303 第1の生成部
304 最適化部
305 第2の生成部
306 決定部
307 出力部
Claims (6)
- プログラムをコンパイルする際に、それぞれの繰り返しで配列のデータにアクセスするとともに所定回先の繰り返しでアクセスする前記配列のデータのプリフェッチを行うループ処理を、先頭から前記所定回先の繰り返しの直前までの第1ループ処理と、前記所定回先の繰り返しから最後までの第2ループ処理とに分割し、
前記第1ループ処理において、キャッシュメモリ内の第1領域を用いて前記配列のデータのアクセスを行うとともに、前記キャッシュメモリ内の第2領域を用いて前記配列のデータのプリフェッチを行い、前記第2ループ処理において、前記第2領域を用いて前記配列のデータのアクセスおよびプリフェッチを行う中間言語コードを生成する、
制御部を有することを特徴とする情報処理装置。 - 前記制御部は、
生成した前記中間言語コードに基づいて、前記プログラムの実行可能ファイルを生成する、ことを特徴とする請求項1に記載の情報処理装置。 - 前記制御部は、
前記第1領域のサイズを変えながら、生成した前記実行可能ファイルを実行して、前記サイズに対応する前記第1領域についてのキャッシュミスの数を測定し、
測定した前記キャッシュミスの数が、前記サイズをキャッシュラインで割った値以下となる最小のサイズを前記第1領域のサイズに決定し、
決定した前記第1領域のサイズを示す情報を前記実行可能ファイルと対応付けて出力する、ことを特徴とする請求項2に記載の情報処理装置。 - コンピュータに、
プログラムをコンパイルする際に、それぞれの繰り返しで配列のデータにアクセスするとともに所定回先の繰り返しでアクセスする前記配列のデータのプリフェッチを行うループ処理を、先頭から前記所定回先の繰り返しの直前までの第1ループ処理と、前記所定回先の繰り返しから最後までの第2ループ処理とに分割し、
前記第1ループ処理において、キャッシュメモリ内の第1領域を用いて前記配列のデータのアクセスを行うとともに、前記キャッシュメモリ内の第2領域を用いて前記配列のデータのプリフェッチを行い、前記第2ループ処理において、前記第2領域を用いて前記配列のデータのアクセスおよびプリフェッチを行う中間言語コードを生成する、
処理を実行させることを特徴とするコンパイルプログラム。 - コンピュータが、
プログラムをコンパイルする際に、それぞれの繰り返しで配列のデータにアクセスするとともに所定回先の繰り返しでアクセスする前記配列のデータのプリフェッチを行うループ処理を、先頭から前記所定回先の繰り返しの直前までの第1ループ処理と、前記所定回先の繰り返しから最後までの第2ループ処理とに分割し、
前記第1ループ処理において、キャッシュメモリ内の第1領域を用いて前記配列のデータのアクセスを行うとともに、前記キャッシュメモリ内の第2領域を用いて前記配列のデータのプリフェッチを行い、前記第2ループ処理において、前記第2領域を用いて前記配列のデータのアクセスおよびプリフェッチを行う中間言語コードを生成する、
処理を実行することを特徴とするコンパイル方法。 - コンピュータが、
プログラムを実行する際に、ループ処理の先頭から所定回先の繰り返しの直前までの第1ループ処理において、キャッシュメモリ内の第1領域を用いて、それぞれの繰り返しで配列のデータにアクセスするとともに、前記キャッシュメモリ内の第2領域を用いて、前記所定回先の繰り返しでアクセスする前記配列のデータのプリフェッチを行い、
前記ループ処理の前記所定回先の繰り返しから最後までの第2ループ処理において、前記第2領域を用いて、それぞれの繰り返しで前記配列のデータにアクセスするとともに、前記所定回先の繰り返しでアクセスする前記配列のデータのプリフェッチを行う、
処理を実行することを特徴とするキャッシュ制御方法。
Priority Applications (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2016139830A JP6665720B2 (ja) | 2016-07-14 | 2016-07-14 | 情報処理装置、コンパイルプログラム、コンパイル方法、およびキャッシュ制御方法 |
| US15/639,811 US10353682B2 (en) | 2016-07-14 | 2017-06-30 | Information processing device, storage medium, and method |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2016139830A JP6665720B2 (ja) | 2016-07-14 | 2016-07-14 | 情報処理装置、コンパイルプログラム、コンパイル方法、およびキャッシュ制御方法 |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JP2018010540A JP2018010540A (ja) | 2018-01-18 |
| JP6665720B2 true JP6665720B2 (ja) | 2020-03-13 |
Family
ID=60941013
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP2016139830A Active JP6665720B2 (ja) | 2016-07-14 | 2016-07-14 | 情報処理装置、コンパイルプログラム、コンパイル方法、およびキャッシュ制御方法 |
Country Status (2)
| Country | Link |
|---|---|
| US (1) | US10353682B2 (ja) |
| JP (1) | JP6665720B2 (ja) |
Families Citing this family (9)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US10409614B2 (en) | 2017-04-24 | 2019-09-10 | Intel Corporation | Instructions having support for floating point and integer data types in the same register |
| US10474458B2 (en) | 2017-04-28 | 2019-11-12 | Intel Corporation | Instructions and logic to perform floating-point and integer operations for machine learning |
| CN113424148A (zh) | 2019-03-15 | 2021-09-21 | 英特尔公司 | 用于检测跨分片访问、提供多分片推理缩放和提供最佳页迁移的多分片存储器管理 |
| WO2020190796A1 (en) | 2019-03-15 | 2020-09-24 | Intel Corporation | Systems and methods for cache optimization |
| CN112905241B (zh) | 2019-03-15 | 2024-03-29 | 英特尔公司 | 用于矩阵加速器架构的稀疏优化 |
| US11934342B2 (en) | 2019-03-15 | 2024-03-19 | Intel Corporation | Assistance for hardware prefetch in cache access |
| JP7230719B2 (ja) * | 2019-07-19 | 2023-03-01 | 富士通株式会社 | 情報処理装置及び情報処理方法 |
| US11861761B2 (en) | 2019-11-15 | 2024-01-02 | Intel Corporation | Graphics processing unit processing and caching improvements |
| US11663746B2 (en) | 2019-11-15 | 2023-05-30 | Intel Corporation | Systolic arithmetic on sparse data |
Family Cites Families (10)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2003108386A (ja) * | 2001-09-28 | 2003-04-11 | Hitachi Ltd | 間接参照データプリフェッチ方法 |
| US20070083730A1 (en) * | 2003-06-17 | 2007-04-12 | Martin Vorbach | Data processing device and method |
| US7657880B2 (en) * | 2003-01-31 | 2010-02-02 | Intel Corporation | Safe store for speculative helper threads |
| JPWO2005078579A1 (ja) * | 2004-02-12 | 2007-10-18 | 松下電器産業株式会社 | プログラム変換装置およびプログラム変換方法 |
| US7168070B2 (en) * | 2004-05-25 | 2007-01-23 | International Business Machines Corporation | Aggregate bandwidth through management using insertion of reset instructions for cache-to-cache data transfer |
| US8706964B1 (en) * | 2007-09-28 | 2014-04-22 | The Mathworks, Inc. | Automatic generation of cache-optimized code |
| US8239841B2 (en) * | 2008-04-04 | 2012-08-07 | International Business Machines Corporation | Prefetching irregular data references for software controlled caches |
| JP5251689B2 (ja) | 2009-04-02 | 2013-07-31 | 富士通株式会社 | コンパイラプログラムおよびコンパイラ装置 |
| US8893103B2 (en) * | 2012-08-16 | 2014-11-18 | Nec Laboratories America, Inc. | Automatic asynchronous offload to many-core coprocessors |
| JP6248808B2 (ja) | 2014-05-22 | 2017-12-20 | 富士通株式会社 | 情報処理装置、情報処理システム、情報処理装置の制御方法、及び、情報処理装置の制御プログラム |
-
2016
- 2016-07-14 JP JP2016139830A patent/JP6665720B2/ja active Active
-
2017
- 2017-06-30 US US15/639,811 patent/US10353682B2/en active Active
Also Published As
| Publication number | Publication date |
|---|---|
| US20180018153A1 (en) | 2018-01-18 |
| JP2018010540A (ja) | 2018-01-18 |
| US10353682B2 (en) | 2019-07-16 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| JP6665720B2 (ja) | 情報処理装置、コンパイルプログラム、コンパイル方法、およびキャッシュ制御方法 | |
| US9798528B2 (en) | Software solution for cooperative memory-side and processor-side data prefetching | |
| US8886887B2 (en) | Uniform external and internal interfaces for delinquent memory operations to facilitate cache optimization | |
| US6721943B2 (en) | Compile-time memory coalescing for dynamic arrays | |
| US6148439A (en) | Nested loop data prefetching using inner loop splitting and next outer loop referencing | |
| US20040093591A1 (en) | Method and apparatus prefetching indexed array references | |
| JP5966509B2 (ja) | プログラム、コード生成方法および情報処理装置 | |
| CN101273332A (zh) | 使用编译器的线程数据亲和性优化 | |
| US9483244B2 (en) | Compiling method and compiling device | |
| US20030088863A1 (en) | Method and apparatus for selecting references for prefetching in an optimizing compiler | |
| JP4177681B2 (ja) | コンパイル方法、コンパイラ、およびコンパイル装置 | |
| US7257810B2 (en) | Method and apparatus for inserting prefetch instructions in an optimizing compiler | |
| Hong et al. | Improving simd parallelism via dynamic binary translation | |
| JP7060803B2 (ja) | 情報処理装置、コンパイラプログラム及びコンパイル方法 | |
| US7313787B2 (en) | Compiler and method for optimizing object codes for hierarchical memories | |
| US20050086651A1 (en) | Compiler apparatus and linker apparatus | |
| JP2023045347A (ja) | プログラムおよび情報処理方法 | |
| US9552197B2 (en) | Computer-readable recording medium storing information processing program, information processing apparatus, and information processing method | |
| US20220405110A1 (en) | Non-transitory computer-readable recording medium and compilation method | |
| JP6898556B2 (ja) | 情報処理装置、コンパイル方法及びコンパイルプログラム | |
| CN114041116A (zh) | 数据移动任务优化的方法和装置 | |
| JP2014099108A (ja) | 実行時間算出装置、実行時間算出方法、およびプログラム | |
| Larrea et al. | An in-depth evaluation of GCC’s OpenACC implementation on Cray systems | |
| JPH05265770A (ja) | 計算機言語処理方法 | |
| JP2019164704A (ja) | コンパイラ |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20190409 |
|
| TRDD | Decision of grant or rejection written | ||
| A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20200115 |
|
| A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 Effective date: 20200121 |
|
| A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20200203 |
|
| R150 | Certificate of patent or registration of utility model |
Ref document number: 6665720 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 |