<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 name="l00062" style="color:rgb(61,87,140)"></a>00062     UnknownInsts.insert(UnknownInsts.end(), AS.UnknownInsts.begin(), AS.UnknownInsts.end());
<a name="l00063" style="color:rgb(61,87,140)"></a>00063     AS.UnknownInsts.clear();
<a 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 href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</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 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 href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a><br>
<a 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>