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

Register allocation method for optimizing stack space

A register allocation and register technology, applied in memory systems, instruments, program control design, etc., can solve problems such as increased pressure on stack registers, improve security issues, eliminate false interference edges, and reduce occupancy.

Inactive Publication Date: 2010-05-19
INST OF ACOUSTICS CHINESE ACAD OF SCI
View PDF0 Cites 23 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0004] The purpose of the present invention is, in order to overcome the false interference edge in the interference graph during register allocation, resulting in increased pressure on stack registers from overflow variables during register allocation, thereby proposing a register allocation method for optimizing stack space

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
  • Register allocation method for optimizing stack space
  • Register allocation method for optimizing stack space

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0021] The present invention will be described in detail below in conjunction with the accompanying drawings and specific embodiments. The working steps of the stack analyzer are as follows: figure 1 Shown:

[0022] 1. The register allocator analyzes the data flow of the intermediate file of the program to obtain the data flow diagram

[0023] 2. Construct the interferogram of program variables according to the data flow graph. The definition of an interference graph is that if a variable is active while another variable is defined, then they are interfering. Interfering variables are represented in the interferogram by a line between two nodes

[0024] 3. Eliminate false interference edges in the interferogram, and analyze their inferred register intersection relations for two variables interfering in the interferogram. Because only when the inferred registers intersect, two variables may be interfering. For interfering variables whose inferred registers are disjoint, re...

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 provides a register allocation method for optimizing stack space, which comprises the following steps: 1, analyzing a program intermediate file by a register allotter to obtain a data flow diagram; 2, constructing interference patterns of program variables according to the data flow diagram; 3, optimizing the interference patterns to eliminate false interference edges; 4, trying to color the interference patterns, if the step is successful, indicating no variable overflow and stopping allocating the registers, and otherwise performing the next step; 5, abridging the interferencepatterns, and overflowing the low-priority variables to a stack; 6, allocating the number of actual physical registers for the highest-priority virtual registers; and 7, aiming at the overflow nodes of the step 5), inserting the corresponding codes, and querying the accurate interference patterns of the step 3) to allocate the same stack offset for noninterference overflow variables. The method for eliminating the false interference edges comprises the steps: for two interference variables, further analyzing interference variables which are not intersected with an inference register to deletea connection line of the two variables and eliminate the false interference edges.

Description

technical field [0001] The invention relates to a register allocation method for optimizing stack use. Background technique [0002] In an embedded system, the memory resources are limited, and the overflow of the stack space will cause the pointer to run away and the program to go wrong, which is a great security risk. The optimization of stack space will reduce the program's demand for stack space, reduce the probability of stack overflow, and help the safe operation of the system. [0003] The construction of the stack space occurs when the compiler allocates registers for the program. When the physical registers cannot meet the number requirements of the virtual registers, the variables with low priority will be overflowed to the stack. The compiler allocates stack space for overflow variables sequentially, without considering the interference of overflow variables, resulting in the occupation of redundant stack space; at the same time, in the target machine using infe...

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
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