aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJakob Stoklund Olesen <stoklund@2pi.dk>2009-08-04 20:09:25 +0000
committerJakob Stoklund Olesen <stoklund@2pi.dk>2009-08-04 20:09:25 +0000
commitefb8e3e113cbf359d6a838c3b37fedc8305d19bb (patch)
treeb59d2a13fc2395df49dfa90e074abe586d5e137c /lib
parentded2e3b0d02998b3bb99b5089d05fca1e0097868 (diff)
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78095 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/CodeGen/MachineInstr.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/lib/CodeGen/MachineInstr.cpp b/lib/CodeGen/MachineInstr.cpp
index c29a6e339e..dd2fef7ff0 100644
--- a/lib/CodeGen/MachineInstr.cpp
+++ b/lib/CodeGen/MachineInstr.cpp
@@ -1030,7 +1030,7 @@ bool MachineInstr::addRegisterKilled(unsigned IncomingReg,
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 @@ bool MachineInstr::addRegisterKilled(unsigned IncomingReg,
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;