Looking for breakthrough ideas for innovation challenges? Try Patsnap Eureka!

Cross-file interprocedural optimization method based on algebraic system

An algebraic system and optimization method technology, applied in the field of compilers, can solve problems such as increased workload, limited maximum number of registers, and huge code volume, and achieve the best results

Inactive Publication Date: 2014-02-05
INST OF ACOUSTICS CHINESE ACAD OF SCI
View PDF4 Cites 8 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0003] In this mode, since the maximum number of registers supported by the target machine is limited, and local temporary variables are distributed in multiple basic blocks due to the life cycle, frequent stacking, popping and local temporary register multiplexing will directly cause the function stack to Operation is redundant
[0004] The existing technology is mainly based on the optimization of the intermediate language under the compilation framework, and it mainly faces the following main problems: 1. The formulation of the function stack framework protocol is directly related to the target machine, and the amount of code involved in the modification is very large, which will lead to The workload has increased rapidly; 2. It is very complicated to formulate a function stack frame suitable for various application scenarios, which involves multiple stages such as register allocation, and the intermediate language is only an abstract language, which cannot directly and effectively describe the stack operation, so the design complexity of optimizing from the intermediate language is high

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
  • Cross-file interprocedural optimization method based on algebraic system
  • Cross-file interprocedural optimization method based on algebraic system
  • Cross-file interprocedural optimization method based on algebraic system

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0016] The technical solutions of the present invention will be described in further detail below with reference to the accompanying drawings and embodiments.

[0017] The algebraic system in the linear space is composed of a non-empty set S and an algebraic symbol set defined on the set S, and a relational set. The algebraic expression used for reasoning and calculation in the algebraic system is composed of constants, variables, and a finite number of related algebraic operations ( addition, subtraction, multiplication, etc.). The execution path in the assembly function can be regarded as an ordered tuple composed of multiple assembly-level basic blocks. Suppose there is an execution path L=, where L[i]=xi {i=1,...,n are execution nodes or assembly-level basic blocks along the way}, functions can be defined for the characteristics of L:

[0018]

[0019] For a definite input L[i], the value of Ret(L[i]) is determinable, then the execution information of L can be recursiv...

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

The invention discloses a cross-file interprocedural optimization method based on an algebraic system. The method comprises steps as follows: according to characteristics of a target machine, instructions relating to stack operation and logical operation are selected, the algebraic system is established, and a mapping relation is established for the instructions and the algebraic system; PCGs (procedure call graphs) are traversed from a program entry, and whether nodes with connected sides belong to different source files is judged; if yes, the next operation is continued, and otherwise, the PCGs are traversed continuously; DDGs (data dependence graphs) are traversed from a function call instruction reversely along CFGs (control flow graphs) in a current function, an algebra expression formula of a stack-push operation instruction is generated, and the expression formula is reduced; a stack-pull operation of a successor node function is analyzed, constant values are read, sequentially transferred, optimized and calculated, and finally, a redundant instruction segment is deleted. According to the method, the optimizable part in a functional stack framework is effectively combined and released; and besides, the better effect is obtained during cross-file interprocedural optimization, constant propagation and constant calculation.

Description

technical field [0001] The invention relates to compiler technology, in particular to an algebraic system-based inter-process optimization method across files. Background technique [0002] The function stack framework is a common protocol in the traditional compilation framework, and is defined by the user in the binary interface (Application Binary Interface, ABI). When the function stack frame processes function calls, it saves temporary variables in temporary registers as much as possible according to the hardware resource constraints of the target machine, and the overflow part is pushed into the stack before the function body is executed, and accessed through storage The instruction performs stack operation, and releases the data in the function stack one by one after the function body is executed. [0003] In this mode, since the maximum number of registers supported by the target machine is limited, and local temporary variables are distributed in multiple basic blo...

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 Applications(China)
IPC IPC(8): G06F9/45
Inventor 朱浩王东辉洪缨
Owner INST OF ACOUSTICS CHINESE ACAD OF SCI
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Patsnap Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Patsnap Eureka Blog
Learn More
PatSnap group products