<div dir="ltr"><div><a href="https://github.com/dberlin/llvm-gvn-rewrite/tree/newgvn2">https://github.com/dberlin/llvm-gvn-rewrite/tree/newgvn2</a><br></div><div><br></div><div>(and in particular, <a href="https://github.com/dberlin/llvm-gvn-rewrite/blob/newgvn2/lib/Transforms/Scalar/NewGVN.cpp">https://github.com/dberlin/llvm-gvn-rewrite/blob/newgvn2/lib/Transforms/Scalar/NewGVN.cpp</a>)</div><div><br></div><div>I'm rewriting GVN.</div><div>MemorySSA, recently committed, was the first step along this route.</div><div><br></div><div>It's at the point where it works, it needs to be broken down again and pieces sent for review.</div><div><br></div><div>in any case, you can see struct congruenceclass, and that tracks all the expressions that belong to a given congruence class (the memberset).</div><div><br></div><div>It even tells you thinks that are equivalent to that congruence class in subparts of the CFG, or can be coerced through type changes to be the same as things in the class, etc.</div><div><br></div><div>Note: It catches 99% of the things GVN does, and plenty it doesn't. I have no plans on porting every possible optimization to it (and that would include code hoisting :P)<br><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Apr 4, 2016 at 12:40 PM, Aditya Kumar <span dir="ltr"><<a href="mailto:hiraditya@msn.com" target="_blank">hiraditya@msn.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">hiraditya added a comment.<br>
<span class=""><br>
<br>
<br>
> (FWIW: New GVN already has such a mapping/structure. For each value, it can<br>
<br>
>  tell you all the member expressions of that value)<br>
<br>
<br>
</span>Thanks for the feedback. You mention that 'new GVN', could you point where new GVN is.<br>
Are you referring to the LeaderTable?<br>
<span class="HOEnZb"><font color="#888888"><br>
-Aditya<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
<br>
Repository:<br>
  rL LLVM<br>
<br>
<a href="http://reviews.llvm.org/D18710" rel="noreferrer" target="_blank">http://reviews.llvm.org/D18710</a><br>
<br>
<br>
<br>
</div></div></blockquote></div><br></div>