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 条
  • [1] Graph IRs for Impure Higher-Order Languages: Making Aggressive Optimizations Affordable with Precise Effect Dependencies
    Bračevac, Oliver
    Wei, Guannan
    Jia, Songlin
    Abeysinghe, Supun
    Jiang, Yuxuan
    Bao, Yuyan
    Rompf, Tiark
    [J]. Proceedings of the ACM on Programming Languages, 2023, 7 (OOPSLA2)
  • [2] Environmental Bisimulations for Higher-Order Languages
    Sangiorgi, Davide
    Kobayashi, Naoki
    Sumii, Eijiro
    [J]. ACM TRANSACTIONS ON PROGRAMMING LANGUAGES AND SYSTEMS, 2011, 33 (01):
  • [3] Coinductive techniques for higher-order languages
    Sangiorgi, Davide
    [J]. ELECTRONIC PROCEEDINGS IN THEORETICAL COMPUTER SCIENCE, 2013, (131): : 1 - +
  • [4] EFFECT ANALYSIS IN HIGHER-ORDER LANGUAGES
    NEIRYNCK, A
    PANANGADEN, P
    DEMERS, AJ
    [J]. INTERNATIONAL JOURNAL OF PARALLEL PROGRAMMING, 1989, 18 (01) : 1 - 36
  • [5] Higher-Order Operator Precedence Languages
    Reghizzi, Stefano Crespi
    Pradella, Matteo
    [J]. ELECTRONIC PROCEEDINGS IN THEORETICAL COMPUTER SCIENCE, 2017, (252): : 86 - 100
  • [6] Environmental bisimulations for higher-order languages
    Sangiorgi, Davide
    Kobayashi, Naoki
    Sumii, Eijiro
    [J]. 22ND ANNUAL IEEE SYMPOSIUM ON LOGIC IN COMPUTER SCIENCE, PROCEEDINGS, 2007, : 293 - +
  • [7] ON THE HIGHER-ORDER EDGE TOUGHNESS OF A GRAPH
    CHEN, CC
    KOH, KM
    PENG, YH
    [J]. DISCRETE MATHEMATICS, 1993, 111 (1-3) : 113 - 123
  • [8] A Higher-Order Calculus for Graph Transformation
    Department of Computer Science, King's College, Strand, London WC2R 2LS, United Kingdom
    不详
    [J]. Electron. Notes Theor. Comput. Sci, 2007, 1 SPEC. ISS. (45-58):
  • [9] Local Higher-Order Graph Clustering
    Yin, Hao
    Benson, Austin R.
    Leskovec, Jure
    Gleich, David F.
    [J]. KDD'17: PROCEEDINGS OF THE 23RD ACM SIGKDD INTERNATIONAL CONFERENCE ON KNOWLEDGE DISCOVERY AND DATA MINING, 2017, : 555 - 564
  • [10] Environmental Bisimulations for Probabilistic Higher-order Languages
    Sangiorgi, Davide
    Vignudelli, Valeria
    [J]. ACM TRANSACTIONS ON PROGRAMMING LANGUAGES AND SYSTEMS, 2019, 41 (04):