Abstract
Many architectures require that a program use pairs of adjacent registers to hold double-precision floating-point values. Register allocators based on Chaitin's graph-coloring technique have trouble with programs that contain both single-register values and values that require adjacent pairs of registers. In particular, Chaitin's algorithm often produces excessive spilling on such programs. This results in underuse of the register set; the extra loads and stores inserted into the program for spilling also slow execution.
An allocator based on an optimistic coloring scheme naturally avoids this problem. Such allocators delay the decision to spill a value until late in the allocation process. This eliminates the over-spilling provoked by adjacent register pairs in Chaitin's scheme.
This paper discusses the representation of register pairs in a graph coloring allocator. It explains the problems that arise with Chaitin's allocator and shows how the optimistic allocator avoids them. It provides a rationale for determining how to add larger aggregates to the interference graph.
- 1 BERNSTEIN, D., GOLDIN, D. Q., GOLUMBIC, M. C., KRAWCZYK, H., MANSOUR, Y., NAHSHON, I., AND PINTER, R.Y. Spill code minimization techniques for optimizing compilers. In Proceedings of the ACM SIGPLAN '89 Conference on Programming Language Design and Implementation. SIGPLAN Not. 24, 7 (July 1989), 258-263.]] Google Scholar
Digital Library
- 2 BRIGGS, P., COOPER, K. D., KENNEDY, K., AND TORCZON, L. Coloring heuristics for register allocation. In Proceedings of the ACM SIGPLAN '89 Conference on Programming Language Design and Implementation. SIGPLAN Not. 24, 7 (July 1989), 275-284.]] Google Scholar
Digital Library
- 3 CHAITIN, G. J. Register allocation and spilling via graph coloring. In Proceedings of the ACM SIGPLAN '82 Symposium on Compiler Construction. SIGPLAN Not. 17, 6 (June 1982), 98-105.]] Google Scholar
Digital Library
- 4 CHAITIN, G. J., AUSLANDER, M. A., CHANDRA, A. K., COCKE, J., HOPKINS, M. E., AND MARKSTEIN, P.W. Register allocation via coloring. Comput. Lang. 6, (Jan. 1981), 47-57.]]Google Scholar
Digital Library
- 5 CHOW, F. C., AND HENNESSY, J. L. Register allocation by priority-based coloring. In Proceedings of the A CM SIGPLAN '84 Symposium on Compiler Construction. SIGPLAN Not. 19, 6 (June 1984), 222-232.]] Google Scholar
Digital Library
- 6 CHOW, F. C., AND HENNESSY, J.L. The priority-based coloring approach to register allocation. ACM Trans. Program. Lang. Syst. 12, 4 (Oct. 1990), 501-536.]] Google Scholar
Digital Library
- 7 FABRI, J. Automatic storage optimization. In Proceedings of the A CM SIGPLAN '79 Symposium on Compiler Construction. SIGPLAN Not. 14, 8 (Aug. 1979), 83-91.]] Google Scholar
Digital Library
- 8 FABRI, J. Automatic Storage Optimization. UMI Research Press, Ann Arbor, Mich., 1982.]]Google Scholar
- 9 GOLUMBIC, M.C. Algorithmic Graph Theory and Perfect Graphs. Academic Press, 1980.]] Google Scholar
Digital Library
- 10 HOPKINS, M.E. Compiling for the RT PC ROMP. In IBM RT Personal Computer Technology. IBM, 1986, 76-82.]]Google Scholar
- 11 INTEL CORPORATION. i860TM XP Microprocessor, 1991.]]Google Scholar
- 12 NICKERSON, B. R. Graph coloring register allocation for processors with multi-register operands. In Proceedings of the ACM SIGPLAN '90 Conference on Programming Language Design and Implementation. SIGPLAN Not. 25, 6 (June 1990), 40-52.]] Google Scholar
Digital Library
- 13 SETHI, R.Complete register allocation problems. SIAM J. Comput. 4, 3 (Sept. 1975), 226-248.]]Google Scholar
Cross Ref
Index Terms
Coloring register pairs
Recommendations
A generalized algorithm for graph-coloring register allocation
PLDI '04: Proceedings of the ACM SIGPLAN 2004 conference on Programming language design and implementationGraph-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 ...
Improvements to graph coloring register allocation
We describe two improvements to Chaitin-style graph coloring register allocators. The first, optimistic coloring, uses a stronger heuristic to find a k-coloring for the interference graph. The second extends Chaitin's treatment of rematerialization to ...
Optimistic register coalescing
Graph-coloring register allocators eliminate copies by coalescing the source and target nodes of a copy if they do not interfere in the interference graph. Coalescing, however, can be harmful to the colorability of the graph because it tends to yield a ...








Comments