An optimization method for VEX IR

By removing the redundant VEX IR statement, the problem of gap caused by the difference between the statement of the statement of the statement and the difference in the compilation parameters in the middle of the VEX IR, and achieved more efficient processing and retaining semantics.

CN118939274BActive Publication Date: 2025-01-28SHANGHAI ANBAN INFORMATION TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411175325.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-26
Publication Date
2025-01-28
Estimated Expiration
2044-08-26

AI Technical Summary

Technical Problem

The intermediate representation statements generated by VEX IR during the binary file conversion process are redundant, resulting in a gap between the VEX IR statements generated after the binary file conversion under different compilation parameters, affecting the efficiency of subsequent processing.

Method used

By obtaining continuous code fragments and converting them into VEX IR statements, removing redundant statements, including deleting unsusted registers to write operations, merging operations with the same number of digits, modifying bit width and order operations, etc. Let's eliminate the gap between the VEX IR statement under different compilation parameters.

Benefits of technology

Effectively remove the redundant VEX IR statement, eliminate the gap between the VEX IR statement after the binary files of different compilation parameters are converted, retain the original semantics and improve the processing efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118939274B_ABST
    Figure CN118939274B_ABST
Patent Text Reader

Abstract

The present invention provides an optimization method for VEX IR, comprising: obtaining continuous code fragments and converting them into VEX IR statements; the VEX IR statements include first and second statements, the first and second statements store first and second variables in a first register respectively, and when the first register is not referenced between the first and second statements, the first statement is deleted; the VEX IR statement includes a third statement, when the third statement is used to change the bit width and sequential operation of the first variable and copy it to the second variable, the third statement is modified to a fourth statement, and the fourth statement is used to copy the first variable to the second variable; the VEX IR statement includes a fifth and a sixth statement, when the fifth and sixth statements have the same operator but different bit numbers, the fifth and sixth statements are combined into a unified operator that does not consider the bit number. By removing redundant VEX IR statements, the gap between VEX IR statements converted from binary files with different compilation parameters is eliminated, and the original semantics are retained.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present invention relate to the field of network information security technology, and in particular to an optimization method for VEX IR. Background Art

[0002] In binary similarity analysis, VEX IR (Intermediate Representation) is an excellent tool. Its advantage is that it can convert binary files under different architectures into the same intermediate representation, which is convenient for subsequent feature extraction and other processing. However, its disadvantage is that there is no good optimizer. Even for binary files of the same source, if the compilation parameters are different, different VEX IR statements will be generated after conversion, making the generated intermediate representation statements quite redundant.

[0003] Therefore, it is necessary to provide an optimization method for VEX IR to solve the above problems. Summary of the invention

[0004] The present invention provides an optimization method for VEX IR, which removes redundant VEX IR statements to eliminate the barriers between VEX IR statements converted from binary files with different compilation parameters and retain the original semantics.

[0005] An embodiment of the present invention provides an optimization method for VEX IR, the method comprising:

[0006] Take consecutive code snippets and convert them into VEX IR statements;

[0007] The VEX IR statement includes a first statement and a second statement, the first statement stores a first variable in a first register, and the second statement stores the first variable in the first register, and when the first register is not referenced between the first statement and the second statement, the first statement is deleted;

[0008] The VEX IR statement includes a third statement, when the third statement is used to change the bit width and sequence operation of the first variable and copy it to the second variable, the third statement is modified into a fourth statement, and the fourth statement is used to copy the first variable to the second variable;

[0009] The VEX IR statement includes a fifth statement and a sixth statement. When the fifth statement and the sixth statement have the same operator but different number of bits, the operations of the fifth statement and the sixth statement are merged into a unified operator regardless of the number of bits.

[0010] Preferably, the continuous code fragments include continuous basic blocks and a random path of a control flow graph.

[0011] Preferably, the VEX IR statement includes a seventh statement, the seventh statement reads the value of the first register to the second variable, and when the first register is not rewritten between the first statement and the seventh statement, the first statement is deleted, and the seventh statement is changed to the fourth statement for copying the first variable to the second variable.

[0012] Preferably, the VEX IR statement includes an eighth statement, which references a third variable. When the fourth statement is used to copy the first variable to the second variable, and to copy the second variable to the third variable, the fourth statement is deleted, and the reference to the third variable in the eighth statement is changed to a reference to the first variable.

[0013] Preferably, the VEX IR statement includes a ninth statement and a tenth statement;

[0014] When the ninth statement reads the first register to the first variable and the tenth statement reads the first register to the second variable, and the first variable is not reassigned between the ninth statement and the tenth statement, the tenth statement is deleted, and subsequent references to the second variable are replaced by the first variable;

[0015] When the ninth statement reads the first register to the first variable, the tenth statement reads the second register to the first variable, and the first variable is not referenced between the ninth statement and the tenth statement, the ninth statement is deleted.

[0016] Preferably, the statement that initializes the variable with a constant value is deleted, and the constant is used to replace it in the subsequent expression that references the variable; for operations that are completely calculated using constants after replacement, the result is directly used to replace the operator.

[0017] Preferably, the VEX IR statement includes an eleventh statement and a twelfth statement;

[0018] When the eleventh statement reads the first memory to the first variable and the twelfth statement reads the first memory to the second variable, and the first variable is not reassigned between the eleventh statement and the twelfth statement, the twelfth statement is deleted, and subsequent references to the second variable are replaced with the first variable;

[0019] When the eleventh statement reads the first memory to the first variable and the twelfth statement reads the second memory to the second variable, and the first variable is not referenced between the eleventh statement and the twelfth statement, the eleventh statement is deleted.

[0020] Preferably, the VEX IR statement includes an eleventh statement and a thirteenth statement, the thirteenth statement is used to store the value of the first variable of the eleventh statement into the first memory, and when the value of the first variable is not updated between the eleventh statement and the thirteenth statement, the thirteenth statement is deleted.

[0021] Preferably, the VEX IR statement includes a thirteenth statement and a fourteenth statement, the fourteenth statement is used to store the value of the second variable into the first memory of the thirteenth statement, and when the first memory is not read between the thirteenth statement and the fourteenth statement, the thirteenth statement is deleted.

[0022] Preferably, operations using negative numbers are modified to operations of the same meaning using positive numbers.

[0023] Compared with the prior art, the technical solution of the embodiment of the present invention has the following beneficial effects:

[0024] The VEX IR optimization method of the embodiment of the present invention comprises: obtaining continuous code fragments and converting them into VEX IR statements; the VEX IR statement comprises a first statement and a second statement, the first statement stores a first variable into a first register, and the second statement stores a second variable into the first register, and when the first register is not referenced between the first statement and the second statement, the first statement is deleted; the VEX IR statement comprises a third statement, and when the third statement is used to change the bit width and sequential operation of the first variable and copy it to the second variable, the third statement is modified into a fourth statement, and the fourth statement is used to copy the first variable to the second variable; the VEXIR statement comprises a fifth statement and a sixth statement, and when the fifth statement and the sixth statement have the same operator but different bit numbers, the operation of the fifth statement and the sixth statement is merged into a unified operator that does not consider the bit number, and by removing redundant VEX IR statements, the gap between VEX IR statements converted from binary files with different compilation parameters is eliminated, and the original semantics are retained. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following is a brief introduction to the drawings required for use in the embodiments or the prior art descriptions. Obviously, the drawings described below are some embodiments of the present invention, not all embodiments. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative labor.

[0026] Figure 1 A schematic flow chart of an optimization method for VEX IR provided by one embodiment of the present invention;

[0027] Figure 2 A flowchart of an optimization method for VEX IR provided by another embodiment of the present invention;

[0028] Figure 3 A flowchart of an optimization method for VEX IR provided in accordance with another embodiment of the present invention;

[0029] Figure 4 A flowchart of an optimization method for VEX IR provided in accordance with yet another embodiment of the present invention. DETAILED DESCRIPTION

[0030] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0031] The technical solution of the present invention is described in detail with specific embodiments below. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described in detail in some embodiments.

[0032] Based on the problems existing in the prior art, an embodiment of the present invention provides an optimization method for VEX IR, which removes redundant VEX IR statements to eliminate the barriers between VEX IR statements converted from binary files with different compilation parameters and retain the original semantics.

[0033] Figure 1 A flowchart of an optimization method for VEX IR provided by an embodiment of the present invention. Figure 1 , provides an optimization method for VEX IR, the method comprising:

[0034] Step S101: Obtain continuous code snippets and convert them into VEX IR statements;

[0035] Step S102: the VEX IR statement includes a first statement and a second statement, the first statement stores a first variable in a first register, and the second statement stores a second variable in the first register, and when the first register is not referenced between the first statement and the second statement, the first statement is deleted;

[0036] Step S103: the VEX IR statement includes a third statement, and when the third statement is used to change the bit width and sequence operation of the first variable and copy it to the second variable, the third statement is modified into a fourth statement, and the fourth statement is used to copy the first variable to the second variable;

[0037] Step S104: the VEX IR statement includes a fifth statement and a sixth statement. When the fifth statement and the sixth statement have the same operator but different bit numbers, the operations of the fifth statement and the sixth statement are merged into a unified operator regardless of the bit number.

[0038] In a specific implementation, in step S101, the continuous code fragments include a basic block and a random path of a control flow graph.

[0039] In step S102, the first statement is: PUT(M) = t1, and the second statement is: PUT(M) = t2, which stores the first variable t1 in the first register M; and stores the second variable t2 in the first register M. If the first register M is not referenced between the first statement and the second statement, the first statement will be deleted. This step removes repeated writes to the same register and deletes redundant register write operations.

[0040] In step S103, the third statement is: t2 = 32uto64(t1), the third statement indicates that the 32-bit unsigned bit width is changed to a 64-bit bit width, then the third statement is modified to a fourth statement, the fourth statement is: t2 = t1, the fourth statement is used to copy the first variable to the second variable.

[0041] In step S104, the fifth statement and the sixth statement are one of "Add8", "Add16", "Add32", and "Add64", which are merged into one of them, or merged into "Add". By merging operators with the same actual meaning but different bit numbers, the gap in VEX IR caused by the different bit numbers of operations between different architectures is eliminated.

[0042] Figure 2 A flowchart of an optimization method for VEX IR provided by another embodiment of the present invention. Figure 2 , provides an optimization method for VEX IR, the method comprising:

[0043] Step S201: Obtain continuous code snippets and convert them into VEX IR statements;

[0044] Step S202: the VEX IR statement includes a first statement and a second statement, the first statement stores a first variable in a first register, and the second statement stores a second variable in the first register, and when the first register is not referenced between the first statement and the second statement, the first statement is deleted;

[0045] Step S203: the VEX IR statement includes a third statement, and when the third statement is used to change the bit width and sequence operation of the first variable and copy it to the second variable, the third statement is modified into a fourth statement, and the fourth statement is used to copy the first variable to the second variable;

[0046] Step S204: the VEX IR statement includes a fifth statement and a sixth statement. When the fifth statement and the sixth statement have the same operator but different bit numbers, the operations of the fifth statement and the sixth statement are merged into a unified operator regardless of the bit number.

[0047] Step S205: The VEX IR statement includes a seventh statement, and the seventh statement reads the value of the first register to the second variable. When the first register is not rewritten between the first statement and the seventh statement, the first statement is deleted, and the seventh statement is changed to the fourth statement for copying the first variable to the second variable.

[0048] In step S205, the first statement is PUT(M) = t1, and the seventh statement is: t2 = GET(M). The first statement indicates that the value of the first variable t1 is written into the first register M, and the seventh statement indicates that the value of the first register M is read into the second variable t2. If the first variable t1 is not rewritten into the first register between the first statement and the seventh statement, the first statement is deleted, and the seventh statement is modified to: t2 = t1. This step changes the corresponding reading and writing of the first register to the copying of the variable, which is significant in that it simplifies the reading and writing of the first register into the copying of the variable with the same actual meaning, unifying the differences in the operations on the first register under different architectures and compilation parameters.

[0049] Figure 3 A flowchart of an optimization method for VEX IR provided by another embodiment of the present invention. Figure 3 , provides an optimization method for VEX IR, the method comprising:

[0050] Step S301: Obtain continuous code snippets and convert them into VEX IR statements;

[0051] Step S302: the VEX IR statement includes a first statement and a second statement, the first statement stores a first variable in a first register, and the second statement stores a second variable in the first register, and when the first register is not referenced between the first statement and the second statement, the first statement is deleted;

[0052] Step S303: the VEX IR statement includes a third statement, and when the third statement is used to change the bit width and sequence operation of the first variable and copy it to the second variable, the third statement is modified into a fourth statement, and the fourth statement is used to copy the first variable to the second variable;

[0053] Step S304: the VEX IR statement includes a fifth statement and a sixth statement. When the fifth statement and the sixth statement have the same operator but different bit numbers, the operations of the fifth statement and the sixth statement are merged into a unified operator regardless of the bit number.

[0054] Step S305: the VEX IR statement includes a seventh statement, the seventh statement reads the value of the first register to the second variable, and when the first register is not rewritten between the first statement and the seventh statement, the first statement is deleted, and the seventh statement is replaced by the fourth statement for copying the first variable to the second variable;

[0055] Step S306: The VEX IR statement includes an eighth statement, and the eighth statement references a third variable. When the fourth statement is used to copy the first variable to the second variable, and to copy the second variable to the third variable, the fourth statement is deleted, and the reference to the third variable in the eighth statement is changed to a reference to the first variable.

[0056] In step S306, the fourth statement is: t2 = t1, t3 = t2, and the eighth statement is: PUT(M) = t3. When the fourth statement is used to copy the first variable t1 to the second variable t2, and to copy the second variable t2 to the third variable t3, the fourth statement is deleted, and the eighth statement is modified to the first statement: PUT(M) = t1. This step removes redundant variable copy operations, and directly replaces the original variables in subsequent expressions that reference the copied variables, which is significant in that unnecessary variables are reduced and the structure of the intermediate representation as a whole is simplified.

[0057] Figure 4 A flowchart of an optimization method for VEX IR provided by another embodiment of the present invention. Figure 4 , provides an optimization method for VEX IR, the method comprising:

[0058] Step S401: Obtain continuous code snippets and convert them into VEX IR statements;

[0059] Step S402: the VEX IR statement includes a first statement and a second statement, the first statement stores a first variable in a first register, and the second statement stores a second variable in the first register, and when the first register is not referenced between the first statement and the second statement, the first statement is deleted;

[0060] Step S403: the VEX IR statement includes a third statement, and when the third statement is used to change the bit width and sequence operation of the first variable and copy it to the second variable, the third statement is modified into a fourth statement, and the fourth statement is used to copy the first variable to the second variable;

[0061] Step S404: the VEX IR statement includes a fifth statement and a sixth statement. When the fifth statement and the sixth statement have the same operator but different bit numbers, the operations of the fifth statement and the sixth statement are merged into a unified operator regardless of the bit number.

[0062] Step S405: the VEX IR statement includes a seventh statement, the seventh statement reads the value of the first register to the second variable, and when the first register is not rewritten between the first statement and the seventh statement, the first statement is deleted, and the seventh statement is replaced by the fourth statement for copying the first variable to the second variable;

[0063] Step S406: the VEX IR statement includes a ninth statement and a tenth statement; when the ninth statement reads the first register to the first variable and the tenth statement reads the first register to the second variable, and the first variable is not reassigned between the ninth statement and the tenth statement, the tenth statement is deleted, and subsequent references to the second variable are replaced by the first variable; when the ninth statement reads the first register to the first variable and the tenth statement reads the second register to the first variable, and the first variable is not referenced between the ninth statement and the tenth statement, the ninth statement is deleted.

[0064] In step S406, this step deletes repeated and redundant register read operations, which is divided into two cases.

[0065] The ninth statement is: t1 = Get(M), the tenth statement is: t2 = Get(M), the ninth statement reads the first register to the first variable t1, the tenth statement reads the first register M to the second variable t2, if the ninth statement t1 is not reassigned between the ninth and tenth statements, then the tenth statement is deleted, and the subsequent references to the second variable t2 are replaced with the first variable t1. This situation also includes the case where the ninth statement and the tenth statement are exactly the same: t = Get(M); ...; t = Get(M)).

[0066] The ninth statement is: t = Get(M1), and the tenth statement is: t = Get(M2). The ninth statement reads the first register M1 to the first variable t, and the tenth statement reads the second register M2 to the first variable t. If the first variable t is not referenced between the ninth statement and the tenth statement, delete the ninth statement.

[0067] In a specific implementation, the statement that initializes the variable with a constant value is deleted, and the constant is used to replace it in the subsequent expression that references the variable; for operations that are completely calculated using constants after the replacement, the result is directly used to replace the operator.

[0068] For example, the statements for assigning constant values ​​to initialize variables include: t1 = 0x00000001, PUT(M) = t1. Delete "t1 = 0x00000001" and change "PUT(M) = t1" to "PUT(M) = 0x00000001".

[0069] In a specific implementation, the VEX IR statement includes an eleventh statement and a twelfth statement;

[0070] When the eleventh statement reads the first memory to the first variable and the twelfth statement reads the first memory to the second variable, and the first variable is not reassigned between the eleventh statement and the twelfth statement, the twelfth statement is deleted, and subsequent references to the second variable are replaced with the first variable;

[0071] When the eleventh statement reads the first memory to the first variable and the twelfth statement reads the second memory to the second variable, and the first variable is not referenced between the eleventh statement and the twelfth statement, the eleventh statement is deleted.

[0072] Specifically, register-related statements have been optimized, and some register reads and writes have been converted into variable copies for unified redundancy removal. Due to the nature of memory-related statements in memory addresses, they need to be processed separately.

[0073] The eleventh statement is: t1 = LDle(M), and the twelfth statement is: t2 = LDle(M). The eleventh statement reads the value of the first memory M address to the first variable t1, and the twelfth statement reads the value of the first memory M address to the second variable t2. If the first variable t1 is not reassigned between the eleventh statement and the twelfth statement, the twelfth statement is deleted, and the subsequent references to the second variable t2 are replaced by the first variable t1. This situation also includes the case where the eleventh statement and the twelfth statement are exactly the same, for example, the eleventh statement is: t = LDle(M), and the twelfth statement is: t = LDle(M)).

[0074] When the eleventh statement is: t = LDle(M1) and the twelfth statement is: t = LDle(M2), the eleventh statement reads the first memory M1 to the first variable and the twelfth statement reads the second memory M2 to the second variable, if the first variable t is not referenced between the eleventh statement and the twelfth statement, the eleventh statement is deleted.

[0075] In a specific implementation, the VEX IR statement includes an eleventh statement and a thirteenth statement, the thirteenth statement is used to store the value of the first variable of the eleventh statement into the first memory, and when the value of the first variable is not updated between the eleventh statement and the thirteenth statement, the thirteenth statement is deleted.

[0076] Specifically, for example, the eleventh statement is: t = LDle(M), the thirteenth statement is: STle(M) = t, and the thirteenth statement is used to store the value t of the first variable of the eleventh statement into the first memory M. When the first variable t is not updated between the eleventh statement and the thirteenth statement, the thirteenth statement is deleted.

[0077] In a specific implementation, the VEX IR statement includes a thirteenth statement and a fourteenth statement, the fourteenth statement is used to store the value of the second variable into the first memory of the thirteenth statement, and when the first memory is not read between the thirteenth statement and the fourteenth statement, the thirteenth statement is deleted.

[0078] Specifically, this step optimizes the operational redundancy of memory writing. For example, the thirteenth statement: STle(M) = t1, the fourteenth statement: STle(M) = t2. The fourteenth statement is used to store the second variable value to the first memory M of the thirteenth statement. When the first memory M is not read between the thirteenth statement and the fourteenth statement, the thirteenth statement is deleted.

[0079] In a specific implementation, operations using negative numbers are modified to operations with the same meaning using positive numbers.

[0080] Specifically, for example: Sub(-1,t20) is changed to Add(1,t20), and subtracting a negative number is changed to adding a positive number.

[0081] In summary, the optimization method for VEX IR of an embodiment of the present invention includes: obtaining continuous code fragments and converting them into VEX IR statements; the VEX IR statement includes a first statement and a second statement, the first statement and the second statement are stored in a first register, and when the first register is not referenced between the first statement and the second statement, the first statement is deleted; the VEX IR statement includes a third statement, when the third statement is used to change the bit width and sequential operation, the third statement is modified to a fourth statement, and the fourth statement is used to copy the variable; the VEX IR statement includes a fifth statement and a sixth statement, when the fifth statement and the sixth statement have the same operator but different bit numbers, the fifth statement and the sixth statement are merged into any one of the statements, and the redundant VEX IR statements are removed to eliminate the barriers between the VEX IR statements converted from binary files with different compilation parameters, and retain the original semantics.

[0082] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.

Claims

1. An optimization method for VEX IR, characterized in that: The method comprises: Take consecutive code snippets and convert them into VEX IR statements; The VEX IR statement includes a first statement and a second statement, the first statement stores a first variable in a first register, and the second statement stores a second variable in the first register, and when the first register is not referenced between the first statement and the second statement, the first statement is deleted; The VEX IR statement includes a third statement, when the third statement is used to change the bit width and sequence operation of the first variable and copy it to the second variable, the third statement is modified into a fourth statement, and the fourth statement is used to copy the first variable to the second variable; The VEX IR statement includes a fifth statement and a sixth statement. When the fifth statement and the sixth statement have the same operator but different number of bits, the operations of the fifth statement and the sixth statement are merged into a unified operator regardless of the number of bits.

2. The optimization method for VEX IR according to claim 1, characterized in that: The continuous code fragments include continuous basic blocks and a random path of a control flow graph.

3. The optimization method for VEX IR according to claim 1, characterized in that: The VEX IR statement includes a seventh statement, and the seventh statement reads the value of the first register to a second variable. When the first register is not rewritten between the first statement and the seventh statement, the first statement is deleted, and the seventh statement is changed to the fourth statement for copying the first variable to the second variable.

4. The optimization method for VEX IR according to claim 3, characterized in that: The VEX IR statement includes an eighth statement, which references a third variable. When the fourth statement is used to copy the first variable to the second variable, and to copy the second variable to the third variable, the fourth statement is deleted, and the reference to the third variable in the eighth statement is changed to a reference to the first variable.

5. The optimization method for VEX IR according to claim 3, characterized in that: The VEX IR statements include a ninth statement and a tenth statement; When the ninth statement reads the first register to the first variable and the tenth statement reads the first register to the second variable, and the first variable is not reassigned between the ninth statement and the tenth statement, the tenth statement is deleted, and subsequent references to the second variable are replaced with the first variable; When the ninth statement reads the first register to the first variable, the tenth statement reads the second register to the first variable, and the first variable is not referenced between the ninth statement and the tenth statement, the ninth statement is deleted.

6. The optimization method for VEX IR according to claim 4, characterized in that: Delete the statements that initialize the variable with a constant value, and replace it with the constant in subsequent expressions that reference the variable; for operations that are completely calculated using constants after replacement, directly replace the operator with its result.

7. The optimization method for VEX IR according to claim 5, characterized in that: The VEX IR statements include an eleventh statement and a twelfth statement; When the eleventh statement reads the first memory to the first variable and the twelfth statement reads the first memory to the second variable, and the first variable is not reassigned between the eleventh statement and the twelfth statement, the twelfth statement is deleted, and subsequent references to the second variable are replaced with the first variable; When the eleventh statement reads the first memory to the first variable and the twelfth statement reads the second memory to the second variable, and the first variable is not referenced between the eleventh statement and the twelfth statement, the eleventh statement is deleted.

8. The optimization method for VEX IR according to claim 7, characterized in that: The VEX IR statement includes an eleventh statement and a thirteenth statement, the thirteenth statement is used to store the value of the first variable of the eleventh statement into the first memory, and when the value of the first variable is not updated between the eleventh statement and the thirteenth statement, the thirteenth statement is deleted.

9. The optimization method for VEX IR according to claim 8, characterized in that: The VEX IR statement includes a thirteenth statement and a fourteenth statement, the fourteenth statement is used to store the value of the second variable into the first memory of the thirteenth statement, and when the first memory is not read between the thirteenth statement and the fourteenth statement, the thirteenth statement is deleted.

10. The optimization method for VEX IR according to claim 6, characterized in that: Modify operations that use negative numbers to have the same meaning using positive numbers.

Citation Information

Patent Citations

  • Software patch detection method and device based on data flow analysis

    CN111177733A

  • Query statement optimization method and device, equipment and storage medium

    CN112732752A