“Using Compile-time Code Generation to build an LLVM IR Pattern Matcher”
summary
A C++11 library that encodes LLVM IR match patterns as constexpr expression templates and operator-overloaded syntax produces a specialized pattern-matcher at compile time, rather than an interpreter at run time. It supports cycles in dataflow graphs (unlike LLVM’s tree-only matcher), uses uniform typelists, explicit type traits and comma/paren/operator overloads to name registers, compiles patterns to empty constexpr objects, and emits backtracking runtime code that matches within a 64-register compile-time bitset. The prototype works and the source is planned for GitHub.
AI-written summary · about
chapters (7)
- 0:00Introduction and motivation
- 10:52Problem with pattern matching
- 20:56Design goals and solution
- 34:03Compile-time techniques used
- 45:14Advanced type list features
- 55:03Summary and future work
- 1:00:02Q&A session
related talks
51mSimple, Extensible Pattern Matching in C++14
01h 00m“MPark.Patterns: Pattern Matching in C++”
01h 03mCompile-Time Regular Expressions
08mCompiling pattern matching to in-place modifications
01h 01mExpressive Compile Time Parsers
58mThe Pattern Matching We Already Have
51mCompile-time tools supporting generic programming in C++
23mPattern-matching on mutable values: danger!
