nicolasvasilache wrote: I need to rework this to reuse the same implementation as https://github.com/llvm/llvm-project/pull/66387 which is both more general and more performant overall. https://github.com/llvm/llvm-project/pull/65774