[llvm-commits] [PATCH] Enable edge pruning in PostOrderIterator.h

Chandler Carruth chandlerc at google.com
Mon Jul 16 22:39:05 PDT 2012


Generally LGTM. It might be worth while to beef up the comments on these
methods of po_iterator_storage to make it more clear how this can be used
to hijack and extend the post order iteration.


On Mon, Jul 16, 2012 at 8:05 PM, Jakob Stoklund Olesen <stoklund at 2pi.dk>wrote:

> All,
>
> Please review the attached patch which generalizes the po_iterator class
> template such that it is possible to prune graph edges from the DFS
> traversal.
>
> It is already possible to limit the traversal to a subset of graph nodes
> by providing a custom SetType class, see for example the
> LoopBlocksTraversal class which limits a post-order traversal to blocks
> inside a loop. It is currently not possible to remove edges from the graph,
> though. For example, it would be useful to run a post-order traversal over
> loop blocks while omitting the back edges.
>
> This patch makes it possible to prune graph edges by specializing the
> po_iterator_storage base class and implementing the insertEdge() function.
> The patch also pulls the existing DFSetTraits trick into the
> po_iterator_storage base class.
>
> /jakob
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20120716/db43dd43/attachment.html>


More information about the llvm-commits mailing list