1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 19:52:54 +01:00

Make indexing empty basic blocks an option for the moment.

llvm-svn: 52306
This commit is contained in:
Owen Anderson 2008-06-16 07:10:49 +00:00
parent ffb6425556
commit 114ce854d1

View File

@ -44,6 +44,8 @@ static cl::opt<bool> SplitAtBB("split-intervals-at-bb",
cl::init(true), cl::Hidden);
static cl::opt<int> SplitLimit("split-limit",
cl::init(-1), cl::Hidden);
static cl::opt<bool> EmptyBBIndex("empty-bb-index",
cl::init(false), cl::Hidden);
STATISTIC(numIntervals, "Number of original intervals");
STATISTIC(numIntervalsAfter, "Number of intervals after coalescing");
@ -100,15 +102,23 @@ 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()] = std::make_pair(StartIdx, MIIndex - 1);
Idx2MBBMap.push_back(std::make_pair(StartIdx, MBB));
if (!EmptyBBIndex) {
MBB2IdxMap[MBB->getNumber()] = (StartIdx == MIIndex)
? std::make_pair(StartIdx, StartIdx) // Empty MBB
: std::make_pair(StartIdx, MIIndex - 1);
Idx2MBBMap.push_back(std::make_pair(StartIdx, MBB));
} else {
if (StartIdx == MIIndex) {
// Empty MBB
MIIndex += InstrSlots::NUM;
i2miMap_.push_back(0);
}
MBB2IdxMap[MBB->getNumber()] = std::make_pair(StartIdx, MIIndex - 1);
Idx2MBBMap.push_back(std::make_pair(StartIdx, MBB));
}
}
std::sort(Idx2MBBMap.begin(), Idx2MBBMap.end(), Idx2MBBCompare());
@ -665,7 +675,9 @@ void LiveIntervals::computeIntervals() {
MIIndex += InstrSlots::NUM;
}
if (MBB->begin() == miEnd) MIIndex += InstrSlots::NUM; // Empty MBB
if (EmptyBBIndex) {
if (MBB->begin() == miEnd) MIIndex += InstrSlots::NUM; // Empty MBB
}
}
}