Abstract
Partial Redundancy Elimination (PRE) is a standard program optimization which removes redundant computations via Code Motion. It subsumes and generalizes the optimizations of Global Common Subexpression Elimination (GCSE) and Loop Invariant Code Motion (LICM). Recent work has generalized PRE to become Speculative PRE (SPRE), which uses estimates of execution frequencies to find the optimal places in a program to perform computations. However, the analysis performed by the compiler is computationally intensive and hence impractical for just-in-time (JIT) compilers.
This paper introduces a novel approach which abandons a guarantee of optimality in favour of simplicity and speed of analysis. This new approach, called Isothermal SPRE, achieves results which are close to optimal in practice, yet its analysis time is at least as good as current compiler techniques for code motion. It is a technique suitable for use in JIT compilers.
Preview
Unable to display preview. Download preview PDF.
Similar content being viewed by others
References
Aho, A., Sethi, R., Ullman, J.: Compilers: Principles, Techniques, and Tools. Addison-Wesley, Reading (1986)
Breuer, M.: Generation of optimal code for expressions via factorization. CACM 12(6), 333–340 (1969)
Cai, Q., Xue, J.: Optimal and efficient speculation-based partial redundancy elimination. In: CGO 2003: Proceedings of the ACM/IEEE 2003 Symposium on Code Generation and Optimization, pp. 91–104 (2003)
Cocke, J.: Global common subexpression elimination. In: Proceedings of a symposium on compiler optimization, pp. 20–24 (1970)
Dhamdhere, D.: Practical adaptation of the global optimization algorithm of Morel and Renvoise. ACM Transactions on Programming Languages and Systems 13(2), 291–294 (1991)
Horspool, R., Ho, H.: Partial redundancy elimination driven by a cost-benefit analysis. In: Proceedings of the 8th Israeli Conference on Computer Systems and Software Engineering, pp. 111–118 (1997)
Kam, J.B., Ullman, J.D.: Monotone data flow analysis frameworks. Acta Informatica 7, 309–317 (1977)
Knoop, J., Ruthing, O., Steffen, B.: Lazy code motion. In: PLDI 1992: Proceedings of the ACM SIGPLAN 1992 conference on Programming Language Design and Implementation, pp. 224–234 (1992)
Knoop, J., Ruthing, O., Steffen, B.: Optimal code motion: theory and practice. ACM Transactions on Programming Languages and Systems 16(4), 1117–1155 (1994)
Morel, E., Renvoise, C.: Global optimization by suppression of partial redundancies. CACM 22(2), 96–103 (1979)
Morel, E., Renvoise, C.: Interprocedural elimination of partial redundancies. In: Muchnik, S., Jones, N. (eds.) Program Flow Analysis: Theory and Applications, pp. 160–188. Prentice-Hall, Englewood Cliffs (1981)
Muchnik, S.: Advanced Compiler Design and Implementation. Morgan Kaufmann, San Francisco (1997)
Scholz, B., Horspool, N., Knoop, J.: Optimizing for space and time usage with speculative partial redundancy elimination. In: LCTES 2004: Proceedings of ACM SIGPLAN/SIGBED 2004 Conference on Languages, Compilers, and Tools for Embedded Systems, pp. 221–230 (2004)
Standard Performance Evaluation Corporation. Cpu2000 (2006), http://www.spec.org
Stone, H.: Multiprocessor scheduling with the aid of network flow algorithms. IEEE Transactions on Software Engineering SE-3(1), 85–93 (1977)
Wolfe, M.: Partial redundancy elimination is not bidirectional. SIGPLAN Notices 34(6), 43–46 (1999)
Xue, J., Cai, Q.: A lifetime optimal algorithm for speculative pre. ACM Transactions on Architecture and Code Generation (to appear, 2006)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2006 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Horspool, R.N., Pereira, D.J., Scholz, B. (2006). Fast Profile-Based Partial Redundancy Elimination. In: Lightfoot, D.E., Szyperski, C. (eds) Modular Programming Languages. JMLC 2006. Lecture Notes in Computer Science, vol 4228. Springer, Berlin, Heidelberg. https://doi.org/10.1007/11860990_22
Download citation
DOI: https://doi.org/10.1007/11860990_22
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-40927-4
Online ISBN: 978-3-540-40928-1
eBook Packages: Computer ScienceComputer Science (R0)