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

Andrew Trick atrick at apple.com
Thu Nov 29 11:21:28 PST 2012


That's an awesome catch.
-Andy

On Nov 29, 2012, at 6:36 AM, Benjamin Kramer <benny.kra at googlemail.com> wrote:

> 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.
> 
> 
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits




More information about the llvm-commits mailing list