summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
diff options
context:
space:
mode:
authorJakob Stoklund Olesen <stoklund@2pi.dk>2012-08-09 22:08:26 +0000
committerJakob Stoklund Olesen <stoklund@2pi.dk>2012-08-09 22:08:26 +0000
commit420798ca4f5e1f4368f9300cabb9d3c5c80dccab (patch)
tree67eb4809167dd1829130da6fa4d7fb8a65490b70 /llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
parent4238a89db8c57487a5c27b7ca60cb0fc3459df6b (diff)
downloadbcm5719-llvm-420798ca4f5e1f4368f9300cabb9d3c5c80dccab.tar.gz
bcm5719-llvm-420798ca4f5e1f4368f9300cabb9d3c5c80dccab.zip
Fix a future TwoAddressInstructionPass crash.
No test case, the crash only happens when the default use list order is changed. llvm-svn: 161627
Diffstat (limited to 'llvm/lib/CodeGen/TwoAddressInstructionPass.cpp')
-rw-r--r--llvm/lib/CodeGen/TwoAddressInstructionPass.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp b/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
index d22274496ab..9a219a6b000 100644
--- a/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
+++ b/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
@@ -235,7 +235,7 @@ bool TwoAddressInstructionPass::Sink3AddrInstruction(MachineBasicBlock *MBB,
// appropriate location, we can try to sink the current instruction
// past it.
if (!KillMI || KillMI->getParent() != MBB || KillMI == MI ||
- KillMI->isTerminator())
+ KillMI == OldPos || KillMI->isTerminator())
return false;
// If any of the definitions are used by another instruction between the
@@ -278,6 +278,7 @@ bool TwoAddressInstructionPass::Sink3AddrInstruction(MachineBasicBlock *MBB,
}
}
}
+ assert(KillMO && "Didn't find kill");
// Update kill and LV information.
KillMO->setIsKill(false);
OpenPOWER on IntegriCloud