<div dir="ltr">Oh, hmm, thanks for the warning, I should probably stick with the copy and compare technique then.<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Dec 21, 2015 at 5:11 PM, Artur Pilipenko <span dir="ltr"><<a href="mailto:apilipenko@azulsystems.com" target="_blank">apilipenko@azulsystems.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div style="word-wrap:break-word">
There is a caveat here. I was experimenting with something similar and found that this status is not always trustworthy. I fixed one bug in prune-eh. These is also a bug in reassociate pass. It returns true with no change made on the following instruction:
<div> %0 = and i64 %b, %a</div>
<div>It happens because it performs two distinct transformations which nullify each other (canonicalizeOperands swaps arguments of an and and then ReassociateExpression swaps them back).</div>
<div><br>
</div>
<div>This approach might work for your set of passes, but beware of the problem.</div><span class="HOEnZb"><font color="#888888">
<div><br>
</div>
<div>Artur</div></font></span><div><div class="h5">
<div><br>
<div>
<blockquote type="cite">
<div>On 21 Dec 2015, at 19:59, Russell Wallace <<a href="mailto:russell.wallace@gmail.com" target="_blank">russell.wallace@gmail.com</a>> wrote:</div>
<br>
<div>
<div dir="ltr">Yes, I'm running all the existing passes that I know how to run. I didn't know they returned change-made. Thanks!<br>
</div>
<div class="gmail_extra"><br>
<div class="gmail_quote">On Mon, Dec 21, 2015 at 12:36 PM, Artur Pilipenko <span dir="ltr">
<<a href="mailto:apilipenko@azulsystems.com" target="_blank">apilipenko@azulsystems.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Are you going to run some of the existing passes? Why can’t you just use the returned change-made value from the passes?<br>
<span><font color="#888888"><br>
Artur<br>
</font></span>
<div>
<div><br>
> On 20 Dec 2015, at 15:43, Russell Wallace via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>> wrote:<br>
><br>
> I want to run a bunch of optimizations, iteratively, that is keep running until things stop changing (to make sure all optimization opportunities are taken). As far as I know, there is no way to copy a module or compare modules by value, so it occurs to me
that a practical solution might be to take the hash code of the module and see if that changes.<br>
><br>
> A problem is that hash algorithms are designed to work on streams of bytes, not compound objects.<br>
><br>
> First attempt at a solution: iterate through all instructions in all functions and hash the instruction kinds. I can think of some possible changes that would fail to be captured by that.<br>
><br>
> Is there any already known solution?<br>
</div>
</div>
<div>
<div>> _______________________________________________<br>
> LLVM Developers mailing list<br>
> <a href="mailto:llvm-dev@lists.llvm.org" target="_blank">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>
</div>
</div>
</blockquote>
</div>
<br>
</div>
</div>
</blockquote>
</div>
<br>
</div>
</div></div></div>
</blockquote></div><br></div>