diff options
author | Dan Gohman <gohman@apple.com> | 2008-06-23 21:15:00 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2008-06-23 21:15:00 +0000 |
commit | 8cb8245cf117fc4a4f0a6549d9a773a12895550c (patch) | |
tree | 22399e8c0307c7381b512f0c743968b09f3090cf /lib/CodeGen | |
parent | 4b84086e89d86fb16f562166d9fea8df37db6be7 (diff) |
Move a DenseMap's declaration outside of a loop, and just call
clear() on each iteration. This avoids allocating and deallocating
all of DenseMap's memory on each iteration.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52642 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen')
-rw-r--r-- | lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp b/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp index a50dd7b7c5..f6d68f1ebd 100644 --- a/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp +++ b/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp @@ -953,10 +953,11 @@ void ScheduleDAGRRList::ListScheduleBottomUp() { // While Available queue is not empty, grab the node with the highest // priority. If it is not ready put it back. Schedule the node. SmallVector<SUnit*, 4> NotReady; + DenseMap<SUnit*, SmallVector<unsigned, 4> > LRegsMap; Sequence.reserve(SUnits.size()); while (!AvailableQueue->empty()) { bool Delayed = false; - DenseMap<SUnit*, SmallVector<unsigned, 4> > LRegsMap; + LRegsMap.clear(); SUnit *CurSU = AvailableQueue->pop(); while (CurSU) { if (CurSU->CycleBound <= CurCycle) { |