summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/MachineScheduler.cpp
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2012-11-29 14:36:26 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2012-11-29 14:36:26 +0000
commitaa598b3be67ae5cb7b4d95ae7003135bee622873 (patch)
tree69da6057cc628e6cd7d69d4bea5f277189def6e1 /llvm/lib/CodeGen/MachineScheduler.cpp
parent7ad7e830316df2c12cef9e58c3d10d2abeda4e08 (diff)
downloadbcm5719-llvm-aa598b3be67ae5cb7b4d95ae7003135bee622873.tar.gz
bcm5719-llvm-aa598b3be67ae5cb7b4d95ae7003135bee622873.zip
misched: Recompute priority queue when DFSResults are updated.
This was found by MSVC10's STL debug mode on a test from the test suite. Sadly std::is_heap isn't standard so there is no way to assert this without writing our own heap verify, which looks like overkill to me. llvm-svn: 168885
Diffstat (limited to 'llvm/lib/CodeGen/MachineScheduler.cpp')
-rw-r--r--llvm/lib/CodeGen/MachineScheduler.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/MachineScheduler.cpp b/llvm/lib/CodeGen/MachineScheduler.cpp
index e27bb0dd1bd..b3e38f64ff0 100644
--- a/llvm/lib/CodeGen/MachineScheduler.cpp
+++ b/llvm/lib/CodeGen/MachineScheduler.cpp
@@ -2117,6 +2117,8 @@ public:
virtual void registerRoots() {
DFSResult.compute(ReadyQ);
ScheduledTrees.resize(DFSResult.getNumSubtrees());
+ // Restore the heap in ReadyQ with the updated DFS results.
+ std::make_heap(ReadyQ.begin(), ReadyQ.end(), Cmp);
}
/// Implement MachineSchedStrategy interface.
OpenPOWER on IntegriCloud