https://github.com/ssahasra commented: I think the first line of the commit description should not mention machine sink. The issue was triggered by machine sink, but this change introduces a pass that works in general. https://github.com/llvm/llvm-project/pull/67033