[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


Hi:

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

1. MachineDominatorTree *domintree = new MachineDominatorTree();
   domintree->runOnMachineFunction(mf);

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???

Thanks 
renkun


      ___________________________________________________________ 
  好玩贺卡等你发,邮箱贺卡全新上线! 
http://card.mail.cn.yahoo.com/
-------------- 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