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 条
  • [21] 1ST-ORDER SEMANTICS FOR HIGHER-ORDER LANGUAGES
    KASBAUER, M
    [J]. CRITICA-REVISTA HISPANOAMERICANA DE FILOSOFIA, 1977, 9 (25): : 59 - 71
  • [22] The HyperKron Graph Model for higher-order features
    Eikmeier, Nicole
    Gleich, David F.
    Ramani, Arjun S.
    [J]. 2018 IEEE INTERNATIONAL CONFERENCE ON DATA MINING (ICDM), 2018, : 941 - 946
  • [23] Higher-order port-graph rewriting
    Fernandez, Maribel
    Maulat, Sebastien
    [J]. ELECTRONIC PROCEEDINGS IN THEORETICAL COMPUTER SCIENCE, 2012, (101): : 25 - 37
  • [24] EXTENDING THE GRAPH FORMALISM TO HIGHER-ORDER GATES
    Khesin A.
    Ren K.
    [J]. Quantum Information and Computation, 2023, 23 (13-14): : 1128 - 1141
  • [25] On the higher-order edge-tenacity of a graph
    Bafandeh, Bahareh
    Moazzami, Dara
    [J]. UTILITAS MATHEMATICA, 2018, 108 : 195 - 212
  • [26] A Higher-Order Graph Calculus for Autonomic Computing
    Andrei, Oana
    Kirchner, Helene
    [J]. GRAPH THEORY, COMPUTATIONAL INTELLIGENCE AND THOUGHT: ESSAYS DEDICATED TO MARTIN CHARLES GOLUMBIC ON THE OCCASION OF HIS 60TH BIRTHDAY, 2009, 5420 : 15 - +
  • [27] A practical and flexible flow analysis for higher-order languages
    Ashley, JM
    Dybvig, RK
    [J]. ACM TRANSACTIONS ON PROGRAMMING LANGUAGES AND SYSTEMS, 1998, 20 (04): : 845 - 868
  • [28] HIGHER-ORDER ATTRIBUTE SEMANTICS OF FLAT DECLARATIVE LANGUAGES
    Grigorenko, Pavel
    Tyugu, Enn
    [J]. COMPUTING AND INFORMATICS, 2010, 29 (02) : 251 - 280
  • [29] Formally based profiling for higher-order functional languages
    Sansom, PM
    Jones, SLP
    [J]. ACM TRANSACTIONS ON PROGRAMMING LANGUAGES AND SYSTEMS, 1997, 19 (02): : 334 - 385
  • [30] Test Generation for Higher-Order Functions in Dynamic Languages
    Selakovic, Marija
    Pradel, Michael
    Karim, Rezwana
    Tip, Frank
    [J]. PROCEEDINGS OF THE ACM ON PROGRAMMING LANGUAGES-PACMPL, 2018, 2