aemerson wrote: You're right, I thought we could find some C++ magic to make this ergonomic but after trying myself I came up short. At least not without a restructuring of the `LegalizeRuleSet` infrastructure. https://github.com/llvm/llvm-project/pull/111287