4vtomat wrote: Thanks for the patch, it looks pretty good! One thing that I'm thinking about is that can you also add a precommit test for remat.ll? https://github.com/llvm/llvm-project/pull/107993