<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Sep 21, 2016 at 3:27 PM, Sebastian Pop <span dir="ltr"><<a href="mailto:sebpop@gmail.com" target="_blank">sebpop@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">sebpop added a comment.<br>
<br>
Hi James,<br>
<br>
after I discussed with @hiraditya, we realized that the example you give<br>
is not supposed to be sinked by a GVN-sink pass:<br>
<span class=""><br>
  [ %a1 = add i32 %b, 1  ]   [ %c1 = add i32 %d, 1  ]<br>
  [ %a2 = xor i32 %a1, 1 ]   [ %c2 = xor i32 %c1, 1 ]<br>
                 \           /<br>
           [ %e = phi i32 %a2, %c2 ]<br>
           [ add i32 %e, 4         ]<br>
<br>
</span>Sinking this example would need the bisimulation algorithm implemented in simplifyCFG:<br></blockquote><div><br></div><div><br></div><div>So, you can make this work with a GVN-sink pass.</div><div>It's just not the traditional definition of "GVN" :)<br></div><div><br></div><div>As you mention, this is complementary to the algorithm one would "expect", which handles the case you list below.</div><div><br></div></div></div></div>