Abstract
We show that classic PRE is also a maximum flow problem, thereby revealing the missing link between classic and speculative PRE, and more importantly, establishing a common high-level conceptual basis for this important compiler optimisation. To demonstrate this, we formulate a new, simple unidirectional bit-vector algorithm for classic PRE based only on the well-known concepts of availability and anticipatability. Designed to find a unique minimum cut in a flow network derived from a CFG, which is proved simply but rigorously, our algorithm is simple and intuitive, and its optimality is self-evident. This conceptual simplicity also translates into efficiency, as validated by experiments.
Chapter PDF
Similar content being viewed by others
Keywords
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.
References
Bodik, R.: Path-Sensitive Value-Flow Optimizations of Programs. PhD thesis, University of Pittsburgh (1999)
Bodik, R., Gupta, R., Soffa, M.L.: Complete removal of redundant computations. In: Proceedings of the ACM SIGPLAN 1998 Conference on Programming Language Design and Implementation, pp. 1–14 (1998)
Briggs, P., Cooper, K.D.: Effective partial redundancy elimination. In: Proceedings of the ACM SIGPLAN 1994 Conference on Programming Language Design and Implementation, pp. 159–170 (1994)
Cai, Q., Xue, J.: Optimal and efficient speculation-based partial redundancy elimination. In: 1st IEEE/ACM International Symposium on Code Generation and Optimization, pp. 91–104 (2003)
Cormen, T.H., Leiserson, C.E., Rivest, R.L.: Introduction to Algorithms. MIT Press, Cambridge (1990)
Dhamdhere, D.M.: A fast algorithm for code movement optimisation. SIGPLAN Not. 23(10), 172–180 (1988)
Dhamdhere, D.M.: E-path_pre: partial redundancy elimination made easy. SIGPLAN Not. 37(8), 53–65 (2002)
Dhaneshwar, V.M., Dhamdhere, D.M.: Strength reduction of large expressions. Journal of Programming Languages 3, 95–120 (1995)
Drechsler, K.-H., Stadel, M.P.: A variation on Knoop, Rüthing, and Steffen’s lazy code motion. SIGPLAN Notices 28(5), 29–38 (1993)
Ford, L.R., Fulkerson, D.R.: Flows in Networks. Princeton University Press, Princeton (1962)
Gupta, R., Berson, D.A., Fang, J.Z.: Path profile guided partial redundancy elimination using speculation. In: Proceedings of the 1998 International Conference on Computer Languages, pp. 230–239 (1998)
Hailperin, M.: Cost-optimal code motion. ACM Transactions on Programming Languages and Systems 20(6), 1297–1322 (1998)
Horspool, R., Ho, H.: Partial redundancy elimination driven by a cost-benefit analysis. In: 8th Israeli Conference on Computer System and Software Engineering, pp. 111–118 (1997)
Hu, T.C.: Integer Programming and Network Flows. Addison-Wesley, Reading (1970)
Kennedy, R., Chan, S., Liu, S.-M., Lo, R., Tu, P.: Partial redundancy elimination in SSA form. ACM Transactions on Programming Languages and Systems 21(3), 627–676 (1999)
Kennedy, R., Chow, F.C., Dahl, P., Liu, S.-M., Lo, R., Streich, M.: Strength reduction via SSAPRE. In: Proceedings of the 7th International Conference on Compiler Construction, London, UK, pp. 144–158. Springer, London (1998)
Knoop, J., Rüthing, O., Steffen, B.: Lazy code motion. In: Proceedings of the ACM SIGPLAN 1992 Conference on Programming Language Design and Implementation, pp. 224–234 (1992)
Knoop, J., Rüthing, O., Steffen, B.: Lazy strength reduction. Journal of Programming Languages 1(1), 71–91 (1993)
Knoop, J., Rüthing, O., Steffen, B.: Optimal code motion: Theory and practice. ACM Trans. Program. Lang. Syst. 16(4), 1117–1155 (1994)
Lin, J., Chen, T., Hsu, W.-C., Yew, P.-C., Ju, R.D.-C., Ngai, T.-F., Chan, S.: A compiler framework for speculative analysis and optimizations. In: Proceedings of the ACM SIGPLAN 2003 Conference on Programming Language Design and Implementation, pp. 289–299 (2003)
Lo, R., Chow, F., Kennedy, R., Liu, S.-M., Tu, P.: Register promotion by sparse partial redundancy elimination of loads and stores. SIGPLAN Not. 33(5), 26–37 (1998)
Morel, E., Renvoise, C.: Global optimization by suppression of partial redundancies. Commun. ACM 22(2), 96–103 (1979)
Paleri, V.K., Srikant, Y.N., Shankar, P.: A simple algorithm for partial redundancy elimination. SIGPLAN Not. 33(12), 35–43 (1998)
Rüthing, O., Knoop, J., Steffen, B.: Sparse code motion. In: Conference Record of the 27th Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, Boston, Massachusetts, pp. 170–183. ACM, New York (2000)
Scholz, B., Horspool, R.N., Knoop, J.: Optimizing for space and time usage with speculative partial redundancy elimination. In: Proceedings of the 2004 ACM SIGPLAN/SIGBED Conference on Languages, Compilers, and Tools for Embedded Systems, pp. 221–230 (2004)
Xue, J., Cai, Q.: Profile-guided partial redundancy elimination using control speculation: a lifetime optimal algorithm and an experimental evaluation. Technical Report UNSW–CSE–TR–0420, School of Computer Science and Engigeering, University of New South Wales (July 2004)
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
Xue, J., Knoop, J. (2006). A Fresh Look at PRE as a Maximum Flow Problem. In: Mycroft, A., Zeller, A. (eds) Compiler Construction. CC 2006. Lecture Notes in Computer Science, vol 3923. Springer, Berlin, Heidelberg. https://doi.org/10.1007/11688839_13
Download citation
DOI: https://doi.org/10.1007/11688839_13
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-33050-9
Online ISBN: 978-3-540-33051-6
eBook Packages: Computer ScienceComputer Science (R0)