<!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 4/30/11 4:39 AM, Wenhan Gu wrote:
    <blockquote
      cite="mid:BANLkTimooHGdHc-waCQebXDA22UXqzDbvg@mail.gmail.com"
      type="cite">
      <meta http-equiv="Content-Type" content="text/html;
        charset=ISO-8859-1">
      Hi all,
      <div><br>
      </div>
      <div>in this case:</div>
      <div><br>
      </div>
      <div><font class="Apple-style-span" face="'courier new',
          monospace">...</font></div>
      <div><font class="Apple-style-span" face="'courier new',
          monospace">int* p = ...</font></div>
      <div><font class="Apple-style-span" face="'courier new',
          monospace">int* q = p;</font></div>
      <div><font class="Apple-style-span" face="'courier new',
          monospace">...</font></div>
      <div><br>
      </div>
      <div>How can I know that data-flow from <font
          class="Apple-style-span" face="'courier new', monospace">p</font>
        to <font class="Apple-style-span" face="'courier new',
          monospace">q</font>,</div>
      <div>i.e., which LLVM pass of header files could I use?</div>
    </blockquote>
    <br>
    It's not completely clear what sort of analysis you want.  If you
    want reaching definitions for just SSA virtual register values, then
    you only need to follow the explicit def-use chains in the SSA graph
    (see the use_iterator of class llvm::Value, IIRC).<br>
    <br>
    If you need to know if p and q point to the same memory object
    (assuming that the memory object is not eliminated by the mem2reg
    pass), then you need to either use the AliasAnalysis analysis group
    or a points-to analysis like DSA.<br>
    <br>
    If you need reaching definitions analysis for all values (including
    those that travel into/out of memory objects), then you need a
    points-to analysis combined with a reaching definitions analysis.  I
    do not think anyone has implemented such an analysis for LLVM yet,
    although a (relatively) simple one could probably be written on top
    of DSA.<br>
    <br>
    -- John T.<br>
    <br>
    <br>
    <blockquote
      cite="mid:BANLkTimooHGdHc-waCQebXDA22UXqzDbvg@mail.gmail.com"
      type="cite">
      <div><br>
      </div>
      <div>Thank you all.</div>
      <div><br>
        -- <br>
        Best regards,<br>
        Wen-Han<br>
      </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>