mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-21 18:24:23 +00:00
Assign indices to empty basic blocks. This will be necessary for StrongPHIElimination in the near future.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52300 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -100,11 +100,14 @@ void LiveIntervals::computeNumbering() {
|
|||||||
i2miMap_.push_back(I);
|
i2miMap_.push_back(I);
|
||||||
MIIndex += InstrSlots::NUM;
|
MIIndex += InstrSlots::NUM;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (StartIdx == MIIndex) {
|
||||||
|
// Empty MBB
|
||||||
|
MIIndex += InstrSlots::NUM;
|
||||||
|
i2miMap_.push_back(0);
|
||||||
|
}
|
||||||
// Set the MBB2IdxMap entry for this MBB.
|
// Set the MBB2IdxMap entry for this MBB.
|
||||||
MBB2IdxMap[MBB->getNumber()] = (StartIdx == MIIndex)
|
MBB2IdxMap[MBB->getNumber()] = std::make_pair(StartIdx, MIIndex - 1);
|
||||||
? std::make_pair(StartIdx, StartIdx) // Empty MBB
|
|
||||||
: std::make_pair(StartIdx, MIIndex - 1);
|
|
||||||
Idx2MBBMap.push_back(std::make_pair(StartIdx, MBB));
|
Idx2MBBMap.push_back(std::make_pair(StartIdx, MBB));
|
||||||
}
|
}
|
||||||
std::sort(Idx2MBBMap.begin(), Idx2MBBMap.end(), Idx2MBBCompare());
|
std::sort(Idx2MBBMap.begin(), Idx2MBBMap.end(), Idx2MBBCompare());
|
||||||
@ -661,6 +664,8 @@ void LiveIntervals::computeIntervals() {
|
|||||||
|
|
||||||
MIIndex += InstrSlots::NUM;
|
MIIndex += InstrSlots::NUM;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (MBB->begin() == miEnd) MIIndex += InstrSlots::NUM; // Empty MBB
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user