<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#ffffff" text="#000000">
    On 6/22/11 5:34 AM, Andreas Wilhelm wrote:
    <blockquote cite="mid:87CB53AB-7258-4CB7-AF7F-8EF8E54F668D@gmx.com"
      type="cite">
      <meta http-equiv="Content-Type" content="text/html;
        charset=ISO-8859-1">
      Hello,
      <div><br>
      </div>
      <div>I'm looking for a way to identify dependencies of
        function-pairs (memory-dependency, control-dependency...) in
        order to parallelize them.</div>
      <div>For aliasing problems I use the DataStructureAnalysis.</div>
    </blockquote>
    <br>
    I'm assuming that this is the DSA analysis in the poolalloc module. 
    Be forewarned that:<br>
    <br>
    1) DSA works with LLVM 2.7; I don't believe it works with LLVM
    mainline yet.<br>
    2) The alias analysis interface to DSA hasn't been maintained in
    awhile; you'll need to examine the DSGraphs directly.<br>
    <br>
    <br>
    <blockquote cite="mid:87CB53AB-7258-4CB7-AF7F-8EF8E54F668D@gmx.com"
      type="cite">
      <div> To solve simple memory- and control-dependency problems I
        want to use</div>
      <div>memdep. But unfortunately I even fail with following simple
        C++ example...</div>
      <div><br>
      </div>
      <div><font class="Apple-style-span" face="Verdana">int a( int n) {
          return n; }</font></div>
      <div><font class="Apple-style-span" face="Verdana">int b( int n) {
          return n; }</font></div>
      <div><font class="Apple-style-span" face="Verdana">int c( int n) {
          return n; }</font></div>
      <div><font class="Apple-style-span" face="Verdana"><br>
        </font></div>
      <div><font class="Apple-style-span" face="Verdana">int main( int
          argc, char** argv) {</font></div>
      <div><font class="Apple-style-span" face="Verdana"><br>
        </font></div>
      <div><font class="Apple-style-span" face="Verdana">  int x = a(
          argc);</font></div>
      <div><font class="Apple-style-span" face="Verdana">  b( 0);</font></div>
      <div><font class="Apple-style-span" face="Verdana"><span
            class="Apple-tab-span" style="white-space: pre;"> </span></font></div>
      <div><font class="Apple-style-span" face="Verdana">  <span
            class="Apple-tab-span" style="white-space: pre;">i</span>f (
          x)</font></div>
      <div><font class="Apple-style-span" face="Verdana">    x = 0;</font></div>
      <div><font class="Apple-style-span" face="Verdana"><span
            class="Apple-tab-span" style="white-space: pre;"><br>
          </span></font></div>
      <div><font class="Apple-style-span" face="Verdana">  return ( c(
          x));<span class="Apple-tab-span" style="white-space: pre;"> </span></font></div>
      <div><font class="Apple-style-span" face="Verdana">}</font></div>
      <div><font class="Apple-style-span" face="Verdana"><br>
        </font></div>
      <div><font class="Apple-style-span" face="Verdana">... The result
          of memdep shows a dependency between the callsite of b() and
          the call of a(). Why?</font></div>
      <div><font class="Apple-style-span" face="Verdana">Moreover I want
          to get the dependency between the call to c() and the result
          of a(). How can I obtain this?</font></div>
      <div><font class="Apple-style-span" face="Verdana"><br>
        </font></div>
    </blockquote>
    <br>
    I can't comment on what memdep does as I've never used it; others
    more knowledgeable will have to comment.<br>
    <br>
    Regarding your last question on following the def of x to the use in
    c(x), that looks like a simple data-flow analysis problem; just
    follow the def-use chain of the SSA variables from the call of a()
    to the call of c() in main().<br>
    <br>
    -- John T.<br>
    <br>
    <blockquote cite="mid:87CB53AB-7258-4CB7-AF7F-8EF8E54F668D@gmx.com"
      type="cite">
      <div><font class="Apple-style-span" face="Verdana">Thanks in
          advance,</font></div>
      <div><font class="Apple-style-span" face="Verdana">Andreas</font></div>
      <pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
LLVM Developers mailing list
<a class="moz-txt-link-abbreviated" href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a>         <a class="moz-txt-link-freetext" href="http://llvm.cs.uiuc.edu">http://llvm.cs.uiuc.edu</a>
<a class="moz-txt-link-freetext" href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>