<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">Dear All,<br>
      <br>
      I think I just found the problem.<br>
      <br>
      For those interested, only a few methods of the AliasAnalysis
      class are virtual; many are non-virtual convenience wrapper that
      call the virtual methods.  A new alias analysis cannot override
      the non-virtual methods; it must override the virtual methods.<br>
      <br>
      As it turns out, my alias analysis (more accurately, the alias
      analysis that I'm porting) overrode the non-virtual wrappers and
      not the virtual methods, so passes using it would call
      AliasAnalysis::<wrapperMethod> which called the
      AliasAnalysis::<virtualMethod>.  I'm guessing the wrapper
      methods were virtual in earlier versions of LLVM.<br>
      <br>
      -- John T.<br>
      <br>
      <br>
      On 7/10/13 4:06 PM, John Criswell wrote:<br>
    </div>
    <blockquote cite="mid:51DDCCCC.1020008@illinois.edu" type="cite">
      <meta http-equiv="Content-Type" content="text/html;
        charset=ISO-8859-1">
      <div class="moz-cite-prefix">On 7/10/13 3:43 PM, Cristianno
        Martins wrote:<br>
      </div>
      <blockquote
cite="mid:CAPjL5AcM0OnhGhVgXkWL1H_Nqp9hAf6qQPs7JsbPWskQ0tD6Hw@mail.gmail.com"
        type="cite">
        <div dir="ltr">Hello John,
          <div><br>
          </div>
          <div>What opt command line arguments are you using?</div>
        </div>
      </blockquote>
      <br>
      I'm not using opt.  I'm manually scheduling a pipline within a
      tool.  The code looks like this:<br>
      <br>
      PassManager pm;<br>
      MyAlias * aa = new MyAlias();<br>
      pm.add(aa);<br>
      pm.add(new MyAliasUsingPass());<br>
      <br>
      Both MyAlias and MyAliasUsingPass are now ModulePass'es.  MyAlias
      is an alias analysis pass while MyAliasUsingPass is a pass that
      requires an alias analysis and performs a test query.<br>
      <br>
      The output of -debug-pass=Structure is the following:<br>
      <br>
      No Alias Analysis (always returns 'may' alias)<br>
        ModulePass Manager<br>
          MyAlias<br>
          MyAliasUsingPass<br>
      <br>
      <br>
      I've changed MyAlias to call abort() when it is queried, but the
      program never crashes when running MyAliasUsingPass, which
      indicates that my MyAlias is never being used for queries.<br>
      <br>
      I've also tried making MyAlias an ImmutablePass, but that didn't
      appear to work either.<br>
      <br>
      <blockquote
cite="mid:CAPjL5AcM0OnhGhVgXkWL1H_Nqp9hAf6qQPs7JsbPWskQ0tD6Hw@mail.gmail.com"
        type="cite">
        <div dir="ltr">
          <div><br>
          </div>
          <div>If you follow <a moz-do-not-send="true"
href="http://llvm.org/docs/Passes.html#no-aa-no-alias-analysis-always-returns-may-alias"
              target="_blank">this link</a>, you can see that -no-aa is
            the default alias analysis implementation if you do not
            manually specify which AA passes you want to use. Note that
            you can pass as many different implementations of AA as you
            want, and each of them will be chained together for each
            function, like a pipeline, if the previous one was not able
            to determine if there is a dependence or not.</div>
        </div>
      </blockquote>
      <br>
      Yes, I am aware of how analysis groups are *supposed* to work.  :)
      I'm just not getting the advertised functionality and am at a loss
      as to what I could be doing wrong.<br>
      <br>
      -- John T.<br>
      <br>
      <blockquote
cite="mid:CAPjL5AcM0OnhGhVgXkWL1H_Nqp9hAf6qQPs7JsbPWskQ0tD6Hw@mail.gmail.com"
        type="cite">
        <div dir="ltr">
          <div><br>
          </div>
          <div>Hope this help,</div>
          <div><br>
          </div>
        </div>
        <div class="gmail_extra"><br clear="all">
          <div><br>
            --<br>
            Cristianno Martins<br>
            PhD Student of Computer Science<br>
            University of Campinas<br>
            <a moz-do-not-send="true"
              href="mailto:cmartins@ic.unicamp.br" target="_blank">cmartins@ic.unicamp.br</a><br>
          </div>
          <br>
          <br>
          <div class="gmail_quote">On Wed, Jul 10, 2013 at 1:24 PM, John
            Criswell <span dir="ltr"><<a moz-do-not-send="true"
                href="mailto:criswell@illinois.edu" target="_blank">criswell@illinois.edu</a>></span>
            wrote:<br>
            <blockquote class="gmail_quote" style="margin:0 0 0
              .8ex;border-left:1px #ccc solid;padding-left:1ex"> Dear
              All,<br>
              <br>
              I'm trying to add a new alias analysis to the alias
              analysis group in LLVM 3.2.  This new pass is linked
              statically into a tool that lives outside the LLVM source
              tree, so I'm trying to avoid making patches to the LLVM
              sources.<br>
              <br>
              I've added the INITIALIZE_AG_PASS_BEGIN() and
              INITIALIZE_AG_PASS_END() code to the pass, manually
              scheduled it before the MemoryDependenceAnalysis pass, and
              have tried making it a FunctionPass and an ImmutablePass,
              but no matter what I do, it seems like
              MemoryDependenceAnalysis and other passes keep using the
              -no-aa default pass instead.<br>
              <br>
              1) Does anyone have ideas on how to verify that my pass is
              part of the alias analysis group?<br>
              <br>
              2) Does anyone have any ideas on what I might be doing
              wrong?<br>
              <br>
              Any ideas would be appreciated.<br>
              <br>
              Thanks in advance,<br>
              <br>
              -- John T.<br>
              <br>
              <br>
              _______________________________________________<br>
              LLVM Developers mailing list<br>
              <a moz-do-not-send="true"
                href="mailto:LLVMdev@cs.uiuc.edu" target="_blank">LLVMdev@cs.uiuc.edu</a>
                      <a moz-do-not-send="true"
                href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a><br>
              <a moz-do-not-send="true"
                href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev"
                target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br>
            </blockquote>
          </div>
          <br>
        </div>
      </blockquote>
      <br>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
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>