https://github.com/c-rhodes approved this pull request. LGTM, thanks for the fixes! Wasn't aware of `MLIR_ENABLE_EXPENSIVE_PATTERN_API_CHECKS`, good to know. https://github.com/llvm/llvm-project/pull/76123