ilovepi wrote: I updated `canReplaceOperandWithVariable()` too and tested it w/o the change in GVNSink.cpp. I'm happy to update or remove either of those if you'd prefer. https://github.com/llvm/llvm-project/pull/138414