goldsteinn wrote: This looks fine to me, although I think an easier way to implement this would be make `patchReplacementInstruction` return a bool to indicate `I` and `Repl` where successfully patched. https://github.com/llvm/llvm-project/pull/114011