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.
- Summary
- Abstract
- Description
- Claims
- Application Information
AI Technical Summary
Problems solved by technology
Method used
Image
Examples
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...
PUM
Abstract
Description
Claims
Application Information
- R&D Engineer
- R&D Manager
- IP Professional
- Industry Leading Data Capabilities
- Powerful AI technology
- Patent DNA Extraction
Browse by: Latest US Patents, China's latest patents, Technical Efficacy Thesaurus, Application Domain, Technology Topic, Popular Technical Reports.
© 2024 PatSnap. All rights reserved.Legal|Privacy policy|Modern Slavery Act Transparency Statement|Sitemap|About US| Contact US: help@patsnap.com