Duplo: A Framework for OCaml Post-Link Optimisation
summary
Framework builds a low level SSA IR called LLIR that represents both OCaml and C so optimisations can cross the FFI boundary and the toolchain lowers LLIR through LLVM’s target pipeline while adding GC frame table support. It implements a cross-language inliner, points-to analyses and classic passes and reports about 7% speedup and at least 15% code size reduction on real OCaml workloads, while noting primitive inlining heuristics, limited points-to precision and some missing OCaml-specific optimisations.
AI-written summary · about
chapters (16)
- 0:00Start
- 0:59How do we get there?
- 3:58Part 1: Getting to LLIR
- 4:57Part 2: Back to Machine Code
- 5:30Selection DAG: To-and-From
- 7:20LLIR: Representing OCaml
- 8:46Inlining - mixing root management
- 9:11Inlining in the future - C-to-OCaml
- 10:06Inlining - the problem with boxing/unboxing
- 10:28Understanding Heap-Allocated Objects
- 11:08Points-To Analysis
- 11:24Other Transformations
- 12:37Benchmarks
- 13:04OCaml vs LLVM
- 13:16Is any of it due to the transformations?
- 14:00Conclusion
related talks
48mCross-Domain Compilation: Exploiting Synergies Across the CS Community
22mEfficient OCaml compilation with Flambda 2
22mReconciling High-level Optimizations and Low-level Code in LLVM
01h 02mThinLTO: Scalable and Incremental Link-Time Optimization
22mLinker Relaxation in LLD
53mLLVM
26mAn Invitation to OCaml
23mTargeted Static Analysis for OCaml C Stubs: Eliminating gremlins from the code
