summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorOwen Anderson <resistor@mac.com>2008-06-16 06:18:41 +0000
committerOwen Anderson <resistor@mac.com>2008-06-16 06:18:41 +0000
commitd813091cdecf3b50eba9c2fe09b6a9a47df73c25 (patch)
treefa224105893832db58a74d7fd78e41476cd4615b /llvm/lib/CodeGen
parent98ad816f58330c6051b380b2784e88e1a55d4086 (diff)
downloadbcm5719-llvm-d813091cdecf3b50eba9c2fe09b6a9a47df73c25.tar.gz
bcm5719-llvm-d813091cdecf3b50eba9c2fe09b6a9a47df73c25.zip
Assign indices to empty basic blocks. This will be necessary for StrongPHIElimination in the near future.
llvm-svn: 52300
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/LiveIntervalAnalysis.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp b/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
index 37e3895b3c4..5bb3cfa4596 100644
--- a/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
+++ b/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
@@ -100,11 +100,14 @@ void LiveIntervals::computeNumbering() {
i2miMap_.push_back(I);
MIIndex += InstrSlots::NUM;
}
-
+
+ if (StartIdx == MIIndex) {
+ // Empty MBB
+ MIIndex += InstrSlots::NUM;
+ i2miMap_.push_back(0);
+ }
// Set the MBB2IdxMap entry for this MBB.
- MBB2IdxMap[MBB->getNumber()] = (StartIdx == MIIndex)
- ? std::make_pair(StartIdx, StartIdx) // Empty MBB
- : std::make_pair(StartIdx, MIIndex - 1);
+ MBB2IdxMap[MBB->getNumber()] = std::make_pair(StartIdx, MIIndex - 1);
Idx2MBBMap.push_back(std::make_pair(StartIdx, MBB));
}
std::sort(Idx2MBBMap.begin(), Idx2MBBMap.end(), Idx2MBBCompare());
@@ -661,6 +664,8 @@ void LiveIntervals::computeIntervals() {
MIIndex += InstrSlots::NUM;
}
+
+ if (MBB->begin() == miEnd) MIIndex += InstrSlots::NUM; // Empty MBB
}
}
OpenPOWER on IntegriCloud