[LLVMdev] Find all backedges of CFG by MachineDominatorTree. please look at my jpg.

任坤 hbrenkun at yahoo.cn
Mon Jan 25 00:57:02 PST 2010


I hope to cut all backedges of MachineFunction CFG, then topological sort MachineBasicBlocks.

1. MachineDominatorTree *domintree = new MachineDominatorTree();

2. Then travel mf one by one.
   When domintree->dominates(next,current) is true, there is a backedge from current node to next node. move this backedge form CFG.

   But I find A LOOP in some CFG, there is backedge from current to next, dominates function reture "FALSE". So my algorithm find Graph can not be
toplogical sort.

3. how do I find all backedges of CFG???


-------------- next part --------------
A non-text attachment was scrubbed...
Name: dominatorTree.jpg
Type: image/jpeg
Size: 71233 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20100125/4e2bba87/attachment.jpg>

More information about the llvm-dev mailing list