[llvm] [DRAFT][RegisterCoalescer] Enable non-trivial rematerialization (PR #160153)

Philip Reames via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 22 20:59:29 PDT 2025


preames wrote:

> > Where `isTriviallyReMaterializable` would check for virtual registers. We'd then go through and replace existing uses of `isTriviallyReMaterializable` in the first group of users you identified (where they check for use availability) with `isReMaterializable`
> 
> I'll throw up a patch tomorrow which does something along these lines as an NFC such that we can then go through call site by call site and make adjustment as warranted.

Actually, crud, I don't think I can do this as purely NFC.  We have existing backends which lie about instructions being trivially rematerializable.  I need a way to preserve that behavior through the transition of getting each of the callsites updated.  I'll play with it more tomorrow, but I think this structure is at least a reasonable stepping stone even if the end goal is to fold it back away.  

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


More information about the llvm-commits mailing list