Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
skip to main content
10.1145/3178372.3179515acmconferencesArticle/Chapter ViewAbstractPublication PagesccConference Proceedingsconference-collections
research-article

CAnDL: a domain specific language for compiler analysis

Published: 24 February 2018 Publication History
  • Get Citation Alerts
  • Abstract

    Optimizing compilers require sophisticated program analysis and transformations to exploit modern hardware. Implementing the appropriate analysis for a compiler optimization is a time consuming activity. For example, in LLVM, tens of thousands of lines of code are required to detect appropriate places to apply peephole optimizations. It is a barrier to the rapid prototyping and evaluation of new optimizations.
    In this paper we present the Compiler Analysis Description Language (CAnDL), a domain specific language for compiler analysis. CAnDL is a constraint based language that operates over LLVM's intermediate representation. The compiler developer writes a CAnDL program, which is then compiled by the CAnDL compiler into a C++ LLVM pass. It provides a uniform manner in which to describe compiler analysis and can be applied to a range of compiler analysis problems, reducing code length and complexity.
    We implemented and evaluated CAnDL on a number of real world use cases: eliminating redundant operations; graphics code optimization; identifying static control flow regions. In all cases were we able to express the analysis more briefly than competing approaches.

    References

    [1]
    Alexander Aiken. Introduction to set constraint-based program analysis. Sci. Comput. Program., 35(2-3):79-111, November 1999.
    [2]
    Martin Alt, Uwe Aßmann, and Hans van Someren. Cosy compiler phase embedding with the CoSy compiler model, pages 278-293. Springer Berlin Heidelberg, Berlin, Heidelberg, 1994.
    [3]
    Uwe Aßmann. How to uniformly specify program analysis and transformation with graph rewrite systems, pages 121-135. Springer Berlin Heidelberg, Berlin, Heidelberg, 1996.
    [4]
    Uwe Assmann. Optimix - a tool for rewriting and optimizing programs. In Handbook of Graph Grammars and Computing by Graph Transformation. Volume 2: Applications, Languages and Tools, pages 307-318. World Scientific, 1998.
    [5]
    Muthu Manikandan Baskaran, J. Ramanujam, and P. Sadayappan. Automatic c-to-cuda code generation for affine programs. In Proceedings of the 19th Joint European Conference on Theory and Practice of Software, International Conference on Compiler Construction, CC'10/ETAPS'10, pages 244-263, Berlin, Heidelberg, 2010. Springer-Verlag.
    [6]
    Michael Kruse Chandan Reddy and Albert Cohen. Reduction drawing: Language constructs and polyhedral compilation for reductions on gpus. In Proceedings of the 25rd International Conference on Parallel Architectures and Compilation, PACT '16, 2016.
    [7]
    Philip Ginsbach and Michael F. P. O'Boyle. Discovery and exploitation of general reductions: A constraint based approach. In Proceedings of the 2017 International Symposium on Code Generation and Optimization, CGO '17, pages 269-280, Piscataway, NJ, USA, 2017. IEEE Press.
    [8]
    Tobias Grosser, Armin Größlinger, and Christian Lengauer. Polly - performing polyhedral optimizations on a low-level intermediate representation. Parallel Processing Letters, 22(4), 2012.
    [9]
    Sumit Gulwani, Saurabh Srivastava, and Ramarathnam Venkatesan. Program analysis as constraint solving. In Proceedings of the 29th ACM SIGPLAN Conference on Programming Language Design and Implementation, PLDI '08, pages 281-292, New York, NY, USA, 2008. ACM.
    [10]
    Sudipta Kundu, Zachary Tatlock, and Sorin Lerner. Proving optimizations correct using parameterized program equivalence. SIGPLAN Not., 44(6):327-337, June 2009.
    [11]
    Sorin Lerner, Todd Millstein, Erika Rice, and Craig Chambers. Automated soundness proofs for dataflow analyses and transformations via local rules. In Proceedings of the 32Nd ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, POPL '05, pages 364-377, New York, NY, USA, 2005. ACM.
    [12]
    Peter Lipps, Ulrich Möncke, and Reinhard Wilhelm. OPTRAN - A language/system for the specification of program transformations: System overview and experiences, pages 52-65. Springer Berlin Heidelberg, Berlin, Heidelberg, 1989.
    [13]
    Nuno P. Lopes, David Menendez, Santosh Nagarakatte, and John Regehr. Provably correct peephole optimizations with alive. In Proceedings of the 36th ACM SIGPLAN Conference on Programming Language Design and Implementation, PLDI '15, pages 22-32, New York, NY, USA, 2015. ACM.
    [14]
    Florian Martin. Pag - an efficient program analyzer generator. International Journal on Software Tools for Technology Transfer, 2(1):46-67, Nov 1998.
    [15]
    David Menendez and Santosh Nagarakatte. Alive-infer: Data-driven precondition inference for peephole optimizations in llvm. In Proceedings of the 38th ACM SIGPLAN Conference on Programming Language Design and Implementation, PLDI 2017, pages 49-63, New York, NY, USA, 2017. ACM.
    [16]
    David Menendez, Santosh Nagarakatte, and Aarti Gupta. Alive-FP: Automated Verification of Floating Point Based Peephole Optimizations in LLVM, pages 317-337. Springer Berlin Heidelberg, Berlin, Heidelberg, 2016.
    [17]
    Eric Mullen, Daryl Zuniga, Zachary Tatlock, and Dan Grossman. Verified peephole optimizations for compcert. In Proceedings of the 37th ACM SIGPLAN Conference on Programming Language Design and Implementation, PLDI '16, pages 448-461, New York, NY, USA, 2016. ACM.
    [18]
    Andres Nötzli and Fraser Brown. Lifejacket: Verifying precise floating-point optimizations in llvm. In Proceedings of the 5th ACM SIGPLAN International Workshop on State Of the Art in Program Analysis, SOAP 2016, pages 24-29, New York, NY, USA, 2016. ACM.
    [19]
    Karina Olmos and Eelco Visser. Composing source-to-source dataflow transformations with rewriting strategies and dependent dynamic rewrite rules. In Proceedings of the 14th International Conference on Compiler Construction, CC'05, pages 204-220, Berlin, Heidelberg, 2005. Springer-Verlag.
    [20]
    Saurabh Srivastava, Sumit Gulwani, and Jeffrey S. Foster. From program verification to program synthesis. SIGPLAN Not., 45(1):313-326, January 2010.
    [21]
    Ross Tate, Michael Stepp, and Sorin Lerner. Generating compiler optimizations from proofs. In Proceedings of the 37th Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, POPL '10, pages 389-402, New York, NY, USA, 2010. ACM.
    [22]
    Sven Verdoolaege, Juan Carlos Juega, Albert Cohen, José Ignacio Gómez, Christian Tenllado, and Francky Catthoor. Polyhedral parallel code generation for cuda. ACM Trans. Archit. Code Optim., 9(4):54:1-54:23, January 2013.
    [23]
    Deborah L. Whitfield and Mary Lou Soffa. An approach for exploring code improving transformations. ACM Trans. Program. Lang. Syst., 19(6):1053-1084, November 1997.
    [24]
    Jeremiah James Willcock, Andrew Lumsdaine, and Daniel J. Quinlan. Reusable, generic program analyses and transformations. In Proceedings of the Eighth International Conference on Generative Programming and Component Engineering, GPCE '09, pages 5-14, New York, NY, USA, 2009. ACM.
    [25]
    Vanya Yaneva, Ajitha Rajan, and Christophe Dubach. Compiler-Assisted Test Acceleration on GPUs for Embedded Software, pages 35-45. ACM, 7 2017.
    [26]
    Xuejun Yang, Yang Chen, Eric Eide, and John Regehr. Finding and understanding bugs in c compilers. SIGPLAN Not., 46(6):283-294, June 2011.
    [27]
    Eric Yuan. Towards ontology-based software architecture representations. In Proceedings of the 1st International Workshop on Establishing the Community-Wide Infrastructure for Architecture-Based Software Engineering, ECASE '17, pages 21-27, Piscataway, NJ, USA, 2017. IEEE Press.
    [28]
    Jianzhou Zhao, Santosh Nagarakatte, Milo M.K. Martin, and Steve Zdancewic. Formalizing the llvm intermediate representation for verified program transformations. In Proceedings of the 39th Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, POPL '12, pages 427-440, New York, NY, USA, 2012. ACM.

    Cited By

    View all
    • (2024)JOG: Java JIT Peephole Optimizations and Tests from PatternsProceedings of the 2024 IEEE/ACM 46th International Conference on Software Engineering: Companion Proceedings10.1145/3639478.3640040(11-15)Online publication date: 14-Apr-2024
    • (2023)Pattern-Based Peephole Optimizations with Java JIT TestsProceedings of the 32nd ACM SIGSOFT International Symposium on Software Testing and Analysis10.1145/3597926.3598038(64-75)Online publication date: 12-Jul-2023
    • (2023)VClinic: A Portable and Efficient Framework for Fine-Grained Value ProfilersProceedings of the 28th ACM International Conference on Architectural Support for Programming Languages and Operating Systems, Volume 210.1145/3575693.3576934(892-904)Online publication date: 27-Jan-2023
    • Show More Cited By

    Recommendations

    Comments

    Information & Contributors

    Information

    Published In

    cover image ACM Conferences
    CC 2018: Proceedings of the 27th International Conference on Compiler Construction
    February 2018
    206 pages
    ISBN:9781450356442
    DOI:10.1145/3178372
    Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than the author(s) must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected].

    Sponsors

    In-Cooperation

    • IEEE-CS: Computer Society

    Publisher

    Association for Computing Machinery

    New York, NY, United States

    Publication History

    Published: 24 February 2018

    Permissions

    Request permissions for this article.

    Check for updates

    Author Tags

    1. LLVM
    2. constraint programming
    3. optimization

    Qualifiers

    • Research-article

    Funding Sources

    • EPSRC

    Conference

    CGO '18

    Contributors

    Other Metrics

    Bibliometrics & Citations

    Bibliometrics

    Article Metrics

    • Downloads (Last 12 months)30
    • Downloads (Last 6 weeks)1

    Other Metrics

    Citations

    Cited By

    View all
    • (2024)JOG: Java JIT Peephole Optimizations and Tests from PatternsProceedings of the 2024 IEEE/ACM 46th International Conference on Software Engineering: Companion Proceedings10.1145/3639478.3640040(11-15)Online publication date: 14-Apr-2024
    • (2023)Pattern-Based Peephole Optimizations with Java JIT TestsProceedings of the 32nd ACM SIGSOFT International Symposium on Software Testing and Analysis10.1145/3597926.3598038(64-75)Online publication date: 12-Jul-2023
    • (2023)VClinic: A Portable and Efficient Framework for Fine-Grained Value ProfilersProceedings of the 28th ACM International Conference on Architectural Support for Programming Languages and Operating Systems, Volume 210.1145/3575693.3576934(892-904)Online publication date: 27-Jan-2023
    • (2021)Program Lifting using Gray-Box Behavior2021 30th International Conference on Parallel Architectures and Compilation Techniques (PACT)10.1109/PACT52795.2021.00012(60-74)Online publication date: Sep-2021
    • (2021)CinnamonProceedings of the 2021 IEEE/ACM International Symposium on Code Generation and Optimization10.1109/CGO51591.2021.9370313(103-114)Online publication date: 27-Feb-2021
    • (2020)M3Proceedings of the 35th IEEE/ACM International Conference on Automated Software Engineering10.1145/3324884.3416618(90-102)Online publication date: 21-Dec-2020
    • (2019)Type-Directed Program Synthesis and Constraint Generation for Library Portability2019 28th International Conference on Parallel Architectures and Compilation Techniques (PACT)10.1109/PACT.2019.00013(55-67)Online publication date: Sep-2019

    View Options

    Get Access

    Login options

    View options

    PDF

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader

    Media

    Figures

    Other

    Tables

    Share

    Share

    Share this Publication link

    Share on social media