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 | 85abf9ea73c3773a167754528273c4d3c4d020df (patch) | |
tree | 6002426299aa9d83d15b580f7835c02e4a2cc1df | |
parent | 16cd398a1a4c19e20fd7d2de6ded91b5ac612b77 (diff) | |
download | bcm5719-llvm-85abf9ea73c3773a167754528273c4d3c4d020df.tar.gz bcm5719-llvm-85abf9ea73c3773a167754528273c4d3c4d020df.zip |
Use a reference into the BlockLiveness DenseMap to avoid repeated hash lookups in collectMarkers.
llvm-svn: 175484
-rw-r--r-- | llvm/lib/CodeGen/StackColoring.cpp | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/llvm/lib/CodeGen/StackColoring.cpp b/llvm/lib/CodeGen/StackColoring.cpp index bd0d8091ee6..0f1caf72a2c 100644 --- a/llvm/lib/CodeGen/StackColoring.cpp +++ b/llvm/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); } } } |