gonzalobg wrote: @Artem-B for review. I'd prefer to land this before #98551, because it simplifies it a bit. Will rebase that one on top of this one. https://github.com/llvm/llvm-project/pull/99649