[llvm] r264695 - LiveVariables: Do not remove dead flags from vreg operands

Matthias Braun via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 28 20:08:19 PDT 2016


Author: matze
Date: Mon Mar 28 22:08:18 2016
New Revision: 264695

URL: http://llvm.org/viewvc/llvm-project?rev=264695&view=rev
Log:
LiveVariables: Do not remove dead flags from vreg operands

Also add a FIXME comment on why Mips RDDSP causes bogus dead flags to be
added which LiveVariables cleans up by accident.

Modified:
    llvm/trunk/lib/CodeGen/LiveVariables.cpp

Modified: llvm/trunk/lib/CodeGen/LiveVariables.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/LiveVariables.cpp?rev=264695&r1=264694&r2=264695&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/LiveVariables.cpp (original)
+++ llvm/trunk/lib/CodeGen/LiveVariables.cpp Mon Mar 28 22:08:18 2016
@@ -527,9 +527,14 @@ void LiveVariables::runOnInstr(MachineIn
         MO.setIsKill(false);
       if (MO.readsReg())
         UseRegs.push_back(MOReg);
-    } else /*MO.isDef()*/ {
-      if (!(TargetRegisterInfo::isPhysicalRegister(MOReg) &&
-            MRI->isReserved(MOReg)))
+    } else {
+      assert(MO.isDef());
+      // FIXME: We should not remove any dead flags. Howeve the MIPS RDDSP
+      // instruction needs it at the moment: RDDSP gets its implicit use
+      // operands added too late in the processing so InstrEmitter adds an
+      // incorrect dead flag because the uses are not yet visible.
+      if (TargetRegisterInfo::isPhysicalRegister(MOReg) &&
+          !MRI->isReserved(MOReg))
         MO.setIsDead(false);
       DefRegs.push_back(MOReg);
     }




More information about the llvm-commits mailing list