Graph IRs for Impure Higher-Order Languages

被引:0
|
作者
Bracevac, Oliver [1 ,2 ]
Wei, Guannan [1 ]
Jia, Songlin [1 ]
Abeysinghe, Supun [1 ]
Jiang, Yuxuan [1 ]
Bao, Yuyan [3 ]
Rompf, Tiark [1 ]
机构
[1] Purdue Univ, W Lafayette, IN 47907 USA
[2] Galois Inc, Portland, OR 97204 USA
[3] Augusta Univ, Augusta, GA USA
来源
关键词
intermediate representations; higher-order languages; effects; compilers; CODE MOTION; PROGRAMS; INFERENCE;
D O I
10.1145/3622813
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
Graph-based intermediate representations (IRs) are widely used for powerful compiler optimizations, either interprocedurally in pure functional languages, or intraprocedurally in imperative languages. Yet so far, no suitable graph IR exists for aggressive global optimizations in languages with both effects and higher-order functions: aliasing and indirect control transfers make it difficult to maintain sufficiently granular dependency information for optimizations to be effective. To close this long-standing gap, we propose a novel typed graph IR combining a notion of reachability types to track aliasing with an expressive effect systemto compute precise and granular effect dependencies, while supporting local reasoning and separate compilation. Our high-level graph IR imposes lexical structure to represent structured control flow and nesting, enabling aggressive and yet inexpensive code motion, instruction selection, and other optimizations for impure higher-order programs. We formalize the new graph IR based on a lambda-calculus with a reachability type-and-effect system along with a specification of various optimizations. We present performance case studies for CUDA tensor kernel fusion, symbolic execution of LLVM IR, and SQL query compilation in the Scala LMS compiler framework using the new graph IR. We observe significant speedups of up to 21x.
引用
收藏
页数:31
相关论文
共 50 条
  • [31] Test Generation for Higher-Order Functions in Dynamic Languages
    Selakovic, Marija
    Pradel, Michael
    Karim, Rezwana
    Tip, Frank
    PROCEEDINGS OF THE ACM ON PROGRAMMING LANGUAGES-PACMPL, 2018, 2
  • [32] Behavioural equivalence and indistinguishability in higher-order typed languages
    Katsumata, S
    RECENT TRENDS IN ALGEBRAIC DEVELOPMENT TECHNIQUES, 2003, 2755 : 284 - 298
  • [33] Test Generation for Higher-Order Functions in Dynamic Languages
    Selakovic, Marija
    Pradel, Michael
    Karim, Rezwana
    Tip, Frank
    PROCEEDINGS OF THE ACM ON PROGRAMMING LANGUAGES-PACMPL, 2018, 2
  • [34] Higher-order logic programming languages with constraints: A semantics
    Lipton, James
    Nieva, Susana
    TYPED LAMBDA CALCULI AND APPLICATIONS, PROCEEDINGS, 2007, 4583 : 272 - +
  • [35] Automatic Alignment in Higher-Order Probabilistic Programming Languages
    Lunden, Daniel
    Caylak, Gizem
    Ronquist, Fredrik
    Broman, David
    PROGRAMMING LANGUAGES AND SYSTEMS, ESOP 2023, 2023, 13990 : 535 - 563
  • [36] Incorporating Higher-order Structural Information for Graph Clustering
    Li, Qiankun
    Liu, Haobing
    Jiang, Ruobing
    Wang, Tingting
    DATABASE SYSTEMS FOR ADVANCED APPLICATIONS, DASFAA 2024, PT IV, 2024, 14853 : 507 - 517
  • [37] A Graph-Based Higher-Order Intermediate Representation
    Leissa, Roland
    Koester, Marcel
    Hack, Sebastian
    2015 IEEE/ACM INTERNATIONAL SYMPOSIUM ON CODE GENERATION AND OPTIMIZATION (CGO), 2015, : 202 - 212
  • [38] Local structure graph models with higher-order dependence
    Casleton, Emily M.
    Nordman, Daniel J.
    Kaiser, Mark S.
    CANADIAN JOURNAL OF STATISTICS-REVUE CANADIENNE DE STATISTIQUE, 2021, 49 (02): : 497 - 513
  • [39] Higher-order graph wavelets and sparsity on circulant graphs
    Kotzagiannidis, Madeleine S.
    Dragotti, Pier Luigi
    WAVELETS AND SPARSITY XVI, 2015, 9597
  • [40] Higher-order fluctuations in dense random graph models
    Kaur, Gursharn
    Rollin, Adrian
    ELECTRONIC JOURNAL OF PROBABILITY, 2021, 26