# US 2022/0291908 A1 · Information processing apparatus, computer-readable recording medium storing compiling program, and compiling method

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

- Number: US 2022/0291908 A1
- Document ID: US20220291908A1
- Status: Published application
- Kind: A1
- Application number: 17/529,329
- Filed: 2021-11-18
- Published: 2022-09-15
- Earliest claimed: 2021-03-15
- Assignees: Fujitsu Limited
- Applicants: Fujitsu Limited
- Inventors: Tomoko Nikko
- Web page: https://patentgrep.com/patent/US20220291908A1

## CPC

- G06F 8/4441: {Reducing the execution time required by the program code}
- G06F 8/4434: {Reducing the memory space required by the program code}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

An information processing apparatus includes a processor configured to: for each of a plurality of loops, acquire loop information including a number of variables, a number of registers, a number of memory commands for inputting and outputting a value of the variable between the register and a main storage device, and a number of arithmetic commands for the value of the variable stored in the register, which are used in the loop; calculate the number of variables, the number of registers, the number of memory commands, and the number of arithmetic commands, which correspond to a combination of the loops that are candidates for loop fusion, for each of the combinations of the loops; determine a combination to which the loop fusion is to be applied among the combinations which are calculated for each of the combinations; and execute the loop fusion on the determined combination.

## Claims

### Claim 1

An information processing apparatus comprising:
a memory configured to store a code to be processed; and
a processor configured to:
for each of a plurality of loops included in the code, acquire loop information including a number of variables, a number of registers, a number of memory commands for inputting and outputting a value of the variable between the register and a main storage device, and a number of arithmetic commands for the value of the variable stored in the register, which are used in the loop;
based on the acquired loop information, calculate the number of variables, the number of registers, the number of memory commands, and the number of arithmetic commands, which correspond to a combination of the loops that are candidates for loop fusion, for each of a plurality of the combinations of the loops;
determine a combination to which the loop fusion is to be applied among the plurality of combinations, based on the number of variables, the number of registers, and a comparison of the number of memory commands and the number of arithmetic commands, which are calculated for each of the plurality of combinations; and
execute the loop fusion on the determined combination.

### Claim 2 (depends on 1)

The information processing apparatus according to claim 1,
wherein the processor acquires the combination to which two or more loops having different acquirable values of control variables of the loops belong, as the candidate for the loop fusion, based on the code.

### Claim 3 (depends on 1)

The information processing apparatus according to claim 1,
wherein the processor prioritizes the combination having a large calculated number of variables to determine the combination as the combination to which the loop fusion is to be applied, among the plurality of combinations.

### Claim 4 (depends on 1)

The information processing apparatus according to claim 1,
wherein the processor determines the combination in which the calculated number of registers is equal to or less than the number of available registers in an apparatus scheduled to execute an object code generated by the compiling, among the plurality of combinations, as the combination to which the loop fusion is to be applied.

### Claim 5 (depends on 1)

The information processing apparatus according to claim 1,
wherein the processor determines the combination in which a number obtained by subtracting a predetermined value from the calculated number of memory commands is equal to or larger than the number of arithmetic commands, among the plurality of combinations, as the combination to which the loop fusion is to be applied.

### Claim 6 (depends on 5)

The information processing apparatus according to claim 5,
wherein the processor determines the predetermined value in accordance with the number of memory commands that are simultaneously executable by an apparatus scheduled to execute an object code generated by the compiling.

### Claim 7

A non-transitory computer-readable recording medium storing an information processing program causing a computer to execute processing of:
for each of a plurality of loops included in the code, acquiring loop information including a number of variables, a number of registers, a number of memory commands for inputting and outputting a value of the variable between the register and a main storage device, and a number of arithmetic commands for the value of the variable stored in the register, which are used in the loop;
based on the acquired loop information, calculating the number of variables, the number of registers, the number of memory commands, and the number of arithmetic commands, which correspond to a combination of the loops that are candidates for loop fusion, for each of a plurality of the combinations of the loops;
determining a combination to which the loop fusion is to be applied among the plurality of combinations, based on the number of variables, the number of registers, and a comparison of the number of memory commands and the number of arithmetic commands, which are calculated for each of the plurality of combinations; and
executing the loop fusion on the determined combination.

### Claim 8

An information processing method comprising:
for each of a plurality of loops included in the code, acquiring, by a computer, loop information including a number of variables, a number of registers, a number of memory commands for inputting and outputting a value of the variable between the register and a main storage device, and a number of arithmetic commands for the value of the variable stored in the register, which are used in the loop;
based on the acquired loop information, calculating the number of variables, the number of registers, the number of memory commands, and the number of arithmetic commands, which correspond to a combination of the loops that are candidates for loop fusion, for each of a plurality of the combinations of the loops;
determining a combination to which the loop fusion is to be applied among the plurality of combinations, based on the number of variables, the number of registers, and a comparison of the number of memory commands and the number of arithmetic commands, which are calculated for each of the plurality of combinations; and
executing the loop fusion on the determined combination.
