# US 2012/0254551 A1 · Method of generating code executable by processor

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2012/0254551 A1
- Document ID: US20120254551A1
- Status: Published application
- Kind: A1
- Application number: 13/515,759
- Filed: 2010-12-14
- Published: 2012-10-04
- Earliest claimed: 2009-12-16
- Assignees: Waseda University
- Inventors: Hironori Kasahara; Keiji Kimura; Masayoshi Mase
- Web page: https://patentgrep.com/patent/US20120254551A1

## CPC

- G06F 8/70: Software maintenance or management
- G06F 8/41: Compilation
- G06F 12/0837: with software control, e.g. non-cacheable data
- G06F 12/0842: for multiprocessing or multitasking
- Y02D 10/00: Energy efficient computing, e.g. low power processors, power management or thermal management
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)
- Y02D: CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE

## Abstract

It is provided a method of generating a code by a compiler, including the steps of: analyzing a program executed by a processor; analyzing data necessary to execute respective tasks included in a program; determining whether a boundary of the data used by divided tasks is consistent with a management unit of a cache memory based on results of the analyzing; and generating a code for providing a non-cacheable area from which the data to be stored in the management unit including the boundary is not temporarily stored into the cache memory and a code for storing an arithmetic processing result stored in the management unit including the boundary into a non-cacheable area in a case where it is determined that the boundary of the data used by the divided tasks is not consistent with the management unit of the cache memory.

## Claims

### Claim 1

A method of generating a code by a compiler, the code being executable by a processor provided to a multiprocessor system,
the multiprocessor system including a plurality of processing elements and a main memory that can be accessed from each of the plurality of processing elements,
the each of the plurality of processing elements including a processor for performing arithmetic processing and a cache memory for temporarily storing data used by the processor,
the data read and transferred by the each of the plurality of processing elements from the main memory being temporarily stored in the cache memory,
the data whose use by the each of the plurality of processing elements has been finished being transferred from the cache memory and being written back to the main memory,
the data transfer between the main memory and the cache memory being performed in accordance with a management unit of the cache memory,
the method including the steps of:
analyzing a program to be executed by the multiprocessor system;
analyzing data necessary to execute respective tasks included in the program;
determining whether a boundary of the data used by the divided tasks is consistent with the management unit of the cache memory based on results of the analyzing in a case where the respective tasks are divided; and
generating a code for instructing to provide a non-cacheable area from which the data to be stored in the management unit including the boundary is not temporarily stored into the cache memory and a code for instructing to store an arithmetic processing result stored in the management unit including the boundary into the non-cacheable area in a case where it is determined that the boundary of the data used by the divided tasks is not consistent with the management unit of the cache memory.

### Claim 2 (depends on 1)

The method of generating a code according to claim 1, wherein:
the plurality of processing elements include a first processing element and a second processing element; and
the method further includes the step of generating a code to perform, by the first processing element, the arithmetic processing in the cache memory on the data stored in the management unit including the boundary of the data used by the divided tasks, a code for instructing to store, by the second processing element, the arithmetic processing result stored in the management unit including the boundary of the data used by the divided tasks in the non-cacheable area, and a code for instructing to transfer the arithmetic processing result stored in the non-cacheable area to the cache memory of the first processing element based on the results of the analysis of the program in a case where it is determined that the boundary between the data used by the task executed by the first processing element and the data used by the task executed by the second processing element is not consistent with the management unit of the cache memory.

### Claim 3 (depends on 1)

The method of generating a code according to claim 1, wherein:
the plurality of processing elements includes a first processing element and a second processing element;
the non-cacheable area is provided to the each of the plurality of processing elements; and
the method further includes the step of generating a code for instructing to perform, by the each of the plurality of processing elements, the arithmetic processing in the non-cacheable area of the each of the plurality of processing elements on the data stored in the management unit including the boundary of the data used by the divided tasks and a code for instructing to write, by the first processing element, a result of performing the arithmetic processing in the non-cacheable area to a shared memory of the second processing element based on the results of the analysis of the program in a case where it is determined that the boundary between the data used by the task executed by the first processing element and the data used by the task executed by the second processing element is not consistent with the management unit of the cache memory.

### Claim 4 (depends on 1)

The method of generating a code according to claim 1, further including the step of generating one of a code for instructing that the non-cacheable area be provided to the main memory.

### Claim 5 (depends on 1)

The method of generating a code according to claim 1, wherein:
the each of the plurality of processing elements further includes a distributed shared memory that can be accessed by the plurality of respective processing elements; and
the method further includes the step of generating one of a code for instructing that the non-cacheable area is provided to the distributed shared memory.

### Claim 6 (depends on 1)

The method of generating a code according to claim 1, further including the step of generating a code for instructing to divide, with regard to the management unit of the cache memory that is consistent with the boundary of the data used by the tasks, the tasks so um in be consistent with the management unit, and for performing, with regard to the management unit that is consistent with the boundary of the data used by the tasks, the arithmetic processing on the data stored in the management unit including the boundary by using the non-cacheable area from which the data is not temporarily stored into the cache memory based on the results of the analysis of the program in a case where it is determined at the divided tasks access a plurality of areas of the main memory.

### Claim 7 (depends on 1)

The method of generating a code according to claim 1, further including the step of generating a code for instructing to expand an array so as to avoid a plurality of elements of the data from being placed in the respective management units based on the results of the analysis of the program in a case where it is determined that the data used by each of the tasks is declared in the program and used only in the program.

### Claim 8 (depends on 7)

The method of generating a code according to claim 7, wherein:
the data used by the each of the tasks is an array variable; and
the method further includes the steps of:
determining a portion in which inconsistency between the boundary of the data used by the divided tasks and the management unit occurs based on the results of the analysis of the program;
generating a code for instructing to expand the array variable so as to avoid the plurality of elements of the array variable from being placed in the respective management units in a case where the inconsistency between the boundary of the data used by the divided tasks and the management unit occurs between elements in dimensions in which the plurality of elements of the array variable are stored in a continuous area of the main memory; and
generating a code for instructing to expand the array variable so as to avoid the plurality of elements of the array variable in a plurality of dimensions at lower levels than the dimension in which the inconsistency occurs from being placed in the respective management units in a case where the inconsistency between the boundary of the data used by the divided tasks and the management unit does not occur between the elements in the dimensions in which the plurality of elements of the array variable are stored in the continuous area of the main memory.

### Claim 9 (depends on 1)

The method of generating a code according to claim 1, wherein:
the plurality of processing elements includes a first processing element and a second processing element; and
the method further includes the step of generating a code for instructing to define a local variable used within the plurality of processing elements for the each of the plurality of processing elements; a code for performing, by the each of the respective plurality of processing elements, the arithmetic processing by using the defined local variable; a code for instructing to write back, by the first processing element, a result of performing the arithmetic processing by using the defined local variable to the main memory; a code for instructing to read, by the second processing element, the result of performing the arithmetic processing obtained by the first processing element from the main memory; and a code for instructing to write, by the second processing element, the data read from the main memory to the cache memory.

### Claim 10 (depends on 1)

The method of generating a code according to claim 1, further includes the step of generating, in a case where there is a dependence relationship of data between the tasks executed by different ones of the plurality of processing elements, a code for instructing to write back, by one of the plurality of processing elements that produces the data, the data having the dependence relationship to the main memory and a code for instructing to invalidate, by another one of the plurality of processing elements that consumes the data, the data exhibiting the dependence relationship.

### Claim 11

A method of managing a storage area of a memory when a processor provided to a multiprocessor system executes a program,
the multiprocessor system including a plurality of processing elements and a main memory that can be accessed from each of the plurality of processing elements,
the each of the plurality of processing elements including a processor for performing arithmetic processing and a cache memory for temporarily storing data used by the processor,
the method including the steps of:
temporarily storing, in the cache memory, by the each of the plurality of processing elements, the data read and transferred from the main memory in accordance with a management unit of the cache memory;
transferring the data whose use by the each of the plurality of processing elements has been finished from the cache memory in accordance with the management unit of the cache memory and writing back the data to the main memory; and
providing a non-cacheable area from which the data to be stored in the management unit including the boundary is not temporarily stored into the cache memory, and storing an arithmetic processing result stored in the management unit including the boundary into the non-cacheable area in a case where a boundary of the data used by respective tasks generated by dividing the program is not consistent with the management unit of the cache memory.

### Claim 12 (depends on 11)

The method of managing a storage area according to claim 11, wherein:
the plurality of processing elements includes a first processing element and a second processing element; and
the step of storing the arithmetic processing result into the non-cacheable area includes the steps of:
performing, by the first processing element, the arithmetic processing of the data stored in the management unit including the boundary of the data used by the tasks on the cache memory;
storing, by the second processing element, the arithmetic processing result stored in the management unit including the boundary of the data used by the tasks into the non-cacheable area; and
transferring, by the second processing element, the arithmetic processing result stored in the non-cacheable area to the cache memory of the first processing element.

### Claim 13 (depends on 11)

The method of managing a storage area according to claim 11, wherein:
the plurality of processing elements includes a first processing element and a second processing element;
the non-cacheable area is provided to the each of the plurality of processing elements; and
the step of storing the arithmetic processing result into the non-cacheable area includes the steps of:
performing, by the each of the plurality of processing elements, the arithmetic processing in the non-cacheable area of the each of the plurality of processing elements on the data stored in the management unit including the boundary of the data used by the tasks; and
writing, by the first processing element, a result of performing the arithmetic processing in the non-cacheable area to a shared memory of the second processing element.

### Claim 14 (depends on 11)

The method of managing a storage area according to claim 11, further including the steps of:
writing back, by one of the plurality of processing elements that produces the data, in a case where there is a dependence relationship of data between the tasks executed by different ones of the plurality of processing elements, the data having the dependence relationship to the main memory; and
invalidating, by another one of the plurality of processing elements that consumes the data, the data exhibiting the dependence relationship.

### Claim 15

A machine-readable non-transitory storage medium containing at least one sequence of instructions,
the multiprocessor system including a plurality of processing elements and a main memory that can be accessed from each of the plurality of processing elements,
the each of the plurality of processing elements including a processor for performing arithmetic processing and a cache memory for temporarily storing data used by the processor, wherein
the data read and transferred by the each of the plurality of processing elements from the main memory is temporarily stored in the cache memory,
the data whose use by the each of the plurality of processing elements has been finished is transferred from the cache memory and is written back to the main memory,
the data transfer between the main memory and the cache memory is performed in accordance with an access management of the cache memory, and
the instructions, when executed, causes a processor provided to a multiprocessor system to:
analyze a program to be executed by the multiprocessor system;
analyze data necessary to execute respective tasks included in the program;
determine whether or not a boundary of the data used by the divided tasks is consistent with the access management unit of the cache memory based on results of the analyzing in a case where the program is divided into the respective tasks; and
use a code for instructing to provide a non-cacheable area from which the data to be stored in the access management unit including the boundary is not temporarily stored into the cache memory in a case where it is determined that the boundary of the data used by the divided tasks is not consistent with the access management unit of the cache memory, to thereby generate a code for instructing to store an arithmetic processing result stored in the access management unit including the boundary of the data used by the divided tasks, into the non-cacheable area.
