On Wed, Oct 17, 2012 at 6:47 PM, Hal Finkel <span dir="ltr"><<a href="mailto:hfinkel@anl.gov" target="_blank">hfinkel@anl.gov</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">----- Original Message -----<br>
> From: "Preston Briggs" <<a href="mailto:preston.briggs@gmail.com">preston.briggs@gmail.com</a>><br>
> To: <a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>
> Sent: Wednesday, October 17, 2012 7:04:20 PM<br>
> Subject: [llvm-commits] building a Dependence Graph<br>
><br>
><br>
> Attached is a small patch that begins the definition of a new<br>
> function pass, DependenceGraph, that will build a dependence graph<br>
> for an entire function.<br>
<br>
</div>What will time time/space complexity of this be?<br>
<br>
Thanks again,<br>
Hal<br>
<div class="im"><br></div></blockquote><div><br></div><div>In the worst case, O(n^2), where n is the number of memory references (loads, stores, calls), but that's very pessimistic. I discuss many ways to reduce the time/space impact of the dependence graph <a href="https://sites.google.com/site/parallelizationforllvm/building-the-dependence-graph">here</a>.</div>
<div><br></div><div>We did something similar for the Tera compiler, 20 years ago, running on workstations of the day, and it was practical. Nevertheless, in the context of LLVM, I expect it will an expensive analysis, perhaps only suitable for certain demanding applications.</div>
<div><br></div><div>Preston</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">
> I'm trying to sneak up on the problem in<br>
> stages, rather than blatting out one big chunk of code, hoping to<br>
> make it easier to review.<br>
><br>
><br>
> This new pass depends on the DependenceAnalysis pass to answer<br>
> questions about the dependence between pairs of instructions. There<br>
> are two separate passes because there's a useful separation of<br>
> concerns. A dependence exists if two conditions are met:<br>
><br>
><br>
</div>>     1. Two instructions reference the same memory location, and<br>
>     2. There is a flow of control leading from one instruction to the<br>
<div class="im">>     other.<br>
><br>
><br>
> DependenceAnalysis attacks the first condition; DependenceGraph<br>
> attacks the second.<br>
><br>
><br>
> Someday it may be useful to write a different pass, called something<br>
> like LoopDependenceGraph, that would build a dependence graph for a<br>
> single loop nest. Such a pass could still rely on the<br>
> DependenceAnalysis pass.<br>
><br>
><br>
> Thanks,<br>
> Preston<br>
><br>
><br>
</div>> _______________________________________________<br>
> llvm-commits mailing list<br>
> <a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>
> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
><br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
Hal Finkel<br>
Postdoctoral Appointee<br>
Leadership Computing Facility<br>
Argonne National Laboratory<br>
</font></span></blockquote></div><br>