[llvm] r254012 - LiveVariables should not clobber MachineOperand::IsDead, ::IsKill on reserved physical registers

Matthias Braun via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 24 12:06:56 PST 2015


Author: matze
Date: Tue Nov 24 14:06:56 2015
New Revision: 254012

URL: http://llvm.org/viewvc/llvm-project?rev=254012&view=rev
Log:
LiveVariables should not clobber MachineOperand::IsDead, ::IsKill on reserved physical registers

Patch by Nick Johnson <Nicholas.Paul.Johnson at deshawresearch.com>

Differential Revision: http://reviews.llvm.org/D14875

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=254012&r1=254011&r2=254012&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/LiveVariables.cpp (original)
+++ llvm/trunk/lib/CodeGen/LiveVariables.cpp Tue Nov 24 14:06:56 2015
@@ -522,11 +522,15 @@ void LiveVariables::runOnInstr(MachineIn
       continue;
     unsigned MOReg = MO.getReg();
     if (MO.isUse()) {
-      MO.setIsKill(false);
+      if (!(TargetRegisterInfo::isPhysicalRegister(MOReg) &&
+            MRI->isReserved(MOReg)))
+        MO.setIsKill(false);
       if (MO.readsReg())
         UseRegs.push_back(MOReg);
     } else /*MO.isDef()*/ {
-      MO.setIsDead(false);
+      if (!(TargetRegisterInfo::isPhysicalRegister(MOReg) &&
+            MRI->isReserved(MOReg)))
+        MO.setIsDead(false);
       DefRegs.push_back(MOReg);
     }
   }




More information about the llvm-commits mailing list