<div dir="ltr">Hi Arsen,<div>I wrote a pass that computes a control dependence graph as described in Ferrante et al's "The Program Dependence Graph and Its Use in Optimization." It is available at <a href="https://github.com/thinkmoore/llvm-analysis">https://github.com/thinkmoore/llvm-analysis</a>.</div>
<div class="gmail_extra"><div>Cheers,<br>Scott</div>
<br><br><div class="gmail_quote">On Fri, Apr 12, 2013 at 5:04 PM, John Criswell <span dir="ltr"><<a href="mailto:criswell@illinois.edu" target="_blank">criswell@illinois.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div class="im">On 4/12/13 3:19 PM, Arsen wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
Thank you John.<br>
Actually the opt tool (from LLVM 3.2 version) can generate the needed graphs<br>
(with pass "-domfrontier").<br>
But I just want to surely know is there some pass or builder which can be<br>
integrated somehow so it will be possible directly to generate CDG?<br>
</blockquote>
<br></div>
Yes and no.  There's isn't a control dependence pass in LLVM per se, but I believe that is primarily because control dependence is very easy to compute with the existing analysis passes in LLVM.  With PostDominanceFrontier, it was extremely simple (I think it was calling two methods in the PostDominanceFrontier pass).<br>

<br>
It might be slightly more work to compute it with PostDominatorTree, but not significantly.  And, IIRC, you'll want to use PostDominatorTree instead of DominatorTree.  For control dependence, I believe you essentially flip the CFG upside-down and compute the dominance frontier.  Using post dominators instead of dominators does the same thing and is described in the Allen and Kennedy book.<br>

<br>
-- John T.<div class=""><div class="h5"><br>
<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<br>
<br>
<br>
--<br>
View this message in context: <a href="http://llvm.1065342.n5.nabble.com/Control-Dependence-Graph-builder-tp56687p56689.html" target="_blank">http://llvm.1065342.n5.nabble.<u></u>com/Control-Dependence-Graph-<u></u>builder-tp56687p56689.html</a><br>

Sent from the LLVM - Dev mailing list archive at Nabble.com.<br>
______________________________<u></u>_________________<br>
LLVM Developers mailing list<br>
<a href="mailto:LLVMdev@cs.uiuc.edu" target="_blank">LLVMdev@cs.uiuc.edu</a>         <a href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/<u></u>mailman/listinfo/llvmdev</a><br>
</blockquote>
<br>
______________________________<u></u>_________________<br>
LLVM Developers mailing list<br>
<a href="mailto:LLVMdev@cs.uiuc.edu" target="_blank">LLVMdev@cs.uiuc.edu</a>         <a href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/<u></u>mailman/listinfo/llvmdev</a><br>
</div></div></blockquote></div><br></div></div>