[llvm-commits] [llvm] r78095 - /llvm/trunk/lib/CodeGen/MachineInstr.cpp

Jakob Stoklund Olesen stoklund at 2pi.dk
Tue Aug 4 13:09:37 PDT 2009


Author: stoklund
Date: Tue Aug  4 15:09:25 2009
New Revision: 78095

URL: http://llvm.org/viewvc/llvm-project?rev=78095&view=rev
Log:
Don't tamper with <undef> operands in MachineInstr::addRegisterKilled.

For an undef operand, MO.getReg() is meaningless and we should not use it.
Undef operands should be skipped entirely.

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

Modified: llvm/trunk/lib/CodeGen/MachineInstr.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineInstr.cpp?rev=78095&r1=78094&r2=78095&view=diff

==============================================================================
--- llvm/trunk/lib/CodeGen/MachineInstr.cpp (original)
+++ llvm/trunk/lib/CodeGen/MachineInstr.cpp Tue Aug  4 15:09:25 2009
@@ -1030,7 +1030,7 @@
   SmallVector<unsigned,4> DeadOps;
   for (unsigned i = 0, e = getNumOperands(); i != e; ++i) {
     MachineOperand &MO = getOperand(i);
-    if (!MO.isReg() || !MO.isUse())
+    if (!MO.isReg() || !MO.isUse() || MO.isUndef())
       continue;
     unsigned Reg = MO.getReg();
     if (!Reg)
@@ -1041,8 +1041,6 @@
         if (MO.isKill())
           // The register is already marked kill.
           return true;
-        // This operand can no longer be undef since Reg is live-in.
-        MO.setIsUndef(false);
         if (isPhysReg && isRegTiedToDefOperand(i))
           // Two-address uses of physregs must not be marked kill.
           return true;





More information about the llvm-commits mailing list