ABSTRACT
Dataflow analysis and transformation of control-flow graphs is pervasive in optimizing compilers, but it is typically entangled with the details of a particular compiler. We describe Hoopl, a reusable library that makes it unusually easy to define new analyses and transformations for any compiler written in Haskell. Hoopl's interface is modular and polymorphic, and it offers unusually strong static guarantees. The implementation encapsulates state-of-the-art algorithms (interleaved analysis and rewriting, dynamic error isolation), and it cleanly separates their tricky elements so that they can be understood independently.
Supplemental Material
- }}Andrew W. Appel. 1998. Modern Compiler Implementation. Cambridge University Press, Cambridge, UK. Available in three editions: C, Java, and ML. Google ScholarDigital Library
- }}John Cocke and Ken Kennedy. 1977. An algorithm for reduction of operator strength. Communications of the ACM, 20(11): 850--856. Google ScholarDigital Library
- }}Keith D. Cooper, Timothy J. Harvey, and Ken Kennedy. 2001. A simple, fast dominance algorithm. Technical report, Rice University. Unpublished report available from http://www.hipersoft.rice.edu/grads/publications/dom14.pdf.Google Scholar
- }}Patrick Cousot and Radhia Cousot. 1977 (January). Abstract interpretation: A unified lattice model for static analysis of programs by construction or approximation of fixpoints. In Conference Record of the 4th ACM Symposium on Principles of Programming Languages, pages 238--252. Google ScholarDigital Library
- }}Patrick Cousot and Radhia Cousot. 1979 (January). Systematic design of program analysis frameworks. In Conference Record of the 6th Annual ACM Symposium on Principles of Programming Languages, pages 269--282. Google ScholarDigital Library
- }}John B. Kam and Jeffrey D. Ullman. 1976. Global data flow analysis and iterative algorithms. Journal of the ACM, 23(1):158--171. Google ScholarDigital Library
- }}John B. Kam and Jeffrey D. Ullman. 1977. Monotone data flow analysis frameworks. Acta Informatica, 7:305--317.Google ScholarDigital Library
- }}Gary A. Kildall. 1973 (October). A unified approach to global program optimization. In Conference Record of the ACM Symposium on Principles of Programming Languages, pages 194--206. Google ScholarDigital Library
- }}Jens Knoop, Oliver Ruething, and Bernhard Steffen. 1992. Lazy code motion. Proceedings of the ACM SIGPLAN '92 Conference on Programming Language Design and Implementation, in SIGPLAN Notices, 27 (7):224--234. Google ScholarDigital Library
- }}Sorin Lerner, David Grove, and Craig Chambers. 2002 (January). Composing dataflow analyses and transformations. Conference Record of the 29th Annual ACM Symposium on Principles of Programming Languages, in SIGPLAN Notices, 31 (1):270--282. Google ScholarDigital Library
- }}Thomas J. Marlowe and Barbara G. Ryder. 1990. Properties of data flow frameworks: a unified model. Acta Informatica, 28 (2):121--163. Google ScholarDigital Library
- }}Steven S. Muchnick. 1997. Advanced compiler design and implementation. Morgan Kaufmann, San Mateo, CA. Google ScholarDigital Library
- }}George C. Necula, Scott McPeak, Shree Prakash Rahul, and Westley Weimer. 2002. CIL: Intermediate language and tools for analysis and transformation of C programs. In CC '02: Proceedings of the 11th International Conference on Compiler Construction, pages 213--228. Google ScholarDigital Library
- }}Norman Ramsey and João Dias. 2005 (September). An applicative control-flow graph based on Huet's zipper. In ACM SIGPLAN Workshop on ML, pages 101--122.Google Scholar
- }}Colin Runciman. 2010 (June). Finding and increasing PRS candidates. Reduceron Memo 50, www.cs.york.ac.uk/fp/reduceron.Google Scholar
- }}David A. Schmidt. 1998. Data flow analysis is model checking of abstract interpretations. In ACM, editor, Conference Record of the 25th Annual ACM Symposium on Principles of Programming Languages, pages 38--48. Google ScholarDigital Library
- }}Bernhard Steffen. 1991. Data flow analysis as model checking. In TACS '91: Proceedings of the International Conference on Theoretical Aspects of Computer Software, pages 346--365. Google ScholarDigital Library
- }}Raja Vallée-Rai, Etienne Gagnon, Laurie J. Hendren, Patrick Lam, Patrice Pominville, and Vijay Sundaresan. 2000. Optimizing Java bytecode using the Soot framework: Is it feasible? In CC '00: Proceedings of the 9th International Conference on Compiler Construction, pages 18--34. Google ScholarDigital Library
- }}David B. Whalley. 1994 (September). Automatic isolation of compiler errors. ACM Transactions on Programming Languages and Systems, 16 (5):1648--1659. Google ScholarDigital Library
Index Terms
- Hoopl: a modular, reusable library for dataflow analysis and transformation
Recommendations
Hoopl: a modular, reusable library for dataflow analysis and transformation
HASKELL '10Dataflow analysis and transformation of control-flow graphs is pervasive in optimizing compilers, but it is typically entangled with the details of a particular compiler. We describe Hoopl, a reusable library that makes it unusually easy to define new ...
A new concurrency model for Scala based on a declarative dataflow core
SCALA '13: Proceedings of the 4th Workshop on ScalaDeclarative dataflow values are single assignment variables such that all operations needing their values wait automatically until the values are available. Adding threads and declarative dataflow values to a functional language gives declarative ...
Stream Processing for Embedded Domain Specific Languages
IFL '14: Proceedings of the 26nd 2014 International Symposium on Implementation and Application of Functional LanguagesWe present a library for expressing digital signal processing (DSP) algorithms using a deeply embedded domain-specific language (EDSL) in Haskell. The library supports definitions in functional programming style, reducing the gap between the ...
Comments