[llvm-commits] [PATCH] Added topological graph sort routine to llvm/ADT

Delesley Hutchins delesley at google.com
Thu Aug 18 12:56:56 PDT 2011


I am specializing RPO for CFGBlocks, because CFGBlocks allow me to use
a BitVector as a set, rather than the default SmallPtrSet.  Other than
that, though, I don't see much need for a fancy interface; once you
have the ordering, detecting back edges is trivial.

  -DeLesley

On Thu, Aug 18, 2011 at 11:52 AM, Chandler Carruth <chandlerc at google.com> wrote:
> On Thu, Aug 18, 2011 at 10:50 AM, Delesley Hutchins <delesley at google.com>
> wrote:
>>
>> Good point.  Yes, the RPO iterator (not PO iterator -- my bad) does
>> seem to do what we need.  The ordering is slightly different, but it
>> obeys the same constraints.  Moreover, the efficiency of RPO is
>> somewhat better, since it does not attempt to track depth so
>> precisely.  I am withdrawing the patch.
>
> Would it make sense to provide a more convenient topological-ordering
> interface that is actually implemented in terms of RPO traversal, and maybe
> also provides a convenient API for backedge tracking?



-- 
DeLesley Hutchins | Software Engineer | delesley at google.com | 505-206-0315




More information about the llvm-commits mailing list