diff options
author | Craig Topper <craig.topper@gmail.com> | 2013-02-19 03:06:17 +0000 |
---|---|---|
committer | Craig Topper <craig.topper@gmail.com> | 2013-02-19 03:06:17 +0000 |
commit | 252d798fc302ed78bc4b11e66a2382015a25c6e0 (patch) | |
tree | cde90ca51f656920e79fc5df84c0da5db0a2bdf0 | |
parent | 2878b7d7ab8dc4bf424690b58088e0b7d3ada49f (diff) | |
download | external_llvm-252d798fc302ed78bc4b11e66a2382015a25c6e0.zip external_llvm-252d798fc302ed78bc4b11e66a2382015a25c6e0.tar.gz external_llvm-252d798fc302ed78bc4b11e66a2382015a25c6e0.tar.bz2 |
Use a reference into the BlockLiveness DenseMap to avoid repeated hash lookups in collectMarkers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175484 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/CodeGen/StackColoring.cpp | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/lib/CodeGen/StackColoring.cpp b/lib/CodeGen/StackColoring.cpp index bd0d809..0f1caf7 100644 --- a/lib/CodeGen/StackColoring.cpp +++ b/lib/CodeGen/StackColoring.cpp @@ -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); } } } |