[LLVMdev] RFC: GLIBCXX_DEBUG ScheduleDAG Patch

David Greene
Mon, 17 Dec 2007 18:17:52 -0000

Attached is a patch to fix a GLIBCXX_DEBUG error in ScheduleDAGRRList.

The problem is that calls to CapturePred may reprioritize elements in the
priority queue, violating streak weak ordering requirements.

To fix this, I introduced a reference wrapper for containers to obtain access
to the SUnitVec used by std::priority_queue.   When CapturePred runs, it
calls updateNode which does a std::make_heap on the underlying SUnitVec.
This restores the correct ordering.

I believe this should also make the scheduler run more like it is supposed to.
Previously, the priority queue ordering was incorrect so we weren't
necessarly
scheduling correctly.

The container_reference_wrapper part may be controversial.  So I want to
get some opinions on this before I submit it.

Thanks.

                                           -Dave
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ScheduleDAG.patch
Type: text/x-diff
Size: 7731 bytes
Desc: not available
URL:
<http://lists.llvm.org/pipermail/llvm-dev/attachments/20071217/87b1bf6b/attachment.patch>