Compiler optimization method and device and storage medium

By splitting access operations in the compiled language into sub-access operations, the problem of insufficient accuracy in existing compiler optimization is solved, more efficient compiler optimization and bank conflict elimination is achieved, and the optimization accuracy and efficiency of the compiler is improved.

CN120386528APending Publication Date: 2025-07-29SHENZHEN INTELLIFUSION TECHNOLOGIES CO LTD
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202510353075.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-24
Publication Date
2025-07-29

AI Technical Summary

Technical Problem

The existing alias analysis methods have insufficient accuracy in compiler optimization, resulting in low compiler optimization results, especially when dealing with complex pointer operations, subtraction operations and loop variables, which cannot effectively eliminate memory dependencies and bank conflicts.

Method used

By obtaining the vector length in the compiled language, the split access operation is a number of sub-access operations, and splitting when the vector length is not the power of the preset value and is greater than the preset threshold, eliminating duplicate operations in the compiled language, optimizing the compiler's intermediate language, and eliminating hardware-specific bank conflicts after register allocation.

Benefits of technology

Improves the accuracy of compiler optimization results, eliminates duplicate access operations in intermediate languages, and eliminates hardware-specific bank conflicts during subsequent instruction scheduling, improving the optimization effect of the compiler.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120386528A_ABST
    Figure CN120386528A_ABST
Patent Text Reader

Abstract

The invention discloses a compiler optimization method and device and a storage medium, and belongs to the technical field of computers. The method comprises the steps of obtaining a vector length corresponding to an access operation in a compiling language; the vector length is related to the number of elements included in the memory address to be accessed; under the condition that the vector length is not the power of the preset numerical value and the vector length is greater than a preset threshold value, splitting the access operation according to the vector length to obtain a plurality of sub-access operations; and according to the plurality of sub-access operations, optimizing repeated operations in the compilation language to obtain a compilation optimization result. By standardizing the access operation in the intermediate language of the compiler and splitting the access operation into a plurality of sub-access operations, the repeated sub-access operations in the intermediate language can be eliminated; moreover, in the instruction scheduling process after register allocation, based on the instructions corresponding to the multiple sub-access operations, access conflicts specific to hardware can be eliminated, and the accuracy of compiler optimization results is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and particularly to a compiler optimization method, device, and storage medium. Background Art

[0002] Alias analysis technology is usually used in compiler optimization. Alias analysis is used to determine whether two or more pointers in a program may point to the same memory location (or memory address). An accurate alias analysis process can significantly improve the optimization ability of the compiler. For example, it can eliminate duplicate load or store memory operations.

[0003] Current alias analysis methods will give an analysis conclusion of "yes" or "no". Among them, "yes" means that there is a memory dependency between two pointers, and the related operations cannot be eliminated; "no" means that there is no memory dependency between two pointers, and the related operations can be eliminated.

[0004] However, in order to reduce misjudgments, current alias analysis methods usually estimate a relatively large range of memory addresses and give an analysis conclusion of "yes". In this way, the compiled language cannot be optimized. Although this conservative analysis process can reduce errors, it also results in a relatively low accuracy of the compiler optimization result. Summary of the Invention

[0005] This application provides a compiler optimization method, device, and storage medium, which improve the accuracy of the compiler optimization result. The technical solutions are as follows:

[0006] In a first aspect, a compiler optimization method is provided. The method includes: obtaining the vector length corresponding to an access operation in a compiled language; the vector length is related to the number of elements included in the memory address to be accessed; in the case where the vector length corresponding to the access operation is not a power of a preset value and is greater than a preset threshold, splitting the access operation according to the vector length to obtain a plurality of sub-access operations; and optimizing the repeated operations in the compiled language according to the plurality of sub-access operations to obtain a compilation optimization result.

[0007] In a second aspect, a compiler optimization device is provided. The device includes: an obtaining module, configured to obtain the vector length corresponding to an access operation in a compiled language; the vector length is related to the number of elements included in the memory address to be accessed; a splitting module, configured to split the access operation according to the vector length to obtain a plurality of sub-access operations in the case where the vector length corresponding to the access operation is not a power of a preset value and is greater than a preset threshold; and an optimization module, configured to optimize the repeated operations in the compiled language according to the plurality of sub-access operations to obtain a compilation optimization result.

[0008] In a third aspect, a computer device is provided. The computer device includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the computer program is executed by the processor, the method described in the first aspect above is implemented.

[0009] In a fourth aspect, a computer-readable storage medium is provided. The computer-readable storage medium stores a computer program. When the computer program is executed by a processor, the method described in the first aspect above is implemented.

[0010] In a fifth aspect, a computer program product containing instructions is provided. When it runs on a computer, the computer is caused to execute the method described in the first aspect above.

[0011] Embodiments of the present application provide a compiler optimization method, device, and storage medium. According to the solution provided by the present application, the vector length corresponding to an access operation in a compiled language is obtained; the vector length is related to the number of elements included in the memory address to be accessed; in the case where the vector length is not a power of a preset value and the vector length is greater than a preset threshold, the access operation is split according to the vector length to obtain a plurality of sub-access operations; and according to the plurality of sub-access operations, the repeated operations in the compiled language are optimized to obtain a compilation optimization result. Normalizing the access operations in the intermediate representation (IR) of the compiler and splitting them into a plurality of sub-access operations can not only eliminate the repeated sub-access operations in the intermediate language; moreover, in the subsequent instruction scheduling process after register allocation, based on the instructions corresponding to the plurality of sub-access operations respectively, specific hardware bank conflicts can be eliminated, improving the accuracy of the compiler optimization result. Description of the Drawings

[0012] To more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.

[0013] Figure 1 is a flowchart of a compiler optimization method provided by an embodiment of the present application;

[0014] Figure 2 is a flowchart of another compiler optimization method provided by an embodiment of the present application;

[0015] Figure 3 is a flowchart of still another compiler optimization method provided by an embodiment of the present application;

[0016] Figure 4 It is a flowchart of another compiler optimization method provided by an embodiment of the present application;

[0017] Figure 5 It is a flowchart of another compiler optimization method provided by an embodiment of the present application;

[0018] Figure 6 It is a flowchart of another compiler optimization method provided by an embodiment of the present application;

[0019] Figure 7 It is a schematic structural diagram of a compiler optimization device provided by an embodiment of the present application;

[0020] Figure 8 It is a schematic structural diagram of a computer device provided by an embodiment of the present application. Specific embodiments

[0021] To make the objectives, technical solutions, and advantages of the present application clearer, the following will further describe the embodiments of the present application in detail with reference to the accompanying drawings.

[0022] It should be understood that the "multiple" mentioned in the present application refers to two or more. In the description of the present application, unless otherwise specified, " / " means "or", for example, A / B may mean A or B; the "and / or" herein is merely a description of the association relationship between associated objects, indicating that there can be three relationships, for example, A and / or B may mean: A exists alone, A and B exist simultaneously, and B exists alone. In addition, for the convenience of clearly describing the technical solutions of the present application, terms such as "first" and "second" are used to distinguish the same items or similar items with basically the same functions and roles. Those skilled in the art can understand that the terms "first" and "second" do not limit the quantity and execution order, and the terms "first" and "second" do not necessarily limit being different.

[0023] Before explaining the embodiments of the present application in detail, the application scenarios and related technologies of the embodiments of the present application will be described first.

[0024] The compiler optimization method provided by the embodiments of the present application is used in the alias analysis process of the compiler and is applicable to at least the following scenarios: code optimization scenarios, memory management and security scenarios, concurrent programming and multi-threaded scenarios, and specific fields (such as graphics processing and rendering, database query optimization, etc.). Among them, the compiler can be an open-source compiler framework, for example, a low-level virtual machine (LLVM), a GNU Compiler Collection (GCC), Clang, etc. The compiler converts the representation of the intermediate language (IR) into executable machine instructions.

[0025] Alias analysis process can be used to optimize compilers. For example, it can eliminate duplicate load or store memory operations, eliminate bank conflicts, and parallelize instructions. Among them, bank conflict refers to a phenomenon where multiple processing units attempt to access the same memory module, resulting in conflicts and performance degradation.

[0026] Alias analysis is used to determine whether two or more pointers in a program may point to the same memory location. The current alias analysis methods can improve the optimization ability of compilers, but there are still problems with insufficient accuracy. For example, the current alias analysis methods handle different pointers without discrimination. For pointers with a constant base address, they are still treated as ordinary pointers (i.e., pointers with a variable base address). For example, assume that the first step is a load operation, the second step is a write operation, and the third step is a load operation. In one scenario, the second step performs a write operation on the address in the first step, and the third step loads the address after the write operation. The second step depends on the first step, and the third step depends on the second step, so the third step depends on the first step. Since the third step and the first step have the same memory address, the value read by the third step from the memory address is different from the value read by the first step from the memory address, and the third step cannot be deleted. The current alias analysis method does not know whether the third step depends on the first step, but for the sake of conservatism, it gives a "yes" conclusion, indicating that the third step depends on the first step and does not optimize the compiler. In this way, the optimization result must be correct. In another scenario, although the second step depends on the first step and the third step depends on the second step, if the address of the third load operation is different from the address of the second write operation, then the value read by the third step from the memory address is the same as the value read by the first step from the memory address, and the third step can be deleted. However, the current alias analysis method still gives a "yes" conclusion and does not optimize the compiled code. It can be seen that the accuracy of the compiler optimization results using the current alias analysis method is not high.

[0027] The current alias analysis method still has problems with insufficient accuracy when dealing with complex pointer operations, subtraction operations, and negative immediate numbers. For example, in the calculation process of the memory address of a load operation or a store operation located in a loop, loop variables are usually involved. The current alias analysis method does not care about the number of loop executions in the loop variable. It subtracts two loop variables to calculate whether there is an overlap between the memory address range (starting address plus vector length) of the difference and the memory addresses of the two loop variables. However, subtraction operations are signed, while computers perform binary operations, which are unsigned operations. The current alias analysis method treats the difference as unsigned, resulting in very large numbers. Thus, the estimated memory address range will be larger. In this way, there will be an analysis conclusion of overlap, that is, mutual dependence, and the compiled code will not be optimized. The current alias analysis method does not care about the number of loop executions in the loop variable and only gives a final conclusion of "yes" or "no", without providing the operation results of the loop variables in the LLVM IR expression for each iteration. Thus, during the instruction scheduling after register allocation, it is impossible to completely eliminate hardware-specific bank conflicts. It can be seen that the accuracy of the results of the current alias analysis method is not high.

[0028] An embodiment of the present application provides a compiler optimization method, as Figure 1 shown, Figure 1 is a flowchart of a compiler optimization method provided by an embodiment of the present application. The compiler optimization method includes:

[0029] S101. Obtain the vector length corresponding to the access operation in the compiled language; the vector length is related to the number of elements included in the memory address to be accessed.

[0030] In the embodiment of the present application, the access operation may be a load operation or a store operation. The load operation refers to reading data from a memory address into a register. The store operation refers to writing data from a register to a memory address.

[0031] In the embodiments of the present application, the vector length is positively correlated with the number of elements included in the memory address to be read or written. The vector length may refer to the number of elements included in the memory address to be read or written. An element is the basic unit of a data structure. For example, a value in an array. An element can be an integer, a character, or other data types. The size of an element depends on the data type. The integer type (int) occupies 4 bytes, and the double-precision floating-point type (double) occupies 8 bytes. The vector length may also refer to the number of bytes occupied by the memory address to be read or written. A byte is a measurement unit of storage space and is used to measure the size of data. For example, for the memory address read by a load operation, assuming the memory address includes 100 elements, the vector length is 100 elements. If the data type is the int type, the vector length is 400 bytes. If the data type is the double type, the vector length is 800 bytes.

[0032] S102. When the vector length corresponding to the access operation is not a power of a preset value and is greater than a preset threshold, split the access operation according to the vector length to obtain a plurality of sub-access operations.

[0033] In the embodiments of the present application, the access operation is normalized. When the vector length corresponding to the access operation is a power of a preset value, there is no need to split the memory address of the access operation. When the vector length is less than or equal to the preset threshold, it means that the length of the memory address is not very long, and the access operation is not split further. When splitting, after splitting the access operation into a plurality of sub-access operations, if the remaining vector length is less than or equal to the preset threshold, no further splitting is performed.

[0034] It should be noted that the preset value can be set to a power of 2, such as 2, 4, 8, 16, etc. The preset threshold can be set to a power of 2, such as 64, 128, 256, etc. The embodiments of the present application do not limit this.

[0035] Exemplarily, taking the preset value as 2 and the preset threshold as 64 as an example, the splitting rule is that when the vector length is not a power of 2, or less than or equal to 64, no splitting is performed. For example, if the vector length is 2000, 2000 = 1024(2 10 ) + 512(2 9 ) + 256(2 8 ) + 128(2 7 ) + 64(2 6 ) + 16; for example, if the vector length is 1030, 1030 = 1024(2 10 ) + 6.

[0036] In some embodiments, the multiple sub - access operations at least include a first sub - access operation and a second sub - access operation. The vector length corresponding to the first sub - access operation is greater than half of the vector length corresponding to the access operation, and the vector length corresponding to the second sub - access operation is less than or equal to a preset threshold.

[0037] In the embodiments of the present application, when splitting the access operation, it can be split in turn according to the order from the largest power of a preset value to the smallest. In this way, after the first split, the vector length of the first sub - access operation obtained by splitting is greater than half of the vector length of the access operation. After the last split, the vector length of the second sub - access operation obtained by splitting is less than or equal to the preset threshold. For example, 2000 = 1024(2 10 ) + 512(2 9 ) + 256(2 8 ) + 128(2 7 ) + 64(2 6 ) + 16. The vector length of the first sub - access operation is 1024, and the vector length of the second sub - access operation is 16.

[0038] When splitting the access operation, when the vector length corresponding to the access operation is not an integer multiple of the preset power of the preset value and is greater than the preset threshold, the preset threshold is set to the preset power of the preset value, and the access operation is split according to the vector length to obtain multiple sub - access operations. That is, it is always split according to the preset power of the preset value. For example, taking the preset value as 2 and the preset power as 8, the vector length is 2000, 2000 = 256(2 8 )×7 + 208; for example, the vector length is 1030, 1030 = 256(2 8 )×4 + 6.

[0039] It should be noted that the above - mentioned scheme of always splitting according to the preset power of the preset value is a small - granularity split. Based on this scheme, duplicate access operations in the compiled language are eliminated, and the optimization effect at the LLVM IR level of the compiler is improved, but it does not affect the optimization effect at the machine instruction level. However, this scheme will cause the number of sub - access operations obtained by splitting to increase, thereby increasing the additional compilation time.

[0040] In the embodiments of the present application, when optimizing a compiled language, it not only includes eliminating duplicate access operations in the compiled language, but also includes instruction selection (which can also be called instruction optimization) when converting the compiled language into machine instructions, and also includes instruction scheduling before register allocation, and also includes eliminating duplicate access operations in machine instructions, and also includes instruction scheduling after register allocation for eliminating bank conflict. The splitting of access operations is before eliminating duplicate access operations in the compiled language. The splitting of access operations is a large-granularity splitting. The granularity of subsequent instruction selection, instruction scheduling, eliminating duplicate access operations in machine instructions, and eliminating bank conflict will decrease in turn, so as to complete the entire optimization process. Therefore, the splitting of access operations here can be carried out according to the large-granularity splitting method. For example, by splitting in the order from the largest power of a preset value to the smallest, most duplicate access operations in the compiled language can be eliminated, improving the accuracy of the compiler optimization result.

[0041] S103. Optimize the duplicate operations in the compiled language according to multiple sub-access operations to obtain a compilation optimization result.

[0042] In the embodiments of the present application, by splitting an access operation with a longer vector length into multiple sub-access operations with shorter vector lengths, and then eliminating the duplicate operations in the multiple sub-access operations, sub-access operations with duplicate memory addresses can be eliminated, improving the accuracy of the compiler optimization result. And based on the multiple sub-access operations, it can also be applied to subsequent instruction selection, instruction scheduling, eliminating duplicate access operations in machine instructions, and eliminating bank conflict, improving the accuracy of the optimization results of subsequent optimization processes.

[0043] In the embodiments of the present application, after eliminating the duplicate operations in multiple sub-access operations to obtain a compilation optimization result (which includes the optimized multiple sub-access operations), instruction conversion is also performed on the optimized multiple sub-access operations to obtain machine instructions; then physical register allocation (i.e., hardware register allocation) is performed on the machine instructions to complete the compiler optimization process. Before and after the process of physical register allocation, instruction scheduling before register allocation and instruction scheduling after register allocation are also combined with instruction scheduling rules for the machine instructions. The following will be introduced separately.

[0044] The optimization process of the compiled language includes the process of eliminating duplicate operations in multiple sub-access operations (which can refer to the descriptions of S101 - S103 above), the instruction selection process, the instruction scheduling process before register allocation, the process of eliminating duplicate access operations in machine instructions, the register allocation process, and the instruction scheduling process after register allocation.

[0045] Among them, the instruction selection process refers to performing instruction conversion on multiple optimized sub-access operations to generate machine instructions related to the computer device, so as to ensure that the generated machine instructions after instruction conversion can be supported by the computer device.

[0046] The instruction scheduling process before register allocation refers to rearranging the execution order of machine instructions to obtain an instruction scheduling result, so as to ensure that the execution orders of machine instructions do not depend on each other, reduce waiting, and improve resource utilization.

[0047] The process of eliminating duplicate access operations in machine instructions refers to optimizing the memory addresses with duplicate accesses in the instruction scheduling result to obtain instructions corresponding to each of the optimized multiple sub-access operations.

[0048] The register allocation process refers to allocating physical registers to the instructions corresponding to each of the optimized multiple sub-access operations according to the number of physical registers in the hardware platform, so as to efficiently utilize the limited register resources and improve the program execution efficiency.

[0049] The instruction scheduling process after register allocation refers to performing instruction scheduling on the instructions corresponding to each of the multiple sub-access operations after physical registers have been allocated, that is, rearranging the execution order of the machine instructions with allocated physical registers to obtain an instruction scheduling result.

[0050] The above compiler optimization process is based on the multiple sub-access operations split as described above, thereby improving the accuracy of the compiler optimization result.

[0051] According to the solution provided by this application, obtain the vector length corresponding to the access operation in the compiled language; the vector length is related to the number of elements included in the memory address to be accessed; when the vector length is not a power of a preset value and the vector length is greater than a preset threshold, split the access operation according to the vector length to obtain multiple sub-access operations; optimize the duplicate operations in the compiled language according to the multiple sub-access operations to obtain a compilation optimization result. Normalize the access operations in the intermediate representation (IR) of the compiler and split them into multiple sub-access operations, which can not only eliminate duplicate sub-access operations in the intermediate representation; moreover, in the subsequent instruction scheduling process after register allocation, based on the instructions corresponding to each of the multiple sub-access operations, specific hardware bank conflicts can be eliminated, improving the accuracy of the compiler optimization result.

[0052] In some embodiments, before S101, the compiler optimization method may further include the following steps: convert the base address of the pointer in the access operation to obtain a conversion result; when the conversion result indicates that the base address is a constant, replace the base address with the constant and then execute the subsequent S101 - S103.

[0053] In the embodiments of the present application, an access operation can be understood as an expression of operands. An operand refers to data participating in operations in a program, and such data can be constants, variables, or the results of expressions. The pointer in the access operation represents an abstract memory address, and the operand is the data stored in the memory address pointed to by the pointer. By associating with the pointer, the operand realizes the operation and access to the data pointed to by the pointer.

[0054] When optimizing a compiled language, an attempt is made to convert the base address of the pointer in the access operation into an integer constant. If the conversion is successful, the base address value of the constant is obtained for subsequent optimization processing, so that unnecessary memory dependencies can be reduced in the alias analysis process (including eliminating duplicate access operations in the compiled language, instruction selection, instruction scheduling, eliminating duplicate access operations in machine instructions, and eliminating bank conflict). If the conversion fails, the pointer is treated as a normal pointer. That is to say, if the base address of the pointer is a constant, the constant is directly used for alias analysis subsequently, which can improve the accuracy of the compiler optimization result.

[0055] The current alias analysis method treats different pointers without discrimination, resulting in low accuracy of the compiler optimization result. However, the compiler optimization method provided by the embodiments of the present application utilizes information that can be determined during compilation. If the base address is a constant, the base address is replaced with the constant to execute the compiler optimization process, eliminating unnecessary memory dependencies between the original load operation and / or store operation. Exemplarily, the constant can be applied to processes such as eliminating duplicate operations of load operations and store operations in a compiled language (such as the LLVM IR language), instruction selection, instruction scheduling before register allocation, eliminating duplicate operations of load operations and store operations in machine instructions, and instruction scheduling after register allocation (i.e., eliminating bank conflict), improving the accuracy of the compiler optimization result.

[0056] In some embodiments, based on the above Figure 1 , as Figure 2 shown, Figure 2 is a flowchart of another compiler optimization method provided by the embodiments of the present application.

[0057] S201. Obtain the vector length corresponding to the access operation in the compiled language.

[0058] S201 is the same as S101 in the above Figure 1 . For its implementation manner and the achieved technical effects, reference can be made to the description of S101 above, and details will not be elaborated here.

[0059] S202. Determine the type of the access operation.

[0060] The types of access operations include load operations and store operations. Correspondingly, the multiple sub-access operations are multiple sub-load operations and / or multiple sub-store operations.

[0061] When the access operation is a load operation, execute S203 - S204; when the access operation is a store operation, execute S205 - S206.

[0062] S203. In the case where the first vector length corresponding to the load operation is not a power of a preset value and is greater than a preset threshold, split the load operation according to the first vector length to obtain multiple sub-load operations; the first vector length is related to the number of elements included in the memory address to be read.

[0063] When splitting the load operation, perform the splitting in descending order of powers of the preset value. In this way, after the first split, the vector length of the first sub-load operation obtained is greater than half of the vector length of the load operation. After the last split, the vector length of the second sub-load operation obtained is less than or equal to the preset threshold. After splitting the load operation into multiple sub-load operations, if the remaining vector length is less than or equal to the preset threshold, no further splitting is performed. The multiple sub-load operations include at least the first sub-load operation and the second sub-load operation.

[0064] S204. Merge the multiple sub-load operations to obtain a merge operation, and delete the load operation.

[0065] For the load operation, after splitting, it is also necessary to merge the multiple sub-load operations to obtain a merge operation and delete the load operation. When the computer executes the code, the load results corresponding to the multiple sub-load operations are merged and used to replace the load result corresponding to the original load operation. That is to say, the load results corresponding to the multiple sub-load operations are merged and used as the new input to replace the original input. However, the code of the original load operation still exists. Therefore, it is also necessary to delete the original load operation. That is to delete dead code, which refers to the code segment that does not affect the program result.

[0066] S205. In the case where the second vector length corresponding to the store operation is not a power of a preset value and is greater than a preset threshold, split the store operation according to the second vector length to obtain multiple sub-store operations; the second vector length is related to the number of elements included in the memory address to be written.

[0067] When splitting a storage operation, the splitting is performed in descending order of the powers of a preset value. In this way, after the first split, the vector length of the first sub-storage operation obtained is greater than half of the vector length of the storage operation. After the last split, the vector length of the second sub-storage operation obtained is less than or equal to the preset threshold. After splitting a storage operation into multiple sub-storage operations, if the remaining vector length is less than or equal to the preset threshold, the splitting is not continued. The multiple sub-storage operations include at least a first sub-storage operation and a second sub-storage operation.

[0068] S206. Delete the storage operation.

[0069] Since a load operation reads data from a memory address into a register and then performs other operations, it is also necessary to merge multiple sub-load operations. While a storage operation writes data to a memory address, so there is no need to merge. For a storage operation, after splitting, the storage operation also needs to be deleted. When a computer executes code, the storage results corresponding to multiple sub-storage operations are used to replace the storage result corresponding to the original storage operation. However, the code of the original storage operation still exists, so it is also necessary to delete the original storage operation. That is, delete dead code, which refers to a code segment that does not affect the program result.

[0070] After S204 or S206, execute S207.

[0071] S207. Optimize the repeated operations in the compiled language according to the merge operation and / or multiple sub-storage operations to obtain a compilation optimization result.

[0072] In the embodiments of the present application, by splitting a load and / or storage operation with a longer vector length into multiple sub-load operations and / or sub-storage operations with shorter vector lengths, and then eliminating the repeated operations in the multiple sub-load operations and / or sub-storage operations, it is possible to eliminate sub-load operations and / or sub-storage operations with repeated memory addresses, improving the accuracy of the compiler optimization result.

[0073] It should be noted that when the type of the access operation is a load operation, S203 - S204 are executed, and then the duplicate operations in the compiled language are optimized according to the merge operation to obtain the compiled optimization result. When the type of the access operation is a store operation, S205 - S206 are executed, and then the duplicate operations in the compiled language are optimized according to multiple sub - store operations to obtain the compiled optimization result. When the type of the access operation includes both a load operation and a store operation, S203 - S206 are executed, and then the duplicate operations in the compiled language are optimized according to the merge operation and multiple sub - store operations to obtain the compiled optimization result. Among them, the embodiments of the present application do not limit the execution order of S203 - S204 and S205 - S206, and they can be executed in sequence or simultaneously.

[0074] Next, an exemplary application of the embodiments of the present application in an actual application scenario will be described.

[0075] Based on the above Figure 1 and Figure 2 , exemplarily, as Figure 3 shown, Figure 3 is a flowchart of another compiler optimization method provided by the embodiments of the present application. Taking the compiled language as LLVM IR language, the preset value as 2, and the preset threshold as 30 as an example, the splitting of load operations and / or store operations in the LLVM IR language will be described.

[0076] S301. Normalize the LLVM IR language to obtain the vector length of the LLVM IR language.

[0077] Before splitting the load operations and / or store operations in the LLVM IR language, first normalize the instructions involving memory address operations in the LLVM IR language to obtain the vector length. The vector length refers to the length of the number of elements (or bytes) stored in the memory address to be loaded or stored.

[0078] S302. Determine the instruction type corresponding to the LLVM IR language.

[0079] The instruction types corresponding to the LLVM IR language include load operations and store operations. For load operations, S303 - S305 are executed, and for store operations, S306 - S307 are executed.

[0080] S303. Determine whether the vector length is a power of 2.

[0081] S304. Split the load operation into multiple sub - load operations with a vector length that is a power of 2.

[0082] For a load operation where the vector length is not a power of 2, split the load operation into multiple smaller sub-load operations with vector lengths that are powers of 2, and do not split the remaining vector length less than 30.

[0083] S305. Combine multiple sub-load operations, and use the output corresponding to the combined operation obtained as the new instruction to replace the output of the original load operation.

[0084] Combine these small sub-load operations into a combined operation with the original vector length, and use the load result corresponding to the combined operation (i.e., the new instruction) to replace the load result of the original load operation.

[0085] S306. Determine whether the vector length is a power of 2.

[0086] S307. Split the store operation into multiple sub-store operations with vector lengths that are powers of 2.

[0087] For a store operation where the vector length is not a power of 2, split the store operation into multiple smaller sub-store operations with vector lengths that are powers of 2, and do not split the remaining vector length less than 30.

[0088] After S305 or S307, execute S308.

[0089] S308. Delete the code of the original load operation and / or the code of the original store operation.

[0090] The replacement in S305 above means using the load result corresponding to the combined operation as the input. However, the old code (i.e., the code of the load operation) still exists, so it is also necessary to delete the dead code generated during the splitting process (i.e., the code of the original load operation). Similarly, for the store operation, it is also necessary to delete the dead code generated during the splitting process (i.e., the code of the original store operation).

[0091] It should be noted that for the splitting of the load operation, execute S303 - S305, and then optimize the repeated operations in the LLVM IR language according to the multiple sub-load operations after S308. For the splitting of the store operation, execute S306 - S307, and then optimize the repeated operations in the LLVM IR language according to the multiple sub-store operations after S308. For the splitting of the load operation and the store operation, execute S303 - S308, and then optimize the repeated operations in the LLVM IR language according to the combined operation and the multiple sub-store operations. In this example, the execution order of S303 - S305 and S306 - S307 is not restricted, and they can be executed in sequence or simultaneously.

[0092] In the embodiments of the present application, by splitting the load operation and store operation in the LLVM IR language into lengths that are powers of 2, the remaining vector lengths less than the preset threshold are not split. Furthermore, during compiler optimization, sub-load operations and / or sub-store operations with duplicate memory addresses can be eliminated, improving the accuracy of the compiler optimization result.

[0093] In some embodiments, the compilation optimization result includes multiple optimized sub-access operations. After S103, the compiler optimization method further includes the following steps. Perform instruction conversion on the multiple optimized sub-access operations to generate machine instructions; perform instruction scheduling on the execution order of the machine instructions to obtain an instruction scheduling result; the instruction scheduling result includes the memory addresses corresponding to the machine instructions; optimize the repeatedly accessed memory addresses in the instruction scheduling result to obtain the instructions corresponding to each of the multiple optimized sub-access operations.

[0094] In the embodiments of the present application, when optimizing the compiled language, the back-end processing flow not only includes the process of eliminating duplicate access operations in the compiled language as described above Figures 1 - 3 shown, but also includes an instruction selection process, an instruction scheduling process before register allocation, a process of eliminating duplicate access operations in machine instructions, and an instruction scheduling process after register allocation (this process includes but is not limited to eliminating bank conflicts), etc., which will be described separately below.

[0095] Since different computer devices support different machine instruction sets, it is necessary to perform instruction conversion on the compiled language (i.e., the multiple optimized sub-access operations). Instruction conversion includes instruction conversion of operand types and instruction conversion of operations to ensure that the generated machine instructions after instruction conversion can be supported by the computer device. The goal of the instruction selection process is to generate machine instructions related to the computer device, and the process of mapping the compiled language to machine instructions is called the instruction selection process. During the instruction selection process, optimizations such as merging and deleting machine instructions are performed to improve the efficiency of subsequent machine instruction scheduling. The instruction selection process can also be called the instruction optimization process.

[0096] The instruction scheduling process refers to the process of rearranging the generated machine instructions during compilation to determine the execution order of the machine instructions, with the aim of optimizing the timing of instruction execution. For example, since there may be data dependencies between machine instructions, such as the output of one machine instruction being the input of another machine instruction, without sufficient scheduling, subsequent machine instructions may need to wait for the previous machine instruction to complete before execution, which can lead to performance degradation. Therefore, by changing the execution order through instruction scheduling, the waiting caused by data dependencies can be reduced. Through reasonable scheduling of machine instructions, some independent machine instructions can be executed in parallel, improving instruction-level parallelism, thereby making full use of the multiple execution units of the central processing unit (CPU) and improving CPU resource utilization and program throughput.

[0097] The instruction scheduling process is divided into instruction scheduling before register allocation (pre-RA) and instruction scheduling after register allocation (post-RA). Here, the instruction scheduling process refers to the instruction scheduling before register allocation, sorting the machine instructions according to the topological structure, considering the instruction-level parallelism, and generating an instruction sequence (i.e., the instruction scheduling result).

[0098] Instruction scheduling is performed according to the parallelism between machine instructions, and the memory addresses corresponding to the machine instructions are not yet considered. The instruction scheduling result includes the memory addresses corresponding to the machine instructions. Next, it is also necessary to eliminate duplicate load operations and / or store operations in the machine instructions to optimize the machine instructions and obtain instructions corresponding to each of the optimized multiple sub-access operations.

[0099] In the code after the instruction optimization process (i.e., instructions corresponding to each of the optimized multiple sub-access operations), an infinite number of virtual registers can be used, while the number of physical registers on the hardware platform is limited. If the number of physical registers is not sufficient to accommodate all virtual registers, the virtual registers will spill to memory. Therefore, it is also necessary to perform instruction scheduling after register allocation, the purpose of which is to sort the machine instructions with physical registers already allocated, reduce bank conflicts, and improve the accuracy of the compiler optimization result.

[0100] In summary, through the compiler backend processing flow, the compiled language is converted into assembly code or binary code of a specific target architecture, thereby generating the final executable file.

[0101] In the embodiments of the present application, due to the compilation optimization process during compiler backend processing (including the instruction selection process, the instruction scheduling process before register allocation, the process of eliminating duplicate access operations in machine instructions, and the instruction scheduling process after register allocation), which is based on the multiple sub-access operations split as described above, the accuracy of the compiler optimization result is improved.

[0102] In some embodiments, the compilation optimization result includes multiple optimized sub-access operations. After S103, the compiler optimization method further includes S401-S404. In the embodiments of the present application, instruction conversion is performed on the multiple optimized sub-access operations, instruction scheduling before register allocation, and elimination of duplicate load operations and / or store operations in machine instructions are performed to obtain instructions corresponding to each of the multiple optimized sub-access operations. Next, an instruction scheduling after register allocation is described based on the instructions corresponding to each of the multiple optimized sub-access operations. As Figure 4 shown, Figure 4 Figure 4 FIG. is a flowchart of another compiler optimization method provided by the embodiments of the present application.

[0103] S401. Obtain the iteration times of the instructions corresponding to each of the multiple optimized sub-access operations.

[0104] In the embodiments of the present application, an analysis tool or an analysis function can be used to predict the iteration times of instructions. For example, the application programming interface (API) of the compiler provides rich analysis methods and tools. The API provided by the compiler can be used to analyze the loop variables of instructions with a loop structure and predict the iteration times.

[0105] In some embodiments, the above S401 can be implemented in the following manner. Perform loop variable analysis on the instructions corresponding to each of the multiple optimized sub-access operations to obtain the iteration times of each of the multiple optimized sub-access operations; in the case where the loop execution times are predicted, use the loop execution times as the iteration times; in the case where the loop execution times are not predicted, set the iteration times to a preset number.

[0106] Through the above instruction conversion of operations (store operations or load operations), machine instructions are obtained. The machine instructions define the types of operations to be performed, and the operations are the means to implement the functions of these instructions. Based on this, use an analysis tool or an analysis function to perform loop transformation analysis on each machine instruction and predict the iteration times of the operations corresponding to each machine instruction. Some operations can predict their iteration times, while some operations cannot predict their iteration times. Therefore, if the loop execution times of a certain operation can be predicted, use the loop execution times as the iteration times of the operation. If the loop execution times of a certain operation cannot be predicted, a preset number needs to be set according to the empirical value and used as the iteration times of the operation.

[0107] It should be noted that the preset number of times can be appropriately set by those skilled in the art according to a large number of experimental thresholds. For example, 10, 20, 100, 200, etc. The embodiments of the present application do not limit this.

[0108] In the embodiments of the present application, a loop variable analysis is performed on each instruction with a loop structure by using an analysis tool or an analysis function to predict the number of iterations of the operation corresponding to each instruction. The predicted or set number of iterations is used in the subsequent instruction scheduling process after register allocation. By considering the number of loop executions in the loop variable, bank conflict can be reduced.

[0109] S402. When allocating a target instruction to a sequence, analyze the dependencies between the target instruction and each of the first instructions that have been allocated in the sequence to obtain the operation result of each iteration when running the target instruction; the target instruction is any unallocated instruction, and the sequence includes a plurality of first instructions that are not mutually dependent and are executed in parallel.

[0110] The allocated instructions represent the machine instructions whose order has been determined in the sequence to which they belong. When scheduling instructions, each machine instruction is allocated and assigned to each sequence. The sequence can be understood as an instruction packet or a launch packet including a plurality of instructions executed in parallel. Taking the target instruction as an example, if you want to allocate the target instruction to a sequence, assuming that there are no allocated instructions in the sequence, then the target instruction can be allocated to the sequence. Assuming that the sequence includes one or more first instructions that have been allocated. When the number of first instructions is one, it is necessary to analyze the dependency between the target instruction and the first instruction to obtain the operation result of each iteration. When the number of first instructions is multiple, these multiple first instructions are not mutually dependent and can be parallel instructions. It is necessary to analyze the dependencies between the target instruction and the multiple first instructions in the sequence one by one, that is, to analyze the dependencies between the target instruction and each first instruction.

[0111] S403. In the case where the operation result indicates that the target instruction depends on any of the first instructions, continue to analyze the dependencies between the target instruction and each of the second instructions that have been allocated in the next sequence until the operation results of multiple iterations all indicate that the target instruction does not depend on the allocated instructions in the target sequence, and then allocate the target instruction in the target sequence.

[0112] For any first instruction, when running the target instruction, assuming that the operation result of any iteration indicates that the target instruction depends on the first instruction, it means that the target instruction cannot be allocated to this sequence. Continue to analyze the dependency between the target instruction and the next sequence. Assuming that there are no instructions that have been allocated and completed in the next sequence, then the target instruction can be allocated to the next sequence. Assuming that the next sequence includes one or more second instructions that have been allocated and completed. When the number of second instructions is one, it is necessary to analyze the dependency between the target instruction and this second instruction to obtain the operation result of each iteration. When the number of second instructions is multiple, it is necessary to analyze the dependency between the target instruction and multiple second instructions in the sequence one by one, that is, to analyze the dependency between the target instruction and each first instruction. By analogy, until a target sequence is found, there are no instructions that have been allocated and completed in the target sequence, or the operation results of multiple iterations all indicate that the target instruction does not depend on the instructions that have been allocated and completed in the target sequence. In this case, the target instruction can be allocated in the target sequence.

[0113] S404. When the operation results of multiple iterations all indicate that the target instruction does not depend on each first instruction, allocate the target instruction in the sequence, and continue to allocate the next unallocated instruction until the instructions corresponding to each of the optimized multiple sub-access operations are allocated and completed, obtaining the instruction scheduling result.

[0114] During the process of allocating the target instruction to the sequence, assuming that there are no instructions that have been allocated and completed in this sequence, or the operation results of multiple iterations all indicate that the target instruction does not depend on the first instructions that have been allocated and completed in the sequence. In this case, the target instruction can be allocated to this sequence. And referring to the allocation process of the target instruction, continue to allocate the next unallocated instruction until the instructions corresponding to each sub-access operation are all allocated and completed, realizing the instruction scheduling process, and obtaining the instruction scheduling result. The instruction scheduling result is a series of machine instructions, which are then assembled by an assembler to generate assembly code or binary code.

[0115] Here, two examples are given with the iteration count of the target instruction being 50 times and the sequence to be allocated including 3 completed first instructions. Example 1: For each first instruction, it is necessary to obtain the operation result of each run of the target instruction. For the 1st first instruction, assume that at the 23rd iteration, the operation result indicates a mutual dependence between the target instruction and the first first instruction, then the target instruction cannot be allocated to this sequence. Assume that the operation results of 50 iterations all indicate that there is no mutual dependence between the target instruction and the 1st first instruction; then continue for the 2nd first instruction, obtain the operation result of each run of the target instruction. Assume that at the 3rd iteration, the operation result indicates a mutual dependence between the target instruction and the 2nd first instruction, then the target instruction cannot be allocated to this sequence. In the case where for each of the 3 first instructions, the operation results of 50 iterations of running the target instruction all indicate that there is no mutual dependence between the target instruction and this first instruction, the target instruction can be allocated to this sequence. And so on until all machine instructions are allocated.

[0116] Example 2: Obtain the operation result of each run of the target instruction. For the 3 first instructions, assume that the operation results of 22 iterations all indicate that there is no mutual dependence between the target instruction and the 3 first instructions; and at the 23rd iteration, the operation result indicates a mutual dependence between the target instruction and the first first instruction, then the target instruction cannot be allocated to this sequence. Assume that the operation results of 23 iterations all indicate that there is no mutual dependence between the target instruction and these 3 first instructions; then continue for the operation result of the 24th iteration, and judge whether there is a mutual dependence with each of the 3 first instructions until for each of the 3 first instructions, the operation results of 50 iterations of running the target instruction all indicate that there is no mutual dependence between the target instruction and this first instruction, and the target instruction can be allocated to this sequence. And so on until all machine instructions are allocated.

[0117] In the above Example 1, for each first instruction separately, it is judged whether there is a mutual dependence between the target instruction and the first instruction every iteration. In the case where the operation results of multiple iterations all indicate that there is no mutual dependence between the target instruction and the first first instruction, then it is judged whether there is a mutual dependence between the target instruction and the second first instruction, and so on. In the above Example 2, for multiple first instructions, it is judged whether there is a mutual dependence between the target instruction and all the first instructions every iteration, and so on.

[0118] The instruction scheduling process after register allocation is as follows: For machine instruction A, it is intended to allocate machine instruction A to sequence A; assuming that there is no machine instruction that has been allocated in sequence A, machine instruction A is allocated to sequence A. For machine instruction B, it is intended to allocate machine instruction B to sequence A. Since sequence A includes the already allocated machine instruction A, therefore, it is necessary to analyze the dependency between machine instruction B and machine instruction A; assuming that the number of iterations of machine instruction B is 10 times, then it is necessary to obtain the operation result of running machine instruction B each time. Assuming that at the 6th iteration, the operation result indicates that machine instruction B and machine instruction A are mutually dependent, then machine instruction B cannot be allocated to sequence A. Assuming that the operation results of 10 iterations all indicate that machine instruction B and machine instruction A are not mutually dependent, then machine instruction B can be allocated to sequence A. And so on, until all machine instructions are allocated.

[0119] The current alias analysis method does not care about the number of loop executions in loop variables, resulting in the inability to completely eliminate hardware-specific bank conflicts. The compiler optimization method provided by the embodiments of the present application analyzes the number of iterations of instructions and analyzes the dependencies between the instructions and each of the already allocated instructions in the sequence, so that the instructions are allocated to a suitable sequence, and the instructions in this sequence are not mutually dependent and can be executed in parallel. In this way, bank conflicts can be eliminated to the greatest extent, the hardware overhead caused by bank conflicts can be reduced, and the accuracy of the compiler optimization result is improved.

[0120] In some embodiments, when the above S402 allocates the target instruction to the sequence, for each first instruction in the sequence, it analyzes the dependency between the target instruction and the first instruction, and obtains the operation result of running the target instruction at each iteration. Assuming that the number of iterations of the target instruction is K and the sequence includes M first instructions, then for each first instruction, the target instruction needs to be run K times; of course, it is also possible that the target instruction depends on the first instruction when the number of runs is less than K times, then it means that the target instruction cannot be allocated in this sequence, and there is no need to analyze the dependency between the target instruction and the first instruction anymore. In this way, when the operation results of K×M iterations all indicate that the target instruction does not depend on each first instruction, it means that the target instruction can be allocated in this sequence. Next, the process of judging whether the operation result of each iteration indicates that the target instruction depends on the first instruction will be described.

[0121] For the Nth iteration, where N is a positive integer, after the Nth iteration, when the addressing mode of the target instruction is base addressing, determine the memory address corresponding to the target instruction. The memory address includes a starting address and a vector length. The starting address is determined based on the base address and an offset; when the memory address corresponding to the target instruction does not overlap with the memory address corresponding to the first instruction, take that the target instruction does not depend on the first instruction as the operation result of the Nth iteration when running the target instruction; when the memory address corresponding to the target instruction overlaps with the memory address corresponding to the first instruction, take that the target instruction depends on the first instruction as the operation result of the Nth iteration when running the target instruction.

[0122] The base address is equivalent to a pointer pointing to the starting position of the memory area to be accessed. The starting address is the base address plus the offset, representing a certain position in memory; the vector length represents the number of bytes occupied by the accessed memory. Based on the starting address and the vector length, the range of the memory address (which can be simply referred to as the memory address) can be calculated. At the Nth iteration, run the target instruction and calculate the memory address of the target instruction. When the addressing mode of the target instruction is base addressing, determine the memory address corresponding to the target instruction and determine whether the memory address corresponding to the target instruction overlaps with the memory address corresponding to the first instruction. If the memory address corresponding to the target instruction does not overlap with the memory address corresponding to the first instruction, then the target instruction does not depend on the first instruction, and take it as the operation result of the Nth iteration; if the memory address corresponding to the target instruction overlaps with the memory address corresponding to the first instruction, then the target instruction depends on the first instruction, and take it as the operation result of the Nth iteration.

[0123] In the embodiments of the present application, by calculating the memory address of the target instruction and determining whether the memory addresses between the target instruction and the first instruction overlap, it is determined whether there is a mutual dependence between the target instruction and the first instruction, and further determine whether the target instruction can be allocated to the sequence. Not only multiple iterations are considered, but also the possibility of parallelism between the target instruction and each of the first instructions that have been completed in the sequence is considered. In this way, when performing instruction scheduling after register allocation, it helps to eliminate bank conflicts and improves the accuracy of the compiler optimization result.

[0124] In some embodiments, after each iteration, it is determined whether the addressing mode of the target instruction is base addressing. When the addressing mode of the target instruction is not base addressing, recursive analysis is performed on each operand in the target instruction to obtain the expression characteristics of each operand. When the expression characteristic of any operand is not a base address, recursive analysis is continued on each sub-operand in the target operand to obtain the expression characteristics of each sub-operand until the expression characteristics of each sub-operand are all base addresses; the target operand indicates the operand whose expression characteristic is not a base address; when the expression characteristics of each operand are all base addresses, it is determined that the addressing mode of the target instruction is base addressing.

[0125] When the addressing mode of the target instruction is not base addressing, recursive analysis is performed on all operands in the expression of the target instruction to obtain the expression characteristics of each operand. For example, taking the expression of the target instruction as a + b, if a and b are not base addresses, recursive analysis is performed on a and b. Assume a = a1 × a2 + a3 and b = b1 + 5, and continue to analyze whether a1, a2, a3, and b1 are base addresses. Assume a1, a2, and b1 are base addresses and a3 = a4 + a5, and continue to analyze whether a4 and a5 are base addresses. Assume a4 and a5 are base addresses, then it indicates that the addressing mode of the target instruction is base addressing, and the memory address corresponding to the target instruction can be obtained accordingly.

[0126] In the embodiments of the present application, by analyzing the addressing mode of the target instruction, when the target instruction is not a base address, recursive analysis is performed on all operands in the expression of the target instruction until the target instruction is a base address, and the memory address of the target instruction is obtained. In this way, a target instruction whose starting address is the base address plus the offset can be obtained, and combined with the vector length, the memory address of the target instruction can be obtained. So as to compare with the memory address of the first instruction next to determine whether the memory addresses of the two overlap. Compared with the current alias analysis technology solution that only gives a final conclusion of "yes" or "no", by outputting the memory address and then comparing the memory addresses, it is determined whether the target instruction and the first instruction are mutually dependent, improving the accuracy of the judgment result.

[0127] Next, an exemplary application of the embodiments of the present application in an actual application scenario will be described.

[0128] In the embodiments of the present application, when scheduling the instructions after register allocation, every time an instruction is scheduled, it is necessary to query the operation results of the iteration. Assuming that the API analysis tool gives an evaluation result that the instruction needs to iterate 20 times, then the operation results of the iteration should be 20. If the operation result of the 15th iteration indicates that there is a dependency between the instruction and the instructions already allocated in the sequence, then it is necessary to readjust the position of this instruction, and try to allocate the instruction to the next sequence to isolate it from the instructions in the sequence, that is, not in parallel, so as to schedule and eliminate bank conflict. As Figure 5 shown, Figure 5 is a flowchart of another compiler optimization method provided by the embodiments of the present application. The following will Figure 5 describe the instruction scheduling process after register allocation.

[0129] S501. Predict the iteration times of the target instruction.

[0130] By performing instruction conversion on the operation (store operation or load operation) as described above, machine instructions are obtained. The machine instructions define the types of operations to be executed, and the operations are the means to implement the functions of these instructions. The target instruction is any instruction to be allocated. The process of addressing the memory address of the expression of the instruction is also the process of addressing the operation. The calculation process of the memory addresses of the load operations and / or store operations located in the loop usually involves loop variables. Therefore, it is necessary to evaluate whether the number of executions of the loop body (that is, predict the iteration times of the instruction) is a constant. Call the API analysis tool provided by the compiler to evaluate the expressions in the IR language and predict the iteration times of the target instruction.

[0131] If the number of executions of the loop body can be determined at compile time, then substitute all the values of the loop variable into the calculation expression of the memory addresses of the load operations and / or store operations in sequence, and calculate the operation results of the expression at each iteration when the program actually runs these operations. If the number of executions of the loop body cannot be determined at compile time, then those skilled in the art need to specify a preset number as the iteration times. That is, only the operation results of the expression at the specified iteration times can be calculated at compile time.

[0132] That is to say, for some expressions, the number of loop iterations can be determined at compile time, and the API analysis tool can evaluate the iteration times, such as 10 times, 20 times, etc. For some expressions, the number of loop iterations cannot be determined at compile time, and the API analysis tool will give a conclusion of "unknown". Then, in order to eliminate bank conflict during instruction scheduling, those skilled in the art need to specify a preset number, such as 100 times, 8 times, etc. That is, set the iteration times to the preset number.

[0133] S502. Set the iteration variable s, where s = 1.

[0134] The iterative variable s is a loop variable used to determine whether the iteration has ended.

[0135] S503. Determine whether s exceeds the number of iterations.

[0136] If not, execute S504.

[0137] In the case where, for each iteration, it is determined whether the memory address corresponding to the expression of the target instruction overlaps with the memory address of any instruction in the sequence. If so, end and execute the process of determining whether the memory address of the target instruction overlaps with the memory address of the next instruction in the sequence. This can be understood as executing S502 - S507 again, and the object compared with the memory address of the target instruction is the next instruction.

[0138] In the case where, for each iteration, it is determined whether the memory address corresponding to the expression of the target instruction overlaps with the memory addresses of all instructions in the sequence. If so, end and execute the process of determining whether the memory address of the target instruction overlaps with the memory addresses of all instructions in the next sequence. This can be understood as executing S502 - S507 again, and the object compared with the memory address of the target instruction is all instructions in the next sequence.

[0139] S504. Determine whether the expression of the target instruction is a base address.

[0140] If so, execute S505; if not, execute S508. The purpose of determining whether the expression of the target instruction is a base address each time is to calculate the memory address of the expression. The memory address includes the starting address and the vector length, and the starting address is obtained by adding the offset to the base address.

[0141] S505. Calculate the memory address corresponding to the expression of the target instruction.

[0142] S506. Determine whether the memory addresses overlap.

[0143] To determine whether the memory addresses overlap, evaluate whether the representations of each dimension in the expression of the target instruction and the expressions of the allocated instructions in the sequence overlap.

[0144] If not, execute S507.

[0145] In the case where, for each iteration, it is determined whether the memory address corresponding to the expression of the target instruction overlaps with the memory address of any instruction in the sequence. If so, end and execute the process of determining whether the memory address of the target instruction overlaps with the memory address of the next instruction in the sequence. This can be understood as executing S502 - S507 again, and the object compared with the memory address of the target instruction is the next instruction.

[0146] In each iteration, when it is determined whether the memory address corresponding to the expression of the target instruction overlaps with the memory addresses of all instructions in the sequence, if so, it ends, and the process of determining whether the memory addresses of the target instruction and all instructions in the next sequence overlap is executed. It can be understood that S502 - S507 are executed again, and the objects compared with the memory address of the target instruction are all instructions in the next sequence.

[0147] S507, s = s + 1.

[0148] S508, Calculate the results of all operands in the expression of the target instruction.

[0149] A memory address is usually composed of a series of expressions. Therefore, the calculation process of the memory address needs to recursively analyze the values of the operands of these expressions until the base address is found.

[0150] Calculate the results of all operands in the expression. For example, if the expression is d = a + b, the operands are a and b, and then determine whether the operands a and b are base addresses. If so, the memory address of the expression can be calculated. If not, continue to calculate the results of all sub - operands included in a and b until the base address is found, and then calculate the memory address of the expression.

[0151] After S507 or S508, continue to execute S503.

[0152] The embodiment of the present application proposes a compiler optimization method for improving the alias analysis method of the compiler. Predict the number of iterations of the loop body during compilation, and by accurately calculating the memory address of the expression of the compiled language (such as LLVM IR) in each iteration, it can handle complex pointer operations, subtraction operations between different base pointers, operations containing negative immediate numbers, etc. It can improve the performance of the current compilation optimization means and can also be used to eliminate compiler optimizations specific to hardware such as bank conflict.

[0153] Based on the above Figures 1 - 3 split process of the access operation shown in Figure 4 and Figure 5 the process of eliminating bank conflict shown in Figure 6 as shown, Figure 6 is the flowchart of another compiler optimization method provided by the embodiment of the present application. Taking the compiled language as LLVM IR language as an example for illustration.

[0154] S601, Split the load operation and / or store operation in the LLVM IR language to obtain multiple sub - load operations and / or multiple sub - store operations.

[0155] The above-mentioned Figures 1 - 3 solution for splitting load operations and / or store operations can be used in S601.

[0156] S602. Eliminate duplicate sub-load operations and / or sub-store operations in the LLVM IR language.

[0157] Based on Figures 1 - 3 the normalization of the LLVM IR language introduced in any of the above embodiments, eliminate duplicate load operations and / or store operations in the LLVM IR language.

[0158] S603. Convert the LLVM IR language into machine instructions through instruction selection.

[0159] Instruction selection is to convert the IR language into computer-related assembly code (i.e., pseudo-instructions or machine instructions). When doing instruction selection, perform the alias analysis process of LLVM. According to the alias analysis result, eliminate unnecessary dependencies between machine instructions, so as to allow these machine instructions to be executed in parallel during subsequent instruction scheduling.

[0160] Here are several cases to illustrate the instruction selection process. In one case, if both addition and subtraction are performed and their result is 0, then no operation is needed and this instruction can be deleted. In another case, if there are both addition and multiplication, these two instructions can be combined into one instruction. In yet another case, when accessing a memory address, assuming that the previous load instruction has already fetched the content in the memory address and the content has not changed, and when accessing the memory address again later, through alias analysis, it is found that the content has already been fetched and can be directly used, then this load instruction can be deleted.

[0161] S604. Sort the machine instructions through instruction scheduling before register allocation.

[0162] When doing instruction scheduling before register allocation, perform the alias analysis process of LLVM. According to the alias analysis result, adjust the order of machine instructions. Some instructions can be parallel, and some instructions have a sequential execution order.

[0163] S605. Eliminate duplicate sub-load operations and / or sub-store operations in the machine instructions.

[0164] After the above-mentioned S603 converts the IR language into machine instructions, it is further possible to know the starting address and vector length (which can also be understood as vector size) of each machine instruction. When eliminating duplicate operations in the machine instructions, perform the alias analysis process of LLVM. According to the alias analysis result, delete the duplicate load and / or store machine instructions.

[0165] After deleting machine instructions with repeated loads and / or stores, physical register allocation is also performed on the machine instructions, that is, mapping virtual registers in the machine instructions to a limited number of physical registers to efficiently utilize the limited register resources, reduce memory access, and thus improve program execution efficiency. Among them, the register allocation strategies include, but are not limited to, graph coloring algorithms, linear scan algorithms, greedy algorithms, etc.

[0166] S606. Perform scheduling on the machine instructions with physical registers allocated through instruction scheduling after register allocation.

[0167] The above Figure 4 and Figure 5 The instruction scheduling scheme introduced in any of the embodiments can be used in S606 to implement instruction scheduling after register allocation.

[0168] Instruction scheduling after register allocation is to sort the machine instructions with physical registers allocated. Through Figure 5 the operation results of each iteration (that is, whether the memory addresses of two instructions overlap) to perform instruction scheduling. The scheduling principle is that there cannot be a bank conflict between two parallel instructions. For each allocated instruction, inquire about the iterative operation result of the instruction. Suppose there are 10 allocated instructions in the instruction packet or issue packet and this instruction needs to iterate 20 times, then the iterative results of 20×10 times cannot have a bank conflict; then allocate the next instruction. Suppose there can be 4 parallel instructions in the instruction packet or issue packet. When allocating the second instruction, make it parallel to the first instruction. Inquire about the iterative operation result of the instruction. If there is no bank conflict, continue to allocate the third instruction and make it parallel to the first instruction and the second instruction. Inquire about the iterative operation result of the instruction. If there is no bank conflict, continue to allocate the fourth instruction and inquire about the iterative operation result of the instruction. If there is a bank conflict, then allocate the fourth instruction to the next instruction packet or issue packet, and so on. [[ID=!16]]

[0169] It should be noted that the splitting of the IR language, instruction selection, instruction scheduling before register allocation, and the granularity division of instruction scheduling after register allocation are becoming increasingly refined. Therefore, although Figures 1 - 3 the scheme of splitting in descending order of powers of a preset value in

[0170] In the embodiments of the present application, by splitting the load operation and / or store operation in the LLVM IR language, a plurality of sub-load operations and / or a plurality of sub-store operations are obtained, which is beneficial to eliminating duplicate operations in the LLVM IR language and improving the elimination effect of duplicate operations. Then, the LLVM IR language is subjected to instruction conversion, and instruction optimization is performed in combination with the alias analysis result during the conversion to machine instructions. After being converted to machine instructions, the order of the machine instructions is adjusted in combination with the alias analysis result to complete the instruction scheduling before register allocation. After adjusting the order of the machine instructions, duplicate operations in the machine instructions are eliminated in combination with the alias analysis result. Furthermore, the memory address of each iteration of the LLVM IR expression in the loop is calculated and compared with the memory address of the allocated instructions to obtain an operation result, which can indicate whether the memory addresses of the two overlap, and then it is determined whether the instruction can be allocated to the sequence, and so on, to complete the instruction scheduling after register allocation, eliminate bank conflicts, and improve the accuracy of the compiler optimization result.

[0171] Based on the compiler optimization method provided in the above embodiments, Figure 7 is a schematic structural diagram of a compiler optimization device provided in the embodiments of the present application. This device can be implemented by software, hardware, or a combination of both to become part or all of a computer device. Refer to Figure 7 , the compiler optimization device 70 includes: an acquisition module 701, configured to acquire the vector length corresponding to the access operation in the compiled language; the vector length is related to the number of elements included in the memory address to be accessed; a splitting module 702, configured to, when the vector length corresponding to the access operation is not a power of a preset value and is greater than a preset threshold, split the access operation according to the vector length to obtain a plurality of sub-access operations; an optimization module 703, configured to optimize the duplicate operations in the compiled language according to the plurality of sub-access operations to obtain a compilation optimization result.

[0172] Optionally, the plurality of sub-access operations at least include a first sub-access operation and a second sub-access operation, the vector length corresponding to the first sub-access operation is greater than one-half of the vector length corresponding to the access operation, and the vector length corresponding to the second sub-access operation is less than or equal to the preset threshold.

[0173] Optionally, the access operation includes a load operation and / or a store operation; the splitting module 702 is further configured to, when the first vector length corresponding to the load operation is not a power of a preset value and is greater than a preset threshold, split the load operation according to the first vector length to obtain a plurality of sub-load operations; the first vector length is related to the number of elements included in the memory address to be read; and / or, when the second vector length corresponding to the store operation is not a power of a preset value and is greater than a preset threshold, split the store operation according to the second vector length to obtain a plurality of sub-store operations; the second vector length is related to the number of elements included in the memory address to be written; the plurality of sub-access operations are a plurality of sub-load operations and / or a plurality of sub-store operations.

[0174] Optionally, the optimization module 703 is further configured to merge the plurality of sub-load operations to obtain a merged operation; delete the load operation, and optimize the repeated operations in the compiled language according to the merged operation to obtain a compiled optimization result; or, delete the store operation, and optimize the repeated operations in the compiled language according to the plurality of sub-store operations to obtain a compiled optimization result; or, merge the plurality of sub-load operations to obtain a merged operation; delete the load operation and the store operation, and optimize the repeated operations in the compiled language according to the merged operation and the plurality of sub-store operations to obtain a compiled optimization result.

[0175] Optionally, the compiled optimization result includes a plurality of optimized sub-access operations; the compiler optimization device 70 further includes an allocation module 704.

[0176] The obtaining module 701 is configured to obtain the iteration times of the instructions corresponding to the plurality of optimized sub-access operations respectively; the allocation module 704 is configured to analyze the dependencies between the target instruction and each of the first instructions that have been allocated in the sequence when allocating the target instruction to the sequence, to obtain the operation result of each iteration when running the target instruction; the target instruction is any unallocated instruction, and the sequence includes a plurality of first instructions that are not mutually dependent and are executed in parallel; in the case where the operation result indicates that the target instruction depends on any first instruction, continue to analyze the dependencies between the target instruction and each of the second instructions that have been allocated in the next sequence until the operation results of multiple iterations all indicate that the target instruction does not depend on the instructions that have been allocated in the target sequence, and allocate the target instruction in the target sequence; in the case where the operation results of multiple iterations all indicate that the target instruction does not depend on each of the first instructions, allocate the target instruction in the sequence, and continue to allocate the next unallocated instruction until the instructions corresponding to the plurality of optimized sub-access operations are all allocated to obtain an instruction scheduling result.

[0177] Optionally, the allocation module 704 is further configured to, after the Nth iteration, when the addressing mode of the target instruction is base addressing, determine the memory address corresponding to the target instruction, where the memory address includes a starting address and a vector length, the starting address is determined according to a base address and an offset, and N is a positive integer; when the memory address corresponding to the target instruction does not overlap with the memory address corresponding to the first instruction, take that the target instruction does not depend on the first instruction as the operation result of the Nth iteration when running the target instruction; when the memory address corresponding to the target instruction overlaps with the memory address corresponding to the first instruction, take that the target instruction depends on the first instruction as the operation result of the Nth iteration when running the target instruction.

[0178] Optionally, the allocation module 704 is further configured to, when the addressing mode of the target instruction is not base addressing, perform recursive analysis on each operand in the target instruction to obtain the expression characteristics of each operand; when there is any operand whose expression characteristic is not a base address, continue to perform recursive analysis on each sub-operand in the target operand to obtain the expression characteristics of each sub-operand until the expression characteristics of each sub-operand are all base addresses; the target operand indicates an operand whose expression characteristic is not a base address; when the expression characteristics of each operand are all base addresses, determine that the addressing mode of the target instruction is base addressing.

[0179] Optionally, the compiler optimization device 70 further includes a prediction module 705; the prediction module 705 is configured to perform loop variable analysis on the instructions corresponding to each of the optimized multiple sub-access operations to obtain the number of iterations of each of the optimized multiple sub-access operations; when the number of loop executions is predicted, take the number of loop executions as the number of iterations; when the number of loop executions is not predicted, set the number of iterations to a preset number.

[0180] Optionally, the compiler optimization device 70 further includes a conversion module 706; the conversion module 706 is configured to convert the base address of the pointer in the access operation to obtain a conversion result; when the conversion result indicates that the base address is a constant, replace the base address with the constant and then perform the compiler optimization process.

[0181] Optionally, the compilation optimization result includes multiple optimized sub-access operations; the optimization module 703 is further configured to perform instruction conversion on the multiple optimized sub-access operations to generate machine instructions; perform instruction scheduling on the execution order of the machine instructions to obtain an instruction scheduling result; the instruction scheduling result includes the memory addresses corresponding to the machine instructions; optimize the repeatedly accessed memory addresses in the instruction scheduling result to obtain the instructions corresponding to each of the multiple optimized sub-access operations.

[0182] It should be noted that when the compiler optimization device provided in the above embodiments optimizes the compiler, only the division of the above functional modules is used for illustration. In actual applications, the above functions can be assigned to different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above.

[0183] Each functional unit and module in the above embodiments can be integrated into one processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit. The above integrated unit can be implemented in the form of hardware or in the form of a software functional unit. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other and do not limit the protection scope of the embodiments of the present application.

[0184] The compiler optimization device provided in the above embodiments and the embodiments of the compiler optimization method belong to the same concept. For the specific working processes and the technical effects brought by the units and modules in the above embodiments, reference can be made to the method embodiment part, which will not be elaborated here.

[0185] Based on the compiler optimization method provided in the above embodiments, Figure 8 FIG. is a schematic structural diagram of a computer device provided in an embodiment of the present application. As Figure 8 shown, the computer device 80 includes: a processor 801, a memory 802, and a computer program 803 stored in the memory 802 and executable on the processor 801. When the processor 801 executes the computer program 803, the steps in the compiler optimization method in the above embodiments are implemented.

[0186] The computer device 80 can be a general computer device or a special computer device. In specific implementations, the computer device 80 can be a desktop computer, a portable computer, a network server, a palm computer, a mobile phone, a tablet computer, a wireless terminal device, a communication device, or an embedded device. The embodiments of the present application do not limit the type of the computer device 80. Those skilled in the art can understand that Figure 8 merely examples of the computer device 80, and do not constitute a limitation on the computer device 80. It may include more or fewer components than shown in the figure, or combine some components, or different components. For example, it may also include input / output devices, network access devices, etc.

[0187] The processor 801 may be a Central Processing Unit (CPU), or the processor 801 may also be other general-purpose processors, Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field-Programmable Gate Arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor.

[0188] In some embodiments, the memory 802 may be an internal storage unit of the computer device 80, such as the hard disk or memory of the computer device 80. In other embodiments, the memory 802 may also be an external storage device of the computer device 80, such as a plug-in hard disk, Smart Media Card (SMC), Secure Digital (SD) card, Flash Card, etc. equipped on the computer device 80. Further, the memory 802 may also include both the internal storage unit and the external storage device of the computer device 80. The memory 802 is used to store an operating system, application programs, a Boot Loader, data, and other programs, etc. The memory 802 may also be used to temporarily store data that has been output or is to be output.

[0189] The embodiments of the present application also provide a computer device, which includes: at least one processor, a memory, and a computer program stored in the memory and executable on the at least one processor, and when the processor executes the computer program, the steps in any of the above method embodiments are implemented.

[0190] The embodiments of the present application also provide a computer-readable storage medium, which stores a computer program, and when the computer program is executed by a processor, the steps in the above method embodiments can be implemented.

[0191] The embodiments of the present application provide a computer program product, which when running on a computer, causes the computer to execute the steps in the above method embodiments.

[0192] When the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, to implement all or part of the processes in the above method embodiments of the present application, a computer program can be used to instruct the relevant hardware to complete. This computer program can be stored in a computer-readable storage medium. When the computer program is executed by a processor, the steps of the above various method embodiments can be implemented. Among them, the computer program includes computer program code, and the computer program code can be in the form of source code, object code, executable file or some intermediate form, etc. The computer-readable medium can at least include: any entity or device that can carry the computer program code to the photographing device / terminal device, recording medium, computer memory, ROM (Read-Only Memory), RAM (Random Access Memory), CD-ROM (Compact Disc Read-Only Memory), magnetic tape, floppy disk and optical data storage device, etc. The computer-readable storage medium mentioned in the present application can be a non-volatile storage medium, in other words, it can be a non-transitory storage medium.

[0193] It should be understood that all or part of the steps of implementing the above embodiments can be realized by software, hardware, firmware or any combination thereof. When implemented using software, it can be realized in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. These computer instructions can be stored in the above computer-readable storage medium.

[0194] In the above embodiments, the descriptions of the various embodiments have their own emphases. For the parts not detailed or recorded in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0195] Those of ordinary skill in the art can realize that the units and algorithm steps of the examples described in combination with the embodiments disclosed herein can be implemented by electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. Professional technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present application.

[0196] The above-described embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions recorded in the foregoing embodiments, or perform equivalent replacements on some of the technical features; and these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.

Claims

1. A compiler optimization method, characterized in that, The method includes: Obtaining a vector length corresponding to an access operation in a compiled language; the vector length is related to the number of elements included in the memory address to be accessed; When the vector length corresponding to the access operation is not a power of a preset value and is greater than a preset threshold, splitting the access operation according to the vector length to obtain a plurality of sub-access operations; Optimizing the repeated operations in the compiled language according to the plurality of sub-access operations to obtain a compilation optimization result.

2. The method according to claim 1, wherein The plurality of sub-access operations at least include a first sub-access operation and a second sub-access operation. The vector length corresponding to the first sub-access operation is greater than one half of the vector length corresponding to the access operation, and the vector length corresponding to the second sub-access operation is less than or equal to the preset threshold.

3. The method according to claim 1, characterized in that The access operation includes a load operation and / or a store operation; The step of, when the vector length corresponding to the access operation is not a power of a preset value and is greater than a preset threshold, splitting the access operation according to the vector length to obtain a plurality of sub-access operations includes: When the first vector length corresponding to the load operation is not a power of the preset value and is greater than the preset threshold, splitting the load operation according to the first vector length to obtain a plurality of sub-load operations; the first vector length is related to the number of elements included in the memory address to be read; And / or, when the second vector length corresponding to the store operation is not a power of the preset value and is greater than the preset threshold, splitting the store operation according to the second vector length to obtain a plurality of sub-store operations; the second vector length is related to the number of elements included in the memory address to be written; The plurality of sub-access operations are the plurality of sub-load operations and / or the plurality of sub-store operations.

4. The method according to claim 3, characterized in that, The step of optimizing the repeated operations in the compiled language according to the plurality of sub-access operations to obtain a compilation optimization result includes: Merging the plurality of sub-load operations to obtain a merge operation; deleting the load operation, and optimizing the repeated operations in the compiled language according to the merge operation to obtain the compilation optimization result; Or, deleting the store operation, and optimizing the repeated operations in the compiled language according to the plurality of sub-store operations to obtain the compilation optimization result; Or, merging the plurality of sub-load operations to obtain a merge operation; deleting the load operation and the store operation, and optimizing the repeated operations in the compiled language according to the merge operation and the plurality of sub-store operations to obtain the compilation optimization result.

5. The method according to any one of claims 1 to 4, characterized in that, The compilation optimization result includes a plurality of optimized sub-access operations; After optimizing the repeated operations in the compiled language according to the plurality of sub-access operations to obtain a compilation optimization result, the method further includes: Obtaining the iteration times of the instructions corresponding to the plurality of optimized sub-access operations respectively; When allocating a target instruction to a sequence, analyze the dependencies between the target instruction and each of the previously allocated first instructions in the sequence to obtain the operation result for each iteration when running the target instruction; the target instruction is any unallocated instruction, and the sequence includes multiple first instructions that are not mutually dependent and are executed in parallel. In the case where the operation result indicates that the target instruction depends on any first instruction, continue to analyze the dependencies between the target instruction and each of the previously allocated second instructions in the next sequence until the operation results of multiple iterations all indicate that the target instruction does not depend on the previously allocated instructions in the target sequence, and then allocate the target instruction in the target sequence. In the case where the operation results of multiple iterations all indicate that the target instruction does not depend on the first instructions, allocate the target instruction in the sequence and continue to allocate the next unallocated instruction until the allocation of the instructions corresponding to each of the optimized multiple sub-access operations is completed to obtain an instruction scheduling result.

6. The method according to claim 5, characterized in that, The method further includes: After the Nth iteration, in the case where the addressing mode of the target instruction is base addressing, determine the memory address corresponding to the target instruction, where the memory address includes a starting address and the vector length, and the starting address is determined based on a base address and an offset, and N is a positive integer. In the case where the memory address corresponding to the target instruction does not overlap with the memory address corresponding to the first instruction, consider that the target instruction does not depend on the first instruction as the operation result for the Nth iteration when running the target instruction. In the case where the memory address corresponding to the target instruction overlaps with the memory address corresponding to the first instruction, consider that the target instruction depends on the first instruction as the operation result for the Nth iteration when running the target instruction.

7. The method according to claim 6, wherein The method further includes: In the case where the addressing mode of the target instruction is not base addressing, perform recursive analysis on each operand in the target instruction to obtain the expression characteristics of each operand. In the case where the expression characteristic of any operand is not the base address, continue to perform recursive analysis on each sub-operand in the target operand to obtain the expression characteristics of each sub-operand until the expression characteristics of each sub-operand are all the base address; the target operand indicates the operand whose expression characteristic is not the base address. In the case where the expression characteristics of all the operands are the base address, determine that the addressing mode of the target instruction is base addressing.

8. The method according to any one of claims 1 to 4, characterized in that The compilation optimization result includes multiple optimized sub-access operations. After optimizing the repeated operations in the compiled language according to the multiple sub-access operations to obtain the compilation optimization result, the method further includes: Perform instruction conversion on the optimized multiple sub-access operations to generate machine instructions. Perform instruction scheduling on the execution order of the machine instructions to obtain an instruction scheduling result; the instruction scheduling result includes the memory address corresponding to the machine instructions. Optimize the memory addresses that are repeatedly accessed in the instruction scheduling result to obtain the instructions corresponding to each of the optimized multiple sub-access operations.

9. A computer device, characterized in that, The computer device includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the computer program is executed by the processor, the method according to any one of claims 1-8 is implemented.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program. When the computer program is executed by a processor, the method according to any one of claims 1-8 is implemented.

Citation Information

Cited By

  • Task execution method and program product

    CN121349638A

  • Task execution method and program product

    CN121349638B