[llvm] [RegAlloc] Account for use availability when applying rematerializable weight discount (PR #159180)

Philip Reames via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 19 10:50:49 PDT 2025


================
@@ -124,6 +124,17 @@ bool VirtRegAuxInfo::isRematerializable(const LiveInterval &LI,
 
     if (!TII.isTriviallyReMaterializable(*MI))
       return false;
+
+    // If MI has register uses, it will only be rematerializable if its uses are
----------------
preames wrote:

This is wasted work for any instruction which *doesn't* have virt reg uses, maybe filter those out before doing the use walk?  

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


More information about the llvm-commits mailing list