# US 10,372,430 B2 · Method of compiling a program

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

- Number: US 10,372,430 B2
- Document ID: US10372430B2
- Status: Granted
- Kind: B2
- Application number: 15/867,168
- Filed: 2018-01-10
- Published: 2018-12-27
- Granted: 2019-08-06
- Earliest claimed: 2017-06-26
- Assignees: Samsung Electronics Co., Ltd.; Postech Academy-Industry Foundation
- Applicants: Samsung Electronics Co., Ltd.
- Inventors: Hye-Yeon Chung; Han-Jun Kim; Jong-Won Lee; Chang-Su Kim; Seon-Yeong Heo; Jun-Mo Park; Jong-Hee Yoon
- Web page: https://patentgrep.com/patent/US10372430B2

## CPC

- G06F 8/443: {Optimisation}
- G06F 8/4441: {Reducing the execution time required by the program code}
- G06F 8/48: {Incremental compilation (software reuse G06F8/36)}
- G06N 5/01: Dynamic search techniques; Heuristics; Dynamic trees; Branch-and-bound
- G06N 20/00: Machine learning
- G06N 20/10: using kernel methods, e.g. support vector machines [SVM]
- 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)
- G06N: COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS

## Abstract

In a method of compiling an updated program having a plurality of updated functions that is updated from an original program having a plurality of original functions, it is determined whether a first original function corresponding to a first updated function exists, it is determined whether the first updated function is changed from the first original function, a first optimization combination for the first updated function is searched when the first original function does not exist or when the first updated function is changed from the first original function, a second optimization combination applied to the first original function is read from a configuration database storing optimization combinations for the original functions when the first original function exists and the first updated function is not changed from the first original function, and the updated program is compiled using the first optimization combination or the second optimization combination.

## Claims

### Claim 1

A method of compiling an updated program having a plurality of updated functions that is updated from an original program having a plurality of original functions, the method comprising:
determining whether a first original function among the plurality of original functions corresponding to a first updated function among the plurality of updated functions exists;
determining whether the first updated function is changed from the first original function;
searching a first optimization combination for the first updated function when the first original function does not exist or when the first updated function is changed from the first original function;
reading a second optimization combination applied to the first original function from a configuration database storing optimization combinations for the plurality of original functions, when the first original function exists and the first updated function is not changed from the first original function; and
compiling the updated program using the first optimization combination or the second optimization combination.

### Claim 2 (depends on 1)

The method of claim 1, wherein each of the first optimization combination and the second optimization combination includes information about whether optimization passes thereof included in an optimization pool are applied or not, parameters of the applied optimization passes, and an order of the applied optimization passes.

### Claim 3 (depends on 1)

The method of claim 1, wherein determining whether the first original function corresponding to the first updated function exists includes:
determining whether the first original function has a function name the same as a function name of the first updated function.

### Claim 4 (depends on 1)

The method of claim 1, wherein determining whether the first original function corresponding to the first updated function exists includes:
analyzing a call graph of the original program and a call graph of the updated program; and
determining whether the first original function has a calling relationship the same as a calling relationship of the first updated function.

### Claim 5 (depends on 1)

The method of claim 1, wherein determining whether the first updated function is changed from the first original function includes:
calculating an updated bloom filter value by performing bloom filtering on instructions included in the first updated function;
calculating an original bloom filter value by performing bloom filtering on instructions included in the first original function; and
determining whether the first updated function is changed based on whether the updated bloom filter value is equal to the original bloom filter value.

### Claim 6 (depends on 1)

The method of claim 1, wherein searching the first optimization combination for the first updated function includes:
obtaining the first optimization combination by performing iterative compilation on the first updated function when the first original function does not exist.

### Claim 7 (depends on 1)

The method of claim 1, further comprising:
performing machine learning for optimization combinations according to function features of the plurality of original functions,
wherein searching the first optimization combination for the first updated function includes:
extracting a function feature of the first updated function when the first original function does not exist; and
obtaining the first optimization combination according to the extracted function feature of the first updated function by using a result of the machine learning.

### Claim 8 (depends on 7)

The method of claim 7, wherein the extracted function feature of the first updated function is a basic feature for a basic block included in the first updated function, an instruction level feature for instructions included in the first updated function, or a loop level feature for a loop included in the first updated function.

### Claim 9 (depends on 1)

The method of claim 1, wherein searching the first optimization combination for the first updated function includes:
obtaining the first optimization combination by performing iterative compilation on the first updated function when the first updated function is changed from the first original function.

### Claim 10 (depends on 1)

The method of claim 1, further comprising:
performing machine learning for optimization combinations according to function features of the plurality of original functions,
wherein searching the first optimization combination for the first updated function includes:
extracting a function feature of the first updated function when the first updated function is changed from the first original function; and
obtaining the first optimization combination according to the extracted function feature of the first updated function by using a result of the machine learning.

### Claim 11 (depends on 1)

The method of claim 1, further comprising:
performing machine learning for optimization combinations according to function features of the plurality of original functions,
wherein searching the first optimization combination for the first updated function includes:
extracting an original function feature of the first original function and an updated function feature of the first updated function when the first updated function is changed from the first original function;
calculating a change ratio of the updated function feature to the original function feature;
reading a third optimization combination applied to the first original function from the configuration database;
obtaining a fourth optimization combination according to the updated function feature by using a result of the machine learning; and
generating the first optimization combination for the first updated function by reflecting the fourth optimization combination or the third optimization combination with the change ratio.

### Claim 12 (depends on 11)

The method of claim 11, wherein the change ratio has a value ranging from 0 to 1,
wherein, when the change ratio is less than a predetermined threshold, the third optimization combination is reflected to the first optimization combination, and
wherein, when the change ratio is greater than or equal to the predetermined threshold, the fourth optimization combination is reflected to the first optimization combination.

### Claim 13 (depends on 11)

The method of claim 11, wherein generating the first optimization combination by reflecting the fourth optimization combination or the third optimization combination with the change ratio includes:
comparing a random value with the change ratio, wherein the random value is generated with respect to each optimization pass of a plurality of optimization passes included in an optimization pool;
reflecting the third optimization combination with respect to the each optimization pass when the random value is greater than the change ratio; and
reflecting the fourth optimization combination with respect to the each optimization pass when the random value is less than or equal to the change ratio.

### Claim 14 (depends on 13)

The method of claim 13, wherein generating the first optimization combination by reflecting the fourth optimization combination or the third optimization combination with the change ratio further includes:
determining an order of optimization passes included in the first optimization combination by performing iterative compilation on the optimization passes included in the first optimization combination.

### Claim 15

A method of compiling an updated program having a plurality of updated functions that is updated from an original program having a plurality of original functions, the method comprising:
performing machine learning for optimization combinations according to function features of the plurality of original functions of the original program;
determining whether a first original function among the plurality of original functions corresponding to a first updated function among the plurality of updated functions exists;
obtaining a first optimization combination according to a function feature of the first updated function by using a result of the machine learning when the first original function does not exist;
determining whether the first updated function is changed from the first original function when the first original function exists;
reading a second optimization combination applied to the first original function from a configuration database storing optimization combinations for the plurality of original functions, when the first updated function is not changed from the first original function;
generating a third optimization combination for the first updated function by reflecting a fourth optimization combination obtained using the result of the machine learning and a fifth optimization combination applied to the first original function with a change ratio of a function feature of the first updated function to a function feature of the first original function, when the first updated function is changed from the first original function; and
compiling the updated program using the first optimization combination, the second optimization combination, or the third optimization combination.

### Claim 16

A method of compiling an updated program having a plurality of updated functions that is updated from an original program having a plurality of original functions, the method comprising:
obtaining an optimization configuration including optimization combinations of the plurality of original functions by performing iterative compilation for each of the plurality of original functions of the original program;
storing the optimization configuration in a configuration database;
determining whether a first original function among the plurality of original functions corresponding to a first updated function among the plurality of updated functions exists and whether the first updated function is changed from the first original function;
reading a first optimization combination applied to the first original function, among the optimization combinations included in the optimization configuration, from the configuration database, when the first original function exists and the first updated function is not changed from the first original function; and
compiling the updated program using the read first optimization combination.

### Claim 17 (depends on 16)

The method of claim 16, further comprising:
measuring, by using a performance profiler, an execution time of the original program compiled with the obtained optimization configuration,
wherein the execution time is further stored in the configuration database.

### Claim 18 (depends on 16)

The method of claim 16, further comprising:
obtaining a second optimization combination by performing iterative compilation on the first updated function when the first original function does not exist or when the first updated function is changed from the first original function.

### Claim 19 (depends on 16)

The method of claim 16, further comprising:
performing machine learning for optimization combinations according to function features of the plurality of original functions; and
storing a result of the machine learning in a machine learning database.

### Claim 20 (depends on 19)

The method of claim 19, further comprising:
obtaining a third optimization combination by using the result of the machine learning stored in the machine learning database when the first original function does not exist or when the first updated function is changed from the first original function.
