<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">On 4/28/16 4:55 AM, Mani, Suresh wrote:<br>
    </div>
    <blockquote
cite="mid:BLUPR12MB0562F275FE1F1D5FC423E41BF2650@BLUPR12MB0562.namprd12.prod.outlook.com"
      type="cite">
      <meta http-equiv="Context-Type" content="text/html; charset=utf-8">
      <meta name="Generator" content="Microsoft Word 15 (filtered
        medium)">
      <div class="WordSection1">
        <p class="MsoNormal"><span>Hi Criswell,</span></p>
        <p class="MsoNormal"><span> </span></p>
        <p class="MsoNormal"><span>Thanks a lot for the immediate and
            detailed response on this.</span></p>
        <p class="MsoNormal"><span><span>Sure I will try using the
              ported version
            </span></span><a moz-do-not-send="true"
            href="https://github.com/jtcriswell/llvm-dsa">https://github.com/jtcriswell/llvm-dsa</a>
          <span>
            <span>and check.</span></span></p>
      </div>
    </blockquote>
    <br>
    To be clear, the DSA code has been ported to LLVM 3.7.  The
    Poolalloc APA transform has not.<br>
    <br>
    Also, if you're using DSA, you will probably get more accurate
    results if you analyze unoptimized code.  LLVM's optimizations now
    do some really funky things to the IR that make it more difficult
    for DSA to do its type-inference.  With less precise type inference,
    DSA provides less precise points-to analysis results (the
    type-inference gives DSA its field sensitivity feature).<br>
    <br>
    I think DSA can be fixed to deal with those issues, and there are
    multiple ways to fix it.  However, no one's stepped up to the plate
    to do it yet.<br>
    <br>
    Regards,<br>
    <br>
    John Criswell<br>
    <br>
    <blockquote
cite="mid:BLUPR12MB0562F275FE1F1D5FC423E41BF2650@BLUPR12MB0562.namprd12.prod.outlook.com"
      type="cite">
      <div class="WordSection1">
        <p class="MsoNormal"><span> </span></p>
        <p class="MsoNormal"><span><span>Thanks</span></span></p>
        <p class="MsoNormal"><span><span>M Suresh</span></span><span></span></p>
        <p class="MsoNormal"><span> </span></p>
        <p class="MsoNormal"><span> </span></p>
        <p class="MsoNormal"><span> </span></p>
        <div>
          <div>
            <p class="MsoNormal"><b><span>From:</span></b><span> John
                Criswell [<a class="moz-txt-link-freetext" href="mailto:jtcriswel@gmail.com">mailto:jtcriswel@gmail.com</a>]
                <br>
                <b>Sent:</b> Wednesday, April 27, 2016 6:47 PM<br>
                <b>To:</b> Mani, Suresh; <a class="moz-txt-link-abbreviated" href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a><br>
                <b>Subject:</b> Re: [llvm-dev] Building and Invoking DSA
                or Pool Alloc</span></p>
          </div>
        </div>
        <p class="MsoNormal"> </p>
        <div>
          <p class="MsoNormal">Dear Suresh,<br>
            <br>
            First, may I ask why you're using automatic pool allocation
            (APA)?  The APA transforms have probably suffered
            significant bitrot; I haven't used them much in recent
            years.  APA's current algorithms for deciding when and where
            to make pools are a bit complicated.  Depending on your
            needs, it may make more sense to morph the current APA code
            into something that is simpler and easier to maintain (e.g.,
            a transform that creates global, context-insensitive pools)
            than to use it for doing context-sensitive pool allocation
            (which requires changing function signatures which becomes
            tricky when the program uses external libraries).<br>
            <br>
            We've used DSA recently (Fall 2014), so it's in much better
            shape.  We even have a version of it ported to LLVM 3.7 (<a
              moz-do-not-send="true"
              href="https://github.com/jtcriswell/llvm-dsa"><a class="moz-txt-link-freetext" href="https://github.com/jtcriswell/llvm-dsa">https://github.com/jtcriswell/llvm-dsa</a></a>).<br>
            <br>
            Second, to answer your question, the reason why you're
            seeing this error is because you haven't loaded the DSA
            libraries into opt.  You need to include additional -load
            options to opt to load DSA.  I believe the libraries you
            need to load (in order) are libAssistDS.so and
            libLLVMDataStructure.so:<br>
            <br>
            opt -load AssistDS.so -load LLVMDataStructucture.so -load
            poolalloc.so ...<br>
            <br>
            An alternative to running opt is to build a simple tool
            which links in these libraries and runs the needed passes
            over the bitcode file (essentially, writing a specialized
            opt tool just for running these passes).  The pa programs
            (poolalloc/tools/Pa) is an outdated example of such a tool.<br>
            <br>
            Regards,<br>
            <br>
            John Criswell<br>
            <br>
            On 4/27/16 2:06 AM, Mani, Suresh via llvm-dev wrote:</p>
        </div>
        <blockquote>
          <div>
            <p class="MsoNormal">Hi ,</p>
            <p class="MsoNormal"> </p>
            <p class="MsoNormal">This Is ‘Suresh M’ from AMD compiler
              team.</p>
            <p class="MsoNormal"> </p>
            <p class="MsoListParagraph">1)      I obtained the source
              code of llvm and pool-alloc  (relase_32 versions ) using
              the following commands,</p>
            <p class="MsoListParagraph"> </p>
            <p class="MsoListParagraph">svn co <a
                moz-do-not-send="true"
                href="http://llvm.org/svn/llvm-project/llvm/branches/release_32">
<a class="moz-txt-link-freetext" href="http://llvm.org/svn/llvm-project/llvm/branches/release_32">http://llvm.org/svn/llvm-project/llvm/branches/release_32</a></a> llvm</p>
            <p class="MsoListParagraph">cd llvm/projects</p>
            <p class="MsoListParagraph">svn co <a
                moz-do-not-send="true"
                href="http://llvm.org/svn/llvm-project/poolalloc/branches/release_32">
<a class="moz-txt-link-freetext" href="http://llvm.org/svn/llvm-project/poolalloc/branches/release_32">http://llvm.org/svn/llvm-project/poolalloc/branches/release_32</a></a>
              poolalloc</p>
            <p class="MsoNormal"> </p>
            <p class="MsoListParagraph">2)      Was able to build the
              binaries and libraries</p>
            <p class="MsoNormal">             
                          ../rel_32/build_rel/projects/poolalloc/Release+Asserts/lib</p>
            <p class="MsoNormal">-rw-rw-r-- 1 sumani sumani  987956 Apr
              15 15:56 AssistDS.a</p>
            <p class="MsoNormal">-rwxrwxr-x 1 sumani sumani  508376 Apr
              15 15:56 AssistDS.so</p>
            <p class="MsoNormal">-rw-rw-r-- 1 sumani sumani    2648 Apr
              15 15:56 libcount.a</p>
            <p class="MsoNormal">-rwxrwxr-x 1 sumani sumani    8539 Apr
              15 15:56 libcount.so</p>
            <p class="MsoNormal">-rw-rw-r-- 1 sumani sumani    6514 Apr
              15 15:56 libpa_pre_rt.a</p>
            <p class="MsoNormal">-rw-rw-r-- 1 sumani sumani   13526 Apr
              15 15:56 libpoolalloc_fl_rt.a</p>
            <p class="MsoNormal">-rw-rw-r-- 1 sumani sumani   26048 Apr
              15 15:56 libpoolalloc_rt.a</p>
            <p class="MsoNormal">-rwxrwxr-x 1 sumani sumani   28731 Apr
              15 15:56 libpoolalloc_rt.so</p>
            <p class="MsoNormal">-rw-rw-r-- 1 sumani sumani 1656724 Apr
              15 15:56 LLVMDataStructure.a</p>
            <p class="MsoNormal">-rwxrwxr-x 1 sumani sumani  809363 Apr
              15 15:56 LLVMDataStructure.so</p>
            <p class="MsoNormal">-rw-rw-r-- 1 sumani sumani 1255556 Apr
              15 15:56 poolalloc.a</p>
            <p class="MsoNormal">-rwxrwxr-x 1 sumani sumani  609417 Apr
              15 15:56 poolalloc.so</p>
            <p class="MsoNormal">-rwxrwxr-x 1 sumani sumani   23861 Apr
              15 15:56 typechecks_rt.so</p>
            <p class="MsoNormal"> </p>
            <p class="MsoNormal">                              
              ../rel_32/build_rel/Release+Asserts/bin          //
              Contains the llvm binaries</p>
            <p class="MsoNormal">                              
              ../rel_32/build_rel/Release+Asserts/lib           //
              Contains the llvm libraries</p>
            <p class="MsoNormal"> </p>
            <p class="MsoNormal"> </p>
            <p class="MsoNormal"> </p>
            <p class="MsoListParagraph">3)      Invoking opt as follows,</p>
            <p class="MsoNormal"> </p>
            <p class="MsoNormal">              
              ../rel_32/build_rel/Release+Asserts/bin/opt -load
              ../rel_32/build_rel/projects/poolalloc/Release+Asserts/lib/poolalloc.so  
              --help</p>
            <p class="MsoNormal">                  Error opening
              ../rel_32/build_rel/projects/poolalloc/Release+Asserts/lib/poolalloc.so:
../rel_32/build_rel/projects/poolalloc/Release+Asserts/lib/poolalloc.so:
              <b>undefined symbol: _ZN4llvm21EquivBUDataStructures2IDE</b></p>
            <p class="MsoNormal">                 -load request ignored.</p>
            <p class="MsoNormal">                  OVERVIEW: llvm .bc
              -> .bc modular optimizer and analysis printer</p>
            <p class="MsoNormal">                  USAGE: opt [options]
              <input bitcode file></p>
            <p class="MsoNormal"> </p>
            <p class="MsoNormal">                  OPTIONS:</p>
            <p class="MsoNormal">                 
                -O1                                          -
              Optimization level 1. Similar to clang -O1</p>
            <p class="MsoNormal">                 
                -O2                                          -
              Optimization level 2. Similar to clang -O2</p>
            <p class="MsoNormal">                 
                -O3                                          -
              Optimization level 3. Similar to clang -O3</p>
            <p class="MsoNormal">                         :</p>
            <p class="MsoNormal">                         :</p>
            <p class="MsoNormal"> </p>
            <p class="MsoNormal"> </p>
            <p class="MsoNormal">Can anyone please do let me know how
              this could be resolved.</p>
            <p class="MsoNormal"> </p>
            <p class="MsoNormal">Thanks</p>
            <p class="MsoNormal">M Suresh</p>
            <p class="MsoNormal"> </p>
            <p class="MsoNormal"> </p>
          </div>
          <p class="MsoNormal"><br>
            <br>
            <br>
          </p>
          <pre>_______________________________________________</pre>
          <pre>LLVM Developers mailing list</pre>
          <pre><a moz-do-not-send="true" href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a></pre>
          <pre><a moz-do-not-send="true" href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a></pre>
        </blockquote>
        <p class="MsoNormal"><br>
          <br>
          <br>
        </p>
        <pre>-- </pre>
        <pre>John Criswell</pre>
        <pre>Assistant Professor</pre>
        <pre>Department of Computer Science, University of Rochester</pre>
        <pre><a moz-do-not-send="true" href="http://www.cs.rochester.edu/u/criswell">http://www.cs.rochester.edu/u/criswell</a></pre>
      </div>
    </blockquote>
    <br>
    <br>
    <pre class="moz-signature" cols="72">-- 
John Criswell
Assistant Professor
Department of Computer Science, University of Rochester
<a class="moz-txt-link-freetext" href="http://www.cs.rochester.edu/u/criswell">http://www.cs.rochester.edu/u/criswell</a></pre>
  </body>
</html>