A structure lifting optimization compiling method and device for a Sunway platform.NET runtime, a storage medium and equipment

CN117591122BActive Publication Date: 2026-10-09WUXI ADVANCED TECH RES INST
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311550489.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-11-21
Publication Date
2026-10-09
Estimated Expiration
2043-11-21

AI Technical Summary

Technical Problem

[0006]本发明的目的在于提供一种针对申威平台.NET运行时的结构体提升优化编译方法、装置、存储介质及设备,解决现有技术中存在的适用范围小的问题

Benefits of technology

[0036] This invention provides a structure promotion optimization compilation method, apparatus, storage medium, and device for the .NET runtime of the Shenwei platform. In the structure promotion decision stage, the number of temporary registers defined in the current platform CPU register usage specification is combined with the number and type of structure fields and the structure size to determine whether to enable structure promotion compilation optimization. The applicable scope of structure promotion compilation optimization is optimized for platform characteristics.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117591122B_ABST
    Figure CN117591122B_ABST
Patent Text Reader

Abstract

The application discloses a method and device for optimizing and compiling a structure of a.NET runtime of a Sunway platform, a storage medium and equipment, and belongs to the technical field of compiling optimization. The optimization process is to set an entering structure optimization and compiling condition, which comprises the following steps: obtaining the number of temporary registers defined in a current platform CPU register use specification and setting the number as M, and then checking the structure variables in the following order: the number of fields in the structure variable does not exceed M, the size of the structure variable does not exceed M*8 bytes, the fields in the structure variable are all primitive types, the structure variable does not contain special alignment fields and the fields in the structure variable do not participate in SMID instructions. If the structure variable satisfies all the above conditions, the entering structure optimization and compiling condition is satisfied. In the structure optimization decision stage, the application optimizes the applicable range of the structure optimization and compiling optimization according to the platform characteristics.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to a method, apparatus, storage medium, and device for struct optimization compilation of the .NET runtime on the Shenwei platform, belonging to the field of compilation optimization technology. Background Technology

[0002] Mainstream platforms such as x86 and ARM use a just-in-time (JIT) compiler in their .NET runtimes to perform an optimization called structure hoisting (or aggregate scalar replacement) when handling local variables of structure types. This method first hoists all fields within the structure variable to local variables and includes them in the optimization compilation, then allocates registers for the hoisted structure fields for easier access. This reduces the number of stack accesses to structure fields and improves the speed of accessing them. The Shenwei platform's .NET runtime currently uses the default structure compilation method.

[0003] Before enabling structure promotion optimization compilation, the .NET runtime on x86 and ARM platforms goes through a structure promotion decision phase. This phase checks the characteristics of structure type variables. Only when the characteristics of the structure type fully meet the preconditions for structure promotion optimization compilation will the just-in-time compiler execute structure promotion optimization compilation.

[0004] While the .NET runtime on x86 and ARM platforms supports struct promotion optimization, enabling this optimization requires passing all checks during the struct promotion decision phase. Based on the characteristics of struct type variables, the struct promotion decision phase imposes several restrictions on enabling struct promotion optimization, including: all fields within the struct must be primitive types, the number of fields within the struct must not exceed a set value, and the number of bytes occupied by the struct must not exceed a set value. If any of these conditions are not met, the .NET runtime disables struct promotion optimization.

[0005] The struct promotion decision phase did not fully consider platform differences, limiting the applicability of struct promotion optimization compilation. For structs that fail all checks in the decision phase, the just-in-time compiler disables struct promotion compilation optimization and uses the default struct compilation method. The default struct compilation method treats struct local variables as aggregates. When operations involve internal struct fields, the entire struct variable data must first be generated on the method stack before memory access is performed on the target field. This results in more memory access operations and some registers being idle, reducing the efficiency of struct field access. The Shenwei platform's .NET runtime currently uses the default struct compilation method. Summary of the Invention

[0006] The purpose of this invention is to provide a method, apparatus, storage medium, and device for optimizing the compilation of structures in the .NET runtime of the Shenwei platform, thereby solving the problem of limited applicability in the prior art.

[0007] To achieve the above objectives, the present invention employs the following technical solution:

[0008] In a first aspect, the present invention provides a struct-enhancing optimization compilation method for the .NET runtime of the Shenwei platform, comprising:

[0009] Retrieve structure variables from the syntax tree;

[0010] If the structure variable meets the preset conditions for entering structure hoisting optimization compilation, then the structure variable is subjected to structure hoisting optimization compilation.

[0011] The preset entry structure lifting optimization compilation conditions include:

[0012] Obtain the number of temporary registers defined in the current platform CPU register usage specification and set it to M. Then, check the structure variables in the following order: the number of fields in the structure variable does not exceed M, the size of the structure variable does not exceed M*8 bytes, all fields in the structure variable are primitive types, the structure variable does not contain specially aligned fields, and the fields in the structure variable do not participate in the SMID instruction. If the structure variable meets all of the above conditions, then the conditions for entering the structure lifting optimization compilation are met.

[0013] In conjunction with the first aspect, the structure variables are further obtained through the following method:

[0014] Obtain the IL code, parse out the IL instructions in the IL code line by line and convert them into nodes of the syntax tree to generate the initial syntax tree, traverse all local variables in the initial syntax tree and filter out the structure variables.

[0015] In conjunction with the first aspect, the further optimization of the structure compilation includes:

[0016] Sort all fields in the structure variable in ascending order according to the preset offset;

[0017] Each sorted field is promoted to obtain its corresponding temporary local variable, and a free temporary register is allocated for the temporary local variable;

[0018] Replace the nodes in the syntax tree that access fields with nodes that access temporary local variables;

[0019] The syntax tree after replacing nodes is used to optimize the structure variables and generate an optimized syntax tree;

[0020] To optimize the generation of instruction description objects for nodes accessing temporary local variables in the syntax tree, the instruction description objects are stored in instruction group objects;

[0021] The instruction description objects in the instruction group object are encoded into instruction machine code according to the Shenwei platform instruction format, and the structure is improved and optimized for compilation.

[0022] In conjunction with the first aspect, furthermore, after promoting each sorted field, the original structure variables are still retained.

[0023] In conjunction with the first aspect, it further includes: if the structure variable does not meet the preset conditions for entering structure promotion and optimization compilation, the structure variable is compiled using the default structure compilation method.

[0024] In conjunction with the first aspect, further, generating instruction description objects for nodes accessing temporary local variables in the optimized syntax tree includes: saving the access instructions for the temporary local variables corresponding to the nodes and the number of the temporary registers allocated for the temporary local variables into the generated instruction description objects.

[0025] In conjunction with the first aspect, further, the step of encoding the instruction description objects in the instruction group object into instruction machine code according to the Shenwei platform instruction format includes: encoding the access instruction operations and temporary register numbers in the instruction description objects into instruction machine code according to the Shenwei platform instruction format.

[0026] Secondly, the present invention also provides a structure-enhancing optimization compilation apparatus for the .NET runtime of the Shenwei platform, comprising:

[0027] The variable retrieval module is configured to retrieve structure variables from the syntax tree.

[0028] The structure lifting and optimization compilation module is configured to perform structure lifting and optimization compilation on the structure variable if the structure variable meets the preset conditions for entering structure lifting and optimization compilation.

[0029] The preset entry structure lifting optimization compilation conditions include:

[0030] Obtain the number of temporary registers defined in the current platform CPU register usage specification and set it to M. Then, check the structure variables in the following order: the number of fields in the structure variable does not exceed M, the size of the structure variable does not exceed M*8 bytes, all fields in the structure variable are primitive types, the structure variable does not contain specially aligned fields, and the fields in the structure variable do not participate in the SMID instruction. If the structure variable meets all of the above conditions, then the conditions for entering the structure lifting optimization compilation are met.

[0031] Thirdly, the present invention also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the structure promotion optimization compilation method for the Shenwei platform .NET runtime as described in any of the first aspects.

[0032] Fourthly, the present invention also provides an apparatus comprising:

[0033] Memory, used to store instructions;

[0034] A processor for executing the instructions, causing the device to perform operations implementing the struct promotion optimization compilation method for the Shenwei platform .NET runtime as described in any of the first aspects.

[0035] Compared with the prior art, the beneficial effects achieved by the present invention are:

[0036] This invention provides a structure promotion optimization compilation method, apparatus, storage medium, and device for the .NET runtime of the Shenwei platform. In the structure promotion decision stage, the number of temporary registers defined in the current platform CPU register usage specification is combined with the number and type of structure fields and the structure size to determine whether to enable structure promotion compilation optimization. The applicable scope of structure promotion compilation optimization is optimized for platform characteristics.

[0037] During the syntax tree transformation stage, fields in the structure variable are promoted to temporary local variables, allowing them to participate in the optimization compilation steps of the just-in-time compiler in subsequent stages. During the register allocation stage, the promoted structure fields are stored in registers, reducing the number of stack accesses to the structure fields and improving the access speed of the structure fields. Attached Figure Description

[0038] Figure 1 This is one of the flowcharts of a structure enhancement and optimization compilation method for the .NET runtime of the Shenwei platform provided in this embodiment of the invention;

[0039] Figure 2 This is the second flowchart of a structure enhancement and optimization compilation method for the .NET runtime of the Shenwei platform provided in this embodiment of the invention;

[0040] Figure 3 This is a flowchart of the structure enhancement decision-making stage provided in an embodiment of the present invention;

[0041] Figure 4 This refers to the syntax tree and local variable table before and after structure promotion provided in this embodiment of the invention. Detailed Implementation

[0042] The present invention will be further described below with reference to the accompanying drawings. The following embodiments are only used to illustrate the technical solution of the present invention more clearly, and should not be used to limit the scope of protection of the present invention.

[0043] Example 1

[0044] like Figure 1 As shown, this invention provides a structure-enhancing optimization compilation method for the .NET runtime of the Shenwei platform, including the following steps:

[0045] S1. Retrieve the structure variables from the syntax tree.

[0046] Structure variables are obtained through the following methods:

[0047] Obtain the IL code, parse out the IL instructions in the IL code line by line and convert them into nodes of the syntax tree to generate the initial syntax tree. Traverse all local variables in the initial syntax tree and filter out the structure variables.

[0048] S2. If the structure variable meets the preset conditions for entering structure boosting optimization compilation, then the structure variable is subjected to structure boosting optimization compilation.

[0049] like Figure 3 As shown, the preset compilation conditions for entering a structure for optimization include:

[0050] Obtain the number of temporary registers defined in the current platform CPU register usage specification and set it to M. Then, check the structure variables in the following order: the number of fields in the structure variable does not exceed M, the size of the structure variable does not exceed M*8 bytes, all fields in the structure variable are primitive types, the structure variable does not contain specially aligned fields, and the fields in the structure variable do not participate in the SMID instruction. If the structure variable meets all of the above conditions, then the conditions for entering the structure lifting optimization compilation are met.

[0051] If a structure variable does not meet the preset conditions for entering a structure for optimization, the default structure compilation method will be used for the structure variable.

[0052] Perform structure hoisting optimization compilation on structure variables, including:

[0053] Sort all fields in the structure variable in ascending order according to the preset offset;

[0054] Each sorted field is promoted to obtain its corresponding temporary local variable, and an empty temporary register is allocated for the temporary local variable, while the original structure variable is retained;

[0055] Replace the nodes in the syntax tree that access fields with nodes that access temporary local variables;

[0056] The syntax tree after replacing nodes is used to optimize the structure variables and generate an optimized syntax tree;

[0057] To optimize the generation of instruction description objects for nodes accessing temporary local variables in the syntax tree, the access instructions for the temporary local variables corresponding to the nodes and the number of the temporary registers allocated for the temporary local variables are saved in the generated instruction description objects, and the instruction description objects are stored in the instruction group objects.

[0058] The instruction description objects in the instruction group object are encoded into machine code according to the Shenwei platform instruction format. That is, the access instruction operations and temporary register numbers in the instruction description objects are encoded into machine code according to the Shenwei platform instruction format, thus completing the structure upgrade and optimization compilation.

[0059] Example 2

[0060] like Figure 2 As shown, this embodiment of the invention also provides a structure promotion optimization compilation method for the .NET runtime of the Shenwei platform, including five steps: syntax tree generation, structure promotion decision, syntax tree transformation, register allocation, and machine code generation.

[0061] I. Syntax Tree Generation Stage.

[0062] S1: Construct the initial syntax tree.

[0063] Read the IL code, parse out the IL instructions in the IL code one by one and convert them into syntax tree nodes, thereby generating the initial syntax tree and local variable table.

[0064] II. Structural Improvement Decision-Making Stage.

[0065] S2: Inspect local variables in the initial syntax tree.

[0066] Traverse all local variables in the initial syntax tree. If the variable is a structure type local variable (structure variable), jump to S3 to decide whether to use structure promotion optimization for the structure variable.

[0067] S3: Platform Adaptive Structure Improvement Decision-Making Method.

[0068] First, obtain the number of temporary registers defined in the current platform CPU register usage specification and set it to M. Then, check the characteristics of the structure variables in the following order and decide whether to perform structure promotion optimization compilation:

[0069] The number of fields in a structure cannot exceed M;

[0070] The size of the structure shall not exceed M*8 bytes;

[0071] All fields in the struct are primitive types;

[0072] The struct does not contain specially aligned fields;

[0073] The fields of the structure are not involved in the SMID directive (e.g., the structure of type vector);

[0074] When the characteristics of a structure variable do not meet any of the conditions, the just-in-time compiler disables structure promotion optimization and uses the default structure compilation method. See details in [link to details]. Figure 3 .

[0075] III. Syntax Tree Transformation Stage.

[0076] S4: Sort the fields in the structure.

[0077] Sort the list of all fields in the structure variables in the syntax tree in ascending order based on their offsets.

[0078] S5: Structure fields are promoted and temporary local variables are generated.

[0079] Iterate through all the sorted fields in the structure from the previous step, and create a new temporary local variable of the corresponding type for each field in the local variable table. The original structure variables will still be retained. See [link to previous step]. Figure 4 .

[0080] S6: Replace a node in the syntax tree.

[0081] Replace the syntax tree nodes that access structure fields with nodes that access temporary local variables. Figure 4 It is a comparison diagram of the syntax tree and local variable table before and after the promotion.

[0082] S7: Further optimize the syntax tree.

[0083] The replaced syntax tree continues to be optimized for local variables, generating the final optimized syntax tree.

[0084] IV. Register allocation phase.

[0085] S8: Allocate registers for local variables

[0086] Traverse the optimized syntax tree and attempt to allocate registers for the variables in the local variable table using the register allocation algorithm. If the local variable is a structure variable, and the optimization conditions are met in the S3 decision step, and temporary local variables are generated for all fields of the structure in the S5 step, then attempt to allocate free temporary registers for the temporary local variables corresponding to the structure fields; if the structure variable fails to meet the optimization conditions in the S3 decision step, then allocate all fields of the structure variable onto the stack.

[0087] V. Machine code generation stage.

[0088] S9: Generate instruction object.

[0089] Create an instruction group object (insGroup), analyze the optimized syntax tree, and generate instruction description objects (instrDesc) for the syntax tree nodes. If the syntax tree node is a temporary local variable node generated in step S6, then the access instructions for that temporary local variable and the free temporary register number allocated for it in step S8 are saved to the instruction description object. Finally, the generated instruction description objects are sequentially stored into the instruction group object.

[0090] S10: Encode into instruction machine code.

[0091] Process the instruction description objects in the instruction group object one by one, and encode them into instruction machine code according to the Shenwei platform instruction format based on the access instruction operation and register number stored in the instruction description object.

[0092] Example 3

[0093] This invention provides a struct-enhancing optimization compilation device for the .NET runtime on the Shenwei platform, comprising:

[0094] The variable retrieval module is configured to retrieve structure variables from the syntax tree.

[0095] The structure lifting and optimization compilation module is configured to perform structure lifting and optimization compilation on the structure variable if the structure variable meets the preset conditions for entering structure lifting and optimization compilation.

[0096] The preset entry structure lifting optimization compilation conditions include:

[0097] Obtain the number of temporary registers defined in the current platform CPU register usage specification and set it to M. Then, check the structure variables in the following order: the number of fields in the structure variable does not exceed M, the size of the structure variable does not exceed M*8 bytes, all fields in the structure variable are primitive types, the structure variable does not contain specially aligned fields, and the fields in the structure variable do not participate in the SMID instruction. If the structure variable meets all of the above conditions, then the conditions for entering the structure lifting optimization compilation are met.

[0098] Example 4

[0099] The present invention also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the structure-enhancing optimization compilation method for the Shenwei platform .NET runtime as provided in Example 1:

[0100] Retrieve structure variables from the syntax tree;

[0101] If the structure variable meets the preset conditions for entering structure hoisting optimization compilation, then the structure variable is subjected to structure hoisting optimization compilation.

[0102] The preset entry structure lifting optimization compilation conditions include:

[0103] Obtain the number of temporary registers defined in the current platform CPU register usage specification and set it to M. Then, check the structure variables in the following order: the number of fields in the structure variable does not exceed M, the size of the structure variable does not exceed M*8 bytes, all fields in the structure variable are primitive types, the structure variable does not contain specially aligned fields, and the fields in the structure variable do not participate in the SMID instruction. If the structure variable meets all of the above conditions, then the conditions for entering the structure lifting optimization compilation are met.

[0104] Example 5

[0105] The present invention also provides an apparatus comprising:

[0106] Memory, used to store instructions;

[0107] The processor is configured to execute the instructions, causing the device to perform operations implementing the structure-enhancing optimization compilation method for the Shenwei platform .NET runtime as provided in Example 1:

[0108] Retrieve structure variables from the syntax tree;

[0109] If the structure variable meets the preset conditions for entering structure hoisting optimization compilation, then the structure variable is subjected to structure hoisting optimization compilation.

[0110] The preset entry structure lifting optimization compilation conditions include:

[0111] Obtain the number of temporary registers defined in the current platform CPU register usage specification and set it to M. Then, check the structure variables in the following order: the number of fields in the structure variable does not exceed M, the size of the structure variable does not exceed M*8 bytes, all fields in the structure variable are primitive types, the structure variable does not contain specially aligned fields, and the fields in the structure variable do not participate in the SMID instruction. If the structure variable meets all of the above conditions, then the conditions for entering the structure lifting optimization compilation are met.

[0112] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0113] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0114] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0115] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0116] The above description is only a preferred embodiment of the present invention. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the technical principles of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.

Claims

1. A struct promotion optimization compilation method for the .NET runtime of the Shenwei platform, characterized in that, include: Retrieve structure variables from the syntax tree; If the structure variable meets the preset conditions for entering structure hoisting optimization compilation, then the structure variable is subjected to structure hoisting optimization compilation. The preset entry structure lifting optimization compilation conditions include: Get the number of temporary registers defined in the current platform CPU register usage specification and set it to M. Then check the structure variables in the following order: the number of fields in the structure variable does not exceed M, the size of the structure variable does not exceed M*8 bytes, all fields in the structure variable are primitive types, the structure variable does not contain specially aligned fields, and the fields in the structure variable do not participate in the SMID instruction. If the structure variable meets all the above conditions, then it meets the conditions for entering the structure lift optimization compilation. The structure enhancement and optimization compilation includes: Sort all fields in the structure variable in ascending order according to the preset offset; Each sorted field is promoted to obtain its corresponding temporary local variable, and a free temporary register is allocated for the temporary local variable; Replace the nodes in the syntax tree that access fields with nodes that access temporary local variables; The syntax tree after replacing nodes is used to optimize the structure variables and generate an optimized syntax tree; To optimize the generation of instruction description objects for nodes accessing temporary local variables in the syntax tree, the instruction description objects are stored in instruction group objects; Encode the instruction description objects in the instruction group object into instruction machine code according to the Shenwei platform instruction format, and complete the structure upgrade and optimization compilation. The step of generating instruction description objects for nodes accessing temporary local variables in the optimized syntax tree includes: saving the access instructions for the temporary local variables corresponding to the nodes and the number of the temporary registers allocated for the temporary local variables into the generated instruction description objects; The step of encoding the instruction description objects in the instruction group object into instruction machine code according to the Shenwei platform instruction format includes: encoding the access instruction operations and temporary register numbers in the instruction description objects into instruction machine code according to the Shenwei platform instruction format.

2. The struct-based optimization compilation method for the .NET runtime of the Shenwei platform according to claim 1, characterized in that, The structure variables are obtained through the following method: Obtain the IL code, parse out the IL instructions in the IL code one by one and convert them into nodes of the syntax tree to generate the initial syntax tree, traverse all local variables in the initial syntax tree, and filter out the structure variables.

3. The struct promotion optimization compilation method for the Shenwei platform .NET runtime according to claim 1, characterized in that, After each field is promoted according to the sorting, the original structure variables are still retained.

4. The struct promotion optimization compilation method for the Shenwei platform .NET runtime according to claim 1, characterized in that, Also includes: If the structure variable does not meet the preset conditions for entering structure lifting and optimization compilation, the structure variable will be compiled using the default structure compilation method.

5. A struct promotion optimization compilation device for the .NET runtime of the Shenwei platform, characterized in that, include: The variable retrieval module is configured to retrieve structure variables from the syntax tree. The structure lifting and optimization compilation module is configured to perform structure lifting and optimization compilation on the structure variable if the structure variable meets the preset conditions for entering structure lifting and optimization compilation. The preset entry structure lifting optimization compilation conditions include: Get the number of temporary registers defined in the current platform CPU register usage specification and set it to M. Then check the structure variables in the following order: the number of fields in the structure variable does not exceed M, the size of the structure variable does not exceed M*8 bytes, all fields in the structure variable are primitive types, the structure variable does not contain specially aligned fields, and the fields in the structure variable do not participate in the SMID instruction. If the structure variable meets all the above conditions, then it meets the conditions for entering the structure lift optimization compilation. The structure enhancement and optimization compilation includes: Sort all fields in the structure variable in ascending order according to the preset offset; Each sorted field is promoted to obtain its corresponding temporary local variable, and a free temporary register is allocated for the temporary local variable; Replace the nodes in the syntax tree that access fields with nodes that access temporary local variables; The syntax tree after replacing nodes is used to optimize the structure variables and generate an optimized syntax tree; To optimize the generation of instruction description objects for nodes accessing temporary local variables in the syntax tree, the instruction description objects are stored in instruction group objects; Encode the instruction description objects in the instruction group object into instruction machine code according to the Shenwei platform instruction format, and complete the structure upgrade and optimization compilation. The step of generating instruction description objects for nodes accessing temporary local variables in the optimized syntax tree includes: saving the access instructions for the temporary local variables corresponding to the nodes and the number of the temporary registers allocated for the temporary local variables into the generated instruction description objects; The step of encoding the instruction description objects in the instruction group object into instruction machine code according to the Shenwei platform instruction format includes: encoding the access instruction operations and temporary register numbers in the instruction description objects into instruction machine code according to the Shenwei platform instruction format.

6. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the structure promotion optimization compilation method for the Shenwei platform .NET runtime as described in any one of claims 1-4.

7. A device, characterized in that, include: Memory, used to store instructions; A processor for executing the instructions, causing the device to perform operations implementing the structure promotion optimization compilation method for the Shenwei platform .NET runtime as described in any one of claims 1-4.

Citation Information

Patent Citations

  • Instruction optimization method, device, system and equipment for loop program and medium

    CN115469931A

  • Integer division compiling optimization method and device based on Java virtual machine, electronic equipment and medium

    CN116521123A