<div dir="ltr">-reviews because i'm attaching a patch<div><br></div><div>If we aren't going to tackle the broader architectural change now, i'm okay with doing something here.<div>I've attached what i did to mergedloadstoremotion's N^2 algorithm, which is only cares about per-block answers as well[1]</div></div><div><br></div><div><br></div><div>If you need to see if you can hoist to a generic block above you in the dominator tree, you'd need in/out numbers, and can duplicate what we do for the dom tree itself when comparing the DFS Numbers.</div><div><br></div><div>But i think, as you've discovered and i mentioned in another thread, most things only care about whether a given block has maythrow instructions.</div><div><br></div><div>Given how much you are going to discover is going to break here in funny ways without it being part of the CFG, i think we should just make the CFG look right, and have fake EH edges.  Anything else is going to be a true mess over time.</div><div><br></div><div><br></div><div>[1] </div><div>What i've done is also equivalent to just making OrderedBlock into OrderedBlocks, without the laziness.  If you wanted that lazy abstraction, it's harder but doable.</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Jun 12, 2016 at 1:00 PM, Eli Friedman <span dir="ltr"><<a href="mailto:eli.friedman@gmail.com" target="_blank">eli.friedman@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">eli.friedman updated this revision to Diff 60478.<br>
eli.friedman added a comment.<br>
<br>
Improved control-flow check, fix for scalar PRE.<br>
<br>
Still has crappy O(N^2) loop.  My current thinking is that it's possible to precompute it on a<br>
per-block basis in GVN::runImpl.<br>
<br>
<br>
<a href="http://reviews.llvm.org/D21041" rel="noreferrer" target="_blank">http://reviews.llvm.org/D21041</a><br>
<br>
Files:<br>
  lib/Transforms/Scalar/GVN.cpp<br>
  test/Transforms/GVN/local-pre.ll<br>
  test/Transforms/GVN/pre-load.ll<br>
<br>
</blockquote></div><br></div>