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

Register allocation method and device, electronic equipment and computer storage medium

A register allocation and register technology, applied in the computer field, can solve the problems of increasing the cost of register parameter transfer in LLVM and reducing the efficiency of LLVM compilation.

Pending Publication Date: 2020-10-30
ALIBABA GRP HLDG LTD
View PDF0 Cites 2 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0004] As a result, the transfer cost of register parameters in LLVM is greatly increased, and the compilation efficiency of LLVM is reduced.

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 and device, electronic equipment and computer storage medium
  • Register allocation method and device, electronic equipment and computer storage medium
  • Register allocation method and device, electronic equipment and computer storage medium

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0020] refer to figure 1 , shows a flowchart of steps of a register allocation method according to Embodiment 1 of the present invention.

[0021] The register allocation method of this embodiment includes the following steps:

[0022] Step S102: According to the information of the calling instance, obtain the information of the target function to be called and the calling convention.

[0023] In the embodiment of the present invention, the calling convention used is different from the conventional calling convention that needs to be specific to the registers used. The calling convention in the embodiment of the present invention includes definition information of all available registers in the current device. The definition information includes but is not limited to: indication information of each available register (such as identification information or pointer information, etc.), location information of each available register (which can also be considered as sequence info...

Embodiment 2

[0035] refer to figure 2 , shows a flow chart of steps of a register allocation method according to Embodiment 2 of the present invention.

[0036] In this embodiment, LLVM is used as the user of the register allocation method, and the calling convention used for the V8 engine is set as an example to describe the register allocation scheme of the embodiment of the present invention.

[0037] Based on this, the register allocation method of this embodiment includes the following steps:

[0038] Step S202: Generate a calling convention.

[0039] This step may include: obtaining information on other registers in the current device except reserved registers; setting parameter indication information and parameter position information in the calling convention for the other registers; generating a calling convention according to the parameter indication information and parameter position information . Its format can be like xxxcc: target function to be called, r0, r1, r2, r3, r4. ...

Embodiment 3

[0061] refer to image 3 , shows a structural block diagram of a register allocation device according to Embodiment 3 of the present invention.

[0062] The apparatus for allocating registers in this embodiment includes: a first acquiring module 302, configured to acquire the target function to be called and the information of the calling convention according to the information of the calling instance, wherein the calling convention includes the information of all available registers in the current device Define information; the second obtaining module 304 is used to obtain the information of the register used by the target function to be called according to the information of the calling convention; the allocation module 306 is used to obtain the information of the register according to the information of the register. The calling instance allocates registers, so that parameters of the target function to be called are passed through the registers.

[0063] The register alloc...

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 embodiment of the invention provides a register allocation method and device, electronic equipment and a computer storage medium. The register allocation method comprises the steps: according to information of a calling instance, obtaining a to-be-called target function and calling agreement information, wherein the calling agreement comprises definition information of all available registersin current equipment; acquiring information of a register used by the target function according to the called and appointed information; and according to the information of the register, allocating the register to the calling instance so as to carry out parameter transmission of the target function through the register. Through the embodiment of the invention, the transmission cost of register parameters is effectively reduced, and the code compiling efficiency is improved.

Description

technical field [0001] The embodiments of the present invention relate to the technical field of computers, and in particular to a register allocation method, device, electronic equipment, and computer storage medium. Background technique [0002] Register allocation is a method of increasing program execution speed by allocating program variables to registers as much as possible. In the actual compiler, in order to extract the performance as much as possible and improve the allocation efficiency of the compiler, various methods are used to optimize the register allocation algorithm. [0003] Taking LLVM as an example, LLVM is a framework system of a compiler (compiler), which is used to optimize the compile time (compile-time), link time (link-time), run-time (run-time) of programs written in any programming language. ) and idle-time, and compatible with existing scripts. Moreover, LLVM provides language-independent intermediate codes, so different language codes can be g...

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/30
CPCG06F9/30098
Inventor 林作健
Owner ALIBABA GRP HLDG LTD
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