Pointer analysis method and device

A pointer analysis and pointer technology, applied in the computer field, can solve the problems of incomplete analysis results, limited global sharing of multi-threaded program pointer analysis, etc.

Inactive Publication Date: 2017-11-17
HUAWEI TECH CO LTD +1
View PDF3 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0005] The embodiment of the present invention provides a pointer analysis method and device to solve the problem in the prior art that the pointer analysis of multi-threaded programs is only limited to the global share in the program, and the analysis results are not comprehensive

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Pointer analysis method and device
  • Pointer analysis method and device
  • Pointer analysis method and device

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 2

[0086] image 3 It is a flowchart of a pointer analysis method provided by Embodiment 2 of the present invention. Such as image 3 As shown, the method of this embodiment may include:

[0087] S200, receiving a pointer analysis instruction sent by the user;

[0088] S210, read statement information in the multi-threaded program to be analyzed according to the pointer analysis instruction;

[0089] S220, analyze the program according to the global sharing judgment rule, and obtain the global sharing amount in the program;

[0090] When analyzing the pointers of the program, the global sharing amount in the program can be determined first according to the global sharing judgment rules. The judgment of the global sharing amount is based on the analysis of the overall structure of the program. Specifically, the global sharing judgment rules include: if the variable If it can be accessed by at least two threads in the program at the same time, then the variable is a global shared...

Embodiment 3

[0116] Figure 5 It is a schematic structural diagram of a pointer analysis device provided by Embodiment 3 of the present invention. Such as Figure 5 As shown, the pointer analysis device provided in this embodiment specifically includes: a reading module 11 , a pointer analysis module 12 and a compensation analysis module 13 .

[0117] Wherein, the reading module 11 is used to read the statement information in the multi-threaded program to be analyzed;

[0118] The pointer analysis module 12 is used to perform pointer analysis on the program according to the statement information of the program read by the reading module 11, and obtain the shared information of the program, and the shared information includes shared amount, pointer pointing set and access Storage behavior, wherein, the shared amount includes the global shared amount and the local shared amount;

[0119] The compensation analysis module 13 is configured to perform compensation analysis on the sharing amou...

Embodiment 4

[0124] Figure 7 It is a schematic structural diagram of a pointer analysis device provided by Embodiment 4 of the present invention. Such as Figure 7 As shown, the pointer analysis device provided in this embodiment is Figure 6 On the basis of the shown device structure, the pointer analysis module 12 includes: a program analysis unit 16, which is used to analyze the program according to the global sharing judgment rule, and obtain the global sharing amount in the program; a thread analysis unit 17 , for performing pointer analysis on each thread in the program, and obtaining a set of pointers in each thread, a local shared volume, and a memory access behavior corresponding to the shared volume.

[0125] In the specific implementation of this embodiment, the above-mentioned global sharing judgment rule includes: if the variable can be accessed by at least two threads in the program at the same time, then the variable is a global shared quantity.

[0126] Further, in the ...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

PUM

No PUM Login to view more

Abstract

Embodiments of the present invention provide a pointer analysis method and device. The pointer analysis method provided by the present invention includes: reading statement information in the multi-threaded program to be analyzed; performing pointer analysis on the program according to the statement information of the program to obtain shared information of the program, the shared information It includes shared amount, pointer pointing set and memory access behavior, wherein the shared amount includes global shared amount and local shared amount; compensation analysis is performed on the shared amount according to the shared information of the program. The embodiment of the present invention solves the problem in the prior art that the pointer analysis of multi-threaded programs is limited to the global share in the program, and the analysis results are not comprehensive, improves the accuracy of pointer analysis, and correspondingly improves the implementation scope of program optimization and effects.

Description

technical field [0001] The embodiments of the present invention relate to computer technology, and in particular to a pointer analysis method and device. Background technique [0002] With the popularity of computers, computer software is becoming more and more complex, and the types of program statements used in it are more flexible and rich. Taking the commonly used C and C++ program statements as examples to illustrate, the use of pointers in program statements is becoming more and more extensive. The use of pointer statements is an important factor that determines the excellent running performance of a program after being compiled and optimized. Therefore, the compilation and optimization of programs is based on the analysis of pointers in program statements. [0003] The analysis of the pointer generally refers to the analysis of the properties of the pointer variable and the pointing set. At present, when performing pointer analysis, a high-precision Flow-Sensitive an...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

Application Information

Patent Timeline
no application Login to view more
Patent Type & Authority Patents(China)
IPC IPC(8): G06F11/36
Inventor 陈聪明霍玮李丰冯晓兵
Owner HUAWEI TECH CO LTD
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products