<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    In addition to this, see my comments on the bug.  LICM is using AST
    in a particular usage pattern when most of the work done by
    add(AST&) ends up being redundant for perfectly nested loops.  <br>
    <br>
    Philip<br>
    <br>
    <div class="moz-cite-prefix">On 01/24/2016 09:44 AM, Daniel Berlin
      via llvm-dev wrote:<br>
    </div>
    <blockquote
cite="mid:CAF4BwTW0BsZ_jfmUpV_Zhs7orinwvc5HbMQfoXAGdj4nXnzLPg@mail.gmail.com"
      type="cite">
      <div dir="ltr">It sounds like UnknownInsts should really be a
        SmallSet, SmallPtrSet, or DenseSet (if you can't do the others).
        <div><br>
        </div>
        <div>Otherwise, even with your patch, we are still wasting time
          traversing and copying and .... the unknown instructions.</div>
        <div><br>
        </div>
        <div>If that doesn't work, I suspect the way you get dupes is
          through mergeSetIn, so you also could probably just change:<br>
          <br>
        </div>
        <div>
          <pre class="" style="font-family:monospace,fixed;font-size:9pt;border:1px solid rgb(196,207,229);padding:4px 6px;margin:4px 8px 4px 2px;overflow:auto;word-wrap:break-word;line-height:15px;color:rgb(0,0,0);background-color:rgb(251,252,253)">00061   } <span class="" style="color:rgb(224,128,0)">else</span> <span class="" style="color:rgb(224,128,0)">if</span> (ASHadUnknownInsts) {
<a moz-do-not-send="true" name="l00062" style="color:rgb(61,87,140)"></a>00062     UnknownInsts.insert(UnknownInsts.end(), AS.UnknownInsts.begin(), AS.UnknownInsts.end());
<a moz-do-not-send="true" name="l00063" style="color:rgb(61,87,140)"></a>00063     AS.UnknownInsts.clear();
<a moz-do-not-send="true" name="l00064" style="color:rgb(61,87,140)"></a>00064   }</pre>
        </div>
        <div><br>
        </div>
        <div><br>
        </div>
        <div>You could insert the current unknown insts into a
          smallptrset, and then only append them to UnknownInsts if they
          aren't in the set.</div>
        <div><br>
        </div>
        <div>This should remove your dupes.</div>
        <div><br>
        </div>
        <div><br>
        </div>
      </div>
      <div class="gmail_extra"><br>
        <div class="gmail_quote">On Sun, Jan 24, 2016 at 5:28 AM, Roman
          Gareev via llvm-dev <span dir="ltr"><<a
              moz-do-not-send="true"
              href="mailto:llvm-dev@lists.llvm.org" target="_blank"><a class="moz-txt-link-abbreviated" href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a></a>></span>
          wrote:<br>
          <blockquote class="gmail_quote" style="margin:0 0 0
            .8ex;border-left:1px #ccc solid;padding-left:1ex">Dear llvm
            contributors,<br>
            <br>
            Could you please advise me how to skip<br>
            checks, which are performed in AliasSet::aliasesUnknownInst,
            of<br>
            unknown instructions from different alias sets of an alias
            set tracker<br>
            that is a parameter of ‘AliasSetTracker::add(const
            AliasSetTracker<br>
            &AST)’?<br>
            <br>
            If this wasn’t available at the moment and someone could
            review me, I<br>
            would try to implement it. A temporary patch can be found
            attached<br>
            (for example, ViewedInst can become a second parameter of<br>
            AliasSetTracker::addUnknown ). It<br>
            passes the LLVM regression tests and helps to reduce the
            runtime of<br>
            'opt -basicaa -licm out.opt.ll’ from 130ms to 67ms and the
            runtime of<br>
            'opt -basicaa -licm out.opt2.ll’ from 117ms to 62ms
            (out.opt.ll and<br>
            out.opt2.ll can be found on the following link<br>
            <a moz-do-not-send="true"
              href="https://llvm.org/bugs/show_bug.cgi?id=23077"
              rel="noreferrer" target="_blank">https://llvm.org/bugs/show_bug.cgi?id=23077</a>).<br>
            <br>
            Thank you for the attention!<br>
            <span class="HOEnZb"><font color="#888888"><br>
                --<br>
                                                    Cheers, Roman
                Gareev.<br>
              </font></span><br>
            _______________________________________________<br>
            LLVM Developers mailing list<br>
            <a moz-do-not-send="true"
              href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a><br>
            <a moz-do-not-send="true"
              href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev"
              rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
            <br>
          </blockquote>
        </div>
        <br>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
LLVM Developers mailing list
<a class="moz-txt-link-abbreviated" href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>
<a class="moz-txt-link-freetext" href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>