Integrated register allocator in a compiler
OwnerPeter Markstein, Meng Leeinventors
Life of this patent
Estimating the term…
Abstract
A compiler includes a real register allocation stage, an optimization stage and a final code stage. The real register allocation stage is configured to generate intermediate code from a basic block of source code. Physical registers, instead of virtual registers, are allocated to operands from the generated intermediate code, and the operands are stored in the physical registers. Then, the intermediate code is optimized, and machine readable code is generated from the intermediated code using the optimized registers in the final code stage. By allocating physical registers in the front-end of the compiler, instead of just prior to generating the machine-readable code, compiling time and memory needed for compiling source code is reduced.
Claims31
A method of allocating registers when compiling source code, said method comprising steps of:
- translating source code to intermediate code;
- identifying an operand from said intermediate code to store in a real register;
- and
- selecting a class of real registers operable to store said operand.
A method of compiling source code comprising steps of:
- generating intermediate code from a portion of source code;
- allocating a plurality of real registers to store a plurality of operands from said intermediate code while generating the intermediate code;
- and
- generating machine-readable code from said intermediate code using said plurality of real registers.
A compiler configured to compile source code into machine-readable code, said compiler comprising:
- a register allocation stage configured to generate intermediate code from said source code and configured to allocate a plurality of real registers to a plurality of operands from said intermediate code;
- an optimization stage configured to optimize said intermediate code;
- and
- a final code stage configured to generate said machine-readable code from said intermediate code using said plurality real registers.
Dependencies are inferred from the claim text.