Lune

OOPSLA2023Top-tier venue

Graph IRs for Impure Higher-Order Languages: Making Aggressive Optimizations Affordable with Precise Effect Dependencies

Oliver Bracevac, Guannan Wei, Songlin Jia, Supun Abeysinghe, Yuxuan Jiang, Yuyan Bao, Tiark Rompf

Abstract

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 system to 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 𝜆-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 21𝑥.

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

10 top-tier papers have cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

  • What's in the Box: Ergonomic and Expressive Capture Tracking over Generic Data Structures cites Reachability types: tracking aliasing and separation in higher-order functional programs
  • What's in the Box: Ergonomic and Expressive Capture Tracking over Generic Data Structures cites Polymorphic Reachability Types: Tracking Freshness, Aliasing, and Separation in Higher-Order Generic Programs
  • Complete the Cycle: Reachability Types with Expressive Cyclic References cites Reachability types: tracking aliasing and separation in higher-order functional programs
  • Complete the Cycle: Reachability Types with Expressive Cyclic References cites Modeling Reachability Types with Logical Relations: Semantic Type Soundness, Termination, Effect Safety, and Equational Theory
  • Modeling Reachability Types with Logical Relations: Semantic Type Soundness, Termination, Effect Safety, and Equational Theory cites Complete the Cycle: Reachability Types with Expressive Cyclic References
  • Complete the Cycle: Reachability Types with Expressive Cyclic References cites Polymorphic Reachability Types: Tracking Freshness, Aliasing, and Separation in Higher-Order Generic Programs
  • Flan: An Expressive and Efficient Datalog Compiler for Program Analysis cites Compiling symbolic execution with staging and algebraic effects
  • Modeling Reachability Types with Logical Relations: Semantic Type Soundness, Termination, Effect Safety, and Equational Theory cites Reachability types: tracking aliasing and separation in higher-order functional programs
  • Modeling Reachability Types with Logical Relations: Semantic Type Soundness, Termination, Effect Safety, and Equational Theory cites Polymorphic Reachability Types: Tracking Freshness, Aliasing, and Separation in Higher-Order Generic Programs
  • Polymorphic Reachability Types: Tracking Freshness, Aliasing, and Separation in Higher-Order Generic Programs cites Reachability types: tracking aliasing and separation in higher-order functional programs
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers10

  1. Polymorphic Reachability Types: Tracking Freshness, Aliasing, and Separation in Higher-Order Generic ProgramsGuannan Wei, Oliver Bracevac, Songlin Jia, Yuyan Bao et al.POPL 2024 · 12 citations
  2. Flan: An Expressive and Efficient Datalog Compiler for Program AnalysisSupun Abeysinghe, Anxhelo Xhebraj, Tiark RompfPOPL 2024 · 9 citations
  3. Fuzzing JavaScript Engines with a Graph-based IRHaoran Xu, Zhiyuan Jiang, Yongjun Wang, Shuhui Fan et al.CCS 2024 · 8 citations
  4. What's in the Box: Ergonomic and Expressive Capture Tracking over Generic Data StructuresYichen Xu, Oliver Bracevac, Cao Nguyen Pham, Martin OderskyOOPSLA 2025 · 4 citations
  5. Complete the Cycle: Reachability Types with Expressive Cyclic ReferencesHaotian Deng, Siyuan He, Songlin Jia, Yuyan Bao et al.OOPSLA 2025 · 3 citations

Builds on4

  1. Reachability types: tracking aliasing and separation in higher-order functional programsYuyan Bao, Guannan Wei, Oliver Bracevac, Yuxuan Jiang et al.OOPSLA 2021 · 19 citations
  2. Compiling symbolic execution with staging and algebraic effectsGuannan Wei, Oliver Bracevac, Shangyin Tan, Tiark RompfOOPSLA 2020 · 12 citations
  3. Polymorphic Reachability Types: Tracking Freshness, Aliasing, and Separation in Higher-Order Generic ProgramsGuannan Wei, Oliver Bracevac, Songlin Jia, Yuyan Bao et al.POPL 2024 · 12 citations
  4. Modeling Reachability Types with Logical Relations: Semantic Type Soundness, Termination, Effect Safety, and Equational TheoryYuyan Bao, Songlin Jia, Guannan Wei, Oliver Bracevac et al.OOPSLA 2025 · 3 citations

Related papers

  1. A separation logic for effect handlersPaulo Emílio de Vilhena, François PottierPOPL 2021 · 24 citations
  2. Explicit Effects and Effect Constraints in ReMLMartin ElsmanPOPL 2024 · 4 citations
  3. Modular Denotational Semantics for Effects with Guarded Interaction TreesDan Frumin, Amin Timany, Lars BirkedalPOPL 2024 · 13 citations
  4. A Lightweight Type-and-Effect System for Invalidation Safety: Tracking Permanent and Temporary Invalidation with Constraint-Based Subtype InferenceCunyuan Gao, Lionel ParreauxOOPSLA 2025 · 4 citations
  5. From Capabilities to Regions: Enabling Efficient Compilation of Lexical Effect HandlersMarius Müller, Philipp Schuster, Jonathan Lindegaard Starup, Klaus Ostermann et al.OOPSLA 2023 · 7 citations
Dusk over the sea between two cliffs drawn in fine vertical lines