[llvm] [RegAlloc] Allow rematerialization with virtual reg uses (PR #159211)

Philip Reames via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 26 08:26:31 PDT 2025


preames wrote:

Just to note, a bunch of changes have gone in with the goal of making this change more straight forward.  An API reorg (https://github.com/llvm/llvm-project/pull/160377) made it easier to audit the call sites, and their expectations.  We've been auditing call sites one by one to try and figure out the expected behavior between trivial and non-trivial remat (since we actually have both already, just in a much less aggressive form)

We had two heuristic changes which were prerequisites for this change, both have now landed:
https://github.com/llvm/llvm-project/pull/159180, and https://github.com/llvm/llvm-project/pull/160709

At this point, I think we're ready to rebase this, double check the perf impact again, and then move forward with landing this in the next few days.  We'll need to audit the remaining callsites for non-trivial remat one more time, and maybe we'll find another blocker, but at the moment, I don't know of any.  

Luke, when you rebase, please make sure to adjust the framing on the review description.  As we've discussed, this isn't actually introducing the concept of non-trivial remat - we had two backends abusing the prior APIs to achieve this - it's "simply" greatly increasing how aggressive we are about non-trivial remat by default.  Framing it that was should make it easier to understand for later readers.  

https://github.com/llvm/llvm-project/pull/159211


More information about the llvm-commits mailing list