Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to main content

Optimizing Reversible Programs

  • Conference paper
  • First Online:
Reversible Computation (RC 2022)

Abstract

Reversible programming languages have been a focus of research for more than the last decade mostly due to the work of Glück, Yokoyama, Mogensen, and many others. In this paper we report about our recent activities to optimize reversible code with respect to execution time. Based on our rc3-compiler which compiles Janus to reversible static-single-assignment form RSSA, we had explored and implemented optimization algorithms for local common-subexpression elimination, constant propagation, and folding and have presented those at SOAP 2021. This paper focuses on new achievements for procedure inlining as well as elimination of dead code. Our compiler is—to our knowledge—the first optimizing compiler for reversible languages. Whereas these optimizations are well established for “traditional” languages, programs that can be executed forwards and backwards require different and novel approaches.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Subscribe and save

Springer+ Basic
$34.99 /Month
  • Get 10 units per month
  • Download Article/Chapter or eBook
  • 1 Unit = 1 Article or 1 Chapter
  • Cancel anytime
Subscribe now

Buy Now

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 54.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 69.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Similar content being viewed by others

References

  1. Aho, A., Sethi, R., Ullman, J.: Compilers: Principles, Techniques and Tools. Addison-Wesley, Boston (1986)

    Google Scholar 

  2. Appel, A.W.: Modern Compiler Implementation in Java. Cambridge University Press, Cambridge (1998)

    Google Scholar 

  3. Axelsen, H.B.: Clean translation of an imperative reversible programming language. In: Knoop, J. (ed.) CC 2011. LNCS, vol. 6601, pp. 144–163. Springer, Heidelberg (2011). https://doi.org/10.1007/978-3-642-19861-8_9

    Chapter  Google Scholar 

  4. Deworetzki, N., Meyer, U.: Program analysis for reversible languages. In: Proceedings of the 10th ACM SIGPLAN International Workshop on the State of the Art in Program Analysis, SOAP 2021, pp. 13–18. Association for Computing Machinery, New York (2021). https://doi.org/10.1145/3460946.3464314

  5. Deworetzki, N., Meyer, U.: Designing a reversible stack machine. In: Mezzina, C.A., Podlaski, K. (Eds.): RC 2022, LNCS 13354, pp. 65–72. Springer, Cham (2022, to appear)

    Google Scholar 

  6. Frank, M.P.: The future of computing depends on making it reversible. IEEE Spectrum, September 2017

    Google Scholar 

  7. Hudson, S.E., Flannery, F., Ananian, S.C., Wang, D., Petter, M.: Cup user’s manual, June 2014. http://www2.in.tum.de/projects/cup/docs.php

  8. Kildall, G.A.: A unified approach to global program optimization. In: Fischer, P.C., Ullman, J.D. (eds.) POPL, pp. 194–206. ACM Press (1973). http://dblp.uni-trier.de/db/conf/popl/popl73.html

  9. Klein, G., Rowe, S., Décamps, R.: Jflex user’s manual, version 1.8.2 edn., February 2020. https://www.jflex.de/manual.html

  10. Kutrib, M., Meyer, U., Deworetzki, N., Schuster, M.: Compiling Janus to RSSA. In: Yamashita, S., Yokoyama, T. (eds.) RC 2021. LNCS, vol. 12805, pp. 64–78. Springer, Cham (2021). https://doi.org/10.1007/978-3-030-79837-6_4

    Chapter  Google Scholar 

  11. Landauer, R.: Irreversibility and heat generation in the computing process. IBM J. Res. Dev. 5(3), 183–191 (1961)

    Article  MathSciNet  Google Scholar 

  12. Lutz, C.: Janus - A Time-Reversible Language (1986). http://tetsuo.jp/ref/janus.pdf. Letter to R. Landauer

  13. Mogensen, T.Æ.: Partial evaluation of the reversible language Janus. In: Khoo, S.C., Siek, J.G. (eds.) PEPM, pp. 23–32. ACM (2011). http://dblp.uni-trier.de/db/conf/pepm/pepm2011.html

  14. Mogensen, T.Æ.: RSSA: a reversible SSA form. In: Mazzara, M., Voronkov, A. (eds.) PSI 2015. LNCS, vol. 9609, pp. 203–217. Springer, Cham (2016). https://doi.org/10.1007/978-3-319-41579-6_16http://dblp.unitrier.de/db/conf/ershov/ershov2015.html

    Chapter  Google Scholar 

  15. Muchnick, S.S.: Advanced Compiler Design and Implementation. Morgan Kaufmann (1997)

    Google Scholar 

  16. Rosen, B.K., Wegman, M.N., Zadeck, F.K.: Global value numbers and redundant computations. In: Ferrante, J., Mager, P. (eds.) POPL, pp. 12–27. ACM Press (1988). http://dblp.uni-trier.de/db/conf/popl/popl88.html

  17. Technische Hochschule Mittelhessen: Reversible computing compiler collection (rc3), February 2022. https://git.thm.de/thm-rc3/release

  18. Yokoyama, T., Axelsen, H.B., Glück, R.: Principles of a reversible programming language. In: Ramírez, A., Bilardi, G., Gschwind, M. (eds.) Conference Computing Frontiers, pp. 43–54. ACM (2008). http://dblp.uni-trier.de/db/conf/cf/cf2008.html

  19. Yokoyama, T., Axelsen, H.B., Glück, R.: Fundamentals of reversible flowchart languages. Theor. Comput. Sci. 611, 87–115 (2016). http://dblp.uni-trier.de/db/journals/tcs/tcs611.html

  20. Yokoyama, T., Glück, R.: A reversible programming language and its invertible self-interpreter. In: Ramalingam, G., Visser, E. (eds.) PEPM, pp. 144–153. ACM (2007). http://dblp.uni-trier.de/db/conf/pepm/pepm2007.html

Download references

Acknowledgements

We would like to thank the reviewers who had provided valuable feedback and suggestions for improvement.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Uwe Meyer .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2022 The Author(s), under exclusive license to Springer Nature Switzerland AG

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

Deworetzki, N., Kutrib, M., Meyer, U., Ritzke, PD. (2022). Optimizing Reversible Programs. In: Mezzina, C.A., Podlaski, K. (eds) Reversible Computation. RC 2022. Lecture Notes in Computer Science, vol 13354. Springer, Cham. https://doi.org/10.1007/978-3-031-09005-9_16

Download citation

  • DOI: https://doi.org/10.1007/978-3-031-09005-9_16

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-031-09004-2

  • Online ISBN: 978-3-031-09005-9

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics