https://github.com/banach-space approved this pull request. LGTM, thanks! Please resolve the thread on rewrite patterns started by @kuhar before landing this (I have "un-resolved" it - looks like it's still ongoing). https://github.com/llvm/llvm-project/pull/113655