[llvm] 161c0d5 - RegisterCoalescer: Remove dubious dropping of implicit virtual register defs

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 31 16:16:19 PDT 2023


Author: Matt Arsenault
Date: 2023-07-31T19:16:11-04:00
New Revision: 161c0d506b9de2813c380458b9f3b3d9bd62018b

URL: https://github.com/llvm/llvm-project/commit/161c0d506b9de2813c380458b9f3b3d9bd62018b
DIFF: https://github.com/llvm/llvm-project/commit/161c0d506b9de2813c380458b9f3b3d9bd62018b.diff

LOG: RegisterCoalescer: Remove dubious dropping of implicit virtual register defs

Don't understand why this would either be OK or necessary, but doesn't
appear to happen in any tests. This was introduced way back in
76e66c31a0481e72d1ff86c56028d850b6c33cff

https://reviews.llvm.org/D156265

Added: 
    

Modified: 
    llvm/lib/CodeGen/RegisterCoalescer.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/CodeGen/RegisterCoalescer.cpp b/llvm/lib/CodeGen/RegisterCoalescer.cpp
index e49885b6ad9677..826fc916ec083b 100644
--- a/llvm/lib/CodeGen/RegisterCoalescer.cpp
+++ b/llvm/lib/CodeGen/RegisterCoalescer.cpp
@@ -1396,9 +1396,8 @@ bool RegisterCoalescer::reMaterializeTrivialDef(const CoalescerPair &CP,
     MachineOperand &MO = CopyMI->getOperand(I);
     if (MO.isReg()) {
       assert(MO.isImplicit() && "No explicit operands after implicit operands.");
-      // Discard VReg implicit defs.
-      if (MO.getReg().isPhysical())
-        ImplicitOps.push_back(MO);
+      assert(MO.getReg().isPhysical() && "unexpected implicit virtual register def");
+      ImplicitOps.push_back(MO);
     }
   }
 


        


More information about the llvm-commits mailing list