Abstract
The polyhedral model is a high-level intermediate representation for loop nests that supports elegantly a great many loop optimizations. In a compiler, after polyhedral loop optimizations have been performed, it is necessary and difficult to regenerate sequential or parallel loop nests before continuing compilation. This paper reports on the formalization and proof of semantic preservation of such a code generator that produces sequential code from a polyhedral representation. The formalization and proofs are mechanized using the Coq proof assistant.
Supplemental Material
Available for Download
This is the Coq development that accompanies the POPL 2021 paper "Verified Code Generation for the Polyhedral Model".
- Corinne Ancourt and François Irigoin. 1991. Scanning Polyhedra with DO Loops. In PPoPP'91: 3rd symposium on Principles & Practice of Parallel Programming. ACM, 39-50. https://doi.org/10.1145/109625.109631 Google Scholar
Digital Library
- Riyadh Baghdadi, Jessica Ray, Malek Ben Romdhane, Emanuele Del Sozzo, Abdurrahman Akkas, Yunming Zhang, Patricia Suriana, Shoaib Kamil, and Saman P. Amarasinghe. 2019. Tiramisu: A Polyhedral Compiler for Expressing Fast and Portable Code. In CGO 2019: International Symposium on Code Generation and Optimization. IEEE, 193-205. https: //doi.org/10.1109/CGO. 2019.8661197 Google Scholar
Cross Ref
- Gilles Barthe, Juan Manuel Crespo, and César Kunz. 2016. Product programs and relational program logics. J. Log. Algebraic Methods Program. 85, 5 ( 2016 ), 847-859. https://doi.org/10.1016/j.jlamp. 2016. 05.004 Google Scholar
Cross Ref
- Cédric Bastoul. 2004. Code Generation in the Polyhedral Model Is Easier Than You Think. In PACT'04: Proceedings of the 13th International Conference on Parallel Architectures and Compilation Techniques. IEEE, 7-16. https://doi.org/10.1109/ PACT. 2004.11 Google Scholar
Cross Ref
- Ulysse Beaugnon, Alexey Kravets, Sven Van Haastregt, Riyadh Baghdadi, David Tweed, Javed Absar, and Anton Lokhmotov. 2014. VOBLA: a vehicle for optimized basic linear algebra. In LCTES'14: Proceedings of the 2014 SIGPLAN/SIGBED conference on Languages, compilers and tools for embedded systems. ACM, 115-124. https://doi.org/10.1145/2666357.2597818 Google Scholar
Digital Library
- A. J. Bernstein. 1966. Analysis of Programs for Parallel Processing. IEEE Transactions on Electronic Computers EC-15, 5 (Oct 1966 ), 757-763. https://doi.org/10.1109/PGEC. 1966.264565 Google Scholar
Cross Ref
- Pierre Boulet and Paul Feautrier. 1998. Scanning polyhedra without DO-loops. In PACT'98: conference on Parallel Architectures and Compilation Techniques. IEEE, 4-11. https://doi.org/10.1109/PACT. 1998.727127 Google Scholar
Cross Ref
- Sylvain Boulmé, Alexandre Maréchal, David Monniaux, Michaël Périn, and Hang Yu. 2018. The Verified Polyhedron Library: an Overview. In SYNASC 2018 : 20th International Symposium on Symbolic and Numeric Algorithms for Scientific Computing. IEEE, 9-17. https://doi.org/10.1109/SYNASC. 2018.00014 Google Scholar
Cross Ref
- Chun Chen. 2012. Polyhedra Scanning Revisited. In PLDI 2012: conference on Programming Language Design and Implementation. ACM, 499-508. https://doi.org/10.1145/2254064.2254123 Google Scholar
Digital Library
- Berkeley R. Churchill, Oded Padon, Rahul Sharma, and Alex Aiken. 2019. Semantic program alignment for equivalence checking. In PLDI 2019: conference on Programming Language Design and Implementation. ACM, 1027-1040. https: //doi.org/10.1145/3314221.3314596 Google Scholar
Digital Library
- Bruno Cuervo Parrino, Julien Narboux, Eric Violard, and Nicolas Magaud. 2012. Dealing with arithmetic overflows in the polyhedral model. In IMPACT 2012 : 2nd International Workshop on Polyhedral Compilation Techniques. https: //hal.inria.fr/hal-00655485Google Scholar
- Paul Feautrier. 1991. Dataflow analysis of array and scalar references. Int. J. Parallel Program. 20, 1 ( 1991 ), 23-53. https: //doi.org/10.1007/BF01407931 Google Scholar
Cross Ref
- Paul Feautrier and Christian Lengauer. 2011. The Polyhedron Model. In Encyclopedia of Parallel Programming, David Padua (Ed.). Springer, 1581-1592.Google Scholar
- Alexis Fouilhé and Sylvain Boulmé. 2014. A Certifying Frontend for (Sub)polyhedral Abstract Domains. In VSTTE 2014: Verified Software: Theories, Tools and Experiments (LNCS, Vol. 8471 ). Springer, 200-215. https://doi.org/10.1007/978-3-319-12154-3_13 Google Scholar
Cross Ref
- Tobias Grosser, Armin Größlinger, and Christian Lengauer. 2012. Polly-Performing Polyhedral Optimizations on a Low-level Intermediate Representation. Parallel Processing Letters 22, 04 ( 2012 ). https://doi.org/10.1142/S0129626412500107 Google Scholar
Cross Ref
- Tobias Grosser, Sven Verdoolaege, and Albert Cohen. 2015. Polyhedral AST Generation Is More Than Scanning Polyhedra. ACM Trans. Program. Lang. Syst. 37, 4, Article 12 ( July 2015 ), 50 pages. https://doi.org/10.1145/2743016 Google Scholar
Digital Library
- Guy Katz, Clark W. Barrett, David L. Dill, Kyle Julian, and Mykel J. Kochenderfer. 2017. Reluplex: An Eficient SMT Solver for Verifying Deep Neural Networks. In CAV 2017: Computer Aided Verification-29th International Conference (LNCS, Vol. 10426 ). Springer, 97-117. https://doi.org/10.1007/978-3-319-63387-9_5 Google Scholar
Cross Ref
- Ramana Kumar, Magnus O. Myreen, Michael Norrish, and Scott Owens. 2014. CakeML: A Verified Implementation of ML. In POPL'14: 41st symposium Principles of Programming Languages. ACM, 179-191. https://doi.org/10.1145/2535838.2535841 Google Scholar
Digital Library
- Sudipta Kundu, Zachary Tatlock, and Sorin Lerner. 2009. Proving Optimizations Correct using Parameterized Program Equivalence. In PLDI 2009: conference on Programming Language Design and Implementation. ACM, 327-337. https: //doi.org/10.1145/1542476.1542513 Google Scholar
Digital Library
- Leslie Lamport. 1974. The Parallel Execution of DO Loops. Commun. ACM 17, 2 ( 1974 ), 83-93. https://doi.org/10.1145/ 360827.360844 Google Scholar
Digital Library
- Xavier Leroy. 2009. Formal Verification of a Realistic Compiler. Commun. ACM 52, 7 ( 2009 ), 107-115. https://doi.org/10. 1145/1538788.1538814 Google Scholar
Digital Library
- Lee-Chung Lu. 1991. A Unified Framework for Systemic Loop Transformation. In PPoPP 1991: 3rd Symposium on Principles & Practice of Parallel Programming. ACM, 28-38. https://doi.org/10.1145/109625.109630 Google Scholar
Digital Library
- Steven S. Muchnick. 1997. Advanced compiler design and implementation. Morgan Kaufmann.Google Scholar
- Kedar S. Namjoshi and Nimit Singhania. 2016. Loopy: Programmable and Formally Verified Loop Transformations. In SAS 2016: Static Analysis, 23rd International Symposium (LNCS, Vol. 9837 ). Springer, 383-402. https://doi.org/10.1007/978-3-662-53413-7_19 Google Scholar
Cross Ref
- George C. Necula. 2000. Translation validation for an optimizing compiler. In PLDI 2000: conference on Programming Language Design and Implementation. ACM, 83-95. https://doi.org/10.1145/349299.349314 Google Scholar
Digital Library
- Alexandre Pilkiewicz. 2010-2013. s2sLoop: a validator for polyhedral transformations. ( 2010-2013 ). https://github.com/ pilki/s2sLoopGoogle Scholar
- Amir Pnueli, Michael Siegel, and Eli Singerman. 1998. Translation Validation. In TACAS' 98 : Tools and Algorithms for Construction and Analysis of Systems (LNCS, Vol. 1384 ). Springer, 151-166. https://doi.org/10.1007/BFb0054170 Google Scholar
Cross Ref
- William Pugh. 1991. Uniform techniques for loop optimization. In ICS 1991: 5th international conference on Supercomputing. ACM, 341-352. https://doi.org/10.1145/109025.109108 Google Scholar
Digital Library
- Fabien Quilleré, Sanjay Rajopadhye, and Doran Wilde. 2000. Generation of eficient nested loops from polyhedra. International Journal of Parallel Programming 28, 5 ( 2000 ), 469-498. https://doi.org/10.1023/A:1007554627716 Google Scholar
Digital Library
- Jonathan Ragan-Kelley, Andrew Adams, Dillon Sharlet, Connelly Barnes, Sylvain Paris, Marc Levoy, Saman Amarasinghe, and Frédo Durand. 2017. Halide: Decoupling Algorithms from Schedules for High-performance Image Processing. Commun. ACM 61, 1 (Dec. 2017 ), 106-115. https://doi.org/10.1145/3150211 Google Scholar
Digital Library
- Harenome Razanajato, Vincent Loechner, and Cédric Bastoul. 2017. Splitting Polyhedra to Generate More Eficient Code. In IMPACT 2017 : 7th International Workshop on Polyhedral Compilation Techniques. https://hal.inria.fr/hal-01505764Google Scholar
- Markus Schordan, Pei-Hung Lin, Daniel J. Quinlan, and Louis-Noël Pouchet. 2014. Verification of Polyhedral Optimizations with Constant Loop Bounds in Finite State Space Computations. In ISoLA 2014: Leveraging Applications of Formal Methods, Verification and Validation (LNCS, Vol. 8803 ). Springer, 493-508. https://doi.org/10.1007/978-3-662-45231-8_41 Google Scholar
Cross Ref
- Alexander Schrijver. 1998. Theory of Linear and Integer Programming. Wiley.Google Scholar
Digital Library
- Gagandeep Singh, Timon Gehr, Markus Püschel, and Martin T. Vechev. 2019. An abstract domain for certifying neural networks. Proc. ACM Program. Lang. 3, POPL ( 2019 ), 41 : 1-41 : 30. https://doi.org/10.1145/3290354 Google Scholar
Digital Library
- Ross Tate, Michael Stepp, Zachary Tatlock, and Sorin Lerner. 2011. Equality Saturation: A New Approach to Optimization. Log. Methods Comput. Sci. 7, 1 ( 2011 ). https://doi.org/10.2168/LMCS-7( 1 :10) 2011 Google Scholar
Cross Ref
- Konrad Trifunović, Albert Cohen, David Edelsohn, Feng Li, Tobias Grosser, Harsha Jagasia, Razya Ladelsky, Sebastian Pop, Jan Sjödin, and Ramakrishna Upadrasta. 2010. GRAPHITE Two Years After: First Lessons Learned From Real-World Polyhedral Compilation. In GROW' 10 : 2nd GCC Research Opportunities Workshop. https://hal.inria.fr/inria-00551516Google Scholar
- Jean-Baptiste Tristan, Paul Govereau, and Greg Morrisett. 2011. Evaluating value-graph translation validation for LLVM. In PLDI 2011: conference on Programming Language Design and Implementation. ACM, 295-305. https://doi.org/10.1145/ 1993498.1993533 Google Scholar
Digital Library
- Jean-Baptiste Tristan and Xavier Leroy. 2010. A simple, verified validator for software pipelining. In POPL 2010: 37th symposium Principles of Programming Languages. ACM, 83-92. https://doi.org/10.1145/1706299.1706311 Google Scholar
Digital Library
- Nicolas Vasilache, Oleksandr Zinenko, Theodoros Theodoridis, Priya Goyal, Zachary Devito, William S. Moses, Sven Verdoolaege, Andrew Adams, and Albert Cohen. 2020. The Next 700 Accelerated Layers: From Mathematical Expressions of Network Computation Graphs to Accelerated GPU Kernels, Automatically. ACM Trans. Archit. Code Optim. 16, 4 ( 2020 ), 38 : 1-38 : 26. https://doi.org/10.1145/3355606 Google Scholar
Digital Library
- Sven Verdoolaege, Serge Guelton, Tobias Grosser, and Albert Cohen. 2014. Schedule Trees. In IMPACT 2014: 4th International Workshop on Polyhedral Compilation Techniques, Sanjay Rajopadhye and Sven Verdoolaege (Eds.). https://hal.inria.fr/hal00911894Google Scholar
- Sven Verdoolaege, Gerda Janssens, and Maurice Bruynooghe. 2012. Equivalence checking of static afine programs using widening to handle recurrences. ACM Trans. Program. Lang. Syst. 34, 3 ( 2012 ), 11 : 1-11 : 35. https://doi.org/10.1145/ 2362389.2362390 Google Scholar
Digital Library
- Lenore D. Zuck, Amir Pnueli, Benjamin Goldberg, Clark W. Barrett, Yi Fang, and Ying Hu. 2005. Translation and Run-Time Validation of Loop Transformations. Formal Methods in System Design 27, 3 ( 2005 ), 335-360. https://doi.org/10.1007/s10703-005-3402-z Google Scholar
Digital Library
Index Terms
Verified code generation for the polyhedral model
Recommendations
Generation of parallel synchronization-free tiled code
A novel approach to generation of parallel synchronization-free tiled code for the loop nest is presented. It is derived via a combination of the Polyhedral and Iteration Space Slicing frameworks. It uses the transitive closure of loop nest dependence ...
Non-affine Extensions to Polyhedral Code Generation
CGO '14: Proceedings of Annual IEEE/ACM International Symposium on Code Generation and OptimizationThis paper describes a loop transformation framework that extends a polyhedral representation of loop nests to represent and transform computations with non-affine index arrays in loop bounds and subscripts via a new interface between compile-time and ...
A practical automatic polyhedral parallelizer and locality optimizer
PLDI '08We present the design and implementation of an automatic polyhedral source-to-source transformation framework that can optimize regular programs (sequences of possibly imperfectly nested loops) for parallelism and locality simultaneously. Through this ...






Comments