[PATCH] Use FIFO in InitDAGTopologicalSorting

Tijl Coosemans tijl at freebsd.org
Thu Aug 15 05:06:11 PDT 2013


On Wed, 14 Aug 2013 16:16:11 -0700 Sean Silva wrote:
> On Wed, Aug 14, 2013 at 1:09 AM, Tijl Coosemans <tijl at freebsd.org> wrote:
>> The attached patch changes WorkList in InitDAGTopologicalSorting() into a
>> FIFO queue. Items on the list have to be processed in order such that
>> earlier items get higher index numbers than later items because they may
>> be successors of the later items.
>
> Does this fix an existing bug? Do you have a test case?

At the end of InitDAGTopologicalSorting there are assertions that verify
the correctness of the ordering. One of these was hit in
http://llvm.org/bugs/show_bug.cgi?id=15840

The actual fix for bug 15840 made this patch unnecessary, but I thought
it was still a valid patch. Now that I've looked at it again I think the
above statement is incorrect. Earlier items on the list cannot be
successors of later items, because items are never put on the list if
there are still unprocessed successors. The assertion failure in bug
15840 must have been because of a corrupted DAG.

So thanks for looking into this, but this patch can be discarded I think.



More information about the llvm-commits mailing list