1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 03:02:36 +01:00

Use a reference into the BlockLiveness DenseMap to avoid repeated hash lookups in collectMarkers.

llvm-svn: 175484
This commit is contained in:
Craig Topper 2013-02-19 03:06:17 +00:00
parent dd8d472a14
commit 4d243629d2

View File

@ -240,8 +240,11 @@ unsigned StackColoring::collectMarkers(unsigned NumSlot) {
BasicBlocks[*FI] = BasicBlockNumbering.size();
BasicBlockNumbering.push_back(*FI);
BlockLiveness[*FI].Begin.resize(NumSlot);
BlockLiveness[*FI].End.resize(NumSlot);
// Keep a reference to avoid repeated lookups.
BlockLifetimeInfo &BlockInfo = BlockLiveness[*FI];
BlockInfo.Begin.resize(NumSlot);
BlockInfo.End.resize(NumSlot);
for (MachineBasicBlock::iterator BI = (*FI)->begin(), BE = (*FI)->end();
BI != BE; ++BI) {
@ -265,15 +268,15 @@ unsigned StackColoring::collectMarkers(unsigned NumSlot) {
}
if (IsStart) {
BlockLiveness[*FI].Begin.set(Slot);
BlockInfo.Begin.set(Slot);
} else {
if (BlockLiveness[*FI].Begin.test(Slot)) {
if (BlockInfo.Begin.test(Slot)) {
// Allocas that start and end within a single block are handled
// specially when computing the LiveIntervals to avoid pessimizing
// the liveness propagation.
BlockLiveness[*FI].Begin.reset(Slot);
BlockInfo.Begin.reset(Slot);
} else {
BlockLiveness[*FI].End.set(Slot);
BlockInfo.End.set(Slot);
}
}
}