summaryrefslogtreecommitdiff
path: root/lib/CodeGen/RegisterCoalescer.cpp
diff options
context:
space:
mode:
authorJakob Stoklund Olesen <stoklund@2pi.dk>2012-05-20 03:57:12 +0000
committerJakob Stoklund Olesen <stoklund@2pi.dk>2012-05-20 03:57:12 +0000
commit067fcb4087a2c816f6536907b9918165e5b00b33 (patch)
tree33845625c5e7c458c97d4a6d010391b79f487609 /lib/CodeGen/RegisterCoalescer.cpp
parent97769fcdd1b50972222673a0effc6f793848bf06 (diff)
downloadllvm-067fcb4087a2c816f6536907b9918165e5b00b33.tar.gz
llvm-067fcb4087a2c816f6536907b9918165e5b00b33.tar.bz2
llvm-067fcb4087a2c816f6536907b9918165e5b00b33.tar.xz
Fix build bots.
Avoid looking at the operands of a potentially erased instruction. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157146 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/RegisterCoalescer.cpp')
-rw-r--r--lib/CodeGen/RegisterCoalescer.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/CodeGen/RegisterCoalescer.cpp b/lib/CodeGen/RegisterCoalescer.cpp
index c7dcde6c22..f529f1899c 100644
--- a/lib/CodeGen/RegisterCoalescer.cpp
+++ b/lib/CodeGen/RegisterCoalescer.cpp
@@ -1441,10 +1441,10 @@ bool RegisterCoalescer::joinIntervals(CoalescerPair &CP) {
// Now erase all the redundant copies.
for (unsigned i = 0, e = DeadCopies.size(); i != e; ++i) {
MachineInstr *MI = DeadCopies[i];
- DEBUG(dbgs() << "\t\terased:\t" << LIS->getInstructionIndex(MI)
- << '\t' << *MI);
if (!ErasedInstrs.insert(MI))
continue;
+ DEBUG(dbgs() << "\t\terased:\t" << LIS->getInstructionIndex(MI)
+ << '\t' << *MI);
LIS->RemoveMachineInstrFromMaps(MI);
MI->eraseFromParent();
}
@@ -1453,6 +1453,8 @@ bool RegisterCoalescer::joinIntervals(CoalescerPair &CP) {
for (SmallVector<MachineInstr*, 8>::iterator I = DupCopies.begin(),
E = DupCopies.end(); I != E; ++I) {
MachineInstr *MI = *I;
+ if (!ErasedInstrs.insert(MI))
+ continue;
// We have pretended that the assignment to B in
// A = X
@@ -1462,8 +1464,6 @@ bool RegisterCoalescer::joinIntervals(CoalescerPair &CP) {
// A = X
unsigned Src = MI->getOperand(1).getReg();
SourceRegisters.push_back(Src);
- if (!ErasedInstrs.insert(MI))
- continue;
LIS->RemoveMachineInstrFromMaps(MI);
MI->eraseFromParent();
}