Date & Time
Tuesday, October 28, 2025, 2:45 PM - 3:15 PM
Name
Automatically generating pattern rewrites in MLIR
Session Type
Technical Talk
Abstract/s

Manually writing pattern rewrites and canonicalization patterns in MLIR is a critical step when defining a dialect. However, this time-consuming process is prone to subtle errors, and it is often hard to think of all possible rewrites that might be relevant. Instead, what if we could automatically generate these rewrites? In this talk, we will present two tools. First, a tool that generates all possible rewrites on programs of a given size, as long as the rewrite is non-conditional (only match patterns and rewrite them, without additional conditions on the values/attributes matched). Second, a tool that can find very specialized rewrites in a given program (much like LLVM's Souper). We will present how we leverage 3 key dialects to build our tools: (1) IRDL, to describe the search space we are interested in, (2) SMT, to describe the semantics of the dialects we care about (in order to find correct rewrites), and (3) PDL, to output the resulting rewrites.

Location Name
Grand Ballroom