tschuett wrote: There is prior art. I am not going to do git blame in public: https://github.com/llvm/llvm-project/blob/e9be21786c972de93206599d4e06b79c2ca8f772/llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp#L414 https://github.com/llvm/llvm-project/pull/117439