Nothing Special   »   [go: up one dir, main page]

skip to main content
research-article
Open access

Efficient liveness computation using merge sets and DJ-graphs

Published: 26 January 2012 Publication History

Abstract

In this work we devise an efficient algorithm that computes the liveness information of program variables. The algorithm employs SSA form and DJ-graphs as representation to build Merge sets. The Merge set of node n, M(n) is based on the structure of the Control Flow Graph (CFG) and consists of all nodes where a ϕ-function needs to be placed, if a definition of a variable appears in n. The merge sets of a CFG can be computed using DJ-graphs without prior knowledge of how the variables are used and defined. Later, we can answer the liveness query (as a part of other optimization or analysis phase) by utilizing the knowledge of the use/def of variables, the dominator tree and the pre-computed merge sets. On average, merge sets have been shown to be of size comparable to the Dominance Frontier(DF) set of a CFG and can be computed efficiently for all kinds of applications consisting of both reducible and irreducible loops. This is an advantage over existing algorithms which require additional complexities while handling applications using irreducible loops. For cases where the merge sets have already been created during the SSA construction step, the cost of our algorithm reduces even further when we use these merge sets for liveness computation. We have compared our new algorithm with a recent algorithm for computing liveness based on SSA form, and show how it performs better in practice, though being simpler to understand and implement.

References

[1]
Bilardi, G. and Pingali, K. 2003. Algorithms for computing the static single assignment form. J. ACM 50, 3, 375--425.
[2]
Blieberger, J. 2006. Average case analysis of DJ-graphs. J. Discrete Algorithms 4, 4, 649--675.
[3]
Boissinot, B., Darte, A., Rastello, F., Dupont de Dinechin, B., and Guillon, C. 2009. Revisiting out-of-SSA translation for correctness, code quality and efficiency. In Proceedings of the International Symposium on Code Generation and Optimization (CGO). 114--125.
[4]
Boissinot, B., Hack, S., Grund, D., Dupont de Dinechin, B., and Rastello, F. 2008. Fast liveness checking for SSA-form programs. In Proceedings of the International Symposium on Code Generation and Optimization (CGO). 35--44.
[5]
Briggs, P. and Cooper, K. D. Torczon, L. 1994. Improvements to graph coloring register allocation. ACM Trans. Program. Lang. and Sys. 16, 428--455.
[6]
Budimlic, Z., Cooper, K. D., Harvey, T. J., Kennedy, K., Oberg, T. S., and Reeves, S. W. 2002. Fast copy coalescing and live-range identification. In Proceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation. 25--32.
[7]
Chaitin, G. C., Auslander, M. A., Chandra, A. K., Cocke, J., Hopkins, M. E., and Markstein, P. W. 1981. Register allocation via coloring. Computer Lang. 6, 1, 47--57.
[8]
Choi, J. D., Cytron, R., and Ferrante, J. 1991. Automatic construction of sparse data flow evaluation graphs. In Proceedings of the 18th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages. 55--66.
[9]
Cooper, K. and Torczon, L. 2004. Engineering a Compiler. Morgan Kaufmann.
[10]
Cytron, R., Ferrante, J., Rosen, B. K., Wegman, M. N., and Zadeck, F. K. 1991. Efficiently computing static single assignment form and the control dependence graph. ACM Trans. Program. Lang. Syst. 13, 4, 451--490.
[11]
Das, D. and Ramakrishna, U. 2005. A practical and fast iterative algorithm for φ-function computation using DJ-graphs. ACM Trans. Program. Lang. Syst. 27, 3, 426--440.
[12]
Dupont de Dinechin, B., De Ferriere, F., Guillon, C., and Stoutchinin, A. 2000. Code generator optimizations for the ST120 DSP-MCU core. In Proceedings of the International Conference on Compilers, Architecture, and Synthesis for Embedded Systems. 93--102.
[13]
Gerlek, M., Wolfe, M., and Stolz, E. 1994. A Reference chain approach for live variables. Tech. rep., Oregon Graduate Institute of Science and Technology.
[14]
Hack, S., Grund, D., and Goos, G. 2006. Register allocation for programs in SSA form. In Compiler Construction, A. Zeller and A. Mycroft, Eds., Springer-Verlag, Berlin.
[15]
Havlak, P. 1997. Nesting of Reducible and Irreducible Loops. ACM Trans. Program. Lang. Syst. 19, 4, 557--567.
[16]
Lee, C., Potkonjak, M., and Mangione-Smith, W. H. 1997. Mediabench: A tool for evaluating and synthesizing multimedia and communicatons systems. In Proceedings of the 30th Annual ACM/IEEE International Symposium on Microarchitecture. 330--335.
[17]
Morgan, R. 1998. Building an Optimizing Compiler. Digital Press.
[18]
Pingali, K. and Bilardi, G. 1995. APT: A data structure for optimal control dependence computation. SIGPLAN Not. 30, 32--46.
[19]
Puzović, N. 2007. SSA form in an embedded compiler. Tech. rep., HiPEAC/STMicroelectronics.
[20]
Ramalingam, G. 1997. On Sparse evaluation representations. In Proceedings of 4th International Symposium on Static Analysis. 1--15.
[21]
Ramalingam, G. 2002. On loops, dominators and dominance frontiers. ACM Trans. Program. Lang. Syst. 24, 5, 455--490.
[22]
Sreedhar, V. C. 1995. Efficient program analysis using DJ graphs. Ph.D. thesis, McGill University.
[23]
Sreedhar, V. C. and Gao, G. R. 1995. A linear time algorithm for placing φ-nodes. In Proceedings of 22nd ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages. ACM Press, New York, NY, 62--73.
[24]
Sreedhar, V. C., Ju, R. D., Gillies, D. M., and Santhanam, V. 1999. Translating out of static single assignment form. In SAS'99: Proceedings of the 6th International Symposium on Static Analysis. 194--210.
[25]
Srikant, Y. N. and Shankar, P., Eds. 2007. The Compiler Design Handbook: Optimizations and Machine Code Generation. CRC Press.

Cited By

View all

Recommendations

Comments

Please enable JavaScript to view thecomments powered by Disqus.

Information & Contributors

Information

Published In

cover image ACM Transactions on Architecture and Code Optimization
ACM Transactions on Architecture and Code Optimization  Volume 8, Issue 4
Special Issue on High-Performance Embedded Architectures and Compilers
January 2012
765 pages
ISSN:1544-3566
EISSN:1544-3973
DOI:10.1145/2086696
Issue’s Table of Contents
Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 26 January 2012
Accepted: 01 November 2011
Revised: 01 October 2011
Received: 01 July 2011
Published in TACO Volume 8, Issue 4

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. DJ-graph
  2. Liveness
  3. SSA
  4. dominator tree
  5. merge set
  6. optimizing compilers

Qualifiers

  • Research-article
  • Research
  • Refereed

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)114
  • Downloads (Last 6 weeks)4
Reflects downloads up to 18 Nov 2024

Other Metrics

Citations

Cited By

View all

View Options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Login options

Full Access

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media