[PATCH] D14875: LiveVariables should not clobber MachineOperand::IsDead, ::IsKill on reserved physical registers

Nick Johnson via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 24 06:45:56 PST 2015


npjdesres updated this revision to Diff 41039.
npjdesres added a comment.

Thanks for looking it over.  Andy Trick agrees on the llvm-dev list <http://lists.llvm.org/pipermail/llvm-dev/2015-November/092741.html>.

I've uploaded a new patch after passing it though clang-format.

I do not have commit access.


http://reviews.llvm.org/D14875

Files:
  lib/CodeGen/LiveVariables.cpp

Index: lib/CodeGen/LiveVariables.cpp
===================================================================
--- lib/CodeGen/LiveVariables.cpp
+++ lib/CodeGen/LiveVariables.cpp
@@ -522,11 +522,15 @@
       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);
     }
   }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D14875.41039.patch
Type: text/x-patch
Size: 721 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20151124/d5c53fac/attachment.bin>


More information about the llvm-commits mailing list