Abstract
The development and implementation of source-to-source code transformations based on high-level intermediate representations (IRs) is a labor-intensive, error-prone task. It tends to result in large code bases which are hard to read and maintain. Although not encountered within widely used source-to-source compiler infrastructures, transformation systems tackle this issue by utilizing declarative descriptions of unification-based term rewriting rules. However, unification lacks the ability of (arbitrarily) deep term inspection and is limited to tree nodes exhibiting a fixed arity – a property not generally satisfied by high-level IRs or programming languages.
In this paper we present a declarative tree transformation system which exceeds the expressiveness of conventional unification based systems by operating on arbitrary tree structures.We define its formal foundation, describe its implementation within the Insieme compiler project and provide real-world code examples. The latter demonstrate the expressive power, usability and intuitiveness of our solution.
Chapter PDF
Similar content being viewed by others
References
clang: a C language family frontend for LLVM (2012), http://clang.llvm.org/ (Online May 30, 2013)
Cordy, J.R.: The TXL source transformation language. Science of Computer Programming 61(3), 190–210 (2006)
Insieme Compiler and Runtime Infrastructure. University of Innsbruck, http://insieme-compiler.org
Jordan, H., et al.: INSPIRE: The Insieme Parallel Intermediate Representation. In: PACT. ACM (2013) (to be published)
Merrill, J.: Generic and gimple: A new tree representation for entire functions. In: GCC Developers Summit, pp. 171–179 (2003)
Necula, G.C., McPeak, S., Rahul, S.P., Weimer, W.: CIL: Intermediate language and tools for analysis and transformation of C programs. In: Nigel Horspool, R. (ed.) CC 2002. LNCS, vol. 2304, pp. 213–228. Springer, Heidelberg (2002)
Quinlan, D.: ROSE: Compiler support for object-oriented frameworks. Parallel Processing Letters 10(02-03), 215–226 (2000)
The Program Transformation Wiki (2013), http://program-transformation.org/ (May 30, 2013)
Thoman, P., Jordan, H., Fahringer, T.: Adaptive Granularity Control in Task Parallel Programs Using Multiversioning. In: Wolf, F., Mohr, B., an Mey, D. (eds.) Euro-Par 2013. LNCS, vol. 8097, pp. 164–177. Springer, Heidelberg (2013)
Visser, E.: A survey of rewriting strategies in program transformation systems. ENTCS 57, 109–143 (2001)
Visser, E.: Program transformation with stratego/XT. In: Lengauer, C., Batory, D., Blum, A., Odersky, M. (eds.) Domain-Specific Program Generation. LNCS, vol. 3016, pp. 216–238. Springer, Heidelberg (2004)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2014 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Jordan, H., Thoman, P., Fahringer, T. (2014). A High-Level IR Transformation System. In: an Mey, D., et al. Euro-Par 2013: Parallel Processing Workshops. Euro-Par 2013. Lecture Notes in Computer Science, vol 8374. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-54420-0_63
Download citation
DOI: https://doi.org/10.1007/978-3-642-54420-0_63
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-642-54419-4
Online ISBN: 978-3-642-54420-0
eBook Packages: Computer ScienceComputer Science (R0)