[llvm-commits] [llvm] r168885 - /llvm/trunk/lib/CodeGen/MachineScheduler.cpp

Benjamin Kramer benny.kra at googlemail.com
Thu Nov 29 06:36:26 PST 2012


Author: d0k
Date: Thu Nov 29 08:36:26 2012
New Revision: 168885

URL: http://llvm.org/viewvc/llvm-project?rev=168885&view=rev
Log:
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.

Modified:
    llvm/trunk/lib/CodeGen/MachineScheduler.cpp

Modified: llvm/trunk/lib/CodeGen/MachineScheduler.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineScheduler.cpp?rev=168885&r1=168884&r2=168885&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/MachineScheduler.cpp (original)
+++ llvm/trunk/lib/CodeGen/MachineScheduler.cpp Thu Nov 29 08:36:26 2012
@@ -2117,6 +2117,8 @@
   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.





More information about the llvm-commits mailing list