<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><br><div><div>On Apr 8, 2013, at 9:58 PM, Cameron Zwarich <<a href="mailto:zwarich@apple.com">zwarich@apple.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div dir="auto" style="letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><div>As far as I know, there is none. Pretty much every analysis or transform on EBBs can be extended to work on the dominator tree, which is what LLVM prefers.<br></div></div></blockquote><div><br></div>At IR level, passes tend to work on the DomTree or directly on the use/def chains independent of the CFG. If you really need to scan instructions, there's nothing wrong with walking upward in the CFG until you see multiple predecessors. It's possible to have unreachable cycles though.</div><div><br></div><div>In machine code we sometimes scan the instruction list within a block up to some instruction threshold. I think most of those cases should be replaced by scanning an extended basic block, which is no more complex and much less artificially limited. Unfortunately, we don't have reliable block layout until very late. As a workaround, you can visit blocks in RPO order, like Jakob just did in Thumb2SizeReduce:<br><br><div>+  ReversePostOrderTraversal<MachineFunction*> RPOT(&MF);</div><div>+  for (ReversePostOrderTraversal<MachineFunction*>::rpo_iterator</div><div>+       I = RPOT.begin(), E = RPOT.end(); I != E; ++I)</div><div><br></div><div>You don't benefit from branch frequency, but it may be good enough and will tend to work when critical edges are not split.</div><div><br></div><div>-Andy</div><div><br></div><blockquote type="cite"><div dir="auto" style="letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><div>On Apr 8, 2013, at 9:53 PM, Bill He <<a href="mailto:wh3@rice.edu">wh3@rice.edu</a>> wrote:<br><br></div><blockquote type="cite"><span style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.800000190734863px; background-color: rgb(255, 255, 255);">Hi all,</span><div style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.800000190734863px; background-color: rgb(255, 255, 255);"><br></div><div style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.800000190734863px; background-color: rgb(255, 255, 255);">I am trying to find a sample pass that works on extended basic blocks. Any suggestion or help is very much appreciated. </div><div style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.800000190734863px; background-color: rgb(255, 255, 255);"><br></div><div style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.800000190734863px; background-color: rgb(255, 255, 255);">Thanks in advance.</div><div style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.800000190734863px; background-color: rgb(255, 255, 255);"><br></div><div style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.800000190734863px; background-color: rgb(255, 255, 255);">Best,</div><div style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.800000190734863px; background-color: rgb(255, 255, 255);">Weibo</div></blockquote><blockquote type="cite"><span>_______________________________________________</span><br><span>LLVM Developers mailing list</span><br><span><a href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a><span class="Apple-converted-space"> </span>        <a href="http://llvm.cs.uiuc.edu/">http://llvm.cs.uiuc.edu</a></span><br><span><a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a></span><br></blockquote>_______________________________________________<br>LLVM Developers mailing list<br><a href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a><span class="Apple-converted-space"> </span>        <a href="http://llvm.cs.uiuc.edu/">http://llvm.cs.uiuc.edu</a><br><a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a></div></blockquote></div><br></body></html>