From: Benjamin Kramer Date: Thu, 29 Nov 2012 14:36:26 +0000 (+0000) Subject: misched: Recompute priority queue when DFSResults are updated. X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=5175fd990c898a49708d60b84e7838bead48f2cd;p=oota-llvm.git 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168885 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/MachineScheduler.cpp b/lib/CodeGen/MachineScheduler.cpp index e27bb0dd1bd..b3e38f64ff0 100644 --- a/lib/CodeGen/MachineScheduler.cpp +++ b/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.