[llvm] [MachineLICM] Rematerialize instructions that may be hoisted before LICM (PR #158479)

Philip Reames via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 23 08:20:58 PDT 2025


preames wrote:

Just to follow up on a point of confusion upthread.  Rematerialization during register allocation (i.e. splitting and spilling) may duplicate instructions to their uses.  This was said above, but there seemed to be a misunderstanding that the original instruction would survive.  If *all* uses of the original instruction are rematerialized (not guaranteed if e.g. we split a live interval), then the original instruction would become dead, and should be deleted.  

I'll note that the rematerialization heuristics are very delicate, and have lots of subtle interactions w/ flags such as CheapAsAMove.  

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


More information about the llvm-commits mailing list