A generalized algorithm for graph-coloring register allocation
Michael D. Smith, Norman F. Ramsey, Glenn H. Holloway · Proceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation · 2004
Graph-coloring register allocation is an elegant and extremely popular optimization for modern machines. But as currently formulated, it does not handle two characteristics commonly found in commercial architectures. First, a single register name may appear in multiple register classes, where a class is a set of register names that are interchangeable in a particular role. Second, multiple register names may be aliases for a single hardware register. We present a generalization of graph-coloring register allocation that handles these problematic characteristics while preserving the elegance and practicality of traditional graph coloring. Our generalization adapts easily to a new target machine, requiring only the sets of names in the register classes and a map of the register aliases. It also drops easily into a well-known graph-coloring allocator, is efficient at compile time, and produces high-quality code. Categories and subject descriptors D.3.4 [Programming Languages]: Processors—code generation, compilers, optimization, retargetable compilers; G.2.2 [Discrete
Cited by 99 works. doi:10.1145/996841.996875
Authors
References
- Lecture Notes in Computer Science 1205
- Register allocation via coloring
- Register allocation & spilling via graph coloring
- MediaBench: A Tool for Evaluating and Synthesizing Multimedia and Communications Systems
- Advanced Compiler Design and Implementation
- Register allocation & spilling via graph coloring
- Modern Compiler Implementation in Java
- The Alpha 21264 microprocessor architecture
- Improvements to graph coloring register allocation
- Register allocation via graph coloring