Abstract
Presburger arithmetic provides the mathematical core for the polyhedral compilation techniques that drive analytical cache models, loop optimization for ML and HPC, formal verification, and even hardware design. Polyhedral compilation is widely regarded as being slow due to the potentially high computational cost of the underlying Presburger libraries. Researchers typically use these libraries as powerful black-box tools, but the perceived internal complexity of these libraries, caused by the use of C as the implementation language and a focus on end-user-facing documentation, holds back broader performance-optimization efforts. With FPL, we introduce a new library for Presburger arithmetic built from the ground up in modern C++. We carefully document its internal algorithmic foundations, use lightweight C++ data structures to minimize memory management costs, and deploy transprecision computing across the entire library to effectively exploit machine integers and vector instructions. On a newly-developed comprehensive benchmark suite for Presburger arithmetic, we show a 5.4x speedup in total runtime over the state-of-the-art library isl in its default configuration and 3.6x over a variant of isl optimized with element-wise transprecision computing. We expect that the availability of a well-documented and fast Presburger library will accelerate the adoption of polyhedral compilation techniques in production compilers.
Supplemental Material
- Riyadh Baghdadi, Jessica Ray, Malek Ben Romdhane, Emanuele Del Sozzo, Abdurrahman Akkas, Yunming Zhang, Patricia Suriana, Shoaib Kamil, and Saman Amarasinghe. 2019. Tiramisu: A Polyhedral Compiler for Expressing Fast and Portable Code. In Proceedings of the 2019 IEEE/ACM International Symposium on Code Generation and Optimization (CGO 2019). IEEE Press, 193–205. isbn:9781728114361 https://dl.acm.org/doi/10.5555/3314872.3314896 Google Scholar
Digital Library
- Roberto Bagnara, Patricia M. Hill, and Enea Zaffanella. 2008. The Parma Polyhedra Library: Toward a Complete Set of Numerical Abstractions for the Analysis and Verification of Hardware and Software Systems. Sci. Comput. Program., 72, 1–2 (2008), June, 3–21. issn:0167-6423 https://doi.org/10.1016/j.scico.2007.08.001 Google Scholar
Digital Library
- M. S Bazaraa and J. J. Jarvis. 1977. Linear Programming and Network Flows. John Wiley & Sons, Ltd. Google Scholar
Digital Library
- Uday Bondhugula and J. Ramanujam. 2007. Pluto: A practical and fully automatic polyhedral parallelizer and locality optimizer. Google Scholar
Digital Library
- Tianqi Chen, Thierry Moreau, Ziheng Jiang, Lianmin Zheng, Eddie Q. Yan, Haichen Shen, Meghan Cowan, Leyuan Wang, Yuwei Hu, Luis Ceze, Carlos Guestrin, and Arvind Krishnamurthy. 2018. TVM: An Automated End-to-End Optimizing Compiler for Deep Learning. In 13th USENIX Symposium on Operating Systems Design and Implementation, OSDI 2018, Carlsbad, CA, USA, October 8-10, 2018, Andrea C. Arpaci-Dusseau and Geoff Voelker (Eds.). USENIX Association, 578–594. https://www.usenix.org/conference/osdi18/presentation/chen Google Scholar
Digital Library
- David Detlefs, Greg Nelson, and James B. Saxe. 2005. Simplify: A Theorem Prover for Program Checking. J. ACM, 52, 3 (2005), May, 365–473. issn:0004-5411 https://doi.org/10.1145/1066100.1066102 Google Scholar
Digital Library
- Paul Feautrier. 1988. Parametric integer programming. RAIRO-Operations Research, 22, 3 (1988), 243–268. https://doi.org/10.1051/ro/1988220302431 Google Scholar
Cross Ref
- Alexis Fouilhe. 2015. Revisiting the abstract domain of polyhedra : constraints-only representation and formal proof. Université Grenoble Alpes. https://tel.archives-ouvertes.fr/tel-01286086Google Scholar
- 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 and Torsten Hoefler. 2016. Polly-ACC Transparent Compilation to Heterogeneous Hardware. In Proceedings of the 2016 International Conference on Supercomputing (ICS ’16). Association for Computing Machinery, New York, NY, USA. Article 1, 13 pages. isbn:9781450343619 https://doi.org/10.1145/2925426.2926286 Google Scholar
Digital Library
- Tobias Grosser, Theodoros Theodoridis, Maximilian Falkenstein, Arjun Pitchanathan, Michael Kruse, Manuel Rigger, Zhendong Su, and Torsten Hoefler. 2020. Fast Linear Programming through Transprecision Computing on Small and Sparse Data. Proc. ACM Program. Lang., 4, OOPSLA (2020), Article 195, Nov., 28 pages. https://doi.org/10.1145/3428263 Google Scholar
Digital Library
- Tobias Gysi, Tobias Grosser, Laurin Brandner, and Torsten Hoefler. 2019. A Fast Analytical Model of Fully Associative Caches. In Proceedings of the 40th ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI 2019). Association for Computing Machinery, New York, NY, USA. 816–829. isbn:9781450367127 https://doi.org/10.1145/3314221.3314606 Google Scholar
Digital Library
- Christoph Haase. 2018. A Survival Guide to Presburger Arithmetic. ACM SIGLOG News, 5, 3 (2018), July, 67–82. https://doi.org/10.1145/3242953.3242964 Google Scholar
Digital Library
- Bertrand Jeannet and Antoine Miné. 2009. Apron: A Library of Numerical Abstract Domains for Static Analysis. In Proceedings of the 21st International Conference on Computer Aided Verification (CAV ’09). Springer-Verlag, Berlin, Heidelberg. 661–667. isbn:9783642026577 https://doi.org/10.1007/978-3-642-02658-4_52 Google Scholar
Digital Library
- Wayne Kelly, Vadim Maslov, William Pugh, Evan Rosser, Tatiana Shpeisman, and Dave Wonnacott. 1996. The Omega calculator and library, version 1.1. 0. College Park, MD, 20742 (1996), 18.Google Scholar
- Tim King, Clark Barrett, and Cesare Tinelli. 2014. Leveraging linear and mixed integer programming for SMT. In 2014 Formal Methods in Computer-Aided Design (FMCAD). 139–146. https://doi.org/10.1109/FMCAD.2014.6987606 Google Scholar
Digital Library
- Chris Lattner and Vikram Adve. 2004. LLVM: A compilation framework for lifelong program analysis & transformation. In International Symposium on Code Generation and Optimization, 2004. CGO 2004.. 75–86. Google Scholar
Digital Library
- Chris Lattner, Mehdi Amini, Uday Bondhugula, Albert Cohen, Andy Davis, Jacques Pienaar, River Riddle, Tatiana Shpeisman, Nicolas Vasilache, and Oleksandr Zinenko. 2021. MLIR: Scaling Compiler Infrastructure for Domain Specific Computation. In 2021 IEEE/ACM International Symposium on Code Generation and Optimization (CGO). 2–14. https://doi.org/10.1109/CGO51591.2021.9370308 Google Scholar
Digital Library
- Vincent Loechner. 1999. PolyLib: A library for manipulating parameterized polyhedra.Google Scholar
- László Lovász and Herbert E. Scarf. 1992. The Generalized Basis Reduction Algorithm. Mathematics of Operations Research, 17, 3 (1992), 751–764. issn:0364765X, 15265471 http://www.jstor.org/stable/3689761Google Scholar
Digital Library
- Benoit Meister, Nicolas Vasilache, David Wohlford, Muthu Manikandan Baskaran, Allen Leung, and Richard Lethin. 2011. R-Stream Compiler. Springer US, Boston, MA. 1756–1765. isbn:978-0-387-09766-4 https://doi.org/10.1007/978-0-387-09766-4_515 Google Scholar
Cross Ref
- Kedar S. Namjoshi and Nimit Singhania. 2016. Loopy: Programmable and Formally Verified Loop Transformations. In Static Analysis - 23rd International Symposium, SAS 2016, Edinburgh, UK, September 8-10, 2016, Proceedings, Xavier Rival (Ed.) (Lecture Notes in Computer Science, Vol. 9837). Springer, 383–402. https://doi.org/10.1007/978-3-662-53413-7_19 Google Scholar
Cross Ref
- Nicholas Nethercote and Julian Seward. 2007. Valgrind: A Framework for Heavyweight Dynamic Binary Instrumentation. In Proceedings of the 28th ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI ’07). Association for Computing Machinery, New York, NY, USA. 89–100. isbn:9781595936332 https://doi.org/10.1145/1250734.1250746 Google Scholar
Digital Library
- Auguste Olivry, Julien Langou, Louis-Noël Pouchet, P. Sadayappan, and Fabrice Rastello. 2020. Automated Derivation of Parametric Data Movement Lower Bounds for Affine Programs. In Proceedings of the 41st ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI 2020). Association for Computing Machinery, New York, NY, USA. 808–822. isbn:9781450376136 https://doi.org/10.1145/3385412.3385989 Google Scholar
Digital Library
- Arjun Pitchanathan, Christian Ulmann, Michel Weber, Torsten Hoefler, and Tobias Grosser. 2021. Replication Package for Article: FPL: Fast Presburger Arithmetic through Transprecision. https://doi.org/10.1145/3462302Google Scholar
- Louis-Noël Pouchet. 2012. Polybench: The polyhedral benchmark suite.Google Scholar
- Louis-Noel Pouchet, Peng Zhang, P. Sadayappan, and Jason Cong. 2013. Polyhedral-Based Data Reuse Optimization for Configurable Computing. In Proceedings of the ACM/SIGDA International Symposium on Field Programmable Gate Arrays (FPGA ’13). Association for Computing Machinery, New York, NY, USA. 29–38. isbn:9781450318877 https://doi.org/10.1145/2435264.2435273 Google Scholar
Digital Library
- Alexander Schrijver. 1986. Theory of Linear and Integer Programming. John Wiley & Sons, Inc., USA. isbn:0471908541 Google Scholar
Digital Library
- Ron Shamir. 1987. The Efficiency of the Simplex Method: A Survey. Management Science, 33, 3 (1987), 301–334. https://doi.org/10.1287/mnsc.33.3.301 Google Scholar
Digital Library
- Gagandeep Singh, Markus Püschel, and Martin Vechev. 2015. Making Numerical Program Analysis Fast. In Proceedings of the 36th ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI ’15). Association for Computing Machinery, New York, NY, USA. 303–313. isbn:9781450334686 https://doi.org/10.1145/2737924.2738000 Google Scholar
Digital Library
- Nicolas Vasilache, Oleksandr Zinenko, Theodoros Theodoridis, Priya Goyal, Zachary DeVito, William S. Moses, Sven Verdoolaege, Andrew Adams, and Albert Cohen. 2018. Tensor Comprehensions: Framework-Agnostic High-Performance Machine Learning Abstractions. arXiv e-prints, Article arXiv:1802.04730, Feb., arXiv:1802.04730 pages. arxiv:cs.PL/1802.04730.Google Scholar
- Sven Verdoolaege. 2010. isl: An Integer Set Library for the Polyhedral Model. In ICMS. 6327, 299–302. https://doi.org/10.1007/978-3-642-15582-6_49 Google Scholar
Digital Library
- Sven Verdoolaege. 2015. Integer set coalescing. In International Workshop on Polyhedral Compilation Techniques, Date: 2015/01/19-2015/01/19, Location: Amsterdam, The Netherlands.Google Scholar
- Sven Verdoolaege. 2016. Presburger formulas and polyhedral compilation.Google Scholar
- Sven Verdoolaege, Juan Carlos Juega, Albert Cohen, José Ignacio Gómez, Christian Tenllado, and Francky Catthoor. 2013. Polyhedral Parallel Code Generation for CUDA. ACM Trans. Archit. Code Optim., 9, 4 (2013), Article 54, Jan., 23 pages. issn:1544-3566 https://doi.org/10.1145/2400682.2400713 Google Scholar
Digital Library
Index Terms
FPL: fast Presburger arithmetic through transprecision
Recommendations
Bounds on the automata size for Presburger arithmetic
Automata provide a decision procedure for Presburger arithmetic. However, until now only crude lower and upper bounds were known on the sizes of the automata produced by the automata-based approach for Presburger arithmetic. In this article, we give an ...
Deciding Boolean Algebra with Presburger Arithmetic
We describe an algorithm for deciding the first-order multisorted theory BAPA, which combines Boolean algebras of sets of uninterpreted elements (BA) and Presburger arithmetic operations (PA). BAPA can express the relationship between integer variables ...
Interpolating bit-vector formulas using uninterpreted predicates and Presburger arithmetic
AbstractThe inference of program invariants over machine arithmetic, commonly called bit-vector arithmetic, is an important problem in verification. Techniques that have been successful for unbounded arithmetic, in particular Craig interpolation, have ...






Comments