We describe a new algorithm for fast global register allocation called linear scan . This algorithm is not based on graph coloring, but allocates registers to variables in a single linear-time scan of the variables' live ranges. The linear scan algorithm is considerably faster than algorithms based on graph coloring, is simple to implement, and results in code that is almost as efficient as that obtained using more complex and time-consuming register allocators based on graph coloring. The algorithm is of interest in applications where compile time is a concern, such as dynamic compilation systems, “just-in-time” compilers, and interactive development environments.
Dynamic code generation allows programmers t o u s e r un-time information in order to achieve performance and expressiveness superior to those of static code. The`C Tick C language is a superset of ANSI C that supports e cient and high-level use of dynamic code generation.`C provides dynamic code generation at the level of C expressions and statements, and supports the composition of dynamic c o d e a t r un time. These features enable programmers to add dynamic code generation to existing C code incrementally, and to write important applications such a s just-in-time" compilers easily. The paper presents many examples of hoẁ C can be used to solve practical problems.The tcc compiler is an e cient, portable, and freely a vailable implementation of`C. tcc allows programmers to trade dynamic c o m pilation speed for dynamic c o d e q u a l ity: in some applications, it is most important to generate code quickly, while in others code quality m atters m ore than compilation speed. The overhead of dynamic c o m pilation is on the order of 100 to 600 cycles per generated instruction, depending on the level of dynamic optimization. Measurements show that the use of dynamic code generation can improve p e r formance by a l most a n o r d e r o f m agnitude; two-to four-fold speedups are common. In most cases, the overhead of dynamic compilation is recovered in under 100 uses of the dynamic code; sometimes it can be recovered within one use. C is a superset of ANSI C that supports the high-level and e cient use of dynamic code generation. It extends ANSI C with a small number of constructs that allow the programmer to express dynamic code at the level of C e xpressions and statements, a nd to compose arbitrary dynamiccode at r un time. These features enable programmers to write complex imperative c ode manipulation programs in a style similar to Lisp Steele Jr. 1990 , and make it relatively easy to write powerful and portable dynamic code. Furthermore, since`C is a superset of ANSI C, it is not di cult to improve p e r formance of code incrementally by a dding dynamic code generation t o e xisting C programs.C's extension s t o C | t wo t ype constructors, three unary o perators, a nd a few special forms | allow dynamic code to betype-checked statically. Much of the overhead of dynamic compilation can therefore be incurred statically, which improves the e ciency of d y namic compilation. While these constructs were designed for ANSI C, it should be straightforward to add analogous constructs to other statically typed languages.tcc is an e cient a nd freely available implementation of`C, consisting of a f r ont end, back ends that compile to C and to MIPS and SPARC assembly, and two runtime systems. tcc allows the user to trade dynamic code quality for dynamic code generation speed. If compilation speed must bemaximized, dynamic code generation and register allocation can be performed in one pass; if code quality is most important, the system can construct and optimize an intermediate representation prior to code genera...
tee is a compiler that provides efficient and high-level access to dynamic code generation. It implements the 'C ("Tick-C") programming language, an extension of ANSI C that supports dynamic code generation [ 151. 'C gives power and flexibility in specifying dynamically generated code: whereas most other systems use annotations to denote run-time invariants. 'C allows the programmer to specify and compose arbitrary expressions and statements at run time. This degree of control is needed to efficiently implement some of the most important applications of dynamic code generation, such as "just in time" compilers [ 171 and efficient simulators [ 10, 48, 461.The paper focuses on the techniques that allow tee to provide 'C's flexibility and expressiveness without sacrificing run-timecode generation efficiency. These techniques include fast register allocation, efficient creation and composition of dynamic code specifications, and link-time analysis to reduce the size of dynamic code generators. tee also implements two different dynamic code generation strategies, designed to address the tradeoff of dynamic compilation speed versus generated code quality. To characterize the effects of dynamic compilation, we present performance measurements for eleven programs compiled using tee. On these applications, we measured performance improvements of up to one order of magnitude.To encourage further experimentation and use of dynamic code generation, we are making the tee compiler available in the public domain. This is, to our knowledge, the first high-level dynamic compilation system to be made available.
tee is a compiler that provides efficient and high-level access to dynamic code generation. It implements the 'C ("Tick-C") programming language, an extension of ANSI C that supports dynamic code generation [ 151. 'C gives power and flexibility in specifying dynamically generated code: whereas most other systems use annotations to denote run-time invariants. 'C allows the programmer to specify and compose arbitrary expressions and statements at run time. This degree of control is needed to efficiently implement some of the most important applications of dynamic code generation, such as "just in time" compilers [ 171 and efficient simulators [ 10, 48, 461.The paper focuses on the techniques that allow tee to provide 'C's flexibility and expressiveness without sacrificing run-timecode generation efficiency. These techniques include fast register allocation, efficient creation and composition of dynamic code specifications, and link-time analysis to reduce the size of dynamic code generators. tee also implements two different dynamic code generation strategies, designed to address the tradeoff of dynamic compilation speed versus generated code quality. To characterize the effects of dynamic compilation, we present performance measurements for eleven programs compiled using tee. On these applications, we measured performance improvements of up to one order of magnitude.To encourage further experimentation and use of dynamic code generation, we are making the tee compiler available in the public domain. This is, to our knowledge, the first high-level dynamic compilation system to be made available.
scite is a Brooklyn-based organization that helps researchers better discover and understand research articles through Smart Citations–citations that display the context of the citation and describe whether the article provides supporting or contrasting evidence. scite is used by students and researchers from around the world and is funded in part by the National Science Foundation and the National Institute on Drug Abuse of the National Institutes of Health.
customersupport@researchsolutions.com
10624 S. Eastern Ave., Ste. A-614
Henderson, NV 89052, USA
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.
Copyright © 2024 scite LLC. All rights reserved.
Made with 💙 for researchers
Part of the Research Solutions Family.