Abstract
Programs represented in Static Single Assignment (SSA) form contain phi instructions (or functions) whose operational semantics are to merge values coming from distinct control flow paths. However, translating phi instructions into native instructions is nontrivial when transformations such as copy propagation and code motion have been performed. In this paper we present a new framework for translating out of SSA form. By appropriately placing copy instructions, we ensure that none of the resources in a phi congruence class interfere. Within our framework, we propose three methods for copy placement. The first method pessimistically places copies for all operands of phi instructions. The second method uses an interference graph to guide copy placement. The third method uses both data flow liveness sets and an interference graph to guide copy placement. We also present a new SSA-based coalescing method that can selectively remove redundant copy instructions with interfering operands. Our experimental results indicate that the third method results in 35% fewer copy instructions than the second method. Compared to the first method, the third method, on average, inserts 89.9% fewer copies during copy placement and runs 15% faster, which are significant reductions in compilation time and space.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
Similar content being viewed by others
References
A. V. Aho, R. Sethi, and J. D. Ullman. Compilers: Principles, Techniques, and Tools. Addison-Wesley, 1986.
P. Briggs, K. Cooper, T. Harvey, and Taylor Simpson. Practical improvements to the construction and destruction of static single assignment form. Software-Practice and Experience, 28(8):859–881, July 1998.
G. J. Chaitin, Register allocation and spilling via graph coloring. SIGPLAN Notices 17(6):98–105, June 1982. Proc. of the ACM SIGPLAN’ 82 Symp. on Compiler Construction.
F. Chow, S. Chan, R. Kennedy, S. Liu, R. Lo, and P. Tu, “A New Algorithm for Partial Redundancy Elimination based on SSA Form,” Proc. of the 1997 ACM SIGPLAN Conf. on Programming Language Design and Implementation, pp. 273–286, 1997.
C. Click. Global Code Motion Global Value Numbering. SIGPLA Notices, 30(6):246–257, June 1995. Proceedings of the ACM SIGPLAN’95 Conference on Programming Language Design and Implementation.
R. Cytron and R. Gershbein. Efficient accommodation of may-alias information in SSA form. SIGPLAN Notices, 28(6):36–45, June 1993. Proceedings of the ACM SIGPLAN’93 Conference on Programming Language Design and Implementation
R. Cytron, J. Ferrante, B. K. Rosen, M. N. Wegman, and F. K. Zadeck Efficiently computing static single assignment form and the control dependence graph. ACM Transactions on Programming Languages and Systems, 13(4):451–490, October 1991.
A. Leung and L. George. Static Single Assignment Form for Machine Code. SIGPLAN Notices, 34(5):204–214, May 1999. Proceedings of the ACM SIGPLAN’99 Conference on Programming Language Design and Implementation.
S. Muchnick. Advanced Compiler Design and Implementation. Morgan Kaufmann Publishers, CA, 1997.
P. Pineo and M. L. Soffa. A practical approach to the symbolic debugging of parallelized code. Proceedings of International Conference on Compiler Construction, April 1994.
V. C. Sreedhar and G. R. Gao. Computing f-nodes in linear time using DJ graphs. Journal of Programming Languages, 13(4):191–213, 1996.
M. N. Wegman and F. K. Zadeck. Constant propagation with conditional branches. ACM Transactions on Programming Languages and Systems, 13(2):181–210, April 1991.
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 1999 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Sreedhar, V.C., Ju, R.DC., Gillies, D.M., Santhanam, V. (1999). Translating Out of Static Single Assignment Form. In: Cortesi, A., Filé, G. (eds) Static Analysis. SAS 1999. Lecture Notes in Computer Science, vol 1694. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-48294-6_13
Download citation
DOI: https://doi.org/10.1007/3-540-48294-6_13
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-66459-8
Online ISBN: 978-3-540-48294-9
eBook Packages: Springer Book Archive