jayfoad wrote: Sounds reasonable, but I don't immediately see anything in #124327 which iterates over `RematDefToLiveInRegions`. How and where does that happen? https://github.com/llvm/llvm-project/pull/126271